← Back to list
01Issue
FeatureShippedSwamp CLIPublic
Assigneeszack
Relationships
#4591 Lazy loading L1: move VERSION and GIT_SHA out of the version command
Opened by zack · 11/10/2026· Shipped 11/10/2026
Second step of the lazy command loading plan (after the startup benchmark and parity scripts, #4590).
Why
src/cli/commands/version.ts holds both the version command and the build constants that about 28 modules import. Three of those are startup modules: main.ts, repo_context.ts and load_identity.ts.
- The next step (route table) needs the rule that startup code imports no command module. That rule cannot hold while startup imports
version.ts. - An edit to that file selects 33 of 35 commands in
affectedCommands, and so nearly the whole UAT suite.
The speed gain is small (the command adds four modules to startup); the reason is the two points above.
Scope
- A new module below the CLI layer (for example
src/infrastructure/runtime/build_info.ts) exportingVERSIONandGIT_SHA. version.tsre-exports nothing; it imports the constants.- Update every importer.
src/serve/connection.tsthen no longer reaches intosrc/cli/, so delete its pinned exception inintegration/ddd_layer_rules_test.ts. - Update
scripts/compile.ts:VERSION_FILEand both stamp regexes. - Update
AGENTS.md's note thatdeno run compilestampssrc/cli/commands/version.ts.
Acceptance
deno run compilestamps and restores the new file.swamp versionandswamp version --jsonoutput are unchanged.- A
compile.tsunit test fails if either stamp regex matches nothing. affectedCommandsfor an edit toversion.tsnames onlyversion.- The parity script passes against a binary built from the base commit; the PR quotes benchmark numbers before and after, with
workflow runas the control.
Release impact
- Edits
scripts/compile.ts, so the attestation selects every command and the release UAT runs everything. - The new constants file is imported widely, but only the compile stamp changes it, and that never reaches git. Afterwards, selection for
version.tsedits gets more precise. AGENTS.mdis a trust root, so this PR triggersclaude-review-integrity.
Risk: low. The compile stamp is the only moving part, and the unit test above covers it.
02Bog Flow
Shipped
Click a lifecycle step above to view its details.
03Sludge Pulse
Sign in to post a ripple.