Repository navigation
fix(pr-merge): settle a wake's fresh report on its contents, not on runs that moved while it ran - #13008
Conversation
…uns that moved while it ran A PR-scoped wake whose kept report fails runs the post-merge check fresh, then settled that fresh report with the same `settle --idle-tick` as a kept one. Its verifying-runs test refuses any run completed since computedAt less SINCE_CLOCK_MARGIN, so a run that finished while the check ran discarded a report computed seconds earlier (`idle tick runs-changed`). A sweep arms on the report post-merge-dispatch just made with no idle rule at all. `settle --fresh` (with `--idle-tick`) skips only idle_runs_refusal; the report checks (no hold, no needsDispatch, no reruns), the lane room's rule and the quarantine and pin reads still apply. The wake passes it on the fresh path alone; the kept report's settle is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MWmASQQUMmnivZUuzgYfbe
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 Code review: no findingsI read every hunk of all 5 changed files. For context I also read the What changes.
Using Workflow. The
Tests.
I ran none of the tests; the PR's pytest and node results are the author's claims and unverified. Design note, not a finding. With Changelog. The fragment uses Closing issue. The PR only says Spend (not a hold). Per the PR, each fresh-path wake that used to be refused now makes an estimated +23 to +87 more GITHUB_TOKEN API calls, about +650 to +2,500 a day. That uses API rate-limit budget, not billed resources. |
|
claude-security-review reviewed Security review: PR #13008. No security issues found.I read every hunk of all 5 changed files. Two of them are on trusted paths, and I read their whole change and what they gate:
What changed.
The workflow passes Merge-hold check. This narrows a merge hold, so I judged it under the merge-hold bullet:
Shell change. The function changed from Spend. The PR estimates 23 to 87 more critical-findings: 0 |
Refs: #12445
Summary
pr-merge's PR-scoped wake throws away a post-merge report it computed seconds earlier. When the last sweep's report does not stand, the wake runs the post-merge check fresh. It then runs
settle --idle-tickon that fresh report, andidle_runs_refusalrefuses it if any verifying run on main completed sincecomputedAtminus 60 s (babysit_postmerge.py:4575-4599,SINCE_CLOCK_MARGINat babysit_merge_policy.py:6419). On a busy main some run nearly always completes while the check is running. Since #12863, 8 of 23 wakes endedskipped: settle --idle-tick refused the fresh post-merge report (idle tick runs-changed). Each spent 63-71 GITHUB_TOKEN calls and decided nothing (AFTER v3).The sweep has no such rule. post-merge-dispatch keeps its own fresh report without a settle call (pr-merge.yml:303-314), and the sweep's arm reads the room through
lane-room->settle_shared(babysit_merge_policy.py:7347, 7452-7454), which applies no idle rule. So the wake was stricter than the sweep it stands in for.Fix
babysit_verify_evidence.py settle --idle-tick --freshskips onlyidle_runs_refusal.idle_report_refusal(no hold, needsDispatch or reruns: the wake's no-full-run, no-rerun contract),settle_shared(including itsunverified-stalekeep) andidle_marks_refusal(quarantine issues and pins) all still apply.--freshwithout--idle-tickis a usage error.keep-reportpasses--freshonly on the fresh report's settle. The kept-report settle and post-merge-dispatch are unchanged.Call delta (R34). The fresh check's own calls are unchanged. A fresh report that used to be refused on runs-changed now skips 2 run listings, spends
settle_shared's and the marks reads, then arms or refuses on its contents, so the arm step's calls follow. Estimated +23 to +87 GITHUB_TOKEN calls per such wake (between the measured 63-71 refused and 94-150 armed), about +650 to +2,500 a day (UNVERIFIED, linear). This trades wakes that discard what they spent for wakes that decide. The offset is the queued listing-carry fix for the pr-unblock and pr-feedback-dispatch readers (hub estimate ~120-150 calls/h). Both will be re-measured on #12445.Verification
pytest test_babysit_lane_room.py: 2 failed before the fix, 79 passed after. New:test_a_fresh_report_skips_the_runs_its_own_check_just_read(the runs test is not called; needs-dispatch, pins-changed and a lane-room refusal still refuse),test_a_fresh_report_stands_though_a_canary_finished_as_it_ran, andtest_fresh_needs_the_idle_tick(guard).node --test workflow.test.mjs: 2 PR-scoped-run tests failed before, 106/106 after.SETTLE_FRESHpins--freshon the fresh settle; the anchored kept-pathSETTLEfails if--freshever reaches it. workflow + merge-job together: 199/199.scripts/run-ruff.sh checkclean on both Python files.outcome=armedwithreport=freshcall count posted on pr-pipeline: wake pr-merge per PR on pr-verify completion and make the cron a backstop #12445.Related
🤖 Generated with Claude Code
https://claude.ai/code/session_01MWmASQQUMmnivZUuzgYfbe