Plan: Remove execute Phase and Align CC APIs with Current Pipeline#
Summary#
Remove the obsolete execute phase from the database entity, DTOs, task creation defaults, and all test fixtures. The PHASE_ORDER and routing maps already exclude execute and already order deliver before review — this plan addresses the remaining inconsistencies in the entity, API validation, and test layer.
Files#
| File | Action | Description |
|---|---|---|
src/database/entities/task.entity.ts | modify | Remove phaseExecute column definition |
src/task-state/task-state.service.ts | modify | Remove phaseExecute: 'pending' from createTask() defaults |
src/control-api/dto/phase-override.dto.ts | modify | Remove 'execute' from PHASES array, reorder to deliver-before-review |
src/control-api/dto/status-override.dto.ts | modify | Remove 'execute' from PHASES array, reorder to deliver-before-review |
src/database/database.module.spec.ts | modify | Remove phaseExecute assertion |
src/task-state/task-state.service.spec.ts | modify | Remove phaseExecute assertion from createTask test |
src/phase-router/phase-router.service.spec.ts | modify | Replace all 'execute' phase references with 'deliver' in test fixtures |
src/directive/directive.service.spec.ts | modify | Replace phaseExecute and currentPhase: 'execute' in test fixtures |
src/hooks/phase-hooks.service.spec.ts | modify | Replace 'execute' phase references in test cases |
src/hooks/compound.service.spec.ts | modify | Replace execute_completed/execute_failed event types in test data |
src/watchdog/watchdog.service.spec.ts | modify | Replace currentPhase: 'execute' in test fixtures |
src/invoke/claude-invocation.service.spec.ts | modify | Replace 'execute' in test case |
src/metrics/metrics.service.spec.ts | modify | Replace 'execute' in test case |
Steps#
- Remove
phaseExecutefrom production code: Delete thephaseExecutecolumn fromTaskEntity, remove it fromcreateTask()defaults, remove'execute'from both DTO PHASES arrays, and reorder DTOs to[refine, plan, deliver, review, compound]. - Update all test fixtures: Replace every
phaseExecuteproperty andcurrentPhase: 'execute'reference across all.spec.tsfiles with valid phases (primarily'deliver'). Update event type strings likeexecute_completed→deliver_completed. - Run lint and tests: Execute
npm run lintandnpm run testto verify no remaining references toexecuteand all tests pass.
Verification#
grep -r 'execute' src/ --include='*.ts'returns zero hits forexecuteas a pipeline phase (only hits for the verb "execute" in method names/comments are acceptable)npm run testpasses with zero failuresnpm run lintpasses with zero warnings
Risks#
- Existing DB rows with
phase_executecolumn: SQLite ignores unmapped columns — TypeORM will stop reading/writingphase_executebut the column persists harmlessly. No destructive migration needed. - API consumers relying on
executephase in responses: Any external tooling querying task records will no longer seephaseExecutein API responses. This is the intended behavior per the issue.