3.4 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | ||
|---|---|---|---|---|---|---|---|---|
| 03-build-parent-question-lifecycle | Build the parent question lifecycle | done | 3 |
|
plan.md | ../../specs/tasks/requirements/autopilot-mode.md |
Task 03: Build the Parent Question Lifecycle
Acceptance
ask_parent_question_kandevvalidates and durably records one structured pending request, routes it to the resolved direct parent, returns immediately, and never creates an operator clarification.- A correlated direct-parent reply resolves and resumes the recorded child exactly once; duplicate, unauthorized, mismatched, superseded, and stale replies have no delivery side effect.
- Pending questions gate turn completion/queue draining, project to the existing sidebar clarification state, survive restart, and clear on every specified exit.
Verification
cd apps/backend && go test ./internal/mcp/server ./internal/mcp/handlers ./internal/task/repository/sqlite ./internal/task/statussummary ./internal/task/handlers ./internal/orchestrator/... ./internal/clarification/...
Files likely touched
apps/backend/internal/mcp/server/server.goapps/backend/internal/mcp/server/handlers.goapps/backend/internal/mcp/handlers/handlers.goapps/backend/internal/task/models/models.goapps/backend/internal/task/repository/sqlite/message.goapps/backend/internal/task/statussummary/model.goapps/backend/internal/task/statussummary/projector.goapps/backend/internal/task/statussummary/rebuild.goapps/backend/internal/task/handlers/message_handlers.goapps/backend/internal/orchestrator/event_handlers_clarification.goapps/backend/internal/orchestrator/clarification_guard.goapps/backend/internal/clarification/types.goapps/backend/internal/clarification/store.goapps/backend/internal/clarification/canceller.goapps/backend/internal/mcp/handlers/message_task_test.goapps/backend/internal/task/statussummary/projector_test.goapps/backend/internal/task/statussummary/rebuild_test.goapps/backend/internal/orchestrator/event_handlers_clarification_test.go
Dependencies
- Task 01 supplies task identity and persistence.
- Task 02 supplies the discoverable tool and autopilot prompt contract.
Parallelism
Backend lifecycle work is serialized after Task 02 because it implements the tool whose inventory Task 02 defines. Documentation may proceed in parallel once the public payload names are fixed.
Inputs
- Spec sections
Parent question protocol,State model,Persistence and restart, andFailure behavior. - Existing
message_task_kandevqueue/interrupt service, clarification pending actions, status-summary rebuild, prompt-generation guard, and turn-completion flow.
Output contract
Report the hidden message type and metadata schema, question/reply API payloads, transaction and serialization boundaries, state transitions, restart behavior, idempotency key, exact error codes, tests run, and results for answer/supersede/ terminal races.
Results
Done. Added durable parent-question messages, direct-parent authorization,
reply_to_question_id correlation, idempotent answer handling, child waiting and
resume behavior, task pending-action projection, and the parent-question MCP profile
registration. Handler/server/orchestrator tests cover the lifecycle and event order.