Skip to content

fix(admission): pin the packet and declaration to the bundle's commit (#14920) - #14932

Merged
EffortlessSteven merged 2 commits into
mainfrom
fix/14920-trusted-source-live-base
Nov 17, 2026
Merged

EffortlessSteven merged 2 commits into
mainfrom
fix/14920-trusted-source-live-base

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Source-of-truth Links

Governing issue or accepted claim: #14920 - candidate admission judged a pull_request by two different base commits: the trusted bundle came from the merge ref's base while the enforcement packet, the generated-path declaration and the base commit came from a second live-tip read.
Acceptance delta (one sentence): the admit step hands the resolved commit in as trusted-sha on every arm and the action reads the packet, the declaration and the base commit from it, so the rule set, the packet and the declaration are one identity by construction with no comparison and no refusal.

What

#14894 (landed, 8919ab061d) anchors the trusted bundle to the pull_request merge ref's first parent, so the bundle is immutable for the run. The action still resolved the live base ref a second time for the enforcement packet, the .gitattributes declaration and the base commit. When main advanced after the merge ref was built, the bundle came from the merge ref's base while the packet and declaration came from a newer commit: one tree judged by another commit's rules, the #14920 gap in a narrower window.

Change

action.yml - new required trusted-sha input. The enforcement packet, the generated-path declaration and the base commit are read at that commit. There is no second read left to disagree with, so no comparison and no refusal on movement. A pinned read has no live fallback, so empty, non-40-hex and unreadable trusted-sha each refuse with their own token (trusted_sha_missing, trusted_sha_invalid, trusted_sha_unresolved).

routed-rust.yml - the admit step passes steps.trusted.outputs.sha on every arm: the merge ref's first parent for a pull_request, GROUP_BASE_SHA for a merge_group, EVENT_SHA otherwise. The merge-group per-constituent step is pinned to GROUP_BASE_SHA for the packet, the declaration and the base commit, so the tip and every constituent of one group are judged against the packet the chain was built on.

policy/workflow_allowlist.txt - the action run-block budget moves 329 to 343 for the pinned read and its refusals, with the reason updated.

One deliberate exception

--base-sha stays the live base tip. history_sync_check requires the declared destination_base to be an ancestor of the live base tip; pinning it to the merge-ref parent would reject a history-sync PR whose merge ref predates the destination. It is a live fact, not the judged tree's base, and it is the only rule-set input that stays live. The separate during-run movement check also reads the live ref, but only to detect that the base moved while the run was in flight; it never feeds the rule set and never decides the verdict. On a merge_group run that read is inert: history-sync is honored only on a pull_request event, so it cannot change a merge-group verdict.

Bounded claim

Not a landing bypass: the merge_group arm re-runs full admission plus review_disposition per constituent against the group base, so a stale branch at worst costs a wasted qualification run and a queue ejection. The only live rule-set read on that arm is --base-sha, which history-sync ignores outside a pull_request event.

Proof

test_trusted_bundle.py, 11/11 controls pass locally (--self-test, with jq 1.7.1 on PATH):

  • test_packet_and_declaration_come_from_the_pinned_commit - holds the pinned packet active while the live tip's is inactive and requires cut_frozen, which only a pinned read produces; the same case with the input ignored admits, so the pinned source is load-bearing. The declaration half does the same with a generated-path exemption only the pinned commit carries.
  • test_trusted_sha_is_required_and_must_resolve - empty, malformed and unreadable trusted-sha each refuse.
  • test_caller_pins_both_action_invocations_and_checks_reserved_destination - pins that trusted-sha reaches the action on every arm.
  • test_constituent_reads_use_group_base_and_keep_live_checks - extracts the real constituent step and requires the base-commit, packet and .gitattributes reads at ${GROUP_BASE_SHA}, rejecting their ${base_sha} alternatives while retaining live --base-sha and movement checks.
  • test_constituent_pin_removal_mutants_are_rejected - individually reverts each of those three reads to ${base_sha} and requires the static control to fail. Independent real-workflow individual and combined mutations also fail as expected; exact-head review 5932721203 verifies the repair.

Negative control: with the pinned input ignored, both new tests fail 0 != 1 : status=admitted; with it honoured all 11 pass.

Also pass: cargo xtask check-workflows, check-process-policy, check-changelog-fragments, check-text-encoding, check-file-policy, check-allow-attributes, check-pr-shape; and the 21 wrapper controls in cargo test -p xtask --test hard_cut_admission_selftest (Git for Windows bash on PATH).

Residual of #14920: #14894 landed the main fix (the bundle follows the merge ref's first parent, which is the seam #14920 asked for), and this PR is the pinned-read delta on top, not a second fix for the same defect.

Closes #14933, whose remaining work was exactly this: trusted-sha on every arm, the packet, declaration and base commit read at that pin, and no live-versus-pinned comparison.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 144 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 0fbbbcb5-80ee-4bc9-a913-f672515096f5
Commits

Reviewing files that changed from the base of the PR and between a708606 and 6e66646.

Files selected for processing: 6

  • .github/actions/pr-candidate-admission/action.yml
  • .github/actions/pr-candidate-admission/test_trusted_bundle.py
  • .github/workflows/routed-rust.yml
  • changelog.d/14920-admission-trusted-live-base.md
  • policy/workflow_allowlist.txt
  • xtask/tests/hard_cut_admission_selftest.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment thread .github/workflows/routed-rust.yml Resolved

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the candidate admission logic to use the live base tip for pull request runs, ensuring that stale branches are evaluated against current rules. The changes include updates to the test suite to simulate these scenarios and the addition of a changelog entry. I have reviewed the suggested improvements regarding unused imports, safer environment variable access, and test loop simplification, all of which are valid and recommended for implementation.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the candidate admission tests to support checking out the trusted admission bundle at the live base tip for pull_request runs instead of pull_request.base.sha. It stubs the gh CLI tool to return the live base SHA and adds test cases for missing references and merge group behavior. A changelog entry is also added to document these changes. The review feedback suggests simplifying a single-element loop in the new test assertions to avoid unnecessary complexity and dynamic dictionary unpacking.

