2.7 KiB
2.7 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec |
|---|---|---|---|---|---|---|
| 01-persist-task-contract | Persist the autopilot task contract | done | 1 | plan.md | ../../specs/tasks/requirements/autopilot-mode.md |
Task 01: Persist the Autopilot Task Contract
Acceptance
- Existing and newly created tasks round-trip a non-null
autopilotboolean, with omission and migrated rows resolving to false. - HTTP and
create_task_kandevcreation accept the same optional field, do not inherit it from a parent, and reject incompatible agent runtime profiles before persistence. - The MCP schema uses the exact short description: "Start this task in autopilot mode. Default: false. The value is fixed at creation and is not inherited by subtasks. The agent does not ask the user directly; it asks its direct parent only for critical decisions." At runtime, a root autopilot task has no question capability, while an autopilot child has only the direct-parent question tool.
- Update/edit APIs cannot mutate the property, and task read/list/boot payloads expose it consistently to clients.
Verification
cd apps/backend && go test ./internal/task/models ./internal/task/dto ./internal/task/repository/sqlite ./internal/task/handlers ./internal/mcp/server ./internal/mcp/handlers
Files likely touched
apps/backend/internal/task/models/models.goapps/backend/internal/task/dto/dto.goapps/backend/internal/task/dto/requests.goapps/backend/internal/task/repository/sqlite/base_schema.goapps/backend/internal/task/repository/sqlite/base_migrations.goapps/backend/internal/task/repository/sqlite/task.goapps/backend/internal/task/handlers/task_http_handlers.goapps/backend/internal/mcp/server/server.goapps/backend/internal/mcp/handlers/handlers.go- Related model, repository, handler, and tool-schema tests
Dependencies
None.
Parallelism
This establishes the shared persisted/API contract. Runtime and UI work start only after its field name, default, and compatibility behavior are fixed.
Inputs
- Spec sections
Creation API,Persistence and restart, andPermissions and boundaries. - Existing task schema migrations,
TaskDTOconversion, HTTP create handler, and MCPregisterCreateTaskTool/handleCreateTaskpaths.
Output contract
Report the migration number and SQL, Go/JSON field names, compatibility default, profile-validation boundary, exact creation/read paths changed, tests run, and any runtime profile type that remains unsupported.
Results
Done. Added the immutable SQLite-backed field with migration/default, HTTP and MCP create propagation, DTO/WS/boot read paths, exact MCP parameter text, and tests for round trips, omitted values, nested creation, and update immutability.