Pre-review latency: deterministic lens tiering, exploration budget, model override - #22
Merged
Merged
Conversation
…n budget, model override Measured: 23 min / 155 tools / 119 Bash for a <1k-line PR (2 subagents each re-exploring the repo). Lens selection moves from agent judgment to Rust rules over diff signals (S/M single pass, L security-only when flagged, XL capped 2-lens panel); the instruction gains a hard exploration budget (~25 tool calls, diff-not-repo, no builds, ~5 min); optional review_model applies --model to the advisory pass only. Goldens regenerated deliberately (+ panel-variant golden). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Measured problem
A <1k-line PR took 23.0 minutes: 155 tools, 119 Bash commands, 2 specialist subagents each re-exploring the repo from scratch (single-pass baseline: 9.6 min / 40 tools). Three compounding causes: the ~100-line panel threshold was far too low, the instruction imposed no exploration bounds, and the advisory pass ran on the default heavyweight model.
Fix
review_lensesover diff signals): S/M diffs → single general pass, zero subagent language in the prompt; L → at most one security lens and only when auth/dependency paths are flagged; XL → capped two-lens panel (security + dominant area, infra replacing area when CI/migrations dominate). Unit-tested per tier.review_modelconfig (Settings → "Pre-review model"): applies--modelto Review spawns only — fixers/implementers keep the default. Null-honest binding.Expected: the 23-minute case drops to a single budgeted pass (~3–5 min, less on a faster model), which also stops auto-pre-review from starving the agent-slot pool.
Verified
cargo fmt/clippy -D warnings/test --all (501 core + 28 app) · tsc strict · vitest 258 · vite build.
🤖 Generated with Claude Code