feat(tasks): task_decompose splits a goal into a dependency-linked graph in one approval

The freestyle analyst can now break a large goal with dependency seams or
independent review/handoff points into a parent epic + DEPENDS_ON-linked children
in a single T2 approval, instead of N separate task_create calls. Parent
DEPENDS_ON every child (completes last); each child IMPLEMENTS parent. Resolves
depends_on by ref or index; rejects cycles, unresolved refs, missing title/goal,
and empty batches; same batch dedup + force_reason convention as task_create.

A session works one active task, so multi-task work is multi-session by
construction: the analyst names the single ready task this run works, the architect
threads only that one, and siblings are claimed by later runs via task_ready
(claim-driven; no scheduler, /tasks/next stays rejected).

Doctrine: analyst_freestyle.md picks one-task-vs-decompose and names the ready
task; architect_freestyle.md threads only that one; plus the L0 policy line.
freestyle_planning.toml analyst gains task_decompose (pinned by
FreestylePlanningWorkflowTest).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-25 10:39:03 +00:00
parent 67384691e0
commit 21e01da3ac
8 changed files with 446 additions and 15 deletions
+5 -4
View File
@@ -2,14 +2,15 @@ id = "freestyle_planning"
start = "analyst"
# analyst writes no files, but it owns task framing: task_search/task_context (read-only) find
# existing work, and task_create (T2, approval-gated — a task is an event-log entry, not a file
# write) opens a task for this work and names its id in the analysis, so the architect can thread
# it into the plan's implementation stages.
# existing work; task_create (T2, approval-gated — a task is an event-log entry, not a file write)
# opens a single task; task_decompose (T2, one approval for the whole graph) splits a goal with
# dependency seams into parent + DEPENDS_ON-linked children. Either way the analysis names the task
# id the run will work, so the architect threads it into the plan's implementation stages.
[[stages]]
id = "analyst"
prompt = "prompts/analyst_freestyle.md"
produces = [{ name = "analysis", kind = "analysis" }]
allowed_tools = ["file_read", "ShellTool", "task_search", "task_context", "task_create"]
allowed_tools = ["file_read", "ShellTool", "task_search", "task_context", "task_create", "task_decompose"]
token_budget = 16384
max_retries = 2