← Back to Pull requests

watch/prs: skip pull requests the fast pass cannot have missed #1575

Merged
sdowell merged 5 files (547 lines) on Sep 24, 2026 18:09 UTC
View on GitHub
sdowell sdowell commented on Sep 23, 2026 20:40 UTC
Author

The fast pass evaluated every assigned pull request every cycle, and an evaluation costs the better part of a dozen GitHub requests. On the kcc deployment most of those cycles reached the same verdict as the one before, because nothing about the pull request had changed.

needsEvaluation compares the listing's updated_at against the one the last complete evaluation recorded, and skips the pull request when it has not moved. evaluate clears any previously recorded evaluation up front and calls recordEvaluation only once it finishes cleanly, so every early return - a stop label, the merge queue, a history or check fetch failure, a sandbox probe or enqueue failure, a conflict rebase, an inactivity pause - leaves the pull request unrecorded and it is looked at again next cycle. Conversely, a pull request that already has an active task in the queue records that fact and returns before fetching history or checks, since no second task can be queued and the next fast pass can skip it until the task finishes. recordEvaluation re-reads state rather than taking a copy, because the handlers that ran in between write their own progress to the same record.

The gate has two blind spots where state transitions without moving updated_at, and both are covered rather than tolerated:

A check run completing, or GitHub finishing its background mergeability calculation (Mergeable == nil), does not touch the pull request's updated_at. A pull request whose last evaluation saw pending or failing CI or an unknown Mergeable state is therefore never skipped, and evaluateChecks propagates listing errors so a failed check read is never mistaken for a green build.
A task finishing is what makes a pull request ready for a human, and it can finish without pushing anything. The gate re-evaluates whenever HasActivePRTask disagrees with the last evaluation.

The sweep never consults the gate. That asymmetry is deliberate: it is the bounded safety valve for anything neither clause anticipates, which is what makes the gate safe to be aggressive about. For the same reason the record is not recovered from the queue on startup, so a fresh process earns one full evaluation per pull request.

Diff: 547 lines (+470 / -77) across 5 files Reviewer: barney-s Review duration: 1289m
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.47) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 547 lines diff across 5 files
0.47
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.377
Shallow Review Depth shallow_review_depth
0.344
Real PR Conversation Timeline
1 item
"Review active on #1575"
general weight: 0.35
Reviewers
Assignees
sdowell sdowell
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 46.6% (MEDIUM) · Higher = larger blast radius
46.6%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 24.8% · Safe to merge
24.8%