Repository navigation
perf(pr-pipeline): carry pr-merge's lane-dispatch answers between runs - #9453
Conversation
The post-merge check listed every pr-merge-dispatched and pr-merge-rerun record since the floor and read the run that uploaded it, on every run: two GITHUB_TOKEN requests per record, 208 for the 104 records of run 39972998315. A record that is present stays present, so each scheduled or hand-started merge job now uploads the records the checks proved as the pr-merge-lane-records artifact, read back only from the newest trusted pr-merge run on main whose head commit is on main (as the head-ref map is), and the check answers those with no request after running their sender through its own rule again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Matches the other per-run pr-merge artifacts: only the next run reads it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…isting As the head-ref map does: a record no longer listed is dropped, and with no listing nothing is uploaded, so the next run reads an older file. The fragments also name the one decision that moves: where today's read of a held record fails, the carried record reads present. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…den the carry - Each check's save merges with the file as it is now and keeps records at or after the lowest floor any check of the run used, so a later check under a higher floor (the gate's, from the base's history and the pr-merge authority) or a concurrent writer drops nothing still valid. - Any failure to parse the file, a nesting too deep to read included, is no file; warnings print record names escaped. - lane-records.mjs removes a file left at its path before reading, and keeps a record only when the listed artifact's id, name and uploading run all match it. - README: a deleted record artifact stays carried until a later upload's listing drops it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A run with no candidates saves no artifact listing, so the write step threw, warned every scheduled run and uploaded nothing; the carry then aged out. With no listing, keep records by expiry alone: each was listed unexpired when the check proved it, so the listing only prunes. An unreadable listing still writes nothing. The post-merge check no longer writes back a record it read in but never asked for once another check of the run has dropped it from the file. Adds a test that finds a record's artifact by id when the listing holds its name under another id. The old no-listing case moves to its own test, since it now uploads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A Python check writes the file through save_lane_records, lane-records.mjs writes it on, and the check loads the result, so a change to the record name pattern or version on one side fails the test. The texts now say that with no listing file, whether no candidates or a listing the run could not read, unexpired records are carried as they are and pruned on the next run that saves a listing; only a listing file that cannot be parsed writes nothing. The header also says the sender rule runs on the stored sender fields, with only head-commit ancestry read live. 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 issues found in this pull request. critical-findings: 0 What I reviewed. I read all 9 files of the diff and the PR context. Only the PR description and the diff were available; I did not read the unchanged callees ( Trust-boundary analysis.
Manifest fields. No Instruction-surface deletions. None. The diff adds text and removes no standing instruction. Hold. None. No |
|
claude-review reviewed Code review: #9453 (carry pr-merge lane-dispatch records between runs)Result: no findings. I read the whole diff ( What I checked
Closing issue: the PR says Manifests: the diff changes no Hold: none. The PR adds no model or API spend, touches no trusted-actors, Not reviewed: security-lane concerns, since a separate security lane exists. Paved-path rows and path-scoped rules were not resolved. I limited the work to the diff and the files it touches. |
Refs: #9297
Summary
pr-merge's post-merge check re-read every lane-dispatch record on every run: a name-filtered artifact listing plus a run read per full run since the merged-since floor. The answers never change once read. On today's 104-record window that was 217 requests per check, made by three GITHUB_TOKEN checks (post-merge-dispatch, the merge job's "Check earlier lane merges", and the failed-merge record) plus the gate's own check on the lane token. Measured on run 39977943551: 202 workflow calls and 321 gate calls. That's about 2,000 GITHUB_TOKEN requests an hour, growing every day until the floor moves.
Fix
lane-records.mjswrites and reads apr-merge-lane-recordsartifact. It holds, per dispatched run id, the facts_lane_recordderives: only for runs that completed, with an unexpired, listed artifact, created at or after the floor.newestTrustedRun+onMain, as in perf(source-control): carry untied FAIL head refs between pr-merge runs #9416), never through actions/cache. It is uploaded only when that run's artifact listing could be read, with retention 1 day.babysit_postmerge.pyuses a carried answer in place of the two reads; anything not carried is read fresh as today. A malformed file is ignored whole, with a warning.lane_dispatchedorlane_reruncan let a merge verify, so the source binding is the same as perf(source-control): carry untied FAIL head refs between pr-merge runs #9416's head-ref map. A carried record reads present even when today's fresh read would fail on a 5xx or an empty-twice listing: the same exception perf(source-control): carry untied FAIL head refs between pr-merge runs #9416 takes, stated in both changelog fragments.Verification
node --test .github/scripts/pr-merge/*.test.mjs222/222; pinned ruff check and format exit 0; actionlint and zizmor clean on pr-merge.yml;scripts/check-affected.sh --tests: 13 passed, 1 skipped.Related
🤖 Generated with Claude Code