Repository navigation
fix(plugin-sdk): emit revision declarations with their own compiler - #181908
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR emits revision declarations with that revision’s compiler and API client, preserves the historical compiler fallback, and refreshes the shipped SDK inventory. Example: Compare v2026.10.6 with candidate 157d8c2 using plugin-sdk:api:diff.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a release-tooling failure still present on main. The earlier findings are resolved, exact-head CI passes, and no actionable defect remains in the reviewed diff. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherPlugin SDK comparison tooling renders declarations from frozen repository revisions and turns their public signatures into release-review reports. flowchart TD
A[SDK comparison CLI] --> B[Frozen revision checkout]
B --> C[Trusted SDK renderer]
C --> D[Declaration subprocess]
D --> E[Revision compiler and API client]
E --> F[Declaration output]
F --> G[SDK difference report]
Technical reviewBest possible solution: Keep compiler selection in the existing emitter, pairing each native executable with its own client while retaining the historical fallback. Do we have a high-confidence way to reproduce the issue? The reported TS5088 failure on v2026.10.6 matches main’s emission path, which omits revision compiler selection; this review verified that path in source. Is this the best way to solve the issue? The patch repairs the existing compiler owner and subprocess contract without adding a parallel renderer or changing the public SDK. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0a9d5cc49d91. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +3, Tests +48, Other +98. Total +149 across 6 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)
Reviewed October 24, 2026, 2:33 AM ET / 06:33 UTC (Revision 5). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
ba26e91 to
c3c2a16
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…penclaw#181908) * fix(plugin-sdk): render shipped surfaces with revision tooling Co-authored-by: RomneyDa <[email protected]> * fix(plugin-sdk): drop stale renderer argument Co-authored-by: RomneyDa <[email protected]> * fix(release): keep SDK renderer trusted Co-authored-by: RomneyDa <[email protected]> * fix(release): render SDK revisions with Node under Bun Co-authored-by: RomneyDa <[email protected]> * fix(plugin-sdk): emit revision declarations with their own compiler * fix(build): declare the emitter's compiler API edge as a declaration input --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: RomneyDa <[email protected]>
Problem
pnpm release:candidateon trusted main tooling (1fead915921e, TypeScript7.1.0-dev.20261016.1) runspnpm plugin-sdk:api:diffagainst the published bases. Renderingv2026.10.6(fe06181dc5ec, TypeScript7.1.0-dev.20260922.1) failed with TS5088 ("inferred type ... references a type with a cyclic structure") insrc/plugins/plugin-instance-owned-values.ts,src/plugins/runtime/execution-frame.ts, andsrc/plugins/plugin-instance-scope.ts.Root cause: the declaration-emission subprocess never got a compiler selection. It emitted every revision's declarations with the trusted tooling's newer compiler, which rejects declarations the shipped release accepted. The emitter's existing
compilerRootpath had a second problem: it launched the root'stsgobinary but kept the trustedtypescript/asyncclient. That mixes two releases' protocol and filesystem contracts (the API moved fromunstable/*to stable subpaths between these previews).The earlier version of this PR used a Node resolve hook to map
typescript/*to the revision package. That broke on20260922because the package has no./asyncexport. It also broke historical TypeScript 6 tags, copied a linux-x64-only fixture, and was missing from compiled worker artifacts (checks-node-compact-small-1 ERR_MODULE_NOT_FOUND). All of that is removed.Solution
compileNativeProjectowns compiler selection. With acompilerRoot, it loads that root's TypeScript package as a set: the executable, the./asyncAPI client (or./unstable/asyncon earlier previews), and that client's ownserverFS.fakeStatsentinel. It imports the client through its realpath, so a linked package keeps a single module instance.v2026.8.1-beta.1).compilerRoot.renderPluginSdkApiRootpasses the rendered root, so each revision's declarations come from its own locked compiler. The renderer code itself (api-baseline,api-diff, the worker script) stays trusted tooling code.compilerModuleUrl) intsdown-declaration-generator-inputs.mts. Its targets are the installed package manifest plus its./asyncand./fsexports, so declaration build caches still key on them.scripts/lib/plugin-sdk-shipped-surface.jsontov2026.10.6. Regenerating with this fix viapnpm plugin-sdk:shipped-surface:gen -- --release v2026.10.6reproduces it byte-for-byte (151 typed subpaths, 3,645 named exports).ClawSweeper findings: (1) the compiler selection, including the API module, now reaches the subprocess. (2) TS6 and roots without TypeScript fall back to the trusted compiler. (3) and (4) no longer apply because the fixture copying and the loader file are gone.
Evidence
The real release command, run from this branch, succeeds:
beta: v2026.10.10-beta.3 → 157d8c2bc3ea: API changes reported, acknowledgement digestdd1b7efd.latest: v2026.10.6 → 157d8c2bc3ea: 206 affected exports (35 reachable declaration changes), acknowledgement digest7cb70969.1fead915921e, the same command fails rendering fe06181 with the TS5088 errors above.pnpm plugin-sdk:api:diff -- --base v2026.8.1-beta.1 --head 157d8c2bc3ea...exits 0. The base renders through the trusted-compiler fallback and the head through its own compiler. Digeste16729b0.The new regression test
loads the compiler root's own pre-stable native APIfails on main's emitter and passes here.Targeted tests,
pnpm test <file> --maxWorkers=1, local wall time:The two new tests add about 0.5s of CI time. A local
pnpm buildpasses (3m12s).node scripts/check-changed.mjspasses typecheck (core, scripts, tests), lint, and guards. The only failure is the dead-export scan, which reports unused exports in untouched files (scripts/control-ui-parity/scenarios.ts,extensions/github/src/targets.ts, and others). That scan already fails on main.Closes RRI-551.