Repository navigation
fix(pr-merge): carry the verifier reads' run cache through its own trusted artifact - #10327
Conversation
…usted artifact Only the merge job uploaded pr-merge-run-cache, and its gate reads no lane verdict, so after the move from actions/cache the carried chain started empty and stayed empty: every enable-auto-merge verifier read was cold and hit the 4-minute read timeout. enable-auto-merge (scheduled or hand-started runs) now keeps its run cache through carry() and uploads it as pr-merge-verify-run-cache, only when it kept a read. carry-run-cache.mjs read takes each artifact from the newest trusted run on main holding it and adds only the verify file's carried-* sections to the merge job's file; the skip refusals are unchanged and carry() still filters every entry. main() adds kept=true beside carried=true, whose meaning is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A verify artifact that fails to read now warns and leaves the merge job's file as it is, instead of dropping both. Comments in the tests and in babysit_verify_evidence.py name both artifacts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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-security-review reviewed No security findings. critical-findings: 0 I read the whole diff, the PR context, and the surrounding
Spend: the extra artifact upload and the warm read cache change run duration and API calls only, and nothing billed. This is not a hold. |
|
claude-review reviewed No findings. I read the full diff and the PR context, and checked the workflow wiring in What I checked
|
…rd scan passes The local helper was named fetch, which the rate-guard test reads as an unguarded network call. It only downloads through ghDownload and the shared GitHub client. Co-Authored-By: Claude Opus 5.5 <[email protected]>
No related issue: regression from #10292 (empty run-cache artifact chain), .work/poteto-review/stall-2026-10-26-1740.md
Summary
#10292 moved pr-merge's carried run cache from
actions/cacheto thepr-merge-run-cacheartifact, whichcarry-run-cache.mjs readtakes from the newest trusted pr-merge run on main. Only themergejob uploads that artifact, and its gate never reads lane verdicts (not-read-in-pr-merge-lane), so it adds no run records. Theenable-auto-mergejob's verifier reads are the only ones that fillrun-record, and that job never uploaded them. After #10292 the chain started empty ("no earlier run cache to carry") and stayed empty (carried-run-record=0). Every verifier read started cold (~100-120 calls), hit the 4-minuteVERIFY_TIMEOUT_MS(SIGTERM, "its verifier verdict could not be read"), and the PRs after it got "no time left". Lane PRs stopped being armed.Fix
pr-merge.ymlenable-auto-merge: after "Arm and disarm auto-merge", a scheduled or hand-started run keeps its run cache throughcarry-run-cache.mjs(the merge job's keep step and helper) and uploads it aspr-merge-verify-run-cache(retention-days: 1, the sameupload-artifactpin). The upload runs only when the keep step reportskept=true, so an empty file never hides an older one.carry-run-cache.mjsmain(): addskept=truebesidecarried=truewhen anycarried-*entry was kept.carried=truekeeps its meaning (the file was written), so the merge job's "Keep the refusals the next run may skip" and itspr-merge-run-cacheupload are unchanged.carry-run-cache.mjs read: takes each artifact from the newest trusted run on main holding it, with the samenewestTrustedRun,onMain(main-tag check included),sharedReadsandghDownloadhelpers. It clearsCARRY_TOfirst, as before. It adds only the verify file'scarried-*sections to the merge file (withCarried). The merge file's other sections,skip-unchangedincluded, keep their values. With no verify file, the merge file is written byte for byte. With one, the file is re-serialized byJSON.stringify, so the skip section is value-identical, not byte-identical: spacing changes,1.0reads1, and integer keys sort first.babysit_merge_skip.pycompares parsed values only (the key digest string, an integerskips, the reason strings;prior,_row), so it reads the same records. A verify file that does not read is logged as a warning and leaves the merge file as it is. "Start the run cache from them" still filters every entry throughcarry(), so a carried read still only counts a FAIL.pr-pipeline, plussource-controlfor a comment inbabysit_verify_evidence.pythat now names both artifacts.Verification
On base
bf7fff8d71with the new tests, 6 fail: 5 new tests (upload, merge, one-artifact, bad verify file, warm tick) and the updated "carries file to file" (kept=true). The untrusted-run test and thekepttest pass on base by construction, since base never reads a verify file or writeskept. They are regression guards, not fail-first. All pass on the head:merge-job.test.mjs"enable-auto-merge uploads its verifier reads for the next run" (order after the arm step, schedule/dispatch only,kept == 'true'gate, name, path, retention)carried-*from the verify artifact, skip section unchangedcarry-run-cache.test.mjs"read adds the verify file's carried sections to the merge file, every other section as it was" (the verify file's ownskip-unchangedandrun-recordare not taken)pull_request_target,push, off-main head, a tag named main)carried=truewith nokept. The arm keep yieldskept=true. Tick 2's read then starts its run cache atcarried-run-record=1 carried-fail-head-ref=0 carried-on-branch=1, where it was0 0 0before this change.Checks on the head:
node --test .github/scripts/pr-merge/*.test.mjs: 487 pass. This includes "no token-holding job in pr-merge.yml restores a cache" and "no job holding id-token or a lanes App token restores a cache by a bare prefix".actionlintonpr-merge.yml: clean.zizmor --offline: no findings.scripts/check-affected.sh --tests: 13 passed, 1 skipped.Left out: a live run. The first scheduled run after merge finds no
pr-merge-verify-run-cacheyet and reads cold, as today. Itsenable-auto-mergejob uploads the first file, and the next tick should start warm.Related
.work/poteto-review/stall-2026-10-26-1740.md(local diagnosis): section 2 and fix 1.🤖 Generated with Claude Code