Grilling
Review Phase Token Rebuild Brainstorm Brief
Review Phase Token Rebuild Brainstorm Brief
Context
- Source: user
/retroand/brainstorm, 2026-10-23, T3 thread inharness-intelligence. - User claims under test: "review-phase is token hungry and should be rethinked and rebuilt"; "review-phase uses now obsolete openclaw … autoreview".
- System under change:
wearedevpunks/skillsreview-phase,reviewandautoreviewskills (synced intoharness-intelligence.agents/skills/andapps/cli/skills/), plus thedelivery-phasereview gate that starts them. - Evidence: 136 Claude Code sessions and their subagent logs for
collective-intelligence, apito, harness-intelligence, emera and directasim;
T3
statev2.sqliteturn items; 119 retained review reports; Headroomsavings_events.jsonl; upstreamopenclaw/agent-skillsv0.6.0; prior analysis~/Documents/harness-usage-analysis/(2026-09-29).
Findings
| Finding | Evidence |
|---|---|
| Review is 5–6% of delivery tokens, but one Full Code Review Pass costs 12–26M tokens in the gate subagent alone | 17 delivery sessions with review; 4 gate subagents, median 90 turns, context 148k → 370k |
The gate's cost is mechanical ceremony: about 31k tokens of review-phase docs, a full read of review-contract.mjs, hashes, packet, identities, report shape | Command classes in 5 gate transcripts |
| Axis subagents only start the helper and wait: 0.2–1.9M tokens each | 14 axis transcripts, median 7 turns |
| Engine (Codex) cost is small: about 21M input tokens in total, Oct 5–22 | Headroom savings_events.jsonl, model gpt-5.6-terra |
| Passes are slow and fragile: autoreview median 4 min, p90 45 min, max 2 h; one pass on 2026-10-22 ran 200 min and produced no result | 44 runs from heartbeat lines; gate transcript a8879905 |
| The user reports the 2026-10-22 stall came from depleted Codex quota; current skill text forbids switching engine and asks to retry the same engine | autoreview/SKILL.md contract; transcript shows retries on the same engine; quota error itself not retained |
In prepared-packet mode the vendored helper builds our own prompt (AXIS_BRIEF) and applies none of upstream's review method | .agents/skills/autoreview/scripts/autoreview:1100-1160 |
| Upstream autoreview is active, not obsolete: 253 commits, v0.6.0 on 2026-10-19, at least 55 external repos | openclaw/agent-skills; GitHub code search |
| Our copy is a frozen May 2026 fork: 1,285 helper lines against 8,652 upstream, steipete-only paths and instructions | Repo diff |
| Retained reports live in the wiki and enter later review scopes | collective-intelligence 95 reports (3.1 MB); 2026-09-15 report scope listed 8 earlier reports |
verify-behavior runs in implement-spec, not in review; review only consumes Verification evidence | implement-spec/SKILL.md step 12; delivery-phase/phases/review.md |
Simplify is a MUST in implement-spec and also part of the Standards axis | implement-spec/SKILL.md; AXIS_BRIEF.standards |
Accepted Preferences
- The 25–30M-token gate cost is the primary problem to remove. Target: median pass ≤ 4M tokens and at most 10 model turns outside adjudication, measured by recorded usage.
- Mechanical gate work (freeze, hash, Review Packet, budget, size check, retention, routing, skill-evidence cardinality, acceptance-criterion → Verification record check) becomes deterministic script work.
- Pass shape:
review prepare(script) →review run(script, two engine runs in background) → one adjudicator subagent →review retain(script). - No axis subagents. The script starts headless engine processes directly
(upstream helper:
claude --printorcodex exec), owns time limits and records usage. - One adjudicator subagent, not the root agent, verifies candidates with read tools and sets severity and route. It runs a command only to test one specific candidate; review does not repeat Task Gate validation.
- Sync
autoreviewto upstreamopenclaw/agent-skills, unchanged. Our local additions (packet, axis, guard) move into our own wrapper script. - Use the steipete review method (upstream prompt) in both runs. The mattpocock
Standards and Spec axes remain as guidance supplied through
--prompt-fileand--source-context. No third pure-upstream run. --max-priority P2. Documented repo standards are hard rules in Standards guidance; Fowler smells may stay at P3 and appear in the report as information only.- Engine: the host's own model by default through upstream's engine picker, with an option for a second model.
- Engine fallback: on quota, unavailable or timeout, the wrapper starts the
same axis on the next engine at once. When every engine fails, the axis
returns
incompletewith every attempt and cause, and the pass stops with an exact blocker. No open-ended waiting. - Runs stay small and scoped;
--dry-runsizing rejects oversized plans before any model runs. - Simplify leaves the Standards axis.
- Review reports are temporary artifacts at
.devpunks/delivery/<goal>/reviews/pass-<n>.json. The pass count is the number of valid files there. The wrapper always excludes that folder from the review target. - Record engine usage for every engine where upstream provides it.
Rejected Shapes
- Keep axis subagents that wait on the helper: they add about 1M tokens and a failure point per axis.
- Native host subagent as the axis engine (mattpocock original): the script cannot own its time limit or usage.
- Patch upstream autoreview in place: blocks clean updates.
- Retry the same engine on quota or capacity errors: caused the 2026-10-22 stall.
- A third pure-upstream run: repeats the axis runs.
Out Of Scope
- PR bots (for example greptile) and CI overlap.
- Usage accounting for the Claude engine (upstream does not aggregate it).
- The 2026-10-05 to 2026-10-19 subagent start-context inflation (harness side, already gone).
Open Forks
- Standalone review of plan, spec and documentation bundles is not a Git change; whether upstream can review it, and what replaces it, is open.
- Where closeout leaves the temporary reports (delete or keep in the delivery record) is open.
- Fate of accepted-risk second passes and human-directed extra ordinals under a file-count budget is open.