Repository navigation
ci(admission): bind the queued merge commit to the live PR head by tree (#4836) - #11149
Conversation
…ee (#4836) Resolve queued PR accepted a base-suffixed queue ref when the live PR head's commit date preceded the queued commit. The ref names the base and dates are not content, so a different head H2 older than G was admitted (executed counterexample, #4836 comment 6370396130). The step now requires the queued tree to equal `git merge-tree --write-tree <base> <head>`, with the head fetched from refs/pull/<n>/head and required to equal the head read from the API; history is completed first because the queue checkout is depth 1. A different head, extra content, a merge conflict, a moved PR ref or a failed fetch refuses. The premise (GitHub's squash tree equals that merge) held for 60/60 recent squash merges to main. xtask/tests/routed_queue_resolution.rs extracts the production step and runs it over real Git objects behind a stubbed gh, including a guard-removal control for the counterexample. The two source pins that required the timestamp snippet now pin the PR-ref and tree comparisons in repo-policy and xtask. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kSch2opYors8Yb2NR1ZMd
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 50 minutes. View limit details
Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the routed admission process to bind a merge-queue commit to the live PR head by comparing their trees (using git merge-tree) instead of relying on commit-date comparisons. This prevents issues with different heads, extra content, merge conflicts, or moved PR refs. The PR includes updated documentation, policy allowlist updates, and a comprehensive integration test suite in xtask/tests/routed_queue_resolution.rs. Feedback on the test suite suggests making the workflow step parser more robust by splitting on a generic step prefix rather than a hardcoded step name.
|
Independent exact-head review of 2cd3285: REVIEW_READY, no blocking findings. Inspected the full diff, every error path of the new step (fetch, unshallow, merge-tree conflict, empty or multi-line output, quoting), that the test runs the production step text, and the guard-removal control. Local proof only; the tests were not re-run by the reviewer. Applying Optional follow-ups, deliberately not in this push (they would reset CI): narrow Generated by Claude Code |
There was a problem hiding this comment.
Verification questions
- Confirm a repository-wide route scan for other timestamp-based queue bindings or duplicate merge-tree helpers was not evidenced by the supplied sibling-path packet.
- Confirm the workflow extractor depends on the next step being named exactly 'Admit exact candidate'; this is the already-raised low-priority fragility.
- Confirm the executable harness extracts the production step by requiring the exact following step name, Admit exact candidate; inserting or renaming that adjacent step makes the test fail before exercising admission behavior.
- Confirm the conflict fixture uses the base tree rather than a conflict-produced tree, so it does not establish that merge-tree reports a conflict or exercise conflict-output handling.
- Confirm the production route fetches refs/pull//head, requires it to equal the API live head, computes merge-tree(base,head), and compares its first output line with the queued commit tree.
- Confirm the implementation assumes
git merge-tree --write-treeis available and emits a tree OID as its first output line, but no minimum Git version or alternate parser is specified.
Refuted
- The changed workflow needs a fresh blocker for the exact-next-step parser coupling.; refuted because: The seeded Gemini comment already identifies this exact concern, and it is a low-priority harness robustness issue rather than a correctness failure in the production binding.
- The step extractor is a new blocker because it names a downstream workflow step.; refuted because: This is a real low-priority maintainability concern but was already raised in the seeded thread and does not undermine the current oracle's ability to exercise the production step; it is recorded as a duplicate rather than re-posted.
- The tree-binding change should reuse or retain the old timestamp mechanism.; refuted because: The old timestamp comparison cannot identify the live reviewed head and the PR removes it in favor of a content invariant; retaining it would add API calls without strengthening the required binding.
- The test suite merely pattern-matches workflow text rather than exercising the changed admission route.; refuted because: xtask/tests/routed_queue_resolution.rs extracts the checked-in shell, runs it against real commits and a stubbed read-only gh, and covers acceptance and multiple fail-closed refusals.
Evidence gaps
- The harness executes the checked-in shell, but native merge_group admission was not observed and the premise that GitHub's squash tree equals merge-tree remains only fixture/history evidence.
- Model proof intent was rejected by deterministic validation.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Independent review (fresh-context reviewer, head 2cd3285): REVIEW_READY — no blocking defect found in the admission change; the hosted head is green (Rust gates success, all four workspace test shards success) and the new executable harness for the changed merge_group branch ran green in that phase.
Inspected:
- Head
2cd3285f9698449a0fb209c678ebe2509661f20e(re-read viagh pr view --json headRefOid,isDraft,stateimmediately before posting; draft=false; basee39370d2df076a0e3ca764c51e7bcebbd3fc5044; 8 files, +557/-27). - The complete diff of all eight files:
.github/workflows/routed-rust.yml(theResolve queued PRstep),xtask/tests/routed_queue_resolution.rs(new, 520 lines),tools/repo-policy/src/lib.rs,tools/repo-policy/src/workflow_tests.rs,xtask/src/tests.rs,docs/CI.md,policy/process_allowlist.txt,changelog.d/4836-queued-commit-tree-binding.md. - The production shell at the head read line by line (
routed-rust.yml:246-294) and traced under the step's ownset -euo pipefail(line 259), in theadmissionjob context (runs-onubuntu-latest,timeout-minutes: 10,permissions: contents: read+pull-requests: read, depth-1actions/checkout@v6at line 193 plus a second checkout atpath: .admission-trustedwithpersist-credentials: false). - The fetch/compare chain traced end to end: shallow detection ->
git fetch --no-tags --unshallow origin->git fetch --no-tags origin refs/pull/<n>/head->git rev-parse FETCH_HEAD->git merge-tree --write-tree <base> <head>->${merged%%$'\n'*}compared withgit rev-parse "${GROUP_HEAD_SHA}^{tree}". The errexit semantics check out: the command substitution is the left operand of&&, so errexit is suppressed and the||refusal branch runs; a merge conflict makesgit merge-tree --write-treeexit non-zero, which lands in that same refusal branch, so both the conflict path and the tree-mismatch path fail closed. The PR-ref fetch and its equality check precede the merge-tree call, so$headis a local object before it is used as a merge input. - The PR body's cost claim checked against source:
detect-docs-onlydoes usefetch-depth: 0(routed-rust.yml:114-116), so a full-history checkout does already run on the same events. docs/CI.mdat the head against the step: each refusal the doc claims (different head, extra content, merge conflict, moved PR ref, missing history) maps to a distinct refusal path in the step, and the doc's non-claim - that the tree binds the head GitHub reports live at admission, not the head a reviewer judged ready, and that the premise is checked only on past squash merges and local fixtures - matches the PR body's Claim Boundary. The doc does not overclaim.docs/MERGE_FLOW.mdchecked for contradiction: the "Subject and trust" row (line 120) asks for "actual G identity", and lines 95-98 already require binding G to its base and actual tree, so the change is consistent with the governing plan rather than at odds with it.docs/PR_AUTOMATION.mdwas also checked; itsmerge-treemention is about reading a PR merge ref and does not bear on admission.- Hosted proof at the head, re-read after the test phase completed:
Ripr Rust Small on GitHub Hosted / Rust gatessuccess;Rust tests shard 1/2/3/4 of 4all success;Admit PR Candidatesuccess;Detect Docs-Only Surfacesuccess;Rust-only feature lanesuccess;windows-advisory-subsetsuccess;ub-reviewsuccess; overall commit status success.Ripr Docs Gateskipped is correct rather than a gap: its condition (routed-rust.yml:409) requiresdetect-docs-only.outputs.docs_only == 'true', and this PR changes a workflow and Rust sources. - Which shard actually ran the new tests: downloaded the four
ripr-rust-small-github-nextest-shard-N-1artifacts from workflow run 41061864061 and read the retainedlist-N.txtpartition lists. Shard 1 listsxtask::routed_queue_resolution batch_wrong_parent_and_wrong_subject_still_refuse_before_the_tree_is_readand... queued_squash_of_a_different_head_is_refused_even_when_it_predates_the_queue_commit; shard 2 lists... head_that_conflicts_with_the_base_cannot_bind_any_queued_treeand... queued_squash_of_the_live_head_is_accepted_whether_the_ref_names_head_or_base.rust-test-shards.ymlrunscargo nextest run --workspace --profile ci --partition count:N/4and itsverifyjob proves the four partitions are a disjoint cover of the workspace list, so the remaining two new cases sit in shards 3 and 4, both of which completed success. The new tests are therefore in the hosted required phase and green, not merely asserted locally. - Prior evidence read and classified rather than re-raised: the
EffortlessStevenissue comment of 2026-10-30T13:16:25Z (REVIEW_READY on this same head, with three optional follow-ups), the CodeRabbit review and inline findings, and the gemini-code-assist inline finding.
Blocking:
- None found.
Non-blocking:
- NEW (oracle granularity; evidence gap worth recording): the positive fixture is self-referential for the tree computation.
World::squashbuilds the expected queued commit withgit merge-tree --write-tree base head- the same command the production step uses to compute the candidate tree - so the acceptance case proves the end-to-end plumbing and the absence of a false refusal, but it cannot falsify the premise that GitHub's squash tree equalsmerge-tree(base, head). The discriminating cases are not circular (a different head and a tampered tree produce genuinely different trees), so the guard's bite is still proven; it is specifically the positive case that is self-referential. The only evidence for the premise is the 60/60 past-squash check reported in the PR body: a repository-wide search formerge-treereturns only documentation and unrelated source (docs/CI.md,docs/PR_AUTOMATION.md,docs/SOURCE_PROMOTION_PREFLIGHT.md,docs/specs/RIPR-SPEC-0148-source-promotion-preflight.md,plans/4510-candidate-harness.md,xtask/src/command.rs,xtask/src/reports/source_promotion.rs,xtask/tests/rust_gate_merge_ref_check.rs,.github/workflows/rust-gates.yml,policy/doc-artifacts.toml), and no premise receipt is retained in-tree. The failure direction is fail-closed - if the premise were false, admission would refuse every queue entry rather than admit a wrong one - anddocs/CI.mdalready states the boundary. Recording it so the first native queue transaction treats the premise as observed for the first time rather than assumed from the fixtures. - NEW (operational, unmeasured): the new
git fetch --no-tags --unshallow originruns inside theadmissionjob, which hastimeout-minutes: 10(routed-rust.yml:171) and a depth-1 checkout (line 193). The PR body states the cost; this pass did not measure it. The full-history fetch the PR body compares against is real but lives in a different job with its own 10-minute budget (detect-docs-only, lines 109-116), so the two do not share a clock. If the unshallow ever becomes the slow part of admission, the failure mode is a timed-out job - a blocked queue, not a wrong admission. - CORROBORATES (a review-bot question, answered from source; no action needed): the "no minimum Git version" question.
git merge-tree --write-treerequires Git >= 2.38 and nothing in the repository pins a Git version. The only execution environment for this step is theadmissionjob onubuntu-latest(routed-rust.yml:170), whose image carries Git >= 2.43, and the new harness is#[cfg(unix)]on the same platform class; the self-hosted routes (CPX42/CX43/CX53) are downstreamrust-gates.ymlcalls and never run this job. Recorded as answered rather than blocking, with the residual risk being a future runner-image change rather than a defect at this head. - CORROBORATES (a review-bot finding, non-blocking): the source pins in
tools/repo-policy/src/lib.rs,tools/repo-policy/src/workflow_tests.rsandxtask/src/tests.rsnow require[ "$fetched" = "$head" ]and the tree comparison. They are genuine mutation pins - each is removed from the workflow and the contract is expected to go red - but they pin the comparison, not thegit merge-tree --write-tree "$GROUP_BASE_SHA" "$head"invocation that producesmerged. Replacing that invocation with, for example,git rev-parse "$head^{tree}"would leave the pins green while weakening the binding to "G's tree equals the head's tree". The new executable harness would catch that, because the honest case would stop being admitted, so the two mechanisms cover each other. Recording the split so the pins are not read as covering more than they do. - ALREADY_DISPOSED (raised by the prior
EffortlessStevencomment and independently by the review bots; not re-raised as new): the conflict fixture uses the base tree rather than a conflict-produced tree, sohead_that_conflicts_with_the_base_cannot_bind_any_queued_treecannot distinguish "merge-tree reported a conflict" from "the tree did not match"; and the step extraction couples to the literal step namesResolve queued PR/Admit exact candidate. - NON-BLOCKING (pre-existing, unchanged here): the step still does not establish that the admitted head is the head a reviewer judged ready, and the read of the live head and the later protected merge are not atomic. Both are stated as non-goals in the PR body and disclosed in
docs/CI.md; the tree binding strengthens the G-to-H link without touching the reviewed-head question.
Not run:
- No local Rust toolchain on this host:
cargo/rustcare absent from PATH, so build and test execution could not be performed locally; all Rust proof below is hosted CI plus source reading. - No local execution of the new harness. The six new cases are verified only through the hosted
nextest --workspacephase; the PR body's own local receipts (cargo xtask precommit,cargo test --locked -p xtask --test routed_queue_resolution,cargo test --locked -p repo-policy --lib routed_rust,cargo test --locked -p xtask --bin xtask routed_rust) were not re-run here. - The changed
merge_groupbranch was not executed by hosted CI. TheAdmit PR Candidatelane on a pull_request event takes theif [ "$EVENT_NAME" = "merge_group" ]false path (line 261), so the greenAdmit PR Candidatecheck does not exercise the new tree binding at all. The only hosted proof of that branch is the new xtask harness described above, which is green. - The 60/60 past-squash premise check was not re-run here; that claim is taken as reported in the PR body, not independently reproduced.
Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head 2cd3285f9698449a0fb209c678ebe2509661f20e.
…tree case (#8082) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013kSch2opYors8Yb2NR1ZMd
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm the public admission route now derives the queued tree from the API-reported live head after fetching and validating refs/pull//head.
- Confirm the executable harness exercises the checked-in workflow shell rather than a duplicated admission implementation.
- Confirm the evidence does not establish that other admission or queue-binding routes have no timestamp-based or duplicate merge-tree logic.
- Check sibling-path scan coverage before treating the fix as complete; a narrow no-match scan is not proof that no siblings exist.
Refuted
- The workflow harness introduces a memory-safety or ownership defect at the native seam.; refuted because: The changed Rust code uses owned values and standard process/filesystem APIs; no unsafe code, raw pointers, aliasing, or unbounded ownership transfer is introduced in the diff.
- The workflow or Rust harness has an active-view lifetime hazard caused by resizing, detaching, transferring, or observing a stale length of a mutable backing store.; refuted because: No ArrayBuffer, TypedArray, shared-memory region, unsafe slice, or mutable buffer-length snapshot appears in the changed surfaces. Git and API values are materialized as owned strings/collections, and the shell compares complete textual values.
- A JS-backed worker/async/GC/detach/transfer boundary could make the fetched PR head stale or use-after-free.; refuted because: No JavaScript, callback, async task, shared memory, GC-managed object, detach operation, or ownership-transfer API appears in the changed path. Bash captures command output as strings and compares them; Rust test subprocesses communicate through environment variables, files, and process exit status.
- A reusable merge-tree helper or wider production abstraction is required for this change.; refuted because: The changed seam is one admission step; the PR adds a focused executable harness and updates existing source pins. Introducing a shared helper would enlarge scope without a demonstrated second consumer.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Independent review (fresh-context reviewer, head c9396f7): REVIEW_READY — head movement reviewed as a delta: the only change since the head I cleared is one test-only commit that implements the two findings I recorded, and the hosted head is green (Rust gates success, all four workspace test shards success, zero red lanes).
Inspected:
- Head
c9396f753be1b005671428a9e66430980363b077(re-read viagh pr view --json headRefOid,isDraft,stateimmediately before posting; not a draft; basee39370d2df076a0e3ca764c51e7bcebbd3fc5044; 8 files, +571/-27). Head movement during this pass: my earlier review of this PR was bound to2cd3285f9698449a0fb209c678ebe2509661f20eand reached REVIEW_READY on the production change. The head has since moved by exactly one commit,c9396f75"test(admission): generic next-step split and discriminating conflict-tree case (#8082)", which touches onlyxtask/tests/routed_queue_resolution.rs(+25/-11). No production line, workflow line, source-pin line or doc line changed in the delta, so the production conclusions from the earlier review stand unchanged; the delta was reviewed on its own terms below. - The delta patch in full. Two changes:
(a)resolve_shellnow splits the extracted step body on"\n - name:"instead of the literal" - name: Admit exact candidate\n". This removes the coupling to one specific downstream step name - the gemini-code-assist inline nit, which the earlier review recorded as ALREADY_DISPOSED-and-acknowledged - while still requiring that a following step exists (ok_or("missing step after Resolve queued PR")), so a truncated workflow still fails loudly rather than silently extracting the wrong block.
(b)head_that_conflicts_with_the_base_cannot_bind_any_queued_treewas rewritten. It now runsgit merge-tree --write-tree <base> <conflicting head>itself, asserts the exit status is exactly 1, reads the first stdout line as the tree OID, and queues exactly that tree as the queued commit. The previous version queued the base's tree with the comment "its tree is arbitrary because no clean merge exists to compare with", so it could not distinguish "merge-tree reported a conflict" from "the tree simply did not match" - the finding the earlierEffortlessStevencomment and the review bots both raised. - Why the rewritten conflict case is a genuine strengthening, traced against the production shell.
git merge-tree --write-treeprints the conflicted tree OID on its first stdout line and then exits 1. The production step computesmerged="$(git merge-tree --write-tree "$GROUP_BASE_SHA" "$head")" && [ "${merged%%$'\n'*}" = "$(git rev-parse "${GROUP_HEAD_SHA}^{tree}")" ] || { ...; exit 1; }. Because the command substitution is the left operand of&&, errexit is suppressed and the||refusal branch runs; the step therefore refuses on the exit status, not on a tree mismatch. With the queued tree now set to merge-tree's own output, a step that ignored the exit status would compare the tree to itself, match, and admit the entry - so the test would fail. The refusal is now reachable only through the exit-status handling, which is exactly what the test claims to pin. The case also self-checksoutput.status.code() != Some(1)and returns an error rather than proceeding, so a future git change that stops reporting a conflict would fail the test instead of silently weakening it. - Hosted proof at the head, re-read after the test phase completed:
Ripr Rust Small on GitHub Hosted / Rust gatessuccess;Rust tests shard 1/2/3/4 of 4all success;Rust-only feature lanesuccess on one run and skipped on the other;windows-advisory-subsetsuccess on one run and skipped on the other;Admit PR Candidatesuccess;Detect Docs-Only Surfacesuccess;Ripr Rust Small Resultsuccess;Route Ripr Rust Smallsuccess;Report conflicting merge-ready requestsuccess;ub-reviewsuccess;build and inspect Linux x64 wheel,clean pip install and useful Python journey,clean uv install and useful Python journey,workflow policy and wheel applicabilityall success. Zero red lanes. TheRust test shards verifyjob - which re-lists the partition to prove the four shards are a disjoint cover of the workspace list - was still running when this was written; it is a bookkeeping job over the shard lists, and all four shards it covers completed successfully. - Which shards own the changed file, established from the retained partition artifacts of an earlier run of this PR rather than assumed: shard 1 lists
xtask::routed_queue_resolution batch_wrong_parent_and_wrong_subject_still_refuse_before_the_tree_is_readand... queued_squash_of_a_different_head_is_refused_even_when_it_predates_the_queue_commit; shard 2 lists... head_that_conflicts_with_the_base_cannot_bind_any_queued_treeand... queued_squash_of_the_live_head_is_accepted_whether_the_ref_names_head_or_base.rust-test-shards.ymlrunscargo nextest run --workspace --profile ci --partition count:N/4, so the xtask integration test is in the hosted required phase, and the rewritten conflict case in shard 2 completed successfully at this head. - Prior evidence on this PR, read and classified rather than re-raised: the
EffortlessStevenissue comment of 2026-10-30T13:16:25Z (REVIEW_READY on the earlier head with three optional follow-ups), the CodeRabbit review and inline findings, and the gemini-code-assist inline finding about the hardcoded step name.
Blocking:
- None found.
Non-blocking:
- RESOLVED (the step-name coupling, previously recorded as ALREADY_DISPOSED and now implemented).
resolve_shellno longer namesAdmit exact candidate; it splits on the generic"\n - name:". The step it extracts -Resolve queued PR- is still named explicitly, which is correct: that is the step under test, so the harness must find it deliberately. - RESOLVED (the conflict fixture's inability to isolate exit-status handling). The case now derives the queued tree from merge-tree's own conflicted output and asserts the exit status is 1, so the refusal it observes can only come from the step honouring that status. This is the one substantive gap the earlier review recorded, and it is now closed at the source rather than by a comment.
- UNCHANGED from the earlier review, and still the largest open item on this candidate: the
merge-tree(base, head)premise has no retained receipt. The positive fixture remains self-referential for the tree computation -World::squashbuilds the expected queued commit withgit merge-tree --write-tree base head, the same command the production step uses - so the fixtures prove the plumbing and the absence of a false refusal, but cannot falsify the premise that GitHub's squash tree equalsmerge-tree(base, head). The only evidence is the 60/60 past-squash check reported in the PR body; a repository-wide search formerge-tree --write-treefinds it only in the workflow and the new test, so nothing is retained in-tree. The failure direction is fail-closed (a false premise refuses every queue entry rather than admitting a wrong one) anddocs/CI.mdstates the boundary, so this remains a recorded gap for the first native queue transaction rather than a defect in this PR. - UNCHANGED: the source pins cover the comparison, not the invocation.
tools/repo-policy/src/lib.rs,workflow_tests.rsandxtask/src/tests.rsnow require[ "$fetched" = "$head" ]and the tree comparison, but not thegit merge-tree --write-tree "$GROUP_BASE_SHA" "$head"invocation that producesmerged. Replacing that invocation withgit rev-parse "$head^{tree}"would leave the pins green while weakening the binding. The executable harness covers it - the honest case would stop being admitted - so the two mechanisms cover each other, but the split is worth stating so the pins are not read as covering more than they do. - UNCHANGED: the Git version floor is implicit.
git merge-tree --write-treeneeds Git >= 2.38 and nothing in the repository pins a version. The only execution environment for this step is theadmissionjob onubuntu-latest(routed-rust.yml:170), whose image carries Git >= 2.43, and the harness is#[cfg(unix)]on the same platform class; the self-hosted routes run downstream and never execute this job. Answered for this head, with the residual risk being a future runner-image change. - NEW (minor, in the delta): the rewritten case calls
git_command(...).args([...]).output()and readsoutput.stdout, discarding stderr. On a conflicting merge git also writes conflict information to stdout after the tree OID, so stdout is the right stream to read and the tree is correctly taken from the first line - but if a future git moved the tree OID off the first stdout line, the case would queue a non-OID string and fail incommit_treerather than at the point of misparsing. That is a loud failure, not a silent one, so no action is needed; noting it only because the first-line assumption is now load-bearing.
Not run:
- No local Rust toolchain on this host:
cargo/rustcare absent from PATH, so build and test execution could not be performed locally; all Rust proof below is hosted CI plus source reading. - The xtask integration test was not executed locally. Its hosted execution at this head is covered by the green
nextest --workspacephase: all four Rust test shards completed successfully, including shard 2, which owns the rewritten conflict case. - The PR body's local receipts (
cargo xtask precommit,cargo test --locked -p xtask --test routed_queue_resolution,cargo test --locked -p repo-policy --lib routed_rust,cargo test --locked -p xtask --bin xtask routed_rust) were not re-run here. - The 60/60 past-squash premise check was not re-run here; that claim is taken as reported in the PR body, not independently reproduced.
Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head c9396f753be1b005671428a9e66430980363b077. Not an approval.
Summary
Resolve queued PRinrouted-rust.ymlnow binds the merge-queue commit G to the live PR head H by content: G's tree must equalgit merge-tree --write-tree <base> <head>. The commit-date comparison is removed.gh), including a guard-removal control for the documented counterexample.Swarm / Source Boundary
No release, signing, publishing, ruleset, permission or secret surface is touched.
Source-of-truth Links
Proposal: #4984 (native queue cutover), #8082 (reference caller, split by comment 6274349288)
Spec: n/a
ADR: n/a
Plan item: docs/MERGE_FLOW.md "Subject and trust" row
Governing issue or accepted claim: #4836 (claim comment: #4836 (comment); defect demonstrated in #4836 (comment))
Acceptance delta (one sentence): The admission job's queued-commit-to-live-head binding stops depending on the queue ref suffix and commit dates and instead refuses any queued tree that is not the live head merged onto the group base.
Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication):
claude/8082-queued-g-tree-bindingStack parent or prerequisite PR (if any): none; branched from main
280822b23f.Proposed replacement of PR (if any; not yet accepted): none. Not a rival to Draft #8082 (reference, not edited) or #8172.
Acceptance retained from a replaced candidate (if any): n/a
Accepted winner and losing candidate disposition (when decided): n/a
All-state search found no equivalent implementation: no open or merged PR touches the
Resolve queued PRtimestamp predicate (main still carriespushed_at < queued_at).Scope
.github/workflows/routed-rust.yml: one step (Resolve queued PR); no trigger, permission, job-graph, label or required-context change.xtask/tests/routed_queue_resolution.rs(new): runs the extracted production step.tools/repo-policy/src/lib.rs,tools/repo-policy/src/workflow_tests.rs,xtask/src/tests.rs: the two source pins that required the timestamp snippet now pin the PR-ref and tree comparisons (same mutation-test shape).docs/CI.md,policy/process_allowlist.txt,changelog.d/4836-queued-commit-tree-binding.md.Scope Classification
Production delta:
git fetch --unshallow), fetchrefs/pull/<n>/headand require it equal the API-read head, then requiremerge-tree(base, head)tree ==G^{tree}. Existing checks (ref names live head or base; one parent == base; subject ends(#n)) are unchanged and still run first.Evidence/support delta:
git merge-tree --write-tree <squash parent> <PR head>equals the squash commit's tree in 60/60.Single acceptance criterion:
Non-goals:
Support-tier Impact
Claim/proof notes:
docs/CI.mdmerge-queue section now says the tree binds G to the head live at admission, not to the head a reviewer judged ready, and that the squash-tree premise is validated on past squash merges and fixtures, not on a native queue entry.Policy Impact
Ledger or exception notes:
policy/process_allowlist.txt: two entries for the new test (local git + bash only; no network).Proof
Result, failures, or skipped proof:
#[cfg(unix)](the step runs on ubuntu-latest).gh apicalls the stub does not model, so a RED run would fail for the wrong reason. The in-test guard-removal control is the discriminator instead.Claim Boundary
May claim: a queued commit that is not exactly the live head merged onto the base is refused by the admission job, tested against real Git objects.
Must not claim: the binding holds on a native queue entry (unobserved; ruleset has no merge_queue rule), that the live head is the one reviewed, atomicity with the protected merge, or that GitHub's queue squash always equals
merge-tree. The check fails closed if it does not, which would block (not wrongly admit) a queued entry.Rollback
Revert this commit. The timestamp predicate and its two source pins return. No settings, label, ruleset or required-context change to undo.
Spec-Test-Code Traceability
Resolve queued PRStatic Language Check
killed,survived,untested,proven, andadequate.CI Economics
Ripr Rust Small Resultvia admission, merge_group only.Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Gates
cargo fmt --check(inside precommit)cargo xtask check-workflowscargo xtask check-process-policycargo xtask check-covered-bycargo xtask check-file-policyGenerated by Claude Code