Repository navigation
refactor(cli): inject shared StatusUseCase/RestoreUseCase/UpdateOneToolUseCase - #507
Merged
blafourcade merged 1 commit intoJul 24, 2026
Conversation
…olUseCase StatusAllUseCase, RestoreAllUseCase, and UpdateAllUseCase each rebuilt their own duplicate of a collaborator deps.ts already constructs and shares with ai.ts/ide.ts (deps.statusUseCase, deps.restoreUseCase, deps.updateOneToolUseCase consumed directly by those commands). Two of the four duplicate sites rebuilt on every execute() call, not just once. Confirmed all 3 target classes stateless before sharing them as singletons (no memo maps, no accumulator fields — BulkConflictState is passed as an execute() parameter, never stored on UpdateOneToolUseCase). Each class now receives the real instance by constructor injection; every now-dead raw-sub-dependency param removed rather than left unused. grep confirms zero remaining "new StatusUseCase/RestoreUseCase/ UpdateOneToolUseCase" outside deps.ts's 3 original construction sites. 2048/2048 tests pass unmodified — zero behavior change, pure DI wiring. Stacked on fix/e3-02-restore-plugin-scope-dedup (touches the same restore-all-use-case.ts) — needs that branch merged first. Ported/implemented fresh from the archived aidd-cli repo's plan (SPIKE-E1-01 + BUG-E1-02, pre-migration) — original work predates the framework migration (PR #462).
blafourcade
merged commit Jul 24, 2026
7ba7154
into
fix/e3-02-restore-plugin-scope-dedup
13 checks passed
blafourcade
added a commit
that referenced
this pull request
Jul 24, 2026
…olUseCase (#507) (#508) StatusAllUseCase, RestoreAllUseCase, and UpdateAllUseCase each rebuilt their own duplicate of a collaborator deps.ts already constructs and shares with ai.ts/ide.ts (deps.statusUseCase, deps.restoreUseCase, deps.updateOneToolUseCase consumed directly by those commands). Two of the four duplicate sites rebuilt on every execute() call, not just once. Confirmed all 3 target classes stateless before sharing them as singletons (no memo maps, no accumulator fields — BulkConflictState is passed as an execute() parameter, never stored on UpdateOneToolUseCase). Each class now receives the real instance by constructor injection; every now-dead raw-sub-dependency param removed rather than left unused. grep confirms zero remaining "new StatusUseCase/RestoreUseCase/ UpdateOneToolUseCase" outside deps.ts's 3 original construction sites. 2048/2048 tests pass unmodified — zero behavior change, pure DI wiring. Stacked on fix/e3-02-restore-plugin-scope-dedup (touches the same restore-all-use-case.ts) — needs that branch merged first. Ported/implemented fresh from the archived aidd-cli repo's plan (SPIKE-E1-01 + BUG-E1-02, pre-migration) — original work predates the framework migration (PR #462).
blafourcade
added a commit
that referenced
this pull request
Jul 31, 2026
…olUseCase (#507) (#508) StatusAllUseCase, RestoreAllUseCase, and UpdateAllUseCase each rebuilt their own duplicate of a collaborator deps.ts already constructs and shares with ai.ts/ide.ts (deps.statusUseCase, deps.restoreUseCase, deps.updateOneToolUseCase consumed directly by those commands). Two of the four duplicate sites rebuilt on every execute() call, not just once. Confirmed all 3 target classes stateless before sharing them as singletons (no memo maps, no accumulator fields — BulkConflictState is passed as an execute() parameter, never stored on UpdateOneToolUseCase). Each class now receives the real instance by constructor injection; every now-dead raw-sub-dependency param removed rather than left unused. grep confirms zero remaining "new StatusUseCase/RestoreUseCase/ UpdateOneToolUseCase" outside deps.ts's 3 original construction sites. 2048/2048 tests pass unmodified — zero behavior change, pure DI wiring. Stacked on fix/e3-02-restore-plugin-scope-dedup (touches the same restore-all-use-case.ts) — needs that branch merged first. Ported/implemented fresh from the archived aidd-cli repo's plan (SPIKE-E1-01 + BUG-E1-02, pre-migration) — original work predates the framework migration (PR #462).
blafourcade
added a commit
that referenced
this pull request
Jul 31, 2026
…olUseCase (#507) (#508) StatusAllUseCase, RestoreAllUseCase, and UpdateAllUseCase each rebuilt their own duplicate of a collaborator deps.ts already constructs and shares with ai.ts/ide.ts (deps.statusUseCase, deps.restoreUseCase, deps.updateOneToolUseCase consumed directly by those commands). Two of the four duplicate sites rebuilt on every execute() call, not just once. Confirmed all 3 target classes stateless before sharing them as singletons (no memo maps, no accumulator fields — BulkConflictState is passed as an execute() parameter, never stored on UpdateOneToolUseCase). Each class now receives the real instance by constructor injection; every now-dead raw-sub-dependency param removed rather than left unused. grep confirms zero remaining "new StatusUseCase/RestoreUseCase/ UpdateOneToolUseCase" outside deps.ts's 3 original construction sites. 2048/2048 tests pass unmodified — zero behavior change, pure DI wiring. Stacked on fix/e3-02-restore-plugin-scope-dedup (touches the same restore-all-use-case.ts) — needs that branch merged first. Ported/implemented fresh from the archived aidd-cli repo's plan (SPIKE-E1-01 + BUG-E1-02, pre-migration) — original work predates the framework migration (PR #462).
Merged
blafourcade
added a commit
that referenced
this pull request
Jul 31, 2026
🎯 What & why
StatusAllUseCase,RestoreAllUseCase, andUpdateAllUseCaseeach rebuilt their own duplicate of a collaboratordeps.tsalready constructs and shares withai.ts/ide.ts(deps.statusUseCase,deps.restoreUseCase,deps.updateOneToolUseCase, consumed directly by those commands). Two of the four duplicate sites rebuilt on everyexecute()call.🛠️ How it works
Confirmed all 3 target classes are stateless before sharing them as singletons — no memo maps, no accumulator fields;
BulkConflictStateis passed as anexecute()parameter by the caller, never stored onUpdateOneToolUseCase. Each class now receives the real instance by constructor injection; every now-dead raw-sub-dependency param was removed rather than left unused (e.g.UpdateAllUseCasedrops from 9 constructor params to 5).grep -rn "new StatusUseCase\|new RestoreUseCase\|new UpdateOneToolUseCase" src/finds only the 3 original construction sites indeps.ts.Pure DI wiring — zero behavior change. 2048/2048 tests pass unmodified.
🧪 How to verify
pnpm --filter cli testStacked on #506 (touches
restore-all-use-case.tsright after it) — this PR's base is that branch, notnext. Needs #506 merged first, then this one retargeted tonext.Originally planned in the (now-archived) standalone
aidd-clirepo before the framework migration (#462); implemented fresh here since the source repo no longer accepts pushes.