5.0 KiB
5.0 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 05-mcp-dependency-tools | MCP dependency tools | done | 5 |
|
plan.md | ../../specs/tasks/system-design/task-dependencies.md |
Task 05: MCP Dependency Tools
Acceptance
create_task_kandevdeclaresblocked_by(array of task IDs) andstart_when_unblocked(boolean) in itsmcp.NewToolschema ininternal/mcp/server/server.go. Today the handler struct atinternal/mcp/handlers/handlers.go:576readsblocked_bybut the schema never declares it, so no agent can discover or reliably pass it. A pinning test asserts both parameters are present in the registered tool schema.blocked_bynon-empty plusstart_agent: true(including the default) records a start-when-unblocked intent and launches nothing now. The create response reportsstarted: falseandstart_when_unblocked: true.blocked_bynon-empty plus explicitstart_when_unblocked: falsecreates the edges with no launch intent; completing the predecessor starts nothing.add_task_dependency_kandevis registered:{task_id?, depends_on_task_id},task_iddefaults to the calling task, returns the resultingdepends_onlist. It rejects cycles with the cycle path, self-edges, and cross-workspace edges, using the single validator from Task 01.remove_task_dependency_kandevis registered with the same shape. Removing an absent edge succeeds. Removing the last edge unblocks the task without launching it.- Both new tools are registered in the same modes as the other task-mutation
tools, and neither widens the
ModeExternalsurface beyond whatcreate_task_kandevalready exposes there. - An agent cannot set
start_when_unblockedon a task it did not create. - Tool descriptions state: a subtask means "part of" and a dependency means "not
until"; decomposing a plan into ordered phases is N sibling tasks chained with
blocked_by+start_when_unblocked, not N subtasks started at once; and a failed predecessor halts the chain and needs human action. list_related_tasks_kandevpopulatesblockersandblocked_bywithFeatures.Officefalse (inherited from Task 01; asserted here at the MCP boundary).- Both tools authorize through the existing MCP scoping path — the owning task
comes from the
AgentExecution, never from an agent-suppliedtask_idused to reach another workspace's tasks. - The MCP tool list in the root
CLAUDE.md/AGENTS.md"Kandev Task Creation" guidance is updated if the new tools change how an agent should decompose work.
TDD sequence
- Failing pinning test: the registered
create_task_kandevschema declaresblocked_byandstart_when_unblocked. - Failing test:
blocked_by+ defaultstart_agentcreates the edge, starts no session, and returnsstarted: false,start_when_unblocked: true. - Failing test:
blocked_by+start_when_unblocked: falserecords no intent and completing the predecessor starts nothing. - Failing test: three chained
create_task_kandevcalls run in order — completing the first starts the second and not the third. - Failing tests for
add_task_dependency_kandev: defaulttask_id, returneddepends_on, cycle rejection with path, self-edge, cross-workspace. - Failing tests for
remove_task_dependency_kandev: removal, absent-edge success, last-edge removal unblocks without launching. - Failing test: an agent cannot set
start_when_unblockedon a task it did not create. - Failing test: cross-workspace
task_idon either tool is denied by the scoping path. - Failing test: with
Features.Officefalse,create_task_kandev+blocked_bysucceeds andlist_related_tasks_kandevreports the edge. - Implement schema declarations, the two tools, the start-intent semantics, and the descriptions.
Verification
cd apps/backend
go test -tags fts5 ./internal/mcp/... -run 'Test.*(Dependenc|BlockedBy|StartWhenUnblocked|ToolSchema)' -count=1
go test -tags fts5 ./internal/mcp/... -count=1
golangci-lint run ./... --new-from-rev=origin/main --timeout=5m
Files likely touched
apps/backend/internal/mcp/server/server.goapps/backend/internal/mcp/handlers/handlers.goapps/backend/internal/mcp/server/handoff_handlers.goapps/backend/internal/mcp/scope/(if either tool needs a scope entry)CLAUDE.md/AGENTS.md(task-decomposition guidance)- focused MCP handler and schema-pinning tests
Dependencies
Task 01 — needs the wired blocker repository, the single validator, and the
start_when_unblocked create-request field. It does not need Tasks 02–04, so it
may run alongside Task 06.
Parallelism
sequential
Output contract
Mark this task in_progress before the RED tests and done only after the
listed commands pass. Record the two new tool names and their registered modes,
the exact blocked_by + start_agent resolution rule as implemented, the
schema-pinning test name, and test results in this file and plan.md.