Repository navigation
ci: let the merge queue reuse a PR run of the exact same content - #605
Merged
Merged
Conversation
A queue entry ran the full matrix even when its PR's CI had just passed on the same content. Now a merge_group run reuses that PR run when it tested the same tree against the same base and the PR head already holds that tree: the PR contained the latest main when its CI ran, nothing landed since, and nothing is queued ahead. Then the merge changes nothing, so the PR's changed-file list equals the queue's diff for every change gate, and Compute recipe sealing's path-limited history read follows the PR head, never the merge commit, whose timestamp differs between the two merges. - Same-repository PR runs record a qualification receipt (schema 2: event, tested merge commit, base, tree). Fork PRs never do. - The queue probe checks the queue commit merges exactly that PR head onto the group base, and that the PR run's tested merge has the same tree and parents, then republishes its seven reports. - A matrix job skipped as a whole reports one unexpanded name, so reusing queue runs add small jobs that report the required Test Web N and Test Server N names. - A main push that lands several queue entries now reuses when each entry qualified from its first parent back to the previous main, up to the queue's four-entry merge limit. Before, #597 and #598 landing together made #598's push run full CI ("Qualification receipt differs"). Any missing, expired or mismatched evidence still runs normal CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a PR the mobile gate read the PR's live file list while the reuse receipt records the run's original base and tested merge. Retargeting a PR during a run could change that list, so the queue could reuse a run whose mobile lint was skipped for content the queue would lint. It now diffs the event's base against the tested commit with Git, like the compute and packaging gates, on every event. This also drops the API's 300 and 3,000 file limits. Reuse now also requires the PR run's workflow to come from its tested merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Turning Git's NUL-separated paths into lines split a filename containing a newline in two, so a native source with such a name skipped mobile lint. An embedded newline now becomes `?`. A behavioral test runs the gate's own script on commits built with Git plumbing: unrelated, native, renamed into and out of the native paths, a newline filename, and unresolvable bases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In the hosted runners' UTF-8 locale, grep's `.` does not match a byte that is not valid UTF-8, so a native source whose name contains one could skip mobile lint. The gate now matches in the C locale. Its behavioral test commits raw-byte filenames through stdin and runs under C.UTF-8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 19, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 19, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A queue entry runs the full CI matrix (about 25–45 minutes, and one of the queue's two build slots) even when its PR's own CI just passed on exactly the same content. Separately, #582's main-push reuse refused whenever several queue entries landed in one push: #597 and #598 landed together, so #598's push ran full CI with "Qualification receipt differs".
Resulting behavior
merge_grouprun reuses the PR's passing run only when that run tested the same content (tree) against the same base, its workflow ran from that tested merge, and the PR head already holds that content. In practice: the PR contained the latestmainwhen its CI ran, nothing landed since, and nothing is queued ahead. The probe checks, via the API, that the queue commit merges exactly that PR head onto the group base and that the PR run's tested merge has the same tree and parents. It then republishes the run's seven reports.git logfollows the PR head and never a merge commit, whose timestamp differs between the PR's test merge and the queue's.Test Web 1–3orTest Server 1–3. A reusing queue run therefore adds small jobs that report those required names.main, up to the queue's four-entry merge limit.Expected effect: of the last 27 merged PRs with a passing run on their final head, 6 met the queue condition (13 had an unchanged
main, but only 6 of those also contained it). More PRs qualify when the latestmainis merged into the branch before the final push.Verification
node --test .github/scripts/ci-queue-reuse.test.cjs: 84 pass. The tests cover:--no-renameseach fails the behavioral test.mainat test time, PR head]. Queue commitc145ae778fhas parents [queue base, fix(citations): build each citation style's engine once #598 head].ci.ymlchange and a Swift change reportchanged=true; a docs-only commit reportschanged=false; a native rename reportstruewith both paths; a bad base fails open.vp fmt --check,vp linton the scripts, YAML parse, andgit diff --checkpass.GITHUB_WORKFLOW_SHAequals the tested merge onpull_request. If GitHub reports another value, reuse simply never applies.Independent review: Codex
gpt-6.1-sol, five rounds. Round 1 found the mobile-gate and recipe-timestamp gaps, round 2 the live PR file list and the workflow binding, round 3 newline filenames, and round 4 non-UTF-8 filenames. Each was fixed in this branch. Round 5 approved, with no remaining P0–P2.Documentation impact
Updated —
docs/internals/ci.md(reuse rules, required shard names, mobile gate comparison).Model and harness: Claude Opus 5.5 in Claude Code (Scient), with Codex
gpt-6.1-solas independent reviewer.🤖 Generated with Claude Code