refactor: keep command and daemon-route owner-file claims tooling-only (#1178)#1192
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Size Report
Startup median (7 runs, lower is better):
Top changed chunks:
|
Review — 🟢 SHIP (and the better of the #1192/#1194 pair)Pure structural move: the dev-only
Nits (none blocking):
Duplicate of #1194 — recommend merging this one and closing #1194. Both are same-bot PRs closing #1178 with the same "tooling-only typed projection" thesis. This PR's dedicated-module isolation is a stronger, structural tree-shake guarantee than #1194's named-export DCE from inside the production-imported 🤖 Generated with Claude Code |
|
Folded in the daemon-route stripping (nit #2), keeping this PR's separate-file boundary rather than #1194's in-
Result: |
|
Blocking against issue #1178: |
Reworked the command owner-file metadata to be derived from the colocated
The daemon-route owner-file isolation in |
Review — 🟢 approve, two things worth addressing (non-blocking)Design is sound and the earlier blocking concern is resolved: owner claims are now colocated on Two follow-ups: 1. 2. No automated guard for the "strings don't ship" invariant. It's currently verified only by the manual Minor: Generated by Claude Code |
|
Addressed both follow-ups in
I also injected a known owner path into a generated bundle locally to verify the new guard fails, then rebuilt and confirmed the clean bundle passes. |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ion route chain Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ated RAW_COMMAND_DESCRIPTORS - Keep ownerFiles on each RAW_COMMAND_DESCRIPTORS entry as the source of truth. - Add tooling-only __OWNER_FILES__ build flag so production bundles omit the ownerFiles properties entirely. - Derive COMMAND_OWNER_FILES from RAW_COMMAND_DESCRIPTORS instead of a hand-maintained parallel table. - Guard command-explain tests against leaking ownerFiles into production descriptor objects. - Enable treeshake.propertyReadSideEffects: false in tsdown to help drop the dead ownerFiles branch from production bundles. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
16676fa to
7aeac15
Compare
|
…ndle guard - Remove treeshake.propertyReadSideEffects from tsdown.config.ts; the __OWNER_FILES__ define + conditional spread already keeps owner files out of the bundle, so the global DCE lever is unnecessary and scope-creeping. - Add a comment on the __OWNER_FILES__ global declaration explaining the deliberate type-versus-runtime mismatch. - Add test/output-economy/owner-files-no-leak.test.ts to build dist and assert that no command or daemon-route owner-file path appears in the emitted JS. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
@thymikee — addressed both points from the review:
Also switched All |
|
Current-head review found one remaining P2 bundle-contract issue. Please make the production-defined |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Addressed the remaining bundle-contract issue in |
|
Re-review of One acceptance blocker remains against #1178 as written: |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Addressed in |
|
Final re-review at |
Summary
Fixes #1178 by keeping command and daemon-route owner-file claims available to
explain:commandwithout shipping them in production JavaScript.RAW_COMMAND_DESCRIPTORS;COMMAND_OWNER_FILESis derived from that registry rather than maintained as a parallel table.__OWNER_FILES__ = false, allowing the conditional metadata spreads to disappear without changing global property-read tree-shaking semantics.check:bundle-owner-filesderives every current owner path from both projections and fails if any appears indist/src/*.js; the packaged-CLI CI job runs it immediately after building.The build guard currently verifies 44 unique paths representing all 79 command and 8 route claims, while
explain:commandoutput remains unchanged.Link to Devin session: https://app.devin.ai/sessions/b1c3093bf2b248ca82a1a5df89152d02
Requested by: @thymikee