Repository navigation
test(plugin-sdk): avoid duplicate full API render - #122402
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 11, 2026, 11:12 PM ET / August 12, 2026, 03:12 UTC. ClawSweeper reviewWhat this changesThis PR replaces full Plugin SDK rendering in a Vitest suite with small in-memory module fixtures while retaining the separate full API-contract CI check. Merge readinessNo blocking findings. This focused test refactor removes duplicate full-SDK rendering while the dedicated contract lane still renders all public entrypoints; keep it open for normal maintainer handling and completion of exact-head CI. Priority: P3 Review scores
Verification
How this fits togetherThe Plugin SDK baseline generator compiles public SDK subpaths into deterministic contract records. The Vitest suite checks serializer and artifact-repair behavior, while CI runs the full generator against the committed contract inventory. flowchart LR
A[Public SDK entrypoints] --> B[API baseline generator]
B --> C[Contract records]
C --> D[Dedicated CI contract check]
E[Small module fixtures] --> F[Serializer and artifact tests]
D --> G[Contract drift result]
F --> H[Test result]
Before merge
Agent review detailsSecurityNone. PR surfaceTests -52. Total -52 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the full generator as the single canonical composition/drift gate and keep this Vitest suite limited to fast serializer and artifact invariants. Do we have a high-confidence way to reproduce the issue? Not applicable as a defect report: source shows the former suite-wide setup invoked the full renderer, and the PR supplies before/after focused-test timings plus a passing full contract check. Is this the best way to solve the issue? Yes. The dedicated CI lane owns whole-SDK composition and drift detection, while compact fixtures are the narrower maintainable place to test serializer-specific behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 38a5390e2e29. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready evidence on exact head
The initial CodeQL infrastructure attempt failed downloading its bundle because of the runner's self-signed certificate; failed-job rerun 31559012402 passed without a code change. ClawSweeper found no actionable defects; its only rank-up move was to wait for exact-head CI, now satisfied. |
|
Merged via squash.
|
Co-authored-by: Amp <[email protected]>
What Problem This Solves
src/plugin-sdk/api-baseline.test.tsrebuilt a TypeScript program across 14 real Plugin SDK entrypoints before running otherwise narrow serializer and fixture tests. That duplicated the dedicatedplugin-sdk:api:checkCI lane, which already renders the complete canonical public SDK inventory and compares every committed module contract.The duplicate compile dominated this Vitest file: 62.89s of Vitest time / 69.77s wall locally, and 57.00s in the prior hosted baseline.
Why This Change Was Made
plugin-sdk:api:checkunchanged as the canonical whole-repository composition/drift gate.This removes duplicate work rather than adding workers, weakening the contract gate, or hiding latency behind reshards.
User Impact
No runtime or Plugin SDK API behavior changes. Pull-request test shards finish sooner and use substantially less memory.
Production LOC: +0/-0. Test LOC: +49/-101. Test count: 18 before and after.
Evidence
Before
After
Validation:
node scripts/run-vitest.mjs src/plugin-sdk/api-baseline.test.ts— 18/18 passedpnpm plugin-sdk:api:check— canonical full-repository contract current (OK docs/.generated/plugin-sdk-api-baseline)oxfmt --check src/plugin-sdk/api-baseline.test.ts— passednode scripts/run-oxlint.mjs src/plugin-sdk/api-baseline.test.ts— passednode scripts/check-changed.mjs --dry-run— classified expected core/coreTests/extension contract lanesgit diff --check— passed