Skip to content

Pre-review latency: deterministic lens tiering, exploration budget, model override - #22

Merged
alejandro-nexcade merged 1 commit into
mainfrom
alejandro/pre-review-latency
Jul 2, 2026
Merged

Pre-review latency: deterministic lens tiering, exploration budget, model override#22
alejandro-nexcade merged 1 commit into
mainfrom
alejandro/pre-review-latency

Conversation

@alejandro-nexcade

Copy link
Copy Markdown
Collaborator

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

  • Tiering is now deterministic Rust (review_lenses over 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.
  • Exploration budget in both prompt variants: review the diff not the repository, ~25 tool calls total (~15 per subagent), no builds/test suites, report-with-stated-assumption instead of deep verification chains, aim for under 5 minutes.
  • review_model config (Settings → "Pre-review model"): applies --model to Review spawns only — fixers/implementers keep the default. Null-honest binding.
  • Goldens regenerated deliberately; a second golden locks the panel variant.

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

…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>
@alejandro-nexcade
alejandro-nexcade merged commit e031bb1 into main Jul 2, 2026
2 checks passed
@alejandro-nexcade
alejandro-nexcade deleted the alejandro/pre-review-latency branch July 2, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants