tooling-only typed projection for command owner metadata#1194
tooling-only typed projection for command owner metadata#1194devin-ai-integration[bot] wants to merge 1 commit into
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:
|
- Remove ownerFiles from CommandDescriptor and RAW_COMMAND_DESCRIPTORS. - Add commandDescriptorOwners in registry.ts as a tooling-only Record<Command, ...>. - Remove ownerFile from DAEMON_ROUTE_HANDLERS defineDaemonRoute. - Add DAEMON_ROUTE_OWNER_FILES as tooling-only const in request-handler-chain.ts. - Update explain:command and tests to merge projections. - Refactor request-handler-chain test to keep fallow complexity low. - Treeshaking drops owner metadata from production bundles. Fixes #1178. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
d9078a5 to
e96e0ca
Compare
Review — 🟡 Duplicate of #1192; recommend closing this onePure structural move (like #1192): strips Why #1192 is preferable:
What this PR does better than #1192: it actually strips the ~8 daemon-route Recommendation: close this PR and fold its daemon-route stripping into #1192 (separate-file isolation + no-leak test). Don't merge both. 🤖 Generated with Claude Code |
|
Agreed — the daemon-route owner-file metadata has been moved into the separate |
|
Summary
Closes #1178.
PR #1174 colocated
ownerFileson everyCommandDescriptorsoexplain:commandhad typed, completeness-enforced navigation metadata. Those strings were also kept on the runtime descriptor objects and were emitted in production bundles (e.g.sdk-batch.js).This PR moves the owner metadata into a tooling-only typed projection that is still colocated with the declarations, still complete at compile time, still used by
explain:command, and now dropped from production bundles by normal treeshaking.Changes
CommandDescriptorno longer hasownerFiles.RAW_COMMAND_DESCRIPTORSentries no longer carryownerFiles.commandDescriptorOwnersmap insrc/core/command-descriptor/registry.tsis a separateRecord<Command, readonly [string, ...string[]]>projection.src/commands/command-explain.tsandsrc/commands/__tests__/command-explain.test.tsnow mergecommandDescriptorOwnerswhen listing owner files.DAEMON_ROUTE_HANDLERSinsrc/daemon/request-handler-chain.tsno longer takesownerFileindefineDaemonRoute; a newDAEMON_ROUTE_OWNER_FILESrecord is the tooling-only source andgetDaemonRouteOwnerFiles()returns a copy of it.src/daemon/__tests__/request-handler-chain.test.tsparses the new owner-records structure.Verification
pnpm typecheck,pnpm lint,pnpm format:check,pnpm test:unit,pnpm check:layering, andpnpm test:output-economyall pass.pnpm explain:commandstill lists owner files correctly.node --experimental-strip-types node_modules/tsdown/dist/run.mjs --config-loader native) no longer containsownerFilesstrings (rg -n "ownerFiles" dist/srcis empty);sdk-batch.jsgzip drops from ~4.76 kB to ~4.47 kB.Link to Devin session: https://app.devin.ai/sessions/c5f42b75391f471e96a6354577b5d9be
Requested by: @thymikee