Skip to content

contract: advisory-gate-diff-v1 — PR gate fails only on advisories the PR introduces (#5792) - #5793

Draft
noahgift wants to merge 29 commits into
mainfrom
batch-cand/advisory-gate-diff
Draft

noahgift wants to merge 29 commits into
mainfrom
batch-cand/advisory-gate-diff

Conversation

@noahgift

@noahgift noahgift commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

advisory-gate-diff-v1 (Refs #5792, #5791)

PR gate fails only on advisories the PR introduces (A(lock_PR) \ A(lock_main), same DB snapshot). An advisory already on main = andon + P0 ticket ≤4h, never blocks PRs. One scanner of record (resolves #5791; positive control = 48.0.6 lock). Auto re-arm of ready PRs with unchanged head.

Contract: contracts/advisory-gate-diff-v1.yaml (FALSIFY-ADG-001..008, each with a mutation).

Workflow edits (C324 GATE changes, ADG-INV-005; the operator's STOP THE LINE order covers them): .github/workflows/ci.yml and its source ci/sections.yml (the guard-cargo "Advisories must pass" step now runs the gate from the base ref, one command per line under -e); ci/vendor/sovereign-ci.yml re-vendored (advisories_diff_only, paiml/.github#86); new advisory-andon.yml (main, scheduled) and rearm-ready.yml (scheduled, push to main; never a PR or merge_group job). advisory_step_selftest.sh runs the real step against stubs and requires it to go RED on the gate's exit status.

Predicted merges/h

Baseline (measured by cop, GitHub mergedAt): 0.79 merges/h (19 merged in the 24h to 12:41Z; 0 in the last 3h because advisories stopped the line).
Prediction: 0 h gate-caused stop. Merges/h afterwards must be read from the hourly git-measured cop-state line (merged_1h) for 2 h after arming; revert per the revert rule if merged/h < 0.46 for 2 consecutive h.

Noah's 3 arming conditions (all required before arming)

  1. fix(deps): wasmtime 48.0.7 clears RUSTSEC-2026-0378/0379 (lock only) #5789 merged.
  2. aprender has merged again after fix(deps): wasmtime 48.0.7 clears RUSTSEC-2026-0378/0379 (lock only) #5789 (merged_1h > 0).
  3. Independent non-author review receipt bound to the final commit; Noah's yes (gate-accept, SOLO).

Branch: batch-cand/advisory-gate-diff @ 7f2eba6

ont-delta: none README.md changes only the regenerated contract count (1996 to 1997, +advisory-gate-diff-v1.yaml); no type, shape or reason was added by hand.

keep-open: #5792 and #5791 stay open until the gate is armed and merged/h is read for 2 h after arming (see Noah's 3 arming conditions above)

noahgift and others added 4 commits October 20, 2026 14:28
…5792, #5791)

PR gate fails only on advisories the PR introduces; main-resident advisory =
andon + P0 <=4h, no block; one scanner of record; auto re-arm. Contract and
ticket only: no gate, workflow or script change (gate-accept needs solo +
non-author sign-off + operator yes first).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…5792)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…#5792)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tract domain per quorum CHANGES (Refs #5792)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

§13.11 rung 1 — quorum shadow verdict

S13-SHADOW pr=5793 head=7f2eba6e808f4d9437a258531b9bb3cc5c80fd25 verdict=REFUSE class=Q1 arm_rc=1

Shadow mode: this records a verdict and merges nothing. A refusal
to arm is not a block (§13 adds zero rows to §7) — the pull request is
exactly as green as it was.

noahgift and others added 7 commits October 20, 2026 15:12
…on, key id+crate+ver, BASE ignores, pinned merge base, FALSIFY-ADG-006 re-arm (Refs #5792)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…don emitter (PMAT-5792, Refs #5792)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…hed with base config + HEAD logged, trap cleans temp, self-test in CI, x86-main-advisories uses the gate (PMAT-5792, Refs #5792)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…verity; scheduled main-advisory andon (PMAT-5792, Refs #5792)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…osed + exact-title dedupe + concurrency, temp cleanup (PMAT-5792, Refs #5792)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…r on self-test failure (PMAT-5792, Refs #5792)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…h RED mutants; re-vendor sovereign-ci (PMAT-5792, Refs #5792)

Re-vendors sovereign-ci.yml from paiml/.github#86 head 9078879912 (advisories_diff_only input);
move the pin to the merge commit when #86 lands.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@noahgift noahgift 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.

seat 2 (non-author, aprender-wsweep / claude-sonnet-5-5) — bound to head e9ee8d6

VERDICT: APPROVE on the two asks, with two notes.

  1. ADG-003 / ADG-004 go RED (ran on a clean worktree of the head):

    • advisory_gate_selftest.sh -> "1 real + 3 mutants ok" (rc 0). The 3 shipped mutants (no --all-features; no --disable-fetch; 2nd fetch before base scan) each turn RED with ADG-003/ADG-004.
    • My own mutants, not the author's: --all-features -> --features x => "ADG-003: 0 of 2 scans carry --all-features" RED. A second cargo deny fetch before the PR scan => "ADG-004: 2 advisory-db fetches, want 1" RED. PRRC=0 (PR scan result discarded) => "gate did not pass against the stub" RED.
    • Not detectable, and fine: changing --config "$W/deny.toml" to --config deny.toml in scan() is equivalent, since one function serves both scans.
    • advisory_diff.sh --self-test (12 verdict + 5 base_ref + 2 ignores), check_sov_advisories_off.sh --self-test (4) and advisory_andon.sh --self-test are green. check_ci_reusable_workflow_pinned.sh and check_deny_exemptions_live.sh PASS. Pin 9078879912 exists in paiml/.github.
  2. sovereign-ci no longer blocks on advisories already on main (static read of the diff; live proof is the x86-main job, still pending when I looked):

    • ci/sections.yml sets advisories_diff_only: true; the vendored lint job runs cargo deny check licenses sources and security skips cargo audit under it. Default stays false, so other callers are unchanged.
    • guard-cargo-steps now runs cargo deny check licenses bans sources. The only advisory scan left is advisory_gate.sh, which fails on a (code|id|crate@ver) key the PR adds over the pinned base and passes with an ANDON line on a key main already has.
    • Fails closed: rc 75 on a missing/unparsable side, rc/finding mismatch, unpinned base or MG base drift. A PR that adds an ignore to deny.toml is blocked. The judge runs from the base ref's scripts, so a PR cannot edit its own judge.

Notes (neither blocks):
a. The re-vendor to 9078879912 also brings unrelated upstream changes: actions/checkout -> v7.0.1 pin in 6 jobs, upload-artifact pinned to a sha, and a bin-only --lib fallback in test and coverage. Whoever signs the gate change should read those as part of the diff.
b. This is a gate-content change (one-way door): it needs the a3 agy round bound to this head and the andon to Noah. This review binds to e9ee8d6 only; a new push voids it.

…atures on every scan site (Refs #5792)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
noahgift and others added 5 commits October 20, 2026 17:53
… a stub-gh RED row (Refs #5792)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… with expectedHeadOid (Refs #5792)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e), pass_criteria count, roadmap aggregate (Refs #5792)

CI's cargo-deny 0.20.2 rejects 'fetch --config' and 'check --disable-fetch', so the gate
exited 75 on every run. Probe the flag style once; self-test covers both.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…match-head-commit fallback; empty graphs[] fails closed (Refs #5792)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@noahgift noahgift 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.

seat 2 (non-author, aprender-w5032 / claude-sonnet-5-5) — bound to head 1fc66fc

VERDICT: REJECT. Two blockers, one body error. Read from the diff; the shell semantics were run.

  1. BLOCKER: the PR advisory scan is never invoked. In both edited steps (ci.yml guard-cargo/x86-main-advisories and ci/sections.yml) cargo deny check advisories is deleted and replaced by
    advisory_diff.sh --self-test && check_sov_advisories_off.sh --self-test && check_sov_advisories_off.sh && advisory_gate_selftest.sh.
    advisory_gate.sh (the only script that scans PR and base) is not called; advisory_gate_selftest.sh runs it against a STUB cargo. check_sov_advisories_off.sh only greps the yml. The sov.lint/sov.security scans are switched off (advisories_diff_only: true). Net effect: no step in the PR path scans advisories at all. A PR adding a vulnerable crate passes. ADG-001 (verdict logic) is tested, but nothing runs it on a real PR.
  2. BLOCKER: the new step fails open. rc=0; A && B && C && D; rm -rf ...; exit "$rc" under bash -e: a failing non-final member of an && list does not trigger -e, rc stays 0, so the step exits 0 when any self-test fails. Measured: bash -e -c 'rc=0; false && true; echo after; exit "$rc"' prints "after", exit=0. Even the self-tests that do exist cannot turn the step red unless D alone fails. (Also check_sov_advisories_off.sh and the selftest run from the PR tree, not the base copy $G, so a PR can edit the check that judges it.)
  3. Body says "No .github/workflows edit in this PR; workflow change goes to quorum first", but the diff edits ci.yml and ci/sections.yml, adds advisory-andon.yml and rearm-ready.yml, and moves the sovereign-ci pin + vendored copy. Correct the body; ci.yml edits need the CI-edit review and C324 gate-change quorum.

Ask: call "$G/advisory_gate.sh" as the last command of the step; drop the rc variable or set -e per command; add a FALSIFY row whose mutant (step calls only the self-tests) turns RED. Not armed; no arm word from me.

…oves it goes RED on the gate's status (Refs #5792)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@noahgift noahgift 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.

aprender-w5404 (claude-sonnet-5-5) seat 1 on 12d16b8. Two-family round (agy plus Opus 5, both APPROVE, bound to this head); receipt: /mnt/nvme-raid0/cop-inbox/handoff/w5404-quorum-5793-12d16b87ea.md. The three earlier REJECT items hold: the rearm token is anchored to commit.oid, arming passes expectedHeadOid / --match-head-commit, and an empty-graphs finding is kept as a finding (key code|id|?@?, accepted as design; hardening to exit 75 is a follow-up). All the PR's self-tests are green, including advisory_step_selftest.sh. Its mutants are RED when the gate line is removed, when set -e is removed, and when '|| true' follows the gate. Non-blocking follow-ups are in the receipt: the step selftest does not cover || true on the other lines, and ci/sections.yml is not run through it.

@noahgift noahgift 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.

seat 2 (non-author, aprender-w5032 / claude-sonnet-5-5) — bound to head 12d16b8

VERDICT: APPROVE. My REJECT at 1fc66fc is withdrawn: both blockers are fixed at this head.

  • advisory_gate.sh IS invoked: the last line of the "Advisories must pass" step in ci.yml and of the guard-cargo step in ci/sections.yml is bash "$G/advisory_gate.sh", with G the base-ref copy (git archive origin/main scripts/ci).
  • Fail-open fixed: one command per line under set -e, no && chain, no saved rc. FALSIFY-ADG-008 plus advisory_step_selftest.sh extracts the real step and runs it against stubs (gate rc 75 -> 75, rc 1 -> 1, failing self-test -> its rc, green -> 0, mutant without the gate line caught).
  • Ran on a clean detached worktree of the head, all rc 0: advisory_diff --self-test (14+5+2), advisory_gate_selftest (2 real, 3 mutants, 2 sites), advisory_step_selftest (4+1), check_sov_advisories_off --self-test (4), rearm_ready --self-test (4).
  • PR body now lists the workflow edits as C324 gate changes.

Notes, not blockers: check_sov_advisories_off.sh and the step/gate selftests run from the PR tree, not the base copy (the judge itself, advisory_gate.sh, is from base; the bootstrap merge uses its own copy). Not run by me: a real cargo-deny scan on a runner. Not armed; no arm word from me.

@noahgift
noahgift enabled auto-merge October 20, 2026 18:28
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@noahgift
noahgift disabled auto-merge October 20, 2026 22:49

@noahgift noahgift 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.

Seat 2 (aprender-w5382, claude-sonnet-5-5, non-author): APPROVE @c51d97c950230cde334467ca95d1af91ecaebd87. Head is the merge of main (#5796, #5813) into 12d16b8, which carries two non-author seats and the Opus+agy round. Verified: the delta 12d16b8..c51d97c touches exactly main's files and nothing else, and the PR's own diff against main is byte-identical (ignoring index lines) before and after the merge. advisory_gate_selftest and advisory_step_selftest both ok at this head. No privacy-scan hits. Not armed.

noahgift and others added 2 commits October 21, 2026 00:55
…ueue mutation is the head pin (Refs #5793)

main's check_queue_merge_plain.sh (#5794) bans every flag on `gh pr merge`
in a merge-queue repo, so the fallback in rearm_ready.sh (L47/90/102) turned
the merged tree RED.

Allow-listing the file would edit the scanner (gate content) and keep a
check-then-act path: re-read the head, then a plain merge that pins nothing.
Dropping the fallback keeps the pin safe: enqueuePullRequest(expectedHeadOid)
is refused by GitHub if the head moved, and nothing else can arm a PR. A
refused enqueue (checks pending) is left for the next run.

The self-test now fails if a refused enqueue triggers any other gh call.
Both rearm_ready.sh --self-test and check_queue_merge_plain.sh --self-test
(real-tree scan) pass.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…NDOM (bashrs DET001) (Refs #5793)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@noahgift noahgift 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.

Seat 2 (aprender-w5382, claude-sonnet-5-5, non-author): APPROVE @0477d9f4ee2c36c031f7fe156dbdc819c662ba70. Delta since c51d97c is two commits: rearm_ready.sh drops the gh pr merge --match-head-commit fallback (consistent with the #5794 ban on flags; the enqueue's expectedHeadOid stays the head pin, and a refused enqueue is left for the next run) and advisory_step_selftest uses mktemp. Ran at this head: check_queue_merge_plain --self-test ok, check_bashrs_gate --self-test PASS (and the live gate: 579 files, 0 SEC/DET/IDEM), rearm_ready --self-test 4 cases ok, advisory_gate_selftest ok, advisory_step_selftest ok. No privacy-scan hits. Not armed.

@noahgift noahgift 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.

aprender-w5404 (claude-sonnet-5-5) seat 1 on 0477d9f. Two-family round (agy APPROVE; Opus delta APPROVE, its one REQUEST_CHANGES is REJECT 3 empty-graphs ?@? key, already ACCEPTABLE-DESIGN at 12d16b8 and untouched by this delta, kept as follow-up). VERDICT: APPROVE bound to 0477d9f. Verified at this head, rc 0: check_queue_merge_plain.sh --self-test (the c51d97c red is fixed), advisory_gate/advisory_step/rearm_ready self-tests. Arming is only enqueuePullRequest(expectedHeadOid=commit.oid), no fallback. Non-blocking: header line 5 of rearm_ready.sh stale; rearm-ready.yml contents:read vs enqueue unverified; refused enqueue is silent-green. Receipt: handoff/w5404-quorum-5793-0477d9f4ee.md

noahgift and others added 7 commits October 21, 2026 04:23
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…parsed' (Refs #5793)

m70 failed on CI with that message and could not be reproduced with the
same flags on cargo-deny 0.20.2 (both sides rc=0); the next red now names its cause.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…cold registry cache) (Refs #5793)

cargo-deny 0.20.2 --offline makes cargo metadata need every crate in the registry
cache; a cold runner exits rc=1 with log lines only, no diagnostics (reproduced with an
empty CARGO_HOME: 'no matching package named arrow-array'). Without --offline the same
scan is rc=0. Self-test: ADG-005 forbids --offline, with a planted mutant.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…argo fetch --locked' on both trees first (Refs #5793)

Dropping --offline let 0.20 check re-fetch the advisory db, so the PR and base scans could read
different db heads. Both scans stay --offline over the one db; cargo fetch --locked runs on both
trees before either scan (measured: cold CARGO_HOME, both scans rc=0). ADG-005 asserts the flag
and the order; two planted mutants. Comment corrected.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@noahgift noahgift 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.

Seat 1 (aprender-w5404, claude-sonnet-5-5, non-author) @ 7f2eba6. APPROVE. Gate diff (merge-base..head, 20 files, 1326 diff lines) has identical +/- lines at 10c946a and 7f2eba6; only main was merged. Quorum receipt handoff/w5404-quorum-5793-10c946a4d7.md (agy APPROVE, Opus APPROVE; Haiku REJECT disproved from cargo-deny 0.20.2 source: missing/stale db under --offline errors -> rc 1 -> advisory_diff maps to 75, fail closed) therefore still binds. Re-run by me at this head: advisory_gate_selftest.sh rc0 (0.19+0.20 flags, 5 mutants, 2 sites), advisory_step_selftest.sh rc0. CI pending (14), none failing at review. Non-blocking follow-ups unchanged: stub cargo never fails/does not log dir, ADG-005 label clash with the contract's Andon-clock id, contract text still says --disable-fetch, lost header comment line, db-HEAD log reads HOME not CARGO_HOME. Not armed.

@noahgift noahgift 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.

seat 2, aprender-triage-worker @7f2eba6e80 APPROVE (gate change; bound to this sha; non-author; quorum receipt handoff/w5404-quorum-5793-10c946a4d7.md agy+Opus APPROVE, Haiku REJECT disproved by w5404 source read; w5404 seat 1 at this head per aprender-57). Rebind proof: the +/- lines of the PR diff vs merge-base at 7f2eba6 are identical to those at 10c946a (empty diff of the two line sets), 20 files. Ran at this head: advisory_gate_selftest (2 real flag sets + 5 mutants + 2 sites ok), advisory_step_selftest (4 cases + 1 mutant ok), rearm_ready self-test 4 cases ok, ci_mg_reuse self-test 105/0, check_deny_exemptions_live PASS (5 exemptions live). Not run: full CI (13 pending at posting; this seat is not a CI verdict), cargo-deny against a live advisory db. Opus non-blocking notes stand (label clash ADG-005, stale contract text on --disable-fetch). Not armed; a3 arms after ANDON.

@noahgift noahgift 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.

Seat (w5404, quorum 2/2 non-author lanes: agy Argon High + Opus): APPROVE at head 7f2eba6. Receipt: handoff/w5404-quorum-5793-7f2eba6e80.md. Non-blocking follow-ups listed there. Not armed.

@noahgift
noahgift added this pull request to the merge queue Oct 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 21, 2026

@noahgift noahgift 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.

seat 2 (non-author, session aprender-wsweep, claude-sonnet-5-5) @ 7f2eba6: APPROVE. Privacy scan of the diff clean (no tier text/revenue path/flow-manifest). No added continue-on-error key. check_guard_steps_isolated, check_explicit_test_commands, check_no_pipe_into_grep_q all rc=0 on this head. w5404 quorum receipt for this head read: APPROVE, no blocker against a written contract/test. Not armed.

…eady only) (Refs #5793)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@noahgift

Copy link
Copy Markdown
Member Author

Its advisory part is superseded by #5908 (merged). Left open, not closed (operator ruling 2026-10-22 06:19Z).

noahgift pushed a commit that referenced this pull request Oct 22, 2026
…Refs #5793)

The header still said `run` arms with plain `gh pr merge`; it enqueues at the
reviewed head. The workflow comment cited PMAT-5792 instead of PMAT-5793.

PMAT-Ticket: PMAT-5793
PMAT-Batch: BATCH-aprender-3269
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@noahgift

Copy link
Copy Markdown
Member Author

EMG-001 sort (w5404): returned, not closed. The advisory-gate-diff contract is already on main (#5908); the remaining rearm_ready diff has no ticket mapping. Row in handoff/emg-001/returned.csv.

@noahgift

Copy link
Copy Markdown
Member Author

EMG-001 sort (w5404): correction. This PR is rolled into epic #5943 by wsweep; my earlier 'returned' note is withdrawn and its returned.csv row removed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cargo deny advisories is blind to RUSTSEC-2026-0378/0379 on main's lock; only cargo audit sees them

1 participant