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
This commit is contained in:
104
.planning/phases/14-parallel-phase-execution/14-01-PLAN.md
Normal file
104
.planning/phases/14-parallel-phase-execution/14-01-PLAN.md
Normal file
@@ -0,0 +1,104 @@
|
||||
---
|
||||
phase: 14-parallel-phase-execution
|
||||
plan: 01
|
||||
type: execute
|
||||
wave: 1
|
||||
depends_on: []
|
||||
files_modified:
|
||||
- src/db/schema.ts
|
||||
- src/db/repositories/phase-repository.ts
|
||||
- src/db/repositories/drizzle/phase.ts
|
||||
autonomous: true
|
||||
---
|
||||
|
||||
<objective>
|
||||
Add phase dependencies to database schema and repository following the task_dependencies pattern.
|
||||
|
||||
Purpose: Enable tracking which phases depend on which other phases, prerequisite for parallel execution.
|
||||
Output: phase_dependencies table, PhaseRepository with dependency methods.
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
@~/.claude/get-shit-done/workflows/execute-plan.md
|
||||
@~/.claude/get-shit-done/templates/summary.md
|
||||
</execution_context>
|
||||
|
||||
<context>
|
||||
@.planning/PROJECT.md
|
||||
@.planning/ROADMAP.md
|
||||
@.planning/STATE.md
|
||||
|
||||
# Reference implementations:
|
||||
@src/db/schema.ts
|
||||
@src/db/repositories/task-repository.ts
|
||||
@src/db/repositories/drizzle/task.ts
|
||||
</context>
|
||||
|
||||
<tasks>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 1: Add phase_dependencies table to schema</name>
|
||||
<files>src/db/schema.ts</files>
|
||||
<action>
|
||||
Add phase_dependencies table mirroring task_dependencies:
|
||||
- id (text, primary key)
|
||||
- phaseId (text, FK to phases.id, cascade delete)
|
||||
- dependsOnPhaseId (text, FK to phases.id, cascade delete)
|
||||
- createdAt (integer timestamp)
|
||||
|
||||
Add relations for phases:
|
||||
- dependsOn: many(phaseDependencies, relationName: 'dependentPhase')
|
||||
- dependents: many(phaseDependencies, relationName: 'dependencyPhase')
|
||||
|
||||
Add phaseDependenciesRelations with:
|
||||
- phase: one(phases, dependentPhase)
|
||||
- dependsOnPhase: one(phases, dependencyPhase)
|
||||
|
||||
Export PhaseDependency and NewPhaseDependency types.
|
||||
</action>
|
||||
<verify>npx tsc --noEmit passes</verify>
|
||||
<done>phase_dependencies table defined with proper FK relations and types exported</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 2: Add dependency methods to PhaseRepository</name>
|
||||
<files>src/db/repositories/phase-repository.ts, src/db/repositories/drizzle/phase.ts</files>
|
||||
<action>
|
||||
Add to PhaseRepository interface:
|
||||
- createDependency(phaseId: string, dependsOnPhaseId: string): Promise<void>
|
||||
- getDependencies(phaseId: string): Promise<string[]> (returns IDs of phases this phase depends on)
|
||||
- getDependents(phaseId: string): Promise<string[]> (returns IDs of phases that depend on this phase)
|
||||
|
||||
Implement in DrizzlePhaseRepository:
|
||||
- createDependency: insert into phase_dependencies with nanoid
|
||||
- getDependencies: select dependsOnPhaseId where phaseId = input
|
||||
- getDependents: select phaseId where dependsOnPhaseId = input
|
||||
|
||||
Follow exact patterns from DrizzleTaskRepository.createDependency.
|
||||
</action>
|
||||
<verify>npx tsc --noEmit passes; npm test -- --grep "phase" passes</verify>
|
||||
<done>PhaseRepository has dependency methods, Drizzle adapter implements them</done>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
|
||||
<verification>
|
||||
Before declaring plan complete:
|
||||
- [ ] `npm run build` succeeds without errors
|
||||
- [ ] `npm test` passes all tests
|
||||
- [ ] Phase dependency types exported from schema
|
||||
- [ ] PhaseRepository interface has 3 new methods
|
||||
- [ ] DrizzlePhaseRepository implements all methods
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
|
||||
- All tasks completed
|
||||
- All verification checks pass
|
||||
- Schema matches task_dependencies pattern
|
||||
- Repository follows hexagonal architecture
|
||||
</success_criteria>
|
||||
|
||||
<output>
|
||||
After completion, create `.planning/phases/14-parallel-phase-execution/14-01-SUMMARY.md`
|
||||
</output>
|
||||
101
.planning/phases/14-parallel-phase-execution/14-02-PLAN.md
Normal file
101
.planning/phases/14-parallel-phase-execution/14-02-PLAN.md
Normal file
@@ -0,0 +1,101 @@
|
||||
---
|
||||
phase: 14-parallel-phase-execution
|
||||
plan: 02
|
||||
type: execute
|
||||
wave: 1
|
||||
depends_on: []
|
||||
files_modified:
|
||||
- src/events/types.ts
|
||||
- src/events/index.ts
|
||||
autonomous: true
|
||||
---
|
||||
|
||||
<objective>
|
||||
Add phase lifecycle events for parallel execution coordination.
|
||||
|
||||
Purpose: Enable event-driven coordination of parallel phase execution.
|
||||
Output: Phase domain events (queued, started, completed, blocked).
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
@~/.claude/get-shit-done/workflows/execute-plan.md
|
||||
@~/.claude/get-shit-done/templates/summary.md
|
||||
</execution_context>
|
||||
|
||||
<context>
|
||||
@.planning/PROJECT.md
|
||||
@.planning/ROADMAP.md
|
||||
@.planning/STATE.md
|
||||
|
||||
# Reference implementations:
|
||||
@src/events/types.ts
|
||||
@src/events/index.ts
|
||||
</context>
|
||||
|
||||
<tasks>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 1: Add phase domain events</name>
|
||||
<files>src/events/types.ts</files>
|
||||
<action>
|
||||
Add phase events to DomainEventMap following task event patterns:
|
||||
|
||||
PhaseQueuedEvent:
|
||||
- type: 'phase:queued'
|
||||
- payload: { phaseId, initiativeId, dependsOn: string[] }
|
||||
|
||||
PhaseStartedEvent:
|
||||
- type: 'phase:started'
|
||||
- payload: { phaseId, initiativeId }
|
||||
|
||||
PhaseCompletedEvent:
|
||||
- type: 'phase:completed'
|
||||
- payload: { phaseId, initiativeId, success: boolean, message?: string }
|
||||
|
||||
PhaseBlockedEvent:
|
||||
- type: 'phase:blocked'
|
||||
- payload: { phaseId, reason: string }
|
||||
|
||||
Add to DomainEventMap:
|
||||
- 'phase:queued': PhaseQueuedEvent
|
||||
- 'phase:started': PhaseStartedEvent
|
||||
- 'phase:completed': PhaseCompletedEvent
|
||||
- 'phase:blocked': PhaseBlockedEvent
|
||||
</action>
|
||||
<verify>npx tsc --noEmit passes</verify>
|
||||
<done>Four phase events defined in DomainEventMap</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 2: Export phase events</name>
|
||||
<files>src/events/index.ts</files>
|
||||
<action>
|
||||
Add exports for the four new phase event types:
|
||||
- PhaseQueuedEvent
|
||||
- PhaseStartedEvent
|
||||
- PhaseCompletedEvent
|
||||
- PhaseBlockedEvent
|
||||
</action>
|
||||
<verify>npx tsc --noEmit passes</verify>
|
||||
<done>Phase events exported from events module</done>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
|
||||
<verification>
|
||||
Before declaring plan complete:
|
||||
- [ ] `npm run build` succeeds without errors
|
||||
- [ ] `npm test` passes all tests
|
||||
- [ ] All four phase events importable from src/events
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
|
||||
- All tasks completed
|
||||
- All verification checks pass
|
||||
- Events follow existing naming pattern (phase:queued, phase:started, etc.)
|
||||
</success_criteria>
|
||||
|
||||
<output>
|
||||
After completion, create `.planning/phases/14-parallel-phase-execution/14-02-SUMMARY.md`
|
||||
</output>
|
||||
103
.planning/phases/14-parallel-phase-execution/14-03-PLAN.md
Normal file
103
.planning/phases/14-parallel-phase-execution/14-03-PLAN.md
Normal file
@@ -0,0 +1,103 @@
|
||||
---
|
||||
phase: 14-parallel-phase-execution
|
||||
plan: 03
|
||||
type: execute
|
||||
wave: 2
|
||||
depends_on: ["14-01", "14-02"]
|
||||
files_modified:
|
||||
- src/dispatch/phase-dispatch.ts
|
||||
- src/dispatch/types.ts
|
||||
- src/dispatch/index.ts
|
||||
autonomous: true
|
||||
---
|
||||
|
||||
<objective>
|
||||
Create PhaseDispatchManager port interface for dependency-ordered phase execution.
|
||||
|
||||
Purpose: Enable queuing and dispatching phases based on their dependencies.
|
||||
Output: PhaseDispatchManager interface with queue/dispatch operations.
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
@~/.claude/get-shit-done/workflows/execute-plan.md
|
||||
@~/.claude/get-shit-done/templates/summary.md
|
||||
</execution_context>
|
||||
|
||||
<context>
|
||||
@.planning/PROJECT.md
|
||||
@.planning/ROADMAP.md
|
||||
@.planning/STATE.md
|
||||
@.planning/phases/14-parallel-phase-execution/14-01-SUMMARY.md
|
||||
@.planning/phases/14-parallel-phase-execution/14-02-SUMMARY.md
|
||||
|
||||
# Reference implementations:
|
||||
@src/dispatch/types.ts
|
||||
@src/dispatch/manager.ts
|
||||
</context>
|
||||
|
||||
<tasks>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 1: Define PhaseDispatchManager port interface</name>
|
||||
<files>src/dispatch/types.ts</files>
|
||||
<action>
|
||||
Add types for phase dispatch:
|
||||
|
||||
QueuedPhase interface:
|
||||
- phaseId: string
|
||||
- initiativeId: string
|
||||
- queuedAt: Date
|
||||
- dependsOn: string[] (phase IDs)
|
||||
|
||||
PhaseDispatchResult interface:
|
||||
- success: boolean
|
||||
- phaseId: string
|
||||
- reason?: string (failure reason)
|
||||
|
||||
PhaseDispatchManager port interface:
|
||||
- queuePhase(phaseId: string): Promise<void>
|
||||
- getNextDispatchablePhase(): Promise<QueuedPhase | null>
|
||||
- dispatchNextPhase(): Promise<PhaseDispatchResult>
|
||||
- completePhase(phaseId: string): Promise<void>
|
||||
- blockPhase(phaseId: string, reason: string): Promise<void>
|
||||
- getPhaseQueueState(): Promise<{ queued: QueuedPhase[], ready: QueuedPhase[], blocked: Array<{phaseId: string, reason: string}> }>
|
||||
|
||||
Follow exact patterns from DispatchManager for tasks.
|
||||
</action>
|
||||
<verify>npx tsc --noEmit passes</verify>
|
||||
<done>PhaseDispatchManager interface defined with all methods</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 2: Export phase dispatch types</name>
|
||||
<files>src/dispatch/index.ts</files>
|
||||
<action>
|
||||
Export new types from dispatch module:
|
||||
- QueuedPhase
|
||||
- PhaseDispatchResult
|
||||
- PhaseDispatchManager
|
||||
</action>
|
||||
<verify>npx tsc --noEmit passes</verify>
|
||||
<done>Phase dispatch types exported from dispatch module</done>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
|
||||
<verification>
|
||||
Before declaring plan complete:
|
||||
- [ ] `npm run build` succeeds without errors
|
||||
- [ ] `npm test` passes all tests
|
||||
- [ ] PhaseDispatchManager importable from src/dispatch
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
|
||||
- All tasks completed
|
||||
- All verification checks pass
|
||||
- Interface follows hexagonal architecture (port pattern)
|
||||
- Methods mirror DispatchManager for consistency
|
||||
</success_criteria>
|
||||
|
||||
<output>
|
||||
After completion, create `.planning/phases/14-parallel-phase-execution/14-03-SUMMARY.md`
|
||||
</output>
|
||||
98
.planning/phases/14-parallel-phase-execution/14-04-PLAN.md
Normal file
98
.planning/phases/14-parallel-phase-execution/14-04-PLAN.md
Normal file
@@ -0,0 +1,98 @@
|
||||
---
|
||||
phase: 14-parallel-phase-execution
|
||||
plan: 04
|
||||
type: execute
|
||||
wave: 3
|
||||
depends_on: ["14-03"]
|
||||
files_modified:
|
||||
- src/dispatch/phase-manager.ts
|
||||
- src/dispatch/index.ts
|
||||
autonomous: true
|
||||
---
|
||||
|
||||
<objective>
|
||||
Implement DefaultPhaseDispatchManager adapter with in-memory queue and dependency checking.
|
||||
|
||||
Purpose: Enable actual phase dispatch with dependency resolution.
|
||||
Output: Working adapter implementation.
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
@~/.claude/get-shit-done/workflows/execute-plan.md
|
||||
@~/.claude/get-shit-done/templates/summary.md
|
||||
</execution_context>
|
||||
|
||||
<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
|
||||
</context>
|
||||
|
||||
<tasks>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 1: Implement DefaultPhaseDispatchManager</name>
|
||||
<files>src/dispatch/phase-manager.ts</files>
|
||||
<action>
|
||||
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.
|
||||
</action>
|
||||
<verify>npx tsc --noEmit passes</verify>
|
||||
<done>DefaultPhaseDispatchManager implements all interface methods</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 2: Export DefaultPhaseDispatchManager</name>
|
||||
<files>src/dispatch/index.ts</files>
|
||||
<action>
|
||||
Add export for DefaultPhaseDispatchManager class.
|
||||
</action>
|
||||
<verify>npx tsc --noEmit passes</verify>
|
||||
<done>DefaultPhaseDispatchManager exported from dispatch module</done>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
|
||||
<verification>
|
||||
Before declaring plan complete:
|
||||
- [ ] `npm run build` succeeds without errors
|
||||
- [ ] `npm test` passes all tests
|
||||
- [ ] DefaultPhaseDispatchManager importable from src/dispatch
|
||||
</verification>
|
||||
|
||||
<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>
|
||||
|
||||
<output>
|
||||
After completion, create `.planning/phases/14-parallel-phase-execution/14-04-SUMMARY.md`
|
||||
</output>
|
||||
112
.planning/phases/14-parallel-phase-execution/14-05-PLAN.md
Normal file
112
.planning/phases/14-parallel-phase-execution/14-05-PLAN.md
Normal file
@@ -0,0 +1,112 @@
|
||||
---
|
||||
phase: 14-parallel-phase-execution
|
||||
plan: 05
|
||||
type: execute
|
||||
wave: 3
|
||||
depends_on: ["14-01"]
|
||||
files_modified:
|
||||
- src/trpc/context.ts
|
||||
- src/trpc/router.ts
|
||||
autonomous: true
|
||||
---
|
||||
|
||||
<objective>
|
||||
Add tRPC procedures for phase dependencies and dispatch.
|
||||
|
||||
Purpose: Expose phase dependency and dispatch operations via API.
|
||||
Output: tRPC procedures for creating dependencies and managing phase queue.
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
@~/.claude/get-shit-done/workflows/execute-plan.md
|
||||
@~/.claude/get-shit-done/templates/summary.md
|
||||
</execution_context>
|
||||
|
||||
<context>
|
||||
@.planning/PROJECT.md
|
||||
@.planning/ROADMAP.md
|
||||
@.planning/STATE.md
|
||||
@.planning/phases/14-parallel-phase-execution/14-01-SUMMARY.md
|
||||
|
||||
# Reference implementations:
|
||||
@src/trpc/router.ts
|
||||
@src/trpc/context.ts
|
||||
</context>
|
||||
|
||||
<tasks>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 1: Add PhaseDispatchManager to tRPC context</name>
|
||||
<files>src/trpc/context.ts</files>
|
||||
<action>
|
||||
Add optional phaseDispatchManager to AppContext:
|
||||
- phaseDispatchManager?: PhaseDispatchManager
|
||||
|
||||
Import PhaseDispatchManager from dispatch module.
|
||||
Follow same pattern as agentManager (optional, undefined by default).
|
||||
</action>
|
||||
<verify>npx tsc --noEmit passes</verify>
|
||||
<done>PhaseDispatchManager available in tRPC context</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 2: Add phase dependency and dispatch procedures</name>
|
||||
<files>src/trpc/router.ts</files>
|
||||
<action>
|
||||
Add procedures under existing phase group:
|
||||
|
||||
createPhaseDependency:
|
||||
- input: { phaseId: string, dependsOnPhaseId: string }
|
||||
- validates both phases exist
|
||||
- calls phaseRepository.createDependency()
|
||||
- returns { success: true }
|
||||
|
||||
getPhaseDependencies:
|
||||
- input: { phaseId: string }
|
||||
- returns { dependencies: string[] } from phaseRepository.getDependencies()
|
||||
|
||||
Add new phase dispatch procedures:
|
||||
|
||||
queuePhase:
|
||||
- input: { phaseId: string }
|
||||
- requires phaseDispatchManager
|
||||
- calls phaseDispatchManager.queuePhase()
|
||||
- returns { success: true }
|
||||
|
||||
dispatchNextPhase:
|
||||
- no input
|
||||
- requires phaseDispatchManager
|
||||
- calls phaseDispatchManager.dispatchNextPhase()
|
||||
- returns PhaseDispatchResult
|
||||
|
||||
getPhaseQueueState:
|
||||
- no input
|
||||
- requires phaseDispatchManager
|
||||
- returns queue state
|
||||
|
||||
Follow existing router patterns for error handling and input validation.
|
||||
</action>
|
||||
<verify>npx tsc --noEmit passes</verify>
|
||||
<done>Phase dependency and dispatch procedures available via tRPC</done>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
|
||||
<verification>
|
||||
Before declaring plan complete:
|
||||
- [ ] `npm run build` succeeds without errors
|
||||
- [ ] `npm test` passes all tests
|
||||
- [ ] New procedures type-check correctly
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
|
||||
- All tasks completed
|
||||
- All verification checks pass
|
||||
- Procedures follow existing naming conventions
|
||||
- Error handling consistent with other procedures
|
||||
</success_criteria>
|
||||
|
||||
<output>
|
||||
After completion, create `.planning/phases/14-parallel-phase-execution/14-05-SUMMARY.md`
|
||||
</output>
|
||||
103
.planning/phases/14-parallel-phase-execution/14-06-PLAN.md
Normal file
103
.planning/phases/14-parallel-phase-execution/14-06-PLAN.md
Normal file
@@ -0,0 +1,103 @@
|
||||
---
|
||||
phase: 14-parallel-phase-execution
|
||||
plan: 06
|
||||
type: execute
|
||||
wave: 4
|
||||
depends_on: ["14-04", "14-05"]
|
||||
files_modified:
|
||||
- src/cli/commands/phase.ts
|
||||
- src/cli/index.ts
|
||||
autonomous: true
|
||||
---
|
||||
|
||||
<objective>
|
||||
Add CLI commands for phase dependency and dispatch operations.
|
||||
|
||||
Purpose: Enable user to manage phase dependencies and parallel execution from command line.
|
||||
Output: CLI commands for dependencies, queue, and dispatch.
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
@~/.claude/get-shit-done/workflows/execute-plan.md
|
||||
@~/.claude/get-shit-done/templates/summary.md
|
||||
</execution_context>
|
||||
|
||||
<context>
|
||||
@.planning/PROJECT.md
|
||||
@.planning/ROADMAP.md
|
||||
@.planning/STATE.md
|
||||
@.planning/phases/14-parallel-phase-execution/14-04-SUMMARY.md
|
||||
@.planning/phases/14-parallel-phase-execution/14-05-SUMMARY.md
|
||||
|
||||
# Reference implementations:
|
||||
@src/cli/commands/task.ts
|
||||
@src/cli/commands/initiative.ts
|
||||
</context>
|
||||
|
||||
<tasks>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 1: Add phase dependency commands</name>
|
||||
<files>src/cli/commands/phase.ts</files>
|
||||
<action>
|
||||
If phase.ts doesn't exist, create it. If exists, extend it.
|
||||
|
||||
Add commands under phase group:
|
||||
|
||||
cw phase add-dependency --phase <id> --depends-on <id>
|
||||
- Calls createPhaseDependency procedure
|
||||
- Output: "Added dependency: phase {phaseId} depends on {dependsOnPhaseId}"
|
||||
|
||||
cw phase dependencies <phaseId>
|
||||
- Calls getPhaseDependencies procedure
|
||||
- Output: Lists dependency phase IDs or "No dependencies"
|
||||
|
||||
cw phase queue <phaseId>
|
||||
- Calls queuePhase procedure
|
||||
- Output: "Phase {phaseId} queued for execution"
|
||||
|
||||
cw phase dispatch
|
||||
- Calls dispatchNextPhase procedure
|
||||
- Output: Success message with phaseId or failure reason
|
||||
|
||||
cw phase queue-status
|
||||
- Calls getPhaseQueueState procedure
|
||||
- Output: Formatted list of queued, ready, and blocked phases
|
||||
|
||||
Follow existing CLI patterns for error handling and output formatting.
|
||||
</action>
|
||||
<verify>npx tsc --noEmit passes</verify>
|
||||
<done>Phase dependency and dispatch CLI commands implemented</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 2: Register phase commands in CLI</name>
|
||||
<files>src/cli/index.ts</files>
|
||||
<action>
|
||||
Import and register phase commands if not already registered.
|
||||
Follow pattern from other command modules (task, initiative, agent).
|
||||
</action>
|
||||
<verify>npx tsc --noEmit passes; cw phase --help shows new commands</verify>
|
||||
<done>Phase commands available in CLI</done>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
|
||||
<verification>
|
||||
Before declaring plan complete:
|
||||
- [ ] `npm run build` succeeds without errors
|
||||
- [ ] `npm test` passes all tests
|
||||
- [ ] `cw phase --help` shows dependency and dispatch commands
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
|
||||
- All tasks completed
|
||||
- All verification checks pass
|
||||
- Commands follow existing CLI patterns
|
||||
- Help text is clear and concise
|
||||
</success_criteria>
|
||||
|
||||
<output>
|
||||
After completion, create `.planning/phases/14-parallel-phase-execution/14-06-SUMMARY.md`
|
||||
</output>
|
||||
123
.planning/phases/14-parallel-phase-execution/14-07-PLAN.md
Normal file
123
.planning/phases/14-parallel-phase-execution/14-07-PLAN.md
Normal file
@@ -0,0 +1,123 @@
|
||||
---
|
||||
phase: 14-parallel-phase-execution
|
||||
plan: 07
|
||||
type: execute
|
||||
wave: 5
|
||||
depends_on: ["14-06"]
|
||||
files_modified:
|
||||
- src/dispatch/phase-manager.test.ts
|
||||
- src/db/repositories/drizzle/phase.test.ts
|
||||
autonomous: true
|
||||
---
|
||||
|
||||
<objective>
|
||||
Add unit tests for phase dependencies and dispatch.
|
||||
|
||||
Purpose: Verify phase dependency and dispatch logic works correctly.
|
||||
Output: Unit tests with full coverage of new functionality.
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
@~/.claude/get-shit-done/workflows/execute-plan.md
|
||||
@~/.claude/get-shit-done/templates/summary.md
|
||||
</execution_context>
|
||||
|
||||
<context>
|
||||
@.planning/PROJECT.md
|
||||
@.planning/ROADMAP.md
|
||||
@.planning/STATE.md
|
||||
@.planning/phases/14-parallel-phase-execution/14-06-SUMMARY.md
|
||||
|
||||
# Reference implementations:
|
||||
@src/dispatch/manager.test.ts
|
||||
@src/db/repositories/drizzle/task.test.ts
|
||||
</context>
|
||||
|
||||
<tasks>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 1: Add PhaseRepository dependency tests</name>
|
||||
<files>src/db/repositories/drizzle/phase.test.ts</files>
|
||||
<action>
|
||||
Add test cases for new PhaseRepository methods:
|
||||
|
||||
describe('createDependency'):
|
||||
- creates dependency between two phases
|
||||
- throws if phase doesn't exist
|
||||
- allows multiple dependencies for same phase
|
||||
|
||||
describe('getDependencies'):
|
||||
- returns empty array for phase with no dependencies
|
||||
- returns dependency IDs for phase with dependencies
|
||||
- returns only direct dependencies (not transitive)
|
||||
|
||||
describe('getDependents'):
|
||||
- returns empty array for phase with no dependents
|
||||
- returns dependent phase IDs
|
||||
- returns only direct dependents
|
||||
|
||||
Use existing test patterns with createTestDatabase() and cleanup.
|
||||
</action>
|
||||
<verify>npm test -- src/db/repositories/drizzle/phase.test.ts passes</verify>
|
||||
<done>PhaseRepository dependency methods have test coverage</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 2: Add DefaultPhaseDispatchManager tests</name>
|
||||
<files>src/dispatch/phase-manager.test.ts</files>
|
||||
<action>
|
||||
Create test file for DefaultPhaseDispatchManager:
|
||||
|
||||
describe('queuePhase'):
|
||||
- adds phase to queue
|
||||
- emits PhaseQueuedEvent
|
||||
- includes dependencies in queued phase
|
||||
|
||||
describe('getNextDispatchablePhase'):
|
||||
- returns null when queue empty
|
||||
- returns phase with no dependencies first
|
||||
- skips phases with incomplete dependencies
|
||||
- returns oldest phase when multiple ready
|
||||
|
||||
describe('dispatchNextPhase'):
|
||||
- updates phase status to in_progress
|
||||
- emits PhaseStartedEvent
|
||||
- returns failure when no dispatchable phases
|
||||
|
||||
describe('completePhase'):
|
||||
- updates phase status to completed
|
||||
- removes from queue
|
||||
- emits PhaseCompletedEvent
|
||||
|
||||
describe('blockPhase'):
|
||||
- updates phase status
|
||||
- adds to blocked list
|
||||
- emits PhaseBlockedEvent
|
||||
|
||||
Use EventEmitterBus for event verification.
|
||||
Mock PhaseRepository for dependency data.
|
||||
</action>
|
||||
<verify>npm test -- src/dispatch/phase-manager.test.ts passes</verify>
|
||||
<done>DefaultPhaseDispatchManager has test coverage</done>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
|
||||
<verification>
|
||||
Before declaring plan complete:
|
||||
- [ ] `npm run build` succeeds without errors
|
||||
- [ ] `npm test` passes all tests
|
||||
- [ ] New tests cover all new functionality
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
|
||||
- All tasks completed
|
||||
- All verification checks pass
|
||||
- Tests follow existing patterns
|
||||
- Coverage includes happy path and edge cases
|
||||
</success_criteria>
|
||||
|
||||
<output>
|
||||
After completion, create `.planning/phases/14-parallel-phase-execution/14-07-SUMMARY.md`
|
||||
</output>
|
||||
111
.planning/phases/14-parallel-phase-execution/14-08-PLAN.md
Normal file
111
.planning/phases/14-parallel-phase-execution/14-08-PLAN.md
Normal file
@@ -0,0 +1,111 @@
|
||||
---
|
||||
phase: 14-parallel-phase-execution
|
||||
plan: 08
|
||||
type: execute
|
||||
wave: 5
|
||||
depends_on: ["14-06"]
|
||||
files_modified:
|
||||
- src/__tests__/e2e/phase-dispatch.test.ts
|
||||
autonomous: true
|
||||
---
|
||||
|
||||
<objective>
|
||||
Add E2E tests for parallel phase execution scenarios.
|
||||
|
||||
Purpose: Verify end-to-end phase dispatch with dependencies works correctly.
|
||||
Output: E2E tests covering parallel execution scenarios.
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
@~/.claude/get-shit-done/workflows/execute-plan.md
|
||||
@~/.claude/get-shit-done/templates/summary.md
|
||||
</execution_context>
|
||||
|
||||
<context>
|
||||
@.planning/PROJECT.md
|
||||
@.planning/ROADMAP.md
|
||||
@.planning/STATE.md
|
||||
@.planning/phases/14-parallel-phase-execution/14-06-SUMMARY.md
|
||||
|
||||
# Reference implementations:
|
||||
@src/__tests__/e2e/happy-path.test.ts
|
||||
@src/__tests__/e2e/parallel-conflict.test.ts
|
||||
</context>
|
||||
|
||||
<tasks>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 1: Create phase dispatch E2E tests</name>
|
||||
<files>src/__tests__/e2e/phase-dispatch.test.ts</files>
|
||||
<action>
|
||||
Create E2E test file for phase dispatch scenarios:
|
||||
|
||||
describe('Phase Parallel Execution'):
|
||||
|
||||
Test 1: Independent phases dispatch in parallel
|
||||
- Create initiative with 2 independent phases (no dependencies)
|
||||
- Queue both phases
|
||||
- Both should be ready for dispatch immediately
|
||||
- Dispatch both and verify parallel execution
|
||||
|
||||
Test 2: Dependent phase waits for prerequisite
|
||||
- Create phases: A, B (depends on A)
|
||||
- Queue both
|
||||
- Only A should be ready
|
||||
- Complete A
|
||||
- B should become ready
|
||||
|
||||
Test 3: Diamond dependency pattern
|
||||
- Create phases: A, B (depends on A), C (depends on A), D (depends on B, C)
|
||||
- Queue all
|
||||
- A ready first
|
||||
- After A completes: B and C ready (parallel)
|
||||
- After B and C complete: D ready
|
||||
|
||||
Test 4: Blocked phase doesn't dispatch
|
||||
- Create phases: A, B (depends on A)
|
||||
- Block A
|
||||
- B should never become ready
|
||||
|
||||
Use TestHarness with database fixtures.
|
||||
Follow existing E2E test patterns.
|
||||
</action>
|
||||
<verify>npm test -- src/__tests__/e2e/phase-dispatch.test.ts passes</verify>
|
||||
<done>Phase dispatch E2E tests cover parallel execution scenarios</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 2: Add phase dispatch to TestHarness</name>
|
||||
<files>src/__tests__/harness.ts</files>
|
||||
<action>
|
||||
Extend TestHarness to support phase dispatch testing:
|
||||
- Add phaseDispatchManager property (DefaultPhaseDispatchManager instance)
|
||||
- Wire up with phaseRepository and eventBus
|
||||
- Add helper methods if needed: queuePhase(), dispatchPhase()
|
||||
|
||||
Follow patterns from existing harness setup.
|
||||
</action>
|
||||
<verify>npm test -- src/__tests__/e2e/phase-dispatch.test.ts passes</verify>
|
||||
<done>TestHarness supports phase dispatch scenarios</done>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
|
||||
<verification>
|
||||
Before declaring plan complete:
|
||||
- [ ] `npm run build` succeeds without errors
|
||||
- [ ] `npm test` passes all tests
|
||||
- [ ] E2E tests verify actual parallel behavior
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
|
||||
- All tasks completed
|
||||
- All verification checks pass
|
||||
- Tests verify dependency ordering is enforced
|
||||
- Tests verify parallel phases dispatch together
|
||||
</success_criteria>
|
||||
|
||||
<output>
|
||||
After completion, create `.planning/phases/14-parallel-phase-execution/14-08-SUMMARY.md`
|
||||
</output>
|
||||
Reference in New Issue
Block a user