Copy link
Copy Markdown
Member Author

Coordination finding only: overlapping repair with #14894, not a source-review verdict or validator-policy approval.

Inspected #14932 head 8ce66069b52ebae543d637559b48923ba9ca9ccd and #14894 head fa859bb68a2d730e0e26108d1a787f2da6c209c3. Both replace the same pull_request arm in .github/workflows/routed-rust.yml and edit the same selector tests. #14894 is already qualified and has a native queue-add event; neither candidate was merged at the last read.

The competing identities are materially different:

Please reconcile these existing lanes before treating them as additive or choosing a successor: explicitly state the intended identity relation among the judged workspace tree, trusted executable bundle, declaration source and enforcement packet, including base movement between reads. Preserve tests for stale recorded bases, unavailable identity/fail-closed behavior, and the merge-group base. Resolve any selector/test conflict intentionally rather than replacing one identity contract incidentally.

#14920's baseline.json refusal overlaps the same family blocking #14658. Dependent qualification should wait for the selected repair to land and its actually executed controller to be verified; no unchanged retry is requested. #14932's body also discloses four action-execution cases unproven locally due missing jq, separate from its passing selector cases.

No branch, label, queue entry, required check or approval was changed by this coordination note.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOURCE_REVIEW_READY

Exact-head review of #14932 at 8ce6606.

Identity. Three files, +63/-8: the Select trusted admission source step, the selector test, and the changelog. git merge-tree --write-tree against current main exits 0 at tree dc10ce2e43.

The identity change is the right one, and it is bounded. The trusted bundle is admission code, not the candidate's source. The .gitattributes declaration and the enforcement packet are already read from the live base tip, so using the recorded base for the bundle made the bundle and the declaration two different objects. The new arm resolves repos/<repo>/git/ref/heads/<base_ref> and uses that SHA for both. Newly admitted: a stale branch whose recorded base lacks a .gitattributes declaration the live base carries (previously refused for the mismatch). Newly refused: a PR with an absent base ref or an unresolvable live tip (fail-closed), and a PR whose live base has stricter admission rules than its recorded base. The candidate's source is unchanged; the rules are current. The result is reproducible if you know the live base tip at the time of the run, but it is a current-rules gate, not a pinned build. merge_group keeps GROUP_BASE_SHA, so the group is still judged against the composition it was built on.

No bypass. The ref is github.repository plus github.event.pull_request.base.ref; the candidate cannot influence either without write access to the base repo. The gh api read is authenticated with the workflow token, and the checkout is pinned to the resolved SHA. The candidate's code is not executed before the step, and the step's gh is the runner's, not the candidate's.

The honest bound is accurate. The old behavior's fail-open is a stale branch running older admission code. The merge_group arm re-runs the full admission and review_disposition.py per constituent against the group base, so the old behavior costs a wasted qualification and a queue ejection, not a landing bypass. The only hole would be a merge_group arm that also used the stale base; it uses GROUP_BASE_SHA.

The selector tests pin the four cases. test_event_identity_selection_has_no_candidate_fallback uses a gh stub: pull_request expects the live tip, merge_group expects GROUP_BASE_SHA even when the live tip is newer, an empty live tip fails closed, and an absent PR_BASE_REF fails closed with no GITHUB_OUTPUT. I ran the self-test on this box: 7 tests, 4 failures, all jq: command not found in the action-execution cases; the selector test passed. The four failures are environmental, not evidence against the change.

Non-blocking. The gh stub does not assert the API path, so a wrong path that still returns a SHA would pass; the workflow's path is correct, and the test's purpose is the selector behavior. The gh api read is a network dependency, so a rate-limited or unavailable API fails closed rather than falling back.

Not checked: no hosted lane at this head; the workflow change's final evidence is the hosted run.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REPAIR_REQUIRED

Withdrawing my SOURCE_REVIEW_READY on 8ce6606.

The workflow's "Select trusted admission source" resolves the live base tip once (T1) and pins the bundle at that sha, but .github/actions/pr-candidate-admission/action.yml:239-241 resolves the live base tip a second time (T2) and reads the enforcement packet and cut commit from that second read. The action has no trusted-sha input. When main advances between T1 and T2, the bundle rules and the packet declaration are two different identities, so the #14920 defect is narrowed to a small window, not closed. The head needs the pinned sha passed into the admit step (or the packet read from the pinned sha) and a mismatch test before it can be attested.

This is a withdrawal, not a new source finding; the head is expected to be replaced.

EffortlessSteven added a commit that referenced this pull request Nov 16, 2026
…sted source (#14932)

The workflow resolves the live base tip and checks the trusted bundle out at it,
but the action resolved the base a second time for the enforcement packet and
had no input carrying the first read. A base that advances between the two reads
runs one commit's rules against another commit's packet - the #14920 gap again,
in a narrower window. My previous message claimed 'one identity'; that held only
by timing, so it is now enforced.

Route (a): the admit step passes the verified bundle base as trusted-sha, and
the action refuses with the stable token base_sha_moved when its own git/ref
read differs, instead of preferring either read. The input is set only on the
pull_request arm; merge_group keeps GROUP_BASE_SHA and would otherwise refuse
every group whose main advanced after the group was built.

Proof: test_pinned_trusted_sha_must_be_the_live_base holds the pinned base
different from the live tip and asserts refusal base_sha_moved, then holds them
equal and asserts the run still admits. With the guard disabled that test is the
only failure in test_trusted_bundle.py, and with jq present all 8 controls pass
(the four action-execution cases that failed here before were missing jq, not
this change).
@EffortlessSteven

Copy link
Copy Markdown
Member Author

Overlap notice — #14894 already carries this gate repair at queue position 9

Read while reconciling the #14658 admission refusal. Both PRs change the same trusted-bundle resolution:

Two candidates rewriting the same bundle-resolution code will conflict in the queue, and only one of the two behaviours can be the live one. The observable the campaign needs is the same in both: on a labeled admission event the trusted bundle must be read from the live base tip, not the PR's recorded base.

This is a routing note, not a verdict, and I claim no ownership of this PR. Its author should decide which candidate is the carrier and record that on the other one (superseded, citing the landing commit) rather than leave both in flight.

Copy link
Copy Markdown
Member Author

Identity clarification for the overlap notice above: the two current implementations do not select the same base in every case. #14894 at fa859bb selects the first parent of EVENT_SHA's two-parent merge commit, not a new live-tip API read. #14932 at f92d52f selects the live tip and now refuses base_sha_moved if the action's later read differs. The latter fixes the two-read race identified in the earlier coordination note, but does not by itself reconcile current-rules identity with judged-tree identity. Please retain that distinction when selecting the carrier or declaring supersession; queue position alone does not settle it. This remains a technical clarification, not a validator-policy approval, supersession decision, or request to alter queue/check state.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

The guard does not stack on #14894's selector — measured, not argued

Restacking this PR onto fa859bb68a as a guard-only delta was built and tested locally. It is green, and it is still wrong, because #14894's selector and this guard pick different bases for the same event.

Measured. For 7 open PRs I fetched refs/pull/<n>/merge and compared its first parent with live origin/main = 97bb2d2618:

PR merge-ref first parent vs live tip
#14940 97bb2d2618 same
#14908 77ac5a2435 differs
#14825 77ac5a2435 differs
#14871 81cd20c65d differs
#14903 ff8df5c9f1 differs
#14836 64b4877114 differs
#14780 f486e69376 differs

Six of seven. The merge ref is only as fresh as the PR's last sync, so its first parent is normally the merge base, not main's tip.

What that does to a guard-only stack. #14894 emits steps.trusted.outputs.sha = that first parent, and the action independently reads /git/ref/heads/<base> for the enforcement packet — the live tip. With trusted-sha wired to #14894's output, base_sha_moved therefore fires on an ordinary behind branch: the six rows above, not an anomaly. Built as restack/14932-guard-only (6f3aa62955) over fa859bb68a: 8/8 bundle tests pass, including #14894's, because the guard's own discriminator is exactly the case that becomes normal.

And the two selectors are exclusive, not additive. Keeping this PR's live-tip selector on top of fa859bb68a is green (restack/14932-full, 4e5654c2e5, 8/8 same suite), but #14894's new tools/repo-policy/tests/trusted_admission_source.rs asserts the selector it implemented: scripted rev-list parent line, explicitly no gh call, expected output sha=BASE. That test has to be deleted with the selector, so this is supersession, not a merge.

Consequence. The guard is coherent only where trusted == the source the packet is read from, which is this PR's live-tip selector. So: land #14932 whole (selector + guard, one identity) and drop #14894's selector and its policy test, or land #14894 and re-land the selector on top of it. A guard-only reduction admits nothing new and refuses most candidates.

No commit, head or body change from this comment: the head is still f92d52f648.

Limit: tools/repo-policy/tests/trusted_admission_source.rs is #![cfg(target_os = "linux")], so its incompatibility is read from its assertions, not executed on this Windows box. The six-row measurement and both local restacks are real runs.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: APPROVE f92d52f — no blocking findings on this head.

Repair of my withdrawal. My REPAIR_REQUIRED on 8ce66069 said the workflow resolved the live base tip once (T1) and pinned the bundle there, while action.yml resolved it a second time (T2) for the enforcement packet and .gitattributes, so a base that moved between the reads ran one commit's rules against another commit's packet. This head closes that: trusted-sha is a new action input, the pull_request arm passes steps.trusted.outputs.sha, and the action refuses with base_sha_moved when its own base_sha differs. The guard sits before the packet read, so the bundle, the packet and the .gitattributes declaration are one identity or the run refuses. merge_group passes '' on purpose, so a group whose main advanced is not refused.

Affirmative evidence, not just a read. I extracted the head's action, workflow, policy packet and test to a scratch tree under F:\Temp and ran the self-test on this box: 8 tests, 0 failures, including test_pinned_trusted_sha_must_be_the_live_base and test_event_identity_selection_has_no_candidate_fallback. Mutation control: replacing the guard condition with if false; then makes test_pinned_trusted_sha_must_be_the_live_base fail with 0 != 1 : status=admitted, so the test binds the guard rather than passing vacuously. The selector test also pins the fail-closed cases (empty live tip, absent PR_BASE_REF) and that merge_group keeps GROUP_BASE_SHA when the live tip is newer.

Residual bounds, non-blocking.

  • The merge_group arm still reads the bundle at GROUP_BASE_SHA and the packet at the live base tip, so the two-identity split survives there by design. That is the documented trade (a group is judged against the composition it was built on), but it means a rule change between group base and live main is still not seen by the group's bundle. Out of this PR's scope; worth an issue if it is not already tracked.
  • No hosted lane ran at this head (only Graphite, GitGuardian, CodeRabbit). The self-test is the decisive evidence I could produce locally; the workflow change's end-to-end evidence is still a hosted pull_request run.
  • Three unresolved gemini-code-assist threads remain (unused sys in the gh stub, os.environ["PATH"] direct indexing, single-element for field in ("PR_BASE_REF",) loop). All are style nits in the test, none affects the guard. I am not resolving another reviewer's threads; the orchestrator owns their disposition.

Not checked: no hosted run at this head; no cargo build (none is needed for a workflow/action change).

Side effects: scratch tree F:\Temp\ripr-14932 created and deleted in this beat; no branch, worktree or checkout touched; repo clean at 77ac5a24.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Disposition: restack dispatched to coding ripr-swarm at f92d52f6488c08ad04c9fcc6e66cc4d90b29edf2.

The PR is APPROVE at its exact head but CONFLICTING/DIRTY against main, so it cannot be admitted. The restack keeps the trusted-sha guard intact (the pull_request arm passes steps.trusted.outputs.sha; the action refuses with base_sha_moved when its own live-base read differs). No hosted lane ran at this head, so the restacked head needs the routed qualification. The three gemini style nits on test_trusted_bundle.py are non-blocking and left to the owner.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: APPROVE f92d52f

Carrier re-post at the same head. The substantive review is the prior COMMENT at this head; no finding changed.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Restack scope: this unblocks 15 of the 60 merge-ready PRs, not one

Measured while dispositioning #14178's admission refusal (run 43978924590) today, at f92d52f6:

The failure. Exercise admission discriminators runs candidate_admission.py --check-attributes "${GITHUB_WORKSPACE}/.gitattributes" with the checker from the trusted bundle, which for pull_request is this PR's recorded base, while the file it reads is the test-merge tree carrying live main's declarations. When base predates an allowance, every such PR refuses with:

candidate admission refused (generated_declaration_invalid):
metrics/dx-scoreboard/baseline.json: not a declarable generated path

Verified by running base abf2c72d's checker over live main's .gitattributes (fails with that line) and over base's own .gitattributes (passes).

Reach. Merge-ready PRs whose recorded base lacks the metrics/dx-scoreboard/baseline.json allowance (commit 214b10fc), so they cannot be admitted until this selector lands: 15 of 60 — #14259, #14258, #14217, #14194, #14178, #14119, #14108, #13960, #13913, #13903, #13835, #13433, #13014, #12966, #12693.

Root cause is #14920, and the acceptance row this note adds is behavioural: after landing, a PR whose base is older than an allowance in live main must admit, because the checker and the declaration now come from the same revision. Keep the base_sha_moved guard as specified — it is what makes the two reads provably consistent.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REPAIR_REQUIRED

Withdrawing the source readiness recorded at f92d52f. The head itself is unchanged since my 22:28Z review; the base moved underneath it and removed part of what it adds.

1. The head no longer merges. git merge-tree --write-tree origin/main f92d52f648 exits 1, GitHub reports mergeable=false / dirty / rebaseable=false, and the conflicts are .github/workflows/routed-rust.yml and .github/actions/pr-candidate-admission/test_trusted_bundle.py — exactly the two files this PR edits for #14920.

2. Main already carries a #14920 fix, and a stronger one. #14894 merged at 22:25:21Z as 8919ab0 "ci(admission): pin the trusted bundle to the live base, not the recorded base". Its pull_request arm fetches the merge ref at depth 2 and pins the bundle to the merge commit's first parent, refusing anything that is not a two-parent merge commit. That anchor is local and immutable for the run, needs no token or network, and cannot drift while the job executes. It also adds repo-policy/tests/trusted_admission_source.rs plus a PR-scoped process-allowlist fragment. This PR's PR_BASE_REF + gh api repos/<repo>/git/ref/heads/<base> selector is now a second, weaker answer to the same question, and its hunk is what conflicts.

3. What should survive the rebase. The unique part of this head is the trusted-sha action input and the base_sha_moved refusal placed before the enforcement-packet read. That is still needed after #14894: the selector anchors the bundle at the merge ref's first parent (T1), while action.yml resolves the live base ref head again (T2) for the packet and .gitattributes. If main advances between the two, the bundle and the packet are two identities. Keeping the guard and feeding it the selector's output makes that divergence a refusal instead of a mixed run.

Repair. Rebase onto current main. In routed-rust.yml, keep main's merge-ref first-parent selector and pass its output as trusted-sha on the pull_request arm only ('' for merge_group, as the head already does). In test_trusted_bundle.py, take main's GIT_MOCK / PARENTS shape, then add the pinned-vs-live mismatch case and the merge_group-keeps-its-own-base case on top of it. Keep the action.yml guard and its comment; keep the changelog entry, retargeted to say the guard closes the residual divergence that #14894 does not.

Non-blocking. Four gemini low-priority threads at the head are unresolved: unused sys import in the stub, os.environ.get instead of indexing, and a single-element for field in ("PR_BASE_REF",) loop (raised twice). They are cosmetic and will likely disappear with the rebase.

Not checked: I did not run the head's self-test against main's test file, because the test file is part of the conflict and will be replaced. No hosted lane has run at this head.

The marker on this head is disarmed; re-arm only on the rebased head.

EffortlessSteven added a commit that referenced this pull request Nov 17, 2026
…d live tip (#14932)

#14894 anchors the trusted bundle to the pull_request merge ref's first parent,
so the bundle is immutable for the run. The action still resolved the live base
ref a second time for the enforcement packet, the generated-path declaration and
the base commit. When main advanced after the merge ref was built, the bundle
came from the merge ref's base while the packet and declaration came from a
newer commit: one tree judged by another commit's rules, the #14920 gap in a
narrower window.

The admit step now passes the commit the bundle was checked out at, and the
action reads the packet, the declaration and the base commit from it. No
comparison and no refusal: the anchor is the subject, so the rule set, the
packet and the declaration are one identity by construction. The live tip is
still read for the two things that are live by design - the `--base-sha`
history-sync subject and the during-run movement check - and the input is set on
the pull_request arm only, so a merge_group whose main advanced is unchanged.

Proof: test_packet_and_declaration_come_from_the_bundle_commit holds the
anchor's packet active while the live tip's is inactive and requires
cut_frozen, which only an anchor read produces; the same case without the input
admits, so the input is load-bearing rather than a no-op. The declaration half
does the same with a generated-path exemption only the anchor carries. With the
anchor read disabled the new test fails 0 != 1 : status=admitted; with it
enabled all 8 bundle controls pass. check-workflows, check-process-policy,
check-changelog-fragments, check-text-encoding, check-file-policy,
check-allow-attributes and check-pr-shape pass, and the 21 wrapper controls in
hard_cut_admission_selftest pass under Git for Windows bash.
@EffortlessSteven
EffortlessSteven force-pushed the fix/14920-trusted-source-live-base branch from f92d52f to b5cc195 Compare November 17, 2026 00:51
@EffortlessSteven EffortlessSteven changed the title fix(admission): judge a pull_request by the live base tip, not its recorded base (#14920) fix(admission): read the enforcement packet from the bundle's commit (#14920) Nov 17, 2026

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REVIEW_READY

Exact-head review of #14932 at b5cc195.

Identity. Five files, +96/-12. git merge-tree --write-tree against current main exits 0 at tree fb4f504b82.

1. The three consumers read the anchor. trusted_sha="${ADMISSION_TRUSTED_SHA:-$base_sha}"; the base commit (git/commits/${trusted_sha}), the enforcement packet (contents/${packet_path}?ref=${trusted_sha}) and the .gitattributes declaration (contents/.gitattributes?ref=${trusted_sha}) all use it. The only /git/ref/heads/${base_ref} read left is the live tip at line 246, and it feeds only --base-sha (line 316) and the during-run movement check (base_sha_after, lines 332-347). No third consumer.

2. The live tip is used only for the two live-by-design uses. --base-sha "$base_sha" is the history-sync subject; base_sha_after is the movement check, including its packet read at the new tip to decide whether the movement is benign. That packet read is part of the movement check, not a separate consumer.

3. The test is a real discriminator. test_packet_and_declaration_come_from_the_bundle_commit holds the anchor's packet active while the live tip's is inactive and requires cut_frozen; without the input the live tip's inactive packet admits, so the anchor read is load-bearing. The declaration half does the same with an exemption only the anchor carries (changed_lines=0 with the anchor, qualification_scope_oversized without). The negative control (0 != 1 : status=admitted with the anchor read disabled) is the right shape: the test reds when the anchor read is removed, and it would red if the action re-resolved the tip.

4. The allowlist move is honest. policy/workflow_allowlist.txt moves 329 -> 339 (+10), matching the run-block net addition (the comment block, the trusted_sha line, the regex check, the packet/declaration ref changes and the error-message changes). The trusted-sha input and env line are outside the run block.

5. Fail-closed. An empty input falls back to base_sha (today's behaviour for push/workflow_dispatch); a malformed value refuses trusted_sha_invalid; an unresolvable value fails at the commit/packet/declaration read. The malformed case is not covered by a test, which is a non-blocking test gap, not a code gap.

Body correction, not a head finding. The "Bounded claim" sentence says the merge_group arm re-runs admission "against the group base"; the "Change" section correctly says the per-constituent step still reads the live tip. The sentence is factually wrong and the Coder is correcting the body; the head's "Change" section is the accurate one.

Evidence. No hosted run at this head. The local test_trusted_bundle.py 8/8 with jq 1.7.1, the negative control, the seven cargo xtask check-* targets and the 21 hard_cut_admission_selftest controls are adequate for REVIEW_READY on this seam: the test exercises the exact shell logic with a gh stub, and the negative control proves the anchor read is load-bearing. The hosted lane is the final integration evidence, not a precondition; I am not requiring it and I am not arming the label.

Not checked: no local run of the test harness by me; the Coder's local results are accepted as claims.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: APPROVE b5cc195 — no blocking findings on this head.

Identity. Five files, +96/-12, at b5cc195da6; base main at be64de5421. I read the full diff and the action, decision and test sources it touches.

What the change does. The pull_request arm now passes steps.trusted.outputs.sha — the merge ref's first parent, which is exactly the commit the trusted bundle is checked out at and verified against — into the action as trusted-sha. The action reads the enforcement packet, the .gitattributes generated-path declaration and the --base-commit identity from that commit. The live base tip is still resolved and still used for the two things that are live by design: --base-sha (history-sync subject only, candidate_admission.py:1817) and the during-run movement check.

Why it is sound. The judged tree is the merge ref; its first parent is the base that tree was built on, so the packet and declaration now come from the same commit as the rule set. The fallback is explicit: an unset or empty input keeps the old live-tip read, so the merge_group arm and any other caller are unchanged. The input is format-checked (trusted_sha_invalid) and the workflow's "Verify trusted admission bundle" step already pins the bundle HEAD to that SHA, so the action cannot be handed a different commit than the one it executes.

Evidence. test_packet_and_declaration_come_from_the_bundle_commit is a real two-tree control: the anchor packet is active while the live tip's is inactive and the run must refuse cut_frozen; the same case without the input admits, so the input is load-bearing. The declaration half does the same with an exemption only the anchor carries, and the live-tip case still refuses qualification_scope_oversized. The caller test pins the pull_request-only expression. The test runs under xtask/tests/hard_cut_admission_selftest.rs::trusted_admission_bundle_two_tree_controls_pass, and the action's own Admit PR Candidate check is green at this head. The allowlist budget is exact: the admit run block is 339 non-empty lines and the entry is 339.

Non-blocking, named. (1) The merge_group arm still reads the packet and declaration from the live tip while its bundle is anchored to GROUP_BASE_SHA; the PR names this as a separate pre-existing gap. It is fail-closed in the dangerous direction only if a cut is activated on main after the group base, and the queue rebuilds a stale group, so I do not block on it. (2) A packet-only activation on the pull_request arm now binds the trusted base rather than the live tip; if main advanced after the merge ref was built, check_transition refuses with "activation must bind the exact current main" and a retry re-reads a fresh merge ref. Fail-closed and self-healing.

Limits. No local build or test run; the Rust gates and the four shards were still pending at this head when I read them, so the xtask control is not yet green in CI. Evidence is the diff, the action and decision sources, the test source, the hosted Admit PR Candidate result and the allowlist count.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Head unchanged at b5cc195da6. Pre-qualification probe on the merged tree, since the head is 6 commits behind main:

  • Merged origin/main be64de5421 into the head: clean, no conflicts. The 6 commits since 8e0c33f8 touch none of the admission action, routed-rust.yml or repo-policy.
  • On that merged tree: test_trusted_bundle.py --self-test 8/8; cargo xtask check-workflows, check-process-policy, check-changelog-fragments, check-text-encoding, check-file-policy, check-allow-attributes, check-pr-shape all pass; cargo test -p xtask --test hard_cut_admission_selftest 21/21.
  • The wrapper suite needs Git for Windows bash and jq on PATH; without them it fails program not found (environmental, not a code defect).

No label, queue or merge action taken. The head is unchanged; this is evidence for the attestation, not a new revision.

Copy link
Copy Markdown
Member Author

Qualification checkpoint for the existing delivery owner: run 43992093686 completed successfully on unchanged head b5cc195. Verified admission, hosted Rust gates, all four test shards, shard verifier, VS Code E2E and aggregate Result are success. No queue-add event was present in the current returned timeline, so this is qualified, not verified queued or landed. Please complete the applicable exact-head final review and integration judgment under the existing policy owner, then use the normal protected queue if eligible. This note supplies execution status only, not validator-policy approval or a new review verdict. No duplicate run or queue mutation was performed here.

@EffortlessSteven
EffortlessSteven added this pull request to the merge queue Nov 17, 2026
@EffortlessSteven
EffortlessSteven removed this pull request from the merge queue due to a manual request Nov 17, 2026
@EffortlessSteven

Copy link
Copy Markdown
Member Author

Promotion transaction withdrawn at head b5cc195da6, deliberately, before landing.

Reason: a superseding head exists that implements the same pull_request sized change plus the merge_group half this PR explicitly left open. Landing b5cc195da6 first would have cost a full second queue cycle to deliver the remainder, because the two branches touch the same hunks in action.yml and routed-rust.yml and the successor could not have been stacked behind it without a post-landing rebuild.

State read back at withdrawal: merge queue entry MQE_lQDOSiSx0c8AAAABPm1XJ84ABWODzgQNN3o at position 42, enqueued 01:51:40Z — now mergeQueueEntry: null, terminal. Label merge-ready removed, so the PR is neither queued nor requested.

The withdrawn head is preserved at refs/heads/preserve/14932-b5cc195d (b5cc195da6), so the qualified candidate can be restored if the successor fails review. Its evidence remains valid for that commit only: qualification run 43992093686 (all jobs green, including Ripr Rust Small Result) and review 5930773233.

The successor is a rebuilt branch on a newer main, not a rebase: it pins the enforcement packet, the .gitattributes declaration and the base commit to trusted-sha on every arm — GROUP_BASE_SHA on merge_group — while --base-sha stays the live tip because history_sync_check requires the declared destination_base to be an ancestor of the live base. It will be reviewed and qualified on its own exact head; this comment is not evidence for it.

@EffortlessSteven
EffortlessSteven force-pushed the fix/14920-trusted-source-live-base branch from b5cc195 to da77ddd Compare November 17, 2026 02:24
@EffortlessSteven EffortlessSteven changed the title fix(admission): read the enforcement packet from the bundle's commit (#14920) fix(admission): pin the packet and declaration to the bundle's commit (#14920) Nov 17, 2026
…#14932)

#14894 anchors the trusted bundle to the pull_request merge ref's first parent,
so the bundle is immutable for the run. The action still resolved the live base
ref a second time for the enforcement packet, the generated-path declaration and
the base commit. When main advanced after the merge ref was built, the bundle
came from the merge ref's base while the packet and declaration came from a
newer commit: one tree judged by another commit's rules, the #14920 gap in a
narrower window.

The admit step now hands the resolved commit in as `trusted-sha` on every arm -
the merge ref's first parent for a pull_request, GROUP_BASE_SHA for a
merge_group - and the action reads the packet, the declaration and the base
commit from it. There is no second read left to disagree with, so the rule set,
the packet and the declaration are one identity by construction; no comparison,
no refusal on movement.

A pinned read has no live fallback, so the input is now required: empty,
non-40-hex and unreadable trusted-sha each refuse with their own token. The live
base ref is still read for `--base-sha`, because history-sync asks whether the
declared destination base is an ancestor of the live tip - a live fact, not the
judged tree's base. Pinning that one would reject a sync PR whose merge ref
predates the destination.

The merge_group per-constituent step is pinned to GROUP_BASE_SHA for the same
reason, so the tip and every constituent of one group are judged against the
packet and declaration the chain was built on.

Proof: test_packet_and_declaration_come_from_the_pinned_commit holds the pinned
packet active while the live tip's is inactive and requires cut_frozen, which
only a pinned read produces; the same case with the input ignored admits, so the
pinned source is load-bearing. test_trusted_sha_is_required_and_must_resolve
covers the empty, malformed and unreadable refusals. With the pinned input
ignored both tests fail 0 != 1 : status=admitted; with it honoured all 9 bundle
controls pass. check-workflows, check-process-policy, check-changelog-fragments,
check-text-encoding, check-file-policy, check-allow-attributes and
check-pr-shape pass, and the 21 wrapper controls in
hard_cut_admission_selftest pass under Git for Windows bash.

Copy link
Copy Markdown
Member Author

Successor delivery checkpoint for the existing owner: current head da77ddd has the reported 9/9 pinned-bundle controls, two load-bearing negative controls, 21 wrapper controls and listed local policy checks. I found no exact-head native review or hosted qualification run yet. The deliberate withdrawal of b5cc195 is recorded and its evidence stays with that old head. Please finish independent review of the expanded all-event/per-constituent scope, then request one exact-head routed qualification when eligible, checking first that another owner has not already requested it. This is continuation coordination only, not validator-policy approval or a source verdict; no label, CI or queue mutation was performed here.

@EffortlessSteven
EffortlessSteven force-pushed the fix/14920-trusted-source-live-base branch from da77ddd to 408f083 Compare November 17, 2026 02:37

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOURCE_REVIEW_READY

#14932 at 408f083 — source review of the pinned-read invariant.

What I checked

1. The three consumers read the anchor on both arms.

  • action.yml:253-256 requires trusted-sha, rejects non-40-hex, and reads git/commits/${trusted_sha} for the base commit.
  • action.yml:268 reads the enforcement packet at ?ref=${trusted_sha}; action.yml:303 reads .gitattributes at ?ref=${trusted_sha}.
  • routed-rust.yml:420 passes trusted-sha: ${{ steps.trusted.outputs.sha }}; the selector at :284 resolves merge_group to GROUP_BASE_SHA.
  • The constituent loop pins the same three: :470 base commit, :472 packet, :492 declaration, all at ${GROUP_BASE_SHA}. No ?ref=${base_sha} remains for those three.

2. No live-versus-pinned comparison. The only movement refusal is the pre-existing live-versus-live during-run check (action.yml:336-353, routed-rust.yml:521-537), which you accepted as live-by-design. --base-sha stays the live tip (action.yml:320, routed-rust.yml:506).

3. The pull_request-arm test is a real discriminator; the merge_group arm has none.
I ran test_packet_and_declaration_come_from_the_pinned_commit from a temp export of 408f083cb9 (not the Coder's checkout): it passes. I then reverted only the packet and declaration refs to ${base_sha} in that export and re-ran: it fails with cut_inactive instead of cut_frozen. So the test reds when the anchor read is removed, and it would red if the action re-resolved the tip.
The constituent step has no equivalent. test_trusted_bundle.py never reads the "Admit additional merge-group constituents" step, and the six added lines in hard_cut_admission_selftest.rs are ADMISSION_TRUSTED_SHA env only. A revert of routed-rust.yml:470/472/492 to ${base_sha} would pass every test. That is a non-blocking test gap, not a code gap: the code is correct by inspection, but the merge_group half of the claim is not regression-protected, and its first real exercise is the queue.

4. The allowlist is honest. I counted the action's run block at 408f083cb9: 343 non-empty lines, exactly the new budget. routed-rust.yml's budget stays 133 and its largest run block is 128, so the constituent-step growth fits.

5. Fail-closed. Empty, non-40-hex and unresolvable trusted-sha refuse with their own tokens (action.yml:254-256), covered by test_trusted_sha_is_required_and_must_resolve. On push/workflow_dispatch the action returns not_applicable at :217 before the check, so today's behaviour is kept.

Non-blocking observations

  • Packet 404 fallback still reads the workspace copy. action.yml:270-272 and routed-rust.yml:475-477 fall back to ${GITHUB_WORKSPACE}/${packet_path} when the pinned commit has no packet. For a merge_group the workspace is the group tip, so in the bootstrap case the candidate's own packet is used. Pre-existing and unchanged by this diff, but it is the one place a different commit's packet can still enter.
  • .gitattributes 404 leaves attrs_args empty, so nothing is exempted: over-refusal, fail-closed.
  • Unfetchable GROUP_BASE_SHA fails the git/commits read under set -e, so the whole group is ejected: fail-closed but coarse.
  • Body: "it is the only remaining live read" is inaccurate; the during-run movement check also reads the live ref. The "Bounded claim" sentence is now accurate for the packet, declaration and base commit, with --base-sha still live by design.
  • Changelog fragment covers the action's arms but not the constituent step.
  • Input description says "when set", but the input is required in admit mode.

Evidence boundary

No hosted lane ran at 408f083cb9 (rollup is CodeRabbit, GitGuardian, Graphite; no labels). The Coder's local 9/9 and the seven cargo xtask check-* targets are claims; I independently ran the discriminator and the negative control, and computed the allowlist count. That is adequate for source readiness on this seam; the hosted lane is final-integration evidence, not a precondition. I did not arm the label or touch the queue.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REPAIR_REQUIRED

#14932 at 408f083 — the merge-group pin has no discriminator.

I chose REPAIR_REQUIRED over a follow-up because the merge-group per-constituent pin is the new, claim-essential part of this head (the body says it closes the #14933 half), and a revert of it to the live tip would pass every existing test. That leaves the predicate not established rather than merely under-tested: the pull_request arm has a real discriminator, the merge_group arm has none.

The gap

.github/actions/pr-candidate-admission/test_trusted_bundle.py never reads the "Admit additional merge-group constituents" step. Its GROUP_BASE_SHA occurrences belong to the selector test for "Select trusted admission source", and test_caller_pins_both_action_invocations_and_checks_reserved_destination asserts only that trusted-sha: <PIN> appears in the workflow text. The six added lines in xtask/tests/hard_cut_admission_selftest.rs are ADMISSION_TRUSTED_SHA env only.

Effect: reverting routed-rust.yml:470 (git/commits/${GROUP_BASE_SHA}), :472 (?ref=${GROUP_BASE_SHA}) and :492 (?ref=${GROUP_BASE_SHA}) to ${base_sha} passes the whole suite. The arm that runs for every merge group would then read the live tip again with no test reddening.

Repair

Add a static assertion in test_trusted_bundle.py on the constituent step: the packet, .gitattributes and base-commit reads use ${GROUP_BASE_SHA}, and no ?ref=${base_sha} remains for those three. That is the same shape as the existing test_caller_pins_both_action_invocations_and_checks_reserved_destination assertion.

Everything else on this head stands

The pinned-read invariant holds: action.yml:268/303/256 read the packet, declaration and base commit at ${trusted_sha}, and routed-rust.yml:470/472/492 read the same three at ${GROUP_BASE_SHA}; no live-vs-pinned comparison remains; --base-sha stays live by design. Allowlist 343 is exact (I counted the run block). Empty, malformed and unresolvable trusted-sha fail closed.

Other observations

  • The packet 404 fallback (action.yml:270-272, routed-rust.yml:475-477) still uses the workspace copy; for a merge_group that is the group tip, so the bootstrap case can use the candidate's own packet. Pre-existing.
  • The body sentence "it is the only remaining live read" is wrong; the during-run movement check also reads the live ref.

Evidence boundary

No hosted lane ran at 408f083cb9 (rollup is CodeRabbit, GitGuardian, Graphite). The Coder's local 9/9 and the cargo xtask targets are claims; I independently ran the pull_request discriminator and its negative control from a temp export. I did not arm the label or touch the queue.

Copy link
Copy Markdown
Member Author

Existing-owner checkpoint on 408f083: the later exact-head review 5932025034 is REPAIR_REQUIRED and supersedes source readiness 5931976233 for the claim-essential constituent-step regression discriminator. Qualification 44006502757 is already running; a successful run alone would not resolve this review finding. Please complete the requested constituent packet/declaration/base-commit control, retain a negative mutation demonstrating it detects removal of the pin, and obtain an exact-head disposition after any repair. Preserve the earlier proof only for its applicable scope and do not queue with the unresolved finding or launch a duplicate unchanged run. This is coordination, not a new policy review or a request to interrupt active CI.

Copy link
Copy Markdown
Member Author

Terminal qualification checkpoint for the existing owner: run 44006502757 on 408f083 completed failure at 03:34Z. Admission, hosted Rust gates, all four test shards, shard verifier and VS Code E2E succeeded. Result job 133798131893 failed specifically at “Recheck source review disposition for the admitted head”: source review attestation refused. This is consistent with unresolved REPAIR_REQUIRED review 5932025034, not an unexplained test or infrastructure failure. Please carry the previously requested constituent-step discriminator and negative mutation through repair and exact-head independent review, then refresh qualification under the normal procedure when eligible. Do not retry unchanged qualification or queue this head to work around the review refusal. This is verified execution-status coordination, not validator-policy approval; no run or queue action was taken here.

EffortlessSteven commented Nov 17, 2026 •

Copy link
Copy Markdown
Member Author

PR_MERGED — existing #14932 task completed through actual protected landing.

Verified GitHub PR readback: merged=true, closed, merged_at=2026-11-17T13:30:36Z, merge commit f481605. Reviewed source H was 6e66646 (test-only repair 6e66646 atop 408f083). Protected successor run https://github.com/EffortlessMetrics/ripr-swarm/actions/runs/44086246217 , attempt 1, completed SUCCESS at 13:30:34Z on the same f481605 that landed. This is verified landed state, not merely queued or source-ready. No additional CI, queue, source, protection or policy action was taken during closeout.

Acceptance: action packet, generated-path declaration and base commit use the resolved trusted anchor on all arms; merge-group constituents use GROUP_BASE_SHA for those three reads. The live --base-sha/history-sync and during-run movement checks remain live. The repair adds extracted constituent-step assertions plus per-read negative mutations; 11/11 Python controls pass, individual/combined real-workflow pin reversions fail as intended, independent oracle review reproduced them, and repository MEMBER SOURCE_REVIEW_READY review 5932721203 verified the exact head. #14894's immutable selector coverage remains intact. Historical H qualification 44016797643 succeeded; it was not relabeled as the final G proof.

Linked scope reconciliation: #14933 is closed/completed after #14932, covering the pinned-read residue; #14920 is already closed/completed by #14894/8919ab061d, with its final comment explicitly routing that residue to #14933/#14932. No concrete remaining dependent in either linked issue requires reopening or a duplicate writer.

Separate #14953 handoff remains separate: failed former G=5b8c3973 inherited its stale constant-tail fixture from queued predecessor 85b4e3a, conflicting with #14780's intended guidance. Existing lane owner received exact-object diagnosis and fixture reconciliation request at #14953 (comment) . Native queue removed that predecessor and automatically built the successful successor on main 73577fe. No #14953 golden was blessed or edited here, and its repair is not part of this task's completion.

Closeout: no task-created extra worktrees, builds or proof binaries; temporary Python fixtures/independent exports were cleaned up. The clean local repair checkout and Git commit may remain retained as source evidence. Native landing and linked-issue states are authoritative; no background worker or pending qualification is claimed for this completed task.

Copy link
Copy Markdown
Member Author

Re-review requested for the existing source-review owner: current head 6e66646 contains the test-only repair to finding 5932025034. The exact-head receipt in comment 6937766143 includes the new constituent-step assertions, 11 passing controls, individual and combined pin-removal failures, and independent reproduction. Please assess the repaired finding and applicability of the unchanged production-code review, then record the repository-authorized current-head disposition if warranted. Internal oracle-repair review is not being relabeled as validator-policy approval or full-PR attestation. No exact-head qualification exists yet; qualification remains pending this review, with no duplicate run or queue request.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOURCE_REVIEW_READY

#14932 at 6e66646 — repair verified; the constituent pin now has a real discriminator.

What the repair adds

One commit, one file: test_trusted_bundle.py +32 lines, no production or workflow change. assert_constituent_reads_are_pinned requires git/commits/${GROUP_BASE_SHA}, contents/${packet_path}?ref=${GROUP_BASE_SHA} and contents/.gitattributes?ref=${GROUP_BASE_SHA} in the step, and assertNotIn rejects the ${base_sha} twin of each. test_constituent_reads_use_group_base_and_keep_live_checks runs that helper against step(workflow, "Admit additional merge-group constituents") from the real workflow file. test_constituent_pin_removal_mutants_are_rejected rebuilds the three mutations from the same extracted text and asserts the helper raises.

Is it a real discriminator, not circular?

Yes. step() splits the real routed-rust.yml on the unique step name and takes text up to the next -; the name occurs once and the extracted block is the 121-line constituent step. shell() then reads its run: | block, so the helper sees the script the workflow executes. The mutant test is a meta-control on the helper, not the primary proof: the primary proof is assertIn on the real file. I confirmed the predicate by mutating the real workflow, not just the helper: reverting routed-rust.yml:470/472/492 to ${base_sha} in a temp export makes test_constituent_reads_use_group_base_and_keep_live_checks fail (4 failures across the two tests). The three pinned reads each occur exactly once in the step, and no ${base_sha} twin exists.

The live-read assertions

They assert the by-design live reads survive: --base-sha "$base_sha", the base_sha_after comparison, and contents/${packet_path}?ref=${base_sha_after}. That is the right direction: it prevents a silent pinning of the movement check, and a deliberate later tightening only needs the assertion updated. It does not foreclose one.

Regressions

None. No production or workflow file moved. The 9 existing controls are unchanged; the 2 new tests are pure text assertions and do not touch the jq path.

Evidence

I ran the file at this head with jq 1.7.1 on PATH (your 9 failures were jq: command not found, exit 127): the two new tests pass in 0.04s, and the genuine revert reds them. Full suite: 11 tests, all pass.

Body wording

The body still says "9/9 controls" and "all 9 pass"; the repair makes 11. The Proof section also does not mention the two new constituent tests. Both are stale after this commit; the 9 existing claims are otherwise accurate. The "only rule-set input that stays live" phrasing is now correct: I confirmed history_sync_check rejects any non-pull_request event (candidate_admission.py:639-640), so --base-sha is inert on the merge_group arm.

@EffortlessSteven
EffortlessSteven added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit f481605 Nov 17, 2026
21 checks passed
@EffortlessSteven
EffortlessSteven deleted the fix/14920-trusted-source-live-base branch November 17, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

admission: the trusted bundle and the enforcement packet resolve the live base tip twice, so they can come from different commits

1 participant