Review Phase Token Rebuild Grill Log
Review Phase Token Rebuild Grill Log
Status: review-phase-token-rebuild-grill-status. Brief: review-phase-token-rebuild-brainstorm-brief.
Measurement
Q1
Prerequisites:
- none
Altitude: L1
Source: Brainstorm Brief
Question: What is the primary problem and its target?
Accepted answer:
- Remove the 25–30M-token gate cost of one Full Code Review Pass.
- Target: median pass ≤ 4M tokens and at most 10 model turns outside adjudication, measured by recorded usage.
Q19
Prerequisites:
- Q1
Altitude: L1
Question: Is the token target a runtime guard or a delivery acceptance measurement?
Accepted answer:
- A delivery acceptance measurement. Each pass records its usage; the rebuild is accepted only when measured passes reach the median.
- Runtime hard limits are only the per-attempt time limit and the
--dry-runsize check.
Rejected alternatives:
- Runtime guard that fails a pass over budget: leaves code unreviewed; usage is unknown for some engines.
- Soft guard with a report warning.
Q30
Prerequisites:
- Q19, Q14
Altitude: L2
Question: What usage does each Pass Report record?
Accepted answer:
- Per Axis Run attempt: engine, model, duration, outcome and upstream
usageornull. - The Adjudicator's
subagent_tokensfrom the harness notification.
Rejected alternatives:
- Engine attempts only; measure the Adjudicator from session logs.
Pass Orchestration
Q2
Prerequisites:
- none
Altitude: L1
Source: Brainstorm Brief
Question: Who does the mechanical gate work?
Accepted answer:
- Deterministic scripts: freeze, hash, Review Packet, budget, size check, retention, routing, skill-evidence cardinality, and the acceptance-criterion to Verification record check.
Q3
Prerequisites:
- Q2
Altitude: L1
Source: Brainstorm Brief
Question: What is the shape of one pass?
Accepted answer:
review prepare(script) →review run(script, two engine runs in the background) → one adjudicator subagent →review retain(script).
Q4
Prerequisites:
- Q3
Altitude: L1
Source: Brainstorm Brief
Question: Do axis subagents remain?
Accepted answer:
- No. The script starts headless engine processes directly through the upstream helper, owns time limits and records usage.
Rejected alternatives:
- Axis subagents that wait on the helper: about 1M tokens and one failure point per axis.
- Native host subagent as the axis engine: the script cannot own its time limit or usage.
Q5
Prerequisites:
- Q3
Altitude: L1
Source: Brainstorm Brief
Question: Who verifies candidates?
Accepted answer:
- One adjudicator subagent, not the root agent. It 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.
Q20
Prerequisites:
- Q2, Q3
Altitude: L2
Question: What is the script home, language and interface?
Accepted answer:
- One Node ESM CLI
review-phase/scripts/review.mjswith subcommandsprepare,run,retain, reusingreview-contract.mjsas its library. - Each subcommand prints one short JSON line; the agent reads only that line.
- Standalone Git review (Q15) is a flag on the same CLI.
Rejected alternatives:
- Python CLI beside the Python helper.
Q21
Prerequisites:
- Q3
Altitude: L2
Question: Where does in-progress run state live?
Accepted answer:
$TMPDIR/hi-review/<run-id>/holds packet, context list, engine outputs, Lens Results and Adjudicator output;retainremoves it.
Rejected alternatives:
.devpunks/delivery/<goal>/reviews/.runs/<run-id>/, Git-ignored.
Q22
Prerequisites:
- Q3, Q10
Altitude: L2
Question: What does resume reuse?
Accepted answer:
runreuses each completed Axis Run whose packet identity is unchanged and reruns only a failed or missing axis.- A missing run directory reruns both axes.
Rejected alternatives:
- Always rerun both axes.
Q28
Prerequisites:
- Q5
Altitude: L2
Question: What is the Adjudicator contract?
Accepted answer:
- Input: paths to the packet and the two Lens Results.
- Output: one JSON file in the run directory with findings (stable ID, axis, severity, location, evidence, action,
return_route) and each rejected candidate with a reason;retainvalidates it. - Brief:
references/adjudicator.md; a readonly subagent of the host model.
Rejected alternatives:
- Return findings as text for the root agent to write.
Q32
Prerequisites:
- Q20, Q21
Altitude: L3
Question:
What are the review.mjs flags and results?
Accepted scope:
review.mjs prepare --goal <delivery-dir> --base <sha> [--standalone <locator>]→{run_id, run_dir, ordinal|null, axes:{standards:{bytes,passes}, spec:{…}}, blocker|null}.review.mjs run --run-dir <dir>(run in background by the root agent) →{standards:{outcome, engine, attempts}, spec:{…}, blocker|null}.review.mjs retain --run-dir <dir>→{pass_report, commit, route:{primary, secondary_debt}}.review.mjs status --goal <delivery-dir>→{next: prepare|run|adjudicate|retain|done, run_dir, pass_count}.- Each subcommand prints one JSON line;
blockeris a relayable sentence.
Rejected alternatives:
- No
status; the agent infers the step from run-dir files.
Q33
Prerequisites:
- Q20, Q25, Q26; upstream S:7301, S:7312
Altitude: L3
Question: What is the module split and engine test seam?
Accepted scope:
review.mjs: side effects only (git, fs, processes, upstream helper calls).review-contract.mjs: pure logic (identities, budget, context list, fallback plan, routing, schema checks), tested directly.- Engine seam: upstream
CODEX_BIN/CLAUDE_BIN; tests supply fake engine binaries (two adapters: real and fake).
Rejected alternatives:
- Own engine interface with a fake adapter inside
review.mjs.
Q35
Prerequisites:
- Q20, Q22
Altitude: L3
Question:
What is the review-phase skill layout?
Accepted scope:
SKILL.mdis one short procedure (prepare → run → adjudicate → retain → return route), about 60 lines.references/:adjudicator.md,axis-standards.md,axis-spec.md,routing.md.- Remove
phases/,AUTHORING-HANDOFF.md,durable-report.md,runtime-handoff.md,state-graph.md,targets.md,review-packet.md(about 1,900 lines). - Resume goes through
review.mjs status.
Rejected alternatives:
- Keep the router and gates, each thinned to one script call.
Q36
Prerequisites:
- Q20, Q24
Altitude: L3
Question:
Which review-contract.mjs exports stay?
Accepted scope:
- Keep:
reviewPacketIdentity,planDeliveryReviewGate,deriveReviewRouting. - Add:
recoverPassCount,validatePassReport,planEngineOrder,selectSourceContext. - Remove: wiki report path, Markdown report encode/parse, retained-ref checks,
validateRetainedPass,resolveRetainedRun, standalone bundle normalizer.
Rejected alternatives:
- Replace the library completely.
Engine And Helper
Q6
Prerequisites:
- none
Altitude: L1
Source: Brainstorm Brief
Question:
How does autoreview relate to upstream?
Accepted answer:
- Sync to upstream
openclaw/agent-skills, unchanged. Our packet, axis and guard logic moves into our own wrapper script.
Rejected alternatives:
- Patch upstream in place: blocks clean updates.
Q9
Prerequisites:
- Q6
Altitude: L1
Source: Brainstorm Brief
Question: Which engine reviews by default?
Accepted answer:
- The host's own model through upstream's engine picker, with an option for a second model.
Q10
Prerequisites:
- Q9
Altitude: L1
Source: Brainstorm Brief
Question: What happens when an engine cannot complete?
Accepted answer:
- 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.
Rejected alternatives:
- Retry the same engine on quota or capacity errors: caused the 2026-10-22 stall.
Q11
Prerequisites:
- Q6
Altitude: L1
Source: Brainstorm Brief
Question: How large may one engine run be?
Accepted answer:
- Runs stay small and scoped.
--dry-runsizing rejects an oversized plan before any model runs.
Q14
Prerequisites:
- Q6
Altitude: L1
Source: Brainstorm Brief
Question: Which engine usage is recorded?
Accepted answer:
- Every engine where upstream provides usage. Claude-engine usage accounting is out of scope.
Q25
Prerequisites:
- Q6
Altitude: L2
Question:
How is the upstream helper vendored and pinned, and what happens to the autoreview skill?
Accepted answer:
- Copy only the upstream helper script, unchanged, to
review-phase/scripts/vendor/autoreview, withUPSTREAM.mdrecording the tag and--versionsource-sha256. - No byte-identity test on the vendored helper (user, R2: rejected).
- Delete our
autoreviewskill.
Rejected alternatives:
- Install the full upstream skill unchanged and model-visible.
- A test that fails on any byte change of the vendored helper: rejected by the user.
Q26
Prerequisites:
- Q9, Q10; fact: Codex injects
CODEX_THREAD_ID(openai/codexcodex-rs/core/src/exec_env.rs:30-42)
Altitude: L2
Evidence anchor:
CLAUDECODE=1observed in this Claude Code shell;CODEX_THREAD_ID,CODEX_SESSION_IDinjected perexec_env.rs:30-42;CODEX_CI=1perunified_exec/process_manager.rs:105
Observed constraint:
- Codex marker is source-proven, not runtime-proven on 2026-10-23: the proxy served no
solmodel and upstream defaultgpt-6.1-solreturnedmodel_not_found.
Question: What is the engine order and override?
Accepted answer:
- Host detection:
CLAUDECODE=1selects Claude;CODEX_THREAD_IDset selects Codex. - Order
[host, other]; overrideHI_REVIEW_ENGINES=codex,claude; the second-model option places the other engine first. - Models stay at upstream defaults unless overridden.
Rejected alternatives:
- Fixed order with Codex first.
Review Method
Q7
Prerequisites:
- Q6
Altitude: L1
Source: Brainstorm Brief
Question: Whose review method do the engine runs apply?
Accepted answer:
- The steipete method (upstream prompt) in both runs. The mattpocock Standards
and Spec axes remain as guidance through
--prompt-fileand--source-context.
Rejected alternatives:
- A third pure-upstream run: repeats the axis runs.
Q8
Prerequisites:
- Q7
Altitude: L1
Source: Brainstorm Brief
Question: Which finding priorities count?
Accepted answer:
--max-priority P2. Documented repo standards are hard rules in Standards guidance; Fowler smells may stay at P3 and appear only as information.
Q12
Prerequisites:
- Q7
Altitude: L1
Source: Brainstorm Brief
Question: Does the Standards axis check simplify?
Accepted answer:
- No.
implement-specowns simplify.
Q27
Prerequisites:
- Q7; fact: engines read only the bundle (S:4236)
Altitude: L2
Question: Which source context does each axis get?
Accepted answer:
- Standards: the
AGENTS.mdchain for touched paths, matched Codebase Rules, and each assigned skill'sSKILL.md. - Spec:
SPEC.md,ARCHITECTURE.md,PLAN.md,IMPLEMENTATION-NOTES.md. - All as
--source-context;--dry-runsizes first; oversize stopspreparewith a blocker before any model runs.
Rejected alternatives:
- Also add unchanged neighbours of changed files.
Reports And Budget
Q13
Prerequisites:
- none
Altitude: L1
Source: Brainstorm Brief
Question: Where do review reports live, and what holds the pass count?
Accepted answer:
- 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.
Q16
Prerequisites:
- Q13
Altitude: L1
Question: What happens to the temporary reports at closeout?
Accepted answer:
- Keep
reviews/pass-<n>.jsonin the delivery folder; remove nothing.
Rejected alternatives:
- Delete at closeout and keep only finding IDs in the Delivery Handoff.
Q17
Prerequisites:
- Q13
Altitude: L1
Question: Do the extra-pass rules stay?
Accepted answer:
- Keep all three unchanged: one pass by default; a second pass only on an accepted-risk repair (architecture, security, public contract, runtime topology, scope); a further pass only with explicit human direction.
- Only the count source changes, to the number of valid Pass Reports.
Rejected alternatives:
- Remove the accepted-risk second pass.
Q18
Prerequisites:
- Q13
Altitude: L1
Question:
What happens to existing wiki review reports and the reviews section?
Accepted answer:
- Freeze them in place. New passes stop writing to the wiki.
- Remove
reviews/from the scaffolded wiki contract for new projects. Do not delete or migrate old reports.
Rejected alternatives:
- Remove the section in every consumer repo during
hi update.
Q23
Prerequisites:
- Q13, Q16
Altitude: L2
Question: How is the Pass Report written and numbered?
Accepted answer:
retainallocatesnby exclusive create ofpass-<n>.json, then commits only that file through a pathspec commit.- Debt capture keys entries by report path and finding ID.
Rejected alternatives:
- Write without commit; the next delivery commit includes it.
Q24
Prerequisites:
- Q13, Q18
Altitude: L2
Question: What happens to in-flight lineages with legacy wiki reports?
Accepted answer:
- Ignore legacy wiki reports; an in-flight delivery restarts its count under the new model; the baseline changelog says so.
Rejected alternatives:
- For one release, read legacy wiki ordinals read-only.
Q34
Prerequisites:
- Q23, Q28, Q30
Altitude: L3
Question: Which fields does a Pass Report carry?
Accepted scope:
schema: "pass-report-v1",run_id,ordinal,mode,base,head,packet_identity.axes.{standards,spec}: Lens Result plusattempts[{engine, model, seconds, outcome, usage|null}].adjudication:subagent_tokens,findings[],rejected[];route.- No Markdown body, no wiki frontmatter.
Rejected alternatives:
- Keep the
two-axis-v1report shape and change only its location.
Standalone Review
Q15
Prerequisites:
- Q6; fact: upstream reviews only a Git change (S:4224, S:2055)
Altitude: L1
Question: Keep standalone review of plan, spec and doc bundles, and in which form?
Accepted answer:
- Keep it only as a Git review: the operator commits the artifacts and reviews that commit or range.
- Remove the non-Git standalone bundle adapter and its identity rules.
Rejected alternatives:
- Remove standalone mode completely.
Downstream Consumers
Q29
Prerequisites:
- Q7, Q25
Altitude: L2
Question:
What happens to the review skill?
Accepted answer:
- Move its Standards and Spec guidance into
review-phase/references/axis-standards.mdandaxis-spec.md, passed as prompt files. - Keep the mattpocock
UPSTREAM.mdandLICENSEinreview-phase; delete thereviewskill.
Rejected alternatives:
- Keep
reviewas a separate guidance skill.
Q37
Prerequisites:
- Q23, Q24
Altitude: L3
Question: Which delivery-phase handoff fields and files change?
Accepted scope:
references/phase-handoff.md,artifact-state.md: replace report path, report SHA-256, report commit andverified_retained_refwithpass_report(path) andreview_run_id.review_countis no longer stored;review.mjs statusderives it.- Update
phases/review.md,router.md,closeout.md,implement.md,debug.mdto match.
Rejected alternatives:
- Keep stored
review_countbeside the derived value.
Q39
Prerequisites:
- Q33
Altitude: L3
Question: Which tests replace the graph contract tests?
Accepted scope:
- Replace
tests/review-phase-graph.contract.test.mjs,tests/v43-frozen-review.contract.test.mjsand fixturestests/fixtures/v43/IP-453/{retained-pass,prove-native}.mjswithtests/review-phase-cli.test.mjs(CLI with fake engines: fallback, timeout to next engine, resume reuse, exclusive ordinal, oversize blocker, routing) plusreview-contract.mjsunit tests. - Update text pins in
workflow-boundaries,agent-workflow-contract,matt-pocock-provenanceandv43-*tests that point at removed files.
Rejected alternatives:
- Keep and adapt the graph test.
Q38
Prerequisites:
- Q25, Q29; fact:
hi updatestale removal (apps/cli/src/registry/pipeline.ts:1135-1166)
Altitude: L3
Question: How is the change set delivered, and how does it reach consumer repos?
Accepted scope:
- One delivery across the skills repo and the harness: delete skills
autoreviewandreview; rewriteask-hireview references; updatedebugging-phaseandfinder-phase$review-phaseinvocations; harness catalogskills.ts:841-857,packs.ts:266-268, subagent manifests,publisher/sources/skills.test.ts:106(vendored helper path),builders/prompts.ts:36,registry/prompts/root.md.tmpl:37,69; wiki review pages and runbookhi-cli-scaffolding.md:658-712; removereviews/from the scaffolded wiki contract;BASELINE_CHANGELOG.mdUnreleased notes and compatibility. - Consumer repos lose
autoreviewandreviewthrough existing STEP-011 stale removal; the changelog tells operators that edited copies needhi update --yes.
Rejected alternatives:
- Two deliveries (skills first, harness second): leaves the catalog naming skills the source no longer has.
Q40
Prerequisites:
- none
Altitude: L1
Question: How is prompt and skill text written in this delivery?
Accepted answer:
- Every prompt and skill text this delivery creates or edits (
review-phase/SKILL.md,references/adjudicator.md,axis-standards.md,axis-spec.md,routing.md,ask-hireferences,delivery-phase,debugging-phase,finder-phasetext, harness prompt templates) goes through$writing-for-agents.
Glossary Decisions
Glossary Q31
Question: Which terms name the rebuilt pass parts?
Accepted answer:
- Canonical term: Axis Run — one upstream
autoreviewengine run for one axis, started by the wrapper script. - Avoid: axis subagent, lens worker
- Canonical term: Adjudicator — the one subagent that verifies candidates and sets final severity and route.
- Avoid: parent review, gate subagent
- Canonical term: Engine Fallback — the wrapper starting the same Axis Run on the next engine after an engine failure.
- Canonical term: Pass Report — the temporary JSON report of one completed Full Code Review Pass at
.devpunks/delivery/<goal>/reviews/pass-<n>.json. - Avoid: retained report, review report page
- Relationship: one Full Code Review Pass has exactly two Axis Runs, one Adjudicator and at most one Pass Report.
- Axiom: no model turn does work with one correct output; no agent waits on an engine process.
Closure
- Shared-understanding confirmation and closure: "very good. now go full /create-architecture /create-spec /write-backlog /create-plan" (user, 2026-10-23).
- Handoff:
$create-architecturewith this log and the status file, then$create-spec,$write-backlog,$create-planthrough$requirements-phase.