Repository navigation
fix(pr-pipeline): refuse untrusted provenance at arm time, in the merge queue and in lane eligibility - #10040
Conversation
enable-auto-merge arms lane pull requests through babysit_verify_evidence.py `evidence --lane-link`, which never ran eligibility. So a label naming untrusted work, added to the linked issue after admission while the lane built, did not stop the arm. The link read now also applies the trust hold. The hold is one function, babysit_merge_policy.trust_refusal, which eligibility now calls too: labels read whole, none matching _untrusted, and none removed by a non-human (_untrusted_removed_by_non_human). The labels come with the link's existing GraphQL query and the timeline costs one REST read. A refusal comes back as `ineligible`, which enable-auto-merge already treats as a refusal a person clears (comment plus human-gated label), so the JS needs no new code. An unreadable read refuses. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LY6PpXaikB8J2tRLeypMmn
lane_eligibility, the pr-merge gate's own path for lane pull requests, read no label at all, so an untrusted-provenance label on the linked issue never held a lane merge outside native auto-merge. It now calls trust_refusal on the linked issue, judging a human as eligibility does. That is one more REST timeline read per lane pull request with a linked issue. Co-Authored-By: Claude Opus 5.5 <[email protected]>
report-outcome writes a Hold: line only when the issue carries the exact untrusted-provenance label at PR open, and enable-auto-merge checks at arm time. So a label added after arming, or while the pull request waited in the queue, still merged. The merge-group step "Fail a queued pull request carrying a hold label" now reads, for a pull request an automation opened, its linked issue: the closing issues here, or with none, the one plain Refs: issue by the base's merge-holds.mjs refsIssue. It fails on a label containing "untrusted" in any case (_untrusted), or one ever removed by anyone not a person on the base's trusted-actor list, or through an App (_untrusted_removed_by_non_human, stricter than admit.mjs untrustedHold, which lets the lanes App's removal lift it and reads only the newest event). An unreadable link, label list, timeline or trusted-actor list fails closed. That is one GraphQL read per queued pull request, plus a timeline read per linked issue, and a labels read for a Refs issue, when an automation opened it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Held with the do-not-merge label until Automation Lanes' security review of 90010ab returns. poteto removes the label when the review is in and dispositioned. |
|
claude-security-review reviewed Incremental security review of the four files that changed since 275130a, read against the PR context. I found no security issues. The change does two things.
What I checked:
manifest: no manifest files changed. Spend: no change that draws on prepaid credit or subscription usage, and nothing that can start a real charge. |
|
claude-review reviewed Incremental review of the changes since 275130a. I found nothing to flag. What changed
Checks I made by reading the code
I read these tests but did not run them. The PR description's pass counts are the author's claims, and I did not confirm them. I did not re-review files unchanged since 275130a. No manifest items apply, and the closing-issue section is empty because the PR cites an owner decision rather than an issue. No hold applies, because the change spends no billed resource. |
comment-hygiene's tracker-reference pattern flagged "issue 18's labels read" in the stub's description. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…and jq errors The merge-queue trust hold step now fails a lanes App pull request (matched by its bot databaseId, as the lanes App step matches it) that does not link exactly one issue in this repository, so dropping the link after arming no longer skips the check. Another automation's pull request that links none still passes. Both jq matches capture their exit code: 0 holds, 1 passes, anything else fails closed instead of reading as no match. babysit_merge_policy._untrusted matches "untrusted" ASCII-only, as the step's jq ascii_downcase does; a shared fixture holds both to the same table. The README says how a removal-by-non-human hold ends: a new issue and a new pull request, since the timeline keeps the removal. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The queue trust step matched the lanes App by author.databaseId; a Bot author whose databaseId read null counted as another automation and skipped the dropped-link check. It now fails closed. The lanes App id is one job-level LANES_APP_ID in ci-status that both the trust-hold and lanes-hold steps read, and both step suites take it from the workflow. The lanes-hold step fails closed when it is unset. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
The pr-verify verifier failed head dbe26b42ecf01656c182500017284f89a8d1b747. What it wrote, as data:
Summary: PR #10040 links no issue, so the spec is the PR's own title and body. It asks for the untrusted-provenance trust hold to be enforced in three more places: at arm time (`evidence --lane-link` / `enable-auto-merge`), in `lane_eligibility`, and in the merge-queue step of `ci-status`. The diff adds all three, they fail closed, and the tests are thorough. One unrequested change blocks: `_untrusted` used to match with Unicode `casefold()` and now uses an ASCII-only regex. That narrows the existing babysit `eligibility` hold, which was the only untrusted-work hold before this PR, so labels such as `untruſted` or `untrusted` stopped holding. This loosens a hold on outside work that the owner keeps, and it contradicts the body's own "any spelling". The body says the owner approved `ascii_downcase` only for the merge-queue step.
- context.json: a trusted comment says the PR is held with `do-not-merge` until a security review of 90010ab3 is dispositioned. That is context, not a spec requirement, but the hold still applies.
- .github/workflows/pr-require-checks.yml:4376: the queue step judges who removed a label by the base's `trusted-actors.json` human ids. The Python readers use `is_human`, which is permission-based. So a write-access person who is not on the list lifts the hold in Python but not in the queue. This is stricter and documented, so it does not block, but a human should know the two disagree.
- .github/workflows/pr-require-checks.yml:3143: `LANES_APP_ID` moved from a hard-coded step variable to a job-level env value, still checked against `merge.agent-identity`'s trusted-actor id by `scripts/ci-lanes-pr-hold.test.sh`. The step now fails closed when the value is not numeric. No takeover risk found.
There was a problem hiding this comment.
The pr-verify verifier failed head dbe26b42ecf01656c182500017284f89a8d1b747. What it wrote about this file, as data:
- plugins/source-control/skills/babysit-prs/scripts/babysit_merge_policy.py:1398: `_untrusted` changed from `"untrusted" in str(label).casefold()` to the ASCII-only `UNTRUSTED` regex. Labels the old check held (`untruſted`, `untrusted`, `UNTRUſTED`) now pass `eligibility`, `lane_eligibility` and `link_refusal`. The spec asks for no such loosening; it says to refuse 'in any spelling'. Restore the casefold match, or keep ASCII matching and also match casefold. A Python check stricter than the queue's jq check is defence in depth, not a defect.
There was a problem hiding this comment.
The pr-verify verifier failed head dbe26b42ecf01656c182500017284f89a8d1b747. What it wrote about this file, as data:
- plugins/source-control/skills/babysit-prs/scripts/tests/fixtures/untrusted-labels.json:14: the `passes` list pins `untrusted`, `untruſted` and `UNTRUſTED` as passing, and `test_the_label_match_agrees_with_the_queue_step` (test_babysit_merge_policy.py) asserts this for Python. After restoring casefold, have the Python test expect these to hold, for example by moving them to a separate `python-holds` list that `ci-hold-merge-group.test.sh` treats as passes or skips.
There was a problem hiding this comment.
The pr-verify verifier failed head dbe26b42ecf01656c182500017284f89a8d1b747. What it wrote about this file, as data:
- plugins/source-control/skills/babysit-prs/scripts/tests/test_babysit_merge_policy.py:3636: the test case `[MECHANICAL, "work-class: untrusted-provenance"]` is removed from the 'class label is ignored' test. This is correct now that `lane_eligibility` refuses that label, and new tests cover the refusal.
No related issue: owner decision Q-ARM (poteto session, 2026-10-25)
Summary
The untrusted-provenance hold was enforced only by the local babysit lane. A lanes App pull request whose linked issue gained
work-class: untrusted-provenance(or any label naming untrusted work) after admission could still be armed for native auto-merge and pass the merge queue. This applies the same trust hold at three more points: at arm time inenable-auto-merge, in the pr-merge gate'slane_eligibility, and inci-status's merge_group step. All three read the linked issue by the gate's own link rule and refuse on a label naming untrusted work in any spelling, a label removed by a non-human or through an App, or an unreadable link, label list or timeline.Scope choices the owner approved: the merge-queue step checks only pull requests an automation opened (a person's own pull request is not read), and it matches labels with jq
ascii_downcase, soUntrusted,UNTRUSTEDand the canonical label all hold.Fix
plugins/source-control/skills/babysit-prs/scripts/babysit_merge_policy.py:1697: newtrust_refusal, the one home of the hold (labels read whole,_untrusted,_untrusted_removed_by_non_human).eligibility(:1995) now calls it instead of inlining the checks.babysit_merge_policy.py:2643:lane_eligibilityappliestrust_refusalto the linked issue, judging a human with the lane'sagent_identity,self_loginsandpermission.plugins/source-control/skills/babysit-prs/scripts/babysit_verify_evidence.py:246: the issue read fetcheslabels;Reader.link_refusal(:1353) appliestrust_refusalafter the link rule, soevidence --lane-linkrefuses an untrusted issue andenable-auto-mergearms nothing..github/scripts/pr-merge/enable-auto-merge.mjs:32: header comment names the trust hold as part of the link it requires..github/workflows/pr-require-checks.yml:4323: stepFail a queued pull request carrying a hold labelreads, for an automation-opened pull request, its linked issue (closing issues, else the one plainRefs:issue by the base'srefsIssue), its labels and its timeline, and fails on an untrusted label, one removed by anyone other than a person on the base's trusted-actor list or through an App, or any unreadable read (three attempts each).docs/conventions/pr-pipeline/README.md:697,:1110,:1203: Merge authority and Native auto-merge describe the hold at all three points and how a person lifts it..changes/pr-pipeline/and.changes/source-control/.Verification
Run on the branch after merging
origin/main(no conflicts):bash scripts/ci-hold-merge-group.test.sh: PASS=42 FAIL=0 (runs the workflow step body against stubbed reads: untrusted label in variant spellings, non-human and App removals, trusted-actor removal, Refs link, unreadable link, labels, timeline and trusted-actor list).python3 -m unittest discover -s plugins/source-control/skills/babysit-prs/scripts/tests -p 'test_*.py': 2932 tests, OK.node --test .github/scripts/pr-merge/*.test.mjs: 362 pass, 0 fail.shellcheck scripts/ci-hold-merge-group.test.shandactionlint .github/workflows/pr-require-checks.yml: clean.bash scripts/check-affected.sh --tests: 13 checks passed; of 39 selected shell suites, 37 passed and the 2 needing PyYAML (scripts/ci-test-node-stop-commands.test.sh,scripts/run-hygiene-gate.test.sh) passed when re-run with a local PyYAML venv onPATH(2 and 10 checks). Of the 78 delegated non-shell suites: the babysit Python suites are in the discover run above,scripts/test_check_contract_clause_coverage.pyran 24 tests OK, and the other 24 Node files ran 1308 tests, 0 fail (the 3resolve-configfiles afternpm ciin that directory).scripts/check-stale-base-overlap.sh --check origin/main: HEAD is up to date with origin/main.Related
docs/conventions/loop-lane/README.md.docs/conventions/pr-pipeline/README.md, sections Merge authority and Native auto-merge.🤖 Generated with Claude Code