-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
P3: lowNice to have — polish, cleanup, or long-termNice to have — polish, cleanup, or long-termenhancementNew feature or requestNew feature or request
Description
Source
Audit report — Section 7: Technical Debt > Architecture
Description
orchestrator.ts, worktree.ts, integration.ts, and other core modules directly import and call gitCommand(), tmux functions, and Bun.spawn(). This makes unit testing difficult — tests must mock module-level imports via spyOn rather than injecting test doubles through constructors.
Current State
orchestrator.tsdirectly imports fromtmux.ts,git.ts,integration.ts,worktree.ts- Tests use
spyOn(module, 'function')pattern extensively (fragile, order-dependent) - No interface abstractions for git operations, tmux, or process spawning
Proposed Solution
- Define interfaces:
GitClient,Multiplexer,ProcessRunner - Accept these via constructor injection in
Orchestrator,MergeTrain,WorktreeProvider - Provide default implementations wrapping current functions
- Tests inject mocks directly — no more module-level spying
Relationship to Other Issues
- Prerequisite for feat: Abstract tmux behind a Multiplexer interface #27 (Multiplexer interface) — DI makes swapping tmux for Zellij natural
- Aids refactor: Decompose Orchestrator god object into focused modules #17 (Orchestrator decomposition) — extracted modules take dependencies via constructor
- Improves test: Add test coverage for untested core files #25 (test coverage) — makes previously hard-to-test code testable
Priority
P3 — architectural improvement, not blocking any functionality. Best done alongside #17 decomposition.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3: lowNice to have — polish, cleanup, or long-termNice to have — polish, cleanup, or long-termenhancementNew feature or requestNew feature or request