AI Agents SDE Task Viewer
      • Context
      • Plan
      • Prd
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-501
  5. plan
  6. plan.md
plan.md(3.2 KB)· Apr 14, 2026· 2 min read
  • Summary
  • Files
  • Steps
  • Verification
  • Risks

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#

FileActionDescription
src/database/entities/task.entity.tsmodifyRemove phaseExecute column definition
src/task-state/task-state.service.tsmodifyRemove phaseExecute: 'pending' from createTask() defaults
src/control-api/dto/phase-override.dto.tsmodifyRemove 'execute' from PHASES array, reorder to deliver-before-review
src/control-api/dto/status-override.dto.tsmodifyRemove 'execute' from PHASES array, reorder to deliver-before-review
src/database/database.module.spec.tsmodifyRemove phaseExecute assertion
src/task-state/task-state.service.spec.tsmodifyRemove phaseExecute assertion from createTask test
src/phase-router/phase-router.service.spec.tsmodifyReplace all 'execute' phase references with 'deliver' in test fixtures
src/directive/directive.service.spec.tsmodifyReplace phaseExecute and currentPhase: 'execute' in test fixtures
src/hooks/phase-hooks.service.spec.tsmodifyReplace 'execute' phase references in test cases
src/hooks/compound.service.spec.tsmodifyReplace execute_completed/execute_failed event types in test data
src/watchdog/watchdog.service.spec.tsmodifyReplace currentPhase: 'execute' in test fixtures
src/invoke/claude-invocation.service.spec.tsmodifyReplace 'execute' in test case
src/metrics/metrics.service.spec.tsmodifyReplace 'execute' in test case

Steps#

  1. Remove phaseExecute from production code: Delete the phaseExecute column from TaskEntity, remove it from createTask() defaults, remove 'execute' from both DTO PHASES arrays, and reorder DTOs to [refine, plan, deliver, review, compound].
  2. Update all test fixtures: Replace every phaseExecute property and currentPhase: 'execute' reference across all .spec.ts files with valid phases (primarily 'deliver'). Update event type strings like execute_completed → deliver_completed.
  3. Run lint and tests: Execute npm run lint and npm run test to verify no remaining references to execute and all tests pass.

Verification#

  • grep -r 'execute' src/ --include='*.ts' returns zero hits for execute as a pipeline phase (only hits for the verb "execute" in method names/comments are acceptable)
  • npm run test passes with zero failures
  • npm run lint passes with zero warnings

Risks#

  • Existing DB rows with phase_execute column: SQLite ignores unmapped columns — TypeORM will stop reading/writing phase_execute but the column persists harmlessly. No destructive migration needed.
  • API consumers relying on execute phase in responses: Any external tooling querying task records will no longer see phaseExecute in API responses. This is the intended behavior per the issue.
ContextPrd