Tier the quality review by independently-measured diff size #30
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
The per-task quality review (
qual, opus/xhigh) plus its repair loop is the pipeline's largest cost pool: 51M of 164.5M real tokens (31%) over 206 implement-loop runs (local workflow-run telemetry, 2026-06-17..2026-07-17), and opus weighs ~5× on the quota side. The opus pin is justified indocs/agent-template.mdby consequence-of-a-miss — which scales with diff size and drops further once standard mode gains an independent end-of-iteration suite gate (the companion overhead issue).Mechanism
diff_magnitude(changed lines) andtouches_contract(whether the diff touches design-ledger/contract-referenced paths).diff_magnitude <= 25AND NOTtouches_contract→ sonnet/high; otherwise opus/xhigh, unchanged.Acceptance
importantor higher) are recorded on this issue. The threshold stands only if the sample shows no such divergence; otherwise the threshold drops or the change reverts.docs/agent-template.mdmodel-tier rule gains the size-conditioned case;quality-reviewer.mdnotes the tier split.The tiering mechanism is live as of
44f45d1: the spec-reviewer reportsdiff_magnitude/touches_contract, the loop picks sonnet/high at <=25 changed lines on non-contract paths, and the chosen tier lands in the end-report (qual_tier). Verified on two sandbox runs: a mini iteration (1-line diff) and a 2-task standard iteration both dispatched quality at sonnet/high; a mocked 50-line diff selected opus/xhigh, and missing measurements fall back to opus (fail-conservative).The acceptance sampling window is open from the next real consumer small-diff iterations onward: each sonnet quality verdict gets a one-off opus second review of the same diff until ~10 samples exist; any missed important+ finding gets recorded here. Sandbox/trivial iterations do not count toward the sample.