Part of #798.
Verified against 2a6073d5f.
Observation
Three fields on ExecutionLoopOptions (packages/cli/src/services/execution.ts:175-205) exist only so tests can substitute dependencies. Their own TSDoc says so:
/** Optional actor service test seam. */
readonly actorService?: RunbookActorService;
/** Optional core mutation runner test seam. */
readonly actorMutationRunner?: EffectfulActorMutationRunner;
/** Optional command services test seam. */
readonly commandServices?: CommandExecutionServices;
Each is the undo for the loop constructing its own dependencies rather than accepting them (:1184-1190):
const commandServices = options.commandServices ?? createCliCommandServices(options.commandStreamOptions);
const actorService = options.actorService ?? createCliRunbookActorService(manager, commandServices);
const actorMutationRunner = options.actorMutationRunner ?? createEffectfulActorMutationRunner(cwd);
SessionService (:1190) got no such undo — it is constructed unconditionally — which is why the loop's suite replaces the whole core module wholesale instead.
Why this is downstream, not independent
This is a symptom of the CLI holding derivations that core owns. A loop that only observed machine output would have little to inject. Fixing the ownership removes most of the reason these seams exist, so this should be re-assessed after the rendering move, not fixed ahead of it — a dependency-injection refactor now would be work spent on a shape that is about to change.
Filed so the observation is not lost, and so the seams are deleted rather than preserved when the loop is reworked.
Part of #798.
Verified against
2a6073d5f.Observation
Three fields on
ExecutionLoopOptions(packages/cli/src/services/execution.ts:175-205) exist only so tests can substitute dependencies. Their own TSDoc says so:Each is the undo for the loop constructing its own dependencies rather than accepting them (
:1184-1190):SessionService(:1190) got no such undo — it is constructed unconditionally — which is why the loop's suite replaces the whole core module wholesale instead.Why this is downstream, not independent
This is a symptom of the CLI holding derivations that core owns. A loop that only observed machine output would have little to inject. Fixing the ownership removes most of the reason these seams exist, so this should be re-assessed after the rendering move, not fixed ahead of it — a dependency-injection refactor now would be work spent on a shape that is about to change.
Filed so the observation is not lost, and so the seams are deleted rather than preserved when the loop is reworked.