perf(build): reduce plugin SDK declaration package size#98758
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 1, 2026, 4:56 PM ET / 20:56 UTC. Summary PR surface: Tests -26, Config -2, Other +3. Total -25 across 6 files. Reproducibility: not applicable. as a bug reproduction; this is a package-build cleanup/performance PR. The current-main duplicate declaration path is source-visible, and the PR body provides terminal package-size and build validation evidence. Review metrics: 2 noteworthy metrics.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land through the normal maintainer merge path with the canonical tsdown declaration graph, retained standalone fallback, and expanded export guard, then let the linked issue close with the merged PR. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction; this is a package-build cleanup/performance PR. The current-main duplicate declaration path is source-visible, and the PR body provides terminal package-size and build validation evidence. Is this the best way to solve the issue? Yes; reusing the existing unified tsdown declaration output is the narrow owner-boundary fix, while retaining the standalone writer fallback covers package-boundary workflows. Redirecting or byte-deduplicating chunks would add a more fragile second ownership path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 44e88f550b69. Label changesLabel justifications:
Evidence reviewedPR surface: Tests -26, Config -2, Other +3. Total -25 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Closes #98757
What Problem This Solves
Resolves a package-size problem where every OpenClaw npm artifact carried a second independently bundled plugin SDK declaration graph, adding megabytes without changing runtime behavior.
Why This Change Was Made
Normal package builds now publish the plugin SDK declarations already produced by the unified tsdown graph instead of rebuilding the same entrypoints separately. The standalone declaration fallback remains available for package-boundary workflows, while the release guard now traverses the complete reachable public declaration graph and rejects missing chunks, forbidden dependencies, or excessive size.
User Impact
OpenClaw npm packages are 3,184,932 bytes smaller unpacked and 371,214 bytes smaller compressed on the measured current tree. Public plugin SDK entrypoints and runtime behavior are unchanged.
Evidence
Apples-to-apples
npm pack --ignore-scripts --jsoncomparison using identical built runtime artifacts:Validation:
node scripts/run-vitest.mjs test/scripts/build-all.test.ts test/scripts/prepare-extension-package-boundary-artifacts.test.ts— 49 tests passed.node scripts/build-all.mjs ciArtifacts— passed from cleandist/dist-runtime.node scripts/check-plugin-sdk-exports.mjs— passed; validates 4,728,262 bytes across 840 reachable declaration files..agents/skills/autoreview/scripts/autoreview --mode local --engine codex --thinking high ...— clean, no accepted/actionable findings.git diff --check— passed.