Repository navigation
perf(source-control): stop judging a pr-merge candidate once a lane merge is in flight - #8187
Conversation
…erge is in flight pr-merge merges one lane pull request at a time, so while one sits in the merge queue every other candidate is refused `in-flight:...`. `assess` still read eligibility and promotion, and `score_unattended` still read the risk evidence, the changed files and the verifier verdict, for a refusal already decided. `in_flight` now also returns every queued pull request number (None when the queue was not read whole). Past an on rung, `assess` returns the in-flight refusal at once when the candidate has no queue entry of its own and is not a Dependabot pull request; the reason, `enabled` and the rung, cap and in-flight details are unchanged. A queued candidate is still judged in full, so its own refusal still dequeues it; a Dependabot one is too, because its class decides the gate's dependency-manager hold. The risk comment and verifier escalation of an off-queue in-flight candidate wait for a run with nothing in flight. The merge-queue sweep in `unattended_writes` still runs. The in-flight check stays after the post-merge and floor reads: a post-merge refusal outranks it and is a stop refusal that dequeues every identity entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-review reviewed No findings in the incremental change since 319016a (the I could not run the tests. The sandbox required approval for
|
|
claude-security-review reviewed Security review: incremental, 319016a → 5bd9687No security findings. The change touches three files:
The diff has no production code, workflow, token or secret handling, or injection surface. The two new tests only strengthen guards on the refuse path. I didn't consult |
…n-flight early return A rung-off path with an off-queue in-flight refusal still refuses `rung-off:` and reads eligibility, and a Dependabot pull request refused in flight still reads its class, so the gate keeps no dependency-manager hold. Each test fails with its guard removed from the early return. safety.md now states where the reads stop on an in-flight refusal, that `unattended.promoted` is then null (true in the pr-merge lane), and that the risk comment and verifier escalation wait for the first run that reads the pull request in full with nothing in flight. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No related issue: pr-merge throughput (2026-10-18), sweeps time out at 44 of ~106 candidates.
Summary
Run 39113451592 reached 44 of about 106 candidates before the 30-minute timeout, at about 41 s each, and 26 of its 43 refusals were
in-flight:identity-entry-queued:#8036. pr-merge merges one lane pull request at a time, so while one is queued every other candidate is refused in flight, yetassessandscore_unattendedstill read eligibility, promotion, risk evidence, changed files and the verifier verdict for a refusal that was already decided. This change returns that refusal at once.Fix
in_flightalso returnsqueued, every merge-queue pull request number (None when the queue was not read whole). The field iscompare=False, so existingInFlightequality is unchanged.assess, once the rung is notoffandin_flightrefuses, the refusal returns at once when the candidate is not itself in the queue and is not a Dependabot pull request. The reason (in-flight:<reason>),enabled=True, and the rung, cap and in-flight details are the same as before. Eligibility, promotion, and throughscore_unattended(which returns early with no eligibility) the risk evidence, changed files and verifier verdict are no longer read.own_refusal(ineligible, class above rung, verifier refusal, risk) is what removes its own entry, and the sweep skips the verifier hold for the candidate's own number.lane_dependabotinmain), which changes the blocker list.unattended_writes(identity queue,entry_hold, verifier hold for other entries, dequeue) still runs in every gate process.post-merge:..., includingfloor-unreadable) outranks the in-flight refusal. It is a stop refusal withenabled=Falsethat dequeues every identity entry, so checking the queue first would change outcomes.Verification
Assess.test_an_in_flight_refusal_off_the_queue_reads_nothing_after_itpatches eligibility, lane and Dependabot eligibility, and promotion to raise.Assess.test_the_in_flight_refusal_matches_the_full_judgmentchecks that the reason andenabledmatch the full-read path, and that a queued candidate is still read in full withown_refusalset.InFlight.test_the_queue_read_names_every_entry_or_none.LaneMode.test_an_in_flight_refusal_skips_the_risk_and_verifier_readsruns end to end throughmain --merge. The risk evidence and changed files raise, the verifier is read only for the swept entry chore: adopt widened comment-hygiene policy and re-pin ci-workflows @9567b8b #9, no risk comment is written, and the sweep still judges chore: adopt widened comment-hygiene policy and re-pin ci-workflows @9567b8b #9.risk evidence read,read after the refusal, and the list mismatch). On the unchanged source all four fail.python3 -m unittest discover -s tests -t .ran 1794 tests, OK.scripts/run-ruff.sh checkandformat --checkare clean.scripts/check-affected.sh: 7 passed, 1 skipped.Related
🤖 Generated with Claude Code