feat(tasks): analyst opens the task; freestyle threads it into implementation

Two coupled gaps from tracing a real run:

1. Freestyle implements in phase 2 via stages compiled from the architect's
   execution_plan (ExecutionPlanCompiler sets allowedTools = stage.tools), so the
   static allow-lists never reach it and architect_freestyle.md banned every tool
   but the file four. Teach the architect to thread an analysis-referenced task
   through the plan: implementing stages get task_context/task_update and claim +
   submit_for_review; the final/review stage completes it. No task referenced → no
   task tools, and the plan never creates one.

2. Give the analyst task_create so the work is framed as a tracked item up front
   (role_pipeline + freestyle). "Read-only" for the analyst means it writes no
   files; a task is an event-log entry, not a file write — task_create is T2, so
   opening one is approval-gated. The analyst names the new id in the analysis so
   the implementer claims it and the reviewer completes it; the implementer now
   creates only as a fallback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-24 15:13:52 +00:00
parent de54be7ecb
commit 12d5b9d7dc
6 changed files with 37 additions and 17 deletions
+7 -6
View File
@@ -24,16 +24,17 @@
id = "role_pipeline"
start = "analyst"
# 1. Understand the request and the relevant code. Read-only.
# ground_references: every workspace-relative file path the analysis names is checked
# for existence; a hallucinated path fails the stage and retries with the misses fed back.
# task_search/task_context (read-only) let it find related or duplicate tasks and load
# their context, so the analysis is grounded in existing work rather than re-derived.
# 1. Understand the request and the relevant code — writes no files (ground_references checks
# every workspace path the analysis names; a hallucinated path fails the stage and retries).
# It also 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 up front, named in the analysis so the implementer claims it and the
# reviewer completes it.
[[stages]]
id = "analyst"
prompt = "prompts/analyst.md"
produces = [{ name = "analysis", kind = "analysis" }]
allowed_tools = ["file_read", "ShellTool", "task_search", "task_context"]
allowed_tools = ["file_read", "ShellTool", "task_search", "task_context", "task_create"]
ground_references = true
token_budget = 16384
max_retries = 2