feat(implement-loop): retire the finalize dispatch; the end-report carries the artifacts

The finalize agent only templated the script's already-computed
aggregate into stats.json / BLOCKED.md — ~41k real tokens per run
(197 dispatches / 8.0M in the 206-run corpus) for pure formatting.
The templates now live in the script (single source): the end-report
carries artifacts.stats_json and artifacts.blocked_md (null on DONE
and clean no-ops), and the orchestrator writes them byte-identical,
filling exactly two runtime slots it owns anyway — {{DATE}} (date +%F)
and {{FILES_TOUCHED}} (git status --porcelain, its Step-3/4 inspection
duty). File paths, consumers (tdd decompose reads BLOCKED.md,
postmortem parses it), and content shape are unchanged; the
agent-authored 'suggested next step' line is dropped — blocked_detail
carries the diagnosis.

refs #29
This commit is contained in:
2026-07-17 15:29:12 +02:00
parent 8272077e9b
commit 615a76eb01
3 changed files with 119 additions and 73 deletions
+5 -3
View File
@@ -186,9 +186,11 @@ orchestrates from the top level, so the per-task phases are real,
independently-invokable agent calls; this retired the former
`implement-orchestrator` agent's inline-role-switch workaround
(the four phase agents survive as the agent-types the script
dispatches). Writes code, tests, and stats files directly in the
working tree as unstaged changes; never commits. On `PARTIAL` or
`BLOCKED`, also writes `BLOCKED.md` at the repo root.
dispatches). Writes code and tests directly in the working tree as
unstaged changes; never commits. The end-report carries the finished
stats.json and — on `PARTIAL`/`BLOCKED``BLOCKED.md` contents, which
the orchestrator writes (issue #29 retired the finalize dispatch that
only templated the script's own aggregate).
### compiler-driven