Files
Codewalkers/.planning/phases/14-parallel-phase-execution/14-04-PLAN.md
Lukas May 4b454cadf3 docs(14): create phase plans for parallel phase execution
Phase 14: Parallel Phase Execution
- 8 plans in 5 waves
- 4 parallel in Wave 1, 3, 5
- Adds phase_dependencies schema (mirrors task_dependencies)
- PhaseDispatchManager port and adapter
- tRPC procedures and CLI commands
- Unit tests and E2E tests
2026-02-02 11:02:39 +01:00

2.9 KiB

phase, plan, type, wave, depends_on, files_modified, autonomous
phase plan type wave depends_on files_modified autonomous
14-parallel-phase-execution 04 execute 3
14-03
src/dispatch/phase-manager.ts
src/dispatch/index.ts
true
Implement DefaultPhaseDispatchManager adapter with in-memory queue and dependency checking.

Purpose: Enable actual phase dispatch with dependency resolution. Output: Working adapter implementation.

<execution_context> @/.claude/get-shit-done/workflows/execute-plan.md @/.claude/get-shit-done/templates/summary.md </execution_context>

@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md @.planning/phases/14-parallel-phase-execution/14-03-SUMMARY.md

Reference implementations:

@src/dispatch/manager.ts @src/dispatch/types.ts

Task 1: Implement DefaultPhaseDispatchManager src/dispatch/phase-manager.ts Create DefaultPhaseDispatchManager class implementing PhaseDispatchManager:

Constructor dependencies:

  • phaseRepository: PhaseRepository
  • eventBus: EventBus

Internal state:

  • phaseQueue: Map<string, QueuedPhase>
  • blockedPhases: Map<string, {phaseId: string, reason: string}>

Implement methods:

  • queuePhase: fetch phase, get dependencies from phaseRepository.getDependencies(), add to queue, emit PhaseQueuedEvent
  • getNextDispatchablePhase: filter queue for phases with all deps complete (phase.status === 'completed'), sort by queuedAt
  • dispatchNextPhase: get next, update phase status to 'in_progress', emit PhaseStartedEvent, return result
  • completePhase: update phase status to 'completed', remove from queue, emit PhaseCompletedEvent
  • blockPhase: update phase status, add to blocked map, remove from queue, emit PhaseBlockedEvent
  • getPhaseQueueState: return current state of queued, ready, blocked

Private helper:

  • areAllPhaseDependenciesComplete(dependsOn: string[]): check each phase status via phaseRepository.findById

Follow exact patterns from DefaultDispatchManager for consistency. npx tsc --noEmit passes DefaultPhaseDispatchManager implements all interface methods

Task 2: Export DefaultPhaseDispatchManager src/dispatch/index.ts Add export for DefaultPhaseDispatchManager class. npx tsc --noEmit passes DefaultPhaseDispatchManager exported from dispatch module Before declaring plan complete: - [ ] `npm run build` succeeds without errors - [ ] `npm test` passes all tests - [ ] DefaultPhaseDispatchManager importable from src/dispatch

<success_criteria>

  • All tasks completed
  • All verification checks pass
  • Adapter follows hexagonal architecture pattern
  • Event emission matches phase event types from 14-02 </success_criteria>
After completion, create `.planning/phases/14-parallel-phase-execution/14-04-SUMMARY.md`