Purpose
Five daemon files import src/runtime.ts, which imports the command barrel with a value import:
// src/runtime.ts
import { bindCommands, type BoundAgentDeviceCommands } from './commands/index.ts';
The value closure of src/runtime.ts is 122 files, 48 of them under src/commands/. The daemon's total value closure is 717 files and carries 121 src/commands/** files — roughly the entire commands zone (140 files, 21k LOC) — plus 17 root flat files. The daemon loads a command surface it does not dispatch through, and every change in commands is potentially a daemon-restart-cost event.
Umbrella: #2545. Chosen first because it is the only child that changes what the daemon actually loads, and because #2469 (eager-closure budget tolerance) is unblocked by cutting closure, not by adding budget.
Required behavior
src/runtime.ts keeps its public shape: AgentDevice, createAgentDevice, createMemorySessionStore, localCommandPolicy, restrictedCommandPolicy, and the re-exported command types. No consumer-side API change is part of this issue.
- Daemon consumers of
src/runtime.ts take the specific declarations they use through their owning module or contract, not through the runtime facade. Determine the used symbol set per importer before choosing the seam; do not invent an interface wider than the symbols in use.
- The barrel
src/commands/index.ts either stops being the value entry for runtime binding, or the binding moves to the composition root that needs it. One construction path, no second registry.
Completion conditions
- Value-only transitive closure from
src/daemon/** contains zero files under src/commands/. Measured with a probe over scripts/layering/model.ts as described in the parent, and reported in the PR.
src/runtime.ts has no value edge into src/commands/**, or is no longer reachable from src/daemon/** at all.
- No new eager work: the eager-import-closure budgets for the daemon entry surfaces do not rise.
- R4 stays 0, R5 stays 0, R6 does not grow past the ratchet.
Out of scope
- Repackaging
src/commands as a workspace package. That decision needs the cli-schema orientation settled first (sibling child).
- Any change to the command descriptor registry or the
command-registry package.
Dependencies
- None. Wave A, independent branch.
Purpose
Five daemon files import
src/runtime.ts, which imports the command barrel with a value import:The value closure of
src/runtime.tsis 122 files, 48 of them undersrc/commands/. The daemon's total value closure is 717 files and carries 121src/commands/**files — roughly the entire commands zone (140 files, 21k LOC) — plus 17 root flat files. The daemon loads a command surface it does not dispatch through, and every change in commands is potentially a daemon-restart-cost event.Umbrella: #2545. Chosen first because it is the only child that changes what the daemon actually loads, and because #2469 (eager-closure budget tolerance) is unblocked by cutting closure, not by adding budget.
Required behavior
src/runtime.tskeeps its public shape:AgentDevice,createAgentDevice,createMemorySessionStore,localCommandPolicy,restrictedCommandPolicy, and the re-exported command types. No consumer-side API change is part of this issue.src/runtime.tstake the specific declarations they use through their owning module or contract, not through the runtime facade. Determine the used symbol set per importer before choosing the seam; do not invent an interface wider than the symbols in use.src/commands/index.tseither stops being the value entry for runtime binding, or the binding moves to the composition root that needs it. One construction path, no second registry.Completion conditions
src/daemon/**contains zero files undersrc/commands/. Measured with a probe overscripts/layering/model.tsas described in the parent, and reported in the PR.src/runtime.tshas no value edge intosrc/commands/**, or is no longer reachable fromsrc/daemon/**at all.Out of scope
src/commandsas a workspace package. That decision needs thecli-schemaorientation settled first (sibling child).command-registrypackage.Dependencies