3.7 KiB
3.7 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 02-derive-runtime-contract | Derive the autopilot runtime contract | done | 2 |
|
plan.md | ../../specs/tasks/requirements/autopilot-mode.md |
Task 02: Derive the Autopilot Runtime Contract
Acceptance
- Every task launch/resume transport carries the persisted autopilot value into system-prompt construction and agentctl task MCP configuration.
- Autopilot sessions receive the autonomy/last-action guidance and discover
ask_parent_question_kandevonly when a direct parent exists; autopilot root sessions receive no question tool; normal task sessions keep onlyask_user_question_kandev. - No session receives both question tools, and the remaining task/provider tools follow the existing mode allowlists.
- The profile registry composes base surfaces (
kanban-task,office-task,configuration,external) with additive title, question, and provider groups. It replaces duplicated mode branches and manual tool counts. - Top-level, nested, restart, and unsupported-mode behavior is deterministic and covered by prompt/tool inventory tests.
Verification
cd apps/backend && go test ./internal/sysprompt ./internal/mcp/server ./internal/agent/runtime/lifecycle/... ./internal/agentctl/server/... ./internal/orchestrator/...
Files likely touched
apps/backend/config/prompts/kandev-context.mdapps/backend/internal/sysprompt/sysprompt.goapps/backend/internal/sysprompt/sysprompt_test.goapps/backend/internal/orchestrator/task_operations.goapps/backend/internal/orchestrator/event_handlers_workflow.goapps/backend/internal/task/handlers/message_handlers.goapps/backend/internal/agent/runtime/agentctl/control.goapps/backend/internal/agent/runtime/lifecycle/container.goapps/backend/internal/agent/runtime/lifecycle/executor_docker.goapps/backend/internal/agent/runtime/lifecycle/executor_standalone.goapps/backend/internal/agent/runtime/lifecycle/manager_launch.goapps/backend/internal/agentctl/server/config/config.goapps/backend/internal/agentctl/server/instance/instance.goapps/backend/internal/agentctl/server/instance/manager.goapps/backend/internal/agentctl/server/api/server.goapps/backend/internal/mcp/server/server.goapps/backend/internal/mcp/server/tool_profiles.goapps/backend/internal/mcp/server/tool_profiles_test.goapps/backend/internal/agent/runtime/lifecycle/executor_docker_test.goapps/backend/internal/agentctl/server/session_config_test.goapps/backend/internal/mcp/server/server_test.go
Dependencies
- Task 01 provides the persisted property and compatible-profile validation.
Parallelism
Can run in parallel with Task 04 after Task 01. It owns backend launch, prompt, and tool-inventory transport; Task 04 owns frontend files.
Inputs
- Spec sections
Autonomous behavior,Parent question protocol, andPermissions and boundaries. - ADR
2026-08-03-provider-scoped-task-mcp-tools.mdfor backend-owned capability transport. - Existing
KandevContextOptions, task launch wrapping, lifecycle configuration,disableAskQuestionbehavior, and task parent lookup.
Output contract
Report the launch configuration shape, each transport updated, exact prompt text source, MCP registration predicate, tool-list behavior across resume, tests run, and any client that cannot receive a changed inventory.
Results
Done. Added typed backend-owned MCP surfaces and additive capability groups, carried the resolved profile through launch/resume/interaction transports, and derived the autopilot prompt plus mutually exclusive question tools for normal, child, and root tasks. Focused prompt, profile, server, and orchestrator tests pass.