feat(tasks): wire the task tools into role_pipeline

Tool availability is a strict per-stage allowlist, so the task doctrine was
inert in role_pipeline — no stage granted the tools. Add them where they fit
each stage's tier and role, and point the stage prompts at the lifecycle:

- analyst (read-only): task_search/task_context to find related or duplicate
  work and ground the analysis.
- implementer: full set — claim before working, submit_for_review once
  verification passes, create one if the work warrants tracking.
- reviewer: task_context to judge against the task's own criteria, task_update
  to complete it on an approved verdict.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-24 10:04:01 +00:00
parent 06c225e3bd
commit afb536f21f
4 changed files with 30 additions and 7 deletions
+13 -2
View File
@@ -27,11 +27,13 @@ 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.
[[stages]]
id = "analyst"
prompt = "prompts/analyst.md"
produces = [{ name = "analysis", kind = "analysis" }]
allowed_tools = ["file_read", "ShellTool"]
allowed_tools = ["file_read", "ShellTool", "task_search", "task_context"]
ground_references = true
token_budget = 16384
max_retries = 2
@@ -60,12 +62,18 @@ max_retries = 2
# stage may write — a FILE_WRITE outside it is blocked as scope creep. Left open
# here because the targets are task-specific; a task-scoped workflow would set e.g.
# writes = ["core/sessions/**", "testing/sessions/**"]
# The task tools let it own the work item across the loop: claim before starting,
# submit_for_review once verification passes, and add notes (create one first if the
# work warrants tracking and none exists — see the task policy in .correx/project.toml).
[[stages]]
id = "implementer"
prompt = "prompts/implementer.md"
needs = ["impl_plan"]
produces = [{ name = "patch", kind = "file_written" }]
allowed_tools = ["file_read", "file_write", "file_edit", "ShellTool"]
allowed_tools = [
"file_read", "file_write", "file_edit", "ShellTool",
"task_create", "task_update", "task_context", "task_search",
]
token_budget = 32768
max_retries = 3
@@ -85,11 +93,14 @@ max_retries = 0
# 5. Review the patch against the plan AND the analyst's acceptance criteria. The reviewer
# needs `analysis` so it judges the diff against concrete, pre-stated criteria (§5 narrow
# question) rather than whole files against taste.
# 5b. task_context lets the reviewer judge the patch against the task's own acceptance
# criteria; task_update lets it complete the task on an approved verdict (and only then).
[[stages]]
id = "reviewer"
prompt = "prompts/reviewer.md"
needs = ["patch", "impl_plan", "analysis"]
produces = [{ name = "review_report", kind = "review_report" }]
allowed_tools = ["task_context", "task_update"]
token_budget = 32768
max_retries = 2