3.0 KiB
3.0 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec |
|---|---|---|---|---|---|---|
| 01-execution-stop-semantics | Execution stop outcomes | done | 1 | plan.md | ../../specs/tasks/requirements/parent-child-task-stop.md |
Task 01: Execution stop outcomes
Acceptance
- A detailed per-session stop primitive distinguishes accepted cancellation, natural terminal/absent execution, and genuine lookup/persistence failure.
- Only
lifecycle.ErrNoExecutionForSessioncounts as natural absence. Other lookup errors and empty-ID/nil are failures. - The stop-specific state transition reports changed/final state. Natural
terminal races do not get overwritten or count as stopped; successful
acceptance persists
CANCELLEDbefore async teardown. - State-write failure prevents teardown for that candidate. Runtime teardown is asynchronous and detached from caller cancellation.
- Existing UI, completion, Office/tree/workspace, and handoff stop callers retain
supplied reason/force and legacy
ErrExecutionNotFound/ partial-success behavior.
Verification
cd apps/backend && go test ./internal/orchestrator/executor ./internal/orchestrator
Files Likely Touched
apps/backend/internal/orchestrator/executor/executor_interaction.goapps/backend/internal/orchestrator/executor/executor_interaction_test.goapps/backend/internal/orchestrator/executor/executor_mocks_test.goapps/backend/internal/orchestrator/service.goapps/backend/internal/orchestrator/event_handlers_streaming.goapps/backend/internal/orchestrator/event_handlers_streaming_test.go
Dependencies
None.
Inputs
- Spec:
What,State and persistence,Failure modes, andScenarios. - Existing task-stop seam:
Service.StopTaskandExecutor.StopByTaskID. - Normal lifecycle absence sentinel:
lifecycle.ErrNoExecutionForSession.
Output Contract
Update this task to done, update plan.md, and report per-session outcomes,
legacy compatibility, files changed, tests run, blockers, and remaining
lifecycle risks.
Completion
- Added a strict per-session outcome with accepted/final-state reporting.
- Added exact execution teardown ownership across coordinator stops, terminal cleanup, launch/recovery races, and durable task-resource cleanup.
- Preserved legacy stop sentinels while exposing exact runtime absence as idempotent; real lookup and persistence failures remain retryable.
- Added an atomic session-owned task-state CAS so clarification/terminal state cannot be overwritten by delayed runtime reconciliation.
- Changed areas: runtime/lifecycle stop contracts, orchestrator executor and recovery paths, task cleanup jobs, MCP clarification state, and focused E2E coverage.
- Tests run:
make fmt,make typecheck,make test,make lint, scoped Go race suites, and the sidebar-clarification and Office-onboarding Playwright specs against production builds. - Blockers: none.
- Remaining lifecycle risks: none known; session-scoped lookup absence remains retryable until an exact execution identity is available.