From 2ac921a219dc5478c435f25ed772c5cad4a14854 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 19:35:44 +0000 Subject: [PATCH 1/7] Refuse a grade that stands on a receipt recording failure scripts/pwg-derive.sh read a receipt's state but never its result. Measured against main 0dceab6: flipping this repository's Agda receipt to "result": "fail" while leaving "state": "current" left the derived census byte-identical -- 17 PWG-3 grades still published on a receipt recording the checker rejecting the development -- and pwg-check.sh exited 0. A grade may not outlive the run that earned it. usable_receipt and pwg3_receipt now both require result == "pass", and rule 3 constrains result to the closed vocabulary pass|fail so an unrecognised value is an error rather than a silent non-pass. With the fix the same planted receipt collapses the census to PWG-3 0, ungraded 24. Canaries 20 and 21 plant those two cases. Both were confirmed to FAIL against the pre-fix scripts and pass against these, so they are evidence rather than decoration; the suite is 21/21. Two refusals worth recording, each tried and rejected on evidence: SC1112 could not be fixed the obvious way. That comment sits inside the single-quoted jq program, so swapping the Unicode right-quote for a plain apostrophe terminated the string and broke the script -- caught at once by the suite's own live-ledger canary. The comment is reworded to contain no apostrophe, and the block carries a warning saying why. SC2030/SC2031 were not silenced. The meta-canary shadowed PASS/FAIL inside a command substitution to discard the probe's deliberate failure, which tainted ten later reads of the real counters; silencing those to keep one deliberate shadow would blind the check where it does genuine work. It now reads the probe's verdict line instead, so the warnings go by construction. shellcheck 0.11.0 --severity=style, the version and severity CI pins, is clean over every tracked *.sh with no disable added. CHANGELOG also corrects two stale claims that merged with #114: an internal 18/18 vs 19/19 contradiction, and a "both theory groups ungraded" line the published census (17 PWG-3, 7 ungraded) contradicts. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01J4QvDh3p24SCUjyM9HHT31 --- CHANGELOG.adoc | 49 ++++++++++++++++++++++++----- scripts/pwg-check.sh | 2 +- scripts/pwg-derive.sh | 24 +++++++++++--- scripts/test-gate-falsifiability.sh | 33 ++++++++++++++++--- 4 files changed, 91 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 976f692..7d148b1 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -10,6 +10,35 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. ==== Fixed +* *A receipt that records FAILURE no longer supports a grade (2026-11-16).* +`+scripts/pwg-derive.sh+` read a receipt's `+state+` but never its `+result+`. +Measured against `+main+` `+0dceab6+`: flipping this repository's Agda receipt to +`+"result": "fail"+` while leaving `+"state": "current"+` left the derived census +*byte-identical* — 17 `+PWG-3+` grades still published on a receipt recording the +checker *rejecting* the development — and `+scripts/pwg-check.sh+` exited `+0+`. +A grade may not outlive the run that earned it; a regressed run is §8.2 evidence +of the opposite. `+usable_receipt+` and `+pwg3_receipt+` now both require +`+result == "pass"+`, and rule 3 constrains `+result+` to the closed vocabulary +`+pass|fail+` so an unrecognised value is an error rather than a silent +non-pass. With the fix the same planted receipt collapses the census to +`+PWG-3+` 0, `+ungraded+` 24. Canaries 20 and 21 plant exactly these two cases +and were confirmed to FAIL against the pre-fix scripts; the suite is now +*21/21*. ++ +Two things this change did *not* do are worth recording, because each was tried +and rejected on evidence. The ShellCheck `+SC1112+` warning on `+pwg-derive.sh+` +could not be fixed the obvious way: that comment sits inside the single-quoted +`+jq+` program, so replacing the Unicode right-quote with a plain apostrophe +*terminated the string* and broke the script — caught immediately by the suite's +own live-ledger canary. The comment is reworded to contain no apostrophe at all, +and the block now carries a warning saying why. And `+SC2030+`/`+SC2031+` were +not silenced: the meta-canary shadowed `+PASS+`/`+FAIL+` inside a command +substitution to discard the probe's deliberate failure, which tainted *ten* +later reads of the real counters. It now reads the probe's verdict line instead, +so the warnings go away by construction rather than by suppression. +`+shellcheck 0.11.0 --severity=style+` — the version and severity CI pins — is +clean over every tracked `+*.sh+`, with no disable added. + * *A comment marker inside a string literal is no longer read as a comment (2026-11-09).* `+tests/lib/strip-proof-comments.awk+` tracked block comments with no notion of string literals, so `+def m : String := "/-"+` opened a block @@ -65,7 +94,8 @@ count is now part of the claim. + Added canary 19, the *meta-canary*: it breaks one canary's own `+jq+` program and asserts the suite reports FAILURE. It fails against the pre-fix harness, which -is what makes it evidence rather than decoration. The suite is *19/19*, and all +is what makes it evidence rather than decoration. The suite stands at *21/21* +once the receipt-result canaries recorded below are counted, and all four breakages — a corrupted transform, a no-op fixture, a dropped group, and a suite that cannot see its own breakage — were each confirmed to fail it. @@ -102,7 +132,8 @@ Wired: `+just pwg+` (census and per-obligation grades), `+just pwg-render+` job in `+proofs.yml+` that needs no prover because the kernels already ran. + Falsified, not assumed: `+scripts/test-gate-falsifiability.sh+` gains seven PWG -canaries plus a control, and the suite now runs 18/18. Two are load-bearing — +canaries plus a control, taking the suite to 18 cases at that point (it stands at +*21/21* after the later entries in this same block). Two are load-bearing — removing the import cone collapses all 17 `+PWG-3+` to `+ungraded+` (census `+ungraded+` 24), and flipping one Lean leg to `+RECONCILED+` lifts that obligation to `+PWG-2i+` — so they fire only if the published table really is @@ -113,11 +144,15 @@ receipts, the derivation returns `+PWG-1+`. * *Proof Witness Grades recorded, and the proof records reconciled with the sources (2026-11-09).* `+docs/status/PROOF-STATUS.adoc+` gains the §8.5 PWG record -that `+PROOF-POLICY.adoc+` §8 (owner ruling 2026-11-04) requires, with both theory -groups derived as `+ungraded+` — Theorem B for want of a §2.1-conformant *receipt* -(its flags in force already are §2.1), the Lean-witnessed results for want of an -Agda *source* — plus the §1.1 import-cone record and a census in the form §8.4 -rule 7 allows. Four published rows narrowed to what the provers actually state: L3 +that `+PROOF-POLICY.adoc+` §8 (owner ruling 2026-11-04) requires, plus the §1.1 +import-cone record and a census in the form §8.4 rule 7 allows. *As first +drafted this entry read "both theory groups derived as `+ungraded+`"; that +reading was superseded within this same block* by the evidence ledger below, +which records the §2.1-conformant Agda receipt the first reading treated as +missing, and so derives `+PWG-3+` for 17 of the 24 theory obligations and +`+ungraded+` for 7 — on the two §8.1 grounds originally named: no +§2.1-conformant receipt, or no Agda source at all. The published census is the +derived one, and `+scripts/pwg-check.sh+` fails on any drift between them. Four published rows narrowed to what the provers actually state: L3 (two-sidedness is stated only for `+Falsified+` in Agda), L4 (Agda covers fate and fidelity; Lean covers fate; bond, merge and the grade-level lifting have an Idris2 leg only, which §8.1 excludes from the ladder), Target 3 (`+_↝_+` has two diff --git a/scripts/pwg-check.sh b/scripts/pwg-check.sh index b33b977..c3cc80a 100755 --- a/scripts/pwg-check.sh +++ b/scripts/pwg-check.sh @@ -79,7 +79,7 @@ badr=$(jq -r ' (if ($v.checker_version // "" | length) > 0 then empty else "\($k): no checker_version (8.2)" end), (if ($v.invocation // "" | length) > 0 then empty else "\($k): no invocation (8.2)" end), (if ($v.inputs_digest // "" | length) > 0 then empty else "\($k): no inputs_digest (8.2)" end), - (if ($v.result // "" | length) > 0 then empty else "\($k): no result (8.2)" end), + (if ($v.result // "" | test("^(pass|fail)$")) then empty else "\($k): result must be pass|fail (8.2 -- the derivation reads it; an unrecognised value must not be treated as a pass)" end), (if ($v.evidence // "" | length) > 0 then empty else "\($k): no evidence pointer" end), (if ($v.state // "" | test("^(current|superseded|regressed)$")) then empty else "\($k): state must be current|superseded|regressed (8.4 rule 5)" end), (if ($v | has("axioms")) then empty else "\($k): no axioms list (8.4 rule 6 — axioms travel with the grade)" end) ] diff --git a/scripts/pwg-derive.sh b/scripts/pwg-derive.sh index 02360ad..72542c8 100755 --- a/scripts/pwg-derive.sh +++ b/scripts/pwg-derive.sh @@ -40,14 +40,29 @@ command -v jq >/dev/null || { echo "pwg-derive: jq is required" >&2; exit 2; } # --------------------------------------------------------------------------- # shellcheck disable=SC2016 # single quotes are REQUIRED: $a/$c/$l/$t/$R below are # jq variables, and the shell must not expand them. +# +# CONSEQUENCE, and it has bitten twice: NO APOSTROPHE MAY APPEAR ANYWHERE INSIDE +# THIS BLOCK, comments included. One closes the string, and what follows is read +# as shell. Write "the receipt of the leg", never "the leg's receipt". The first +# occurrence here was a Unicode right-quote, which survived only because it is +# not an ASCII apostrophe; "fixing" SC1112 by swapping in a plain one broke the +# script. Reword instead. DERIVE=' # A section 5 token that means the kernel accepted it. def accepted: . == "PROVEN" or . == "PROVEN-WITH-AXIOMS"; - # A receipt is usable when it is the current one and names a full 40-char commit - # (8.2 PWG-1: "the source repository and its full 40-character commit"). + # A receipt is usable when it is the current one, RECORDS A PASS, and names a + # full 40-char commit (8.2 PWG-1: "the source repository and its full + # 40-character commit"). + # + # The result check is load-bearing, not decorative. Measured 2026-11-16 against + # main 0dceab6: flipping the Agda receipt of this ledger to "result": "fail" while + # leaving "state": "current" left the census byte-identical -- 17 PWG-3 grades + # published on a receipt that records the checker REJECTING the development -- + # and scripts/pwg-check.sh exited 0. A grade may not outlive the run that + # earned it; a regressed run is 8.2 evidence of the opposite. def usable_receipt($rs): $rs - | map(select(.state == "current" and (.commit | test("^[0-9a-f]{40}$")))) + | map(select(.state == "current" and .result == "pass" and (.commit | test("^[0-9a-f]{40}$")))) | length > 0; # 8.2 PWG-3 additionally requires the receipt to record the checker version, @@ -55,6 +70,7 @@ DERIVE=' def pwg3_receipt($rs): $rs | map(select( .state == "current" + and .result == "pass" and (.commit | test("^[0-9a-f]{40}$")) and (.checker_version // "" | length > 0) and (.stdlib_pin // "" | length > 0) @@ -69,7 +85,7 @@ DERIVE=' # PROVEN-WITH-AXIOMS and its 2.2 correspondence state is RECONCILED." And: # a waived leg, an unavailable leg and any BRIDGE-PENDING leg do not count. # Also require at least one current receipt with a full 40-character commit, - # resolving the leg’s receipt IDs through the supplied receipt map. + # resolving the receipt IDs of the leg through the supplied receipt map. def counts($leg; $receipts): ($leg.token | accepted) and $leg.state == "RECONCILED" diff --git a/scripts/test-gate-falsifiability.sh b/scripts/test-gate-falsifiability.sh index 2fe424c..348aa10 100755 --- a/scripts/test-gate-falsifiability.sh +++ b/scripts/test-gate-falsifiability.sh @@ -225,6 +225,22 @@ pwg_canaries() { pwg_case reject "flipping a Lean leg to RECONCILED changes the grade and is rejected" \ '(.theorems[] | select(.id == "L1") | .legs.lean.state) |= "RECONCILED"' \ "not the derived one" + # R11. A grade may not outlive the run that earned it. Measured against main + # 0dceab6 these two PASSED the gate: the derivation read .state but never + # .result, so a receipt recording the checker REJECTING the development still + # carried 17 PWG-3 grades, and an unrecognised result was not a pass but was + # not an error either. Both canaries FAIL against the pre-fix scripts. + # "fail" is a LEGITIMATE recorded value, so rule 3 admits it; the rejection + # must come from the grades themselves collapsing. Measured 2026-11-16: with + # the Agda receipt at result=fail the census goes PWG-3 17 -> 0 and ungraded + # 7 -> 24, so the published table is no longer the derived one. Against the + # pre-fix scripts the census was byte-identical and this canary did not fire. + pwg_case reject "a receipt that records result=fail cannot support a grade" \ + '.receipts["agda-c0eb4f1"].result = "fail"' \ + "not the derived one" + pwg_case reject "a receipt result outside the closed vocabulary is rejected" \ + '.receipts["agda-c0eb4f1"].result = "probably-fine"' \ + "result must be pass|fail" } # --- META (R10 applied to R10): the suite must detect breakage in ITS OWN fixtures. @@ -234,10 +250,17 @@ pwg_canaries() { # reports FAILURE. Measured: this canary FAILS against the pre-fix harness. meta_canary() { local out - out=$( PASS=0; FAIL=0 - pwg_case reject "meta-probe (expected to be reported as FAILING)" '.theorems[0].pwg = ' >/dev/null 2>&1 - printf 'FAILCOUNT=%s' "$FAIL" ) - if printf '%s' "$out" | grep -q 'FAILCOUNT=1'; then + # Isolation by subshell is the POINT: the meta-probe is MEANT to fail, and its + # failure must not reach the suite tally. Read its VERDICT LINE rather than a + # counter. An earlier version shadowed PASS/FAIL inside the substitution to + # discard them; that worked, but ShellCheck then marked every later read of + # those names SC2031 across the whole tally block, and silencing ten warnings + # on the real counters to keep one deliberate shadow is a bad trade -- it + # blinds the check where it would do genuine work. Nothing is assigned here + # that the outer shell reads, so the warnings go away by construction instead + # of by suppression. + out=$( pwg_case reject "meta-probe (expected to be reported as FAILING)" '.theorems[0].pwg = ' 2>&1 ) + if printf '%s\n' "$out" | grep -q '^FAIL '; then ok "a canary whose own jq program is broken is reported as FAILURE (meta-canary)" else bad "a BROKEN canary still reported PASS — the suite cannot detect its own breakage" @@ -251,7 +274,7 @@ meta_canary echo # A canary group that silently stops running used to report "10/10" and exit 0. # The count is part of the claim. -EXPECTED_CASES=19 +EXPECTED_CASES=21 if [ "$((PASS+FAIL))" -ne "$EXPECTED_CASES" ]; then echo "gate falsifiability canaries: $((PASS+FAIL)) cases ran, $EXPECTED_CASES expected — a canary group did not run" exit 1 From c8d6c5cb9df63c45fe9b52ff8944d3c2817f03e0 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 19:38:27 +0000 Subject: [PATCH 2/7] Narrow two prose claims to what the provers actually state Both were raised in review on #114 and merged unaddressed. README said psiBond "separates honest from deceptive bonds". The Lean file states one pair: psiBond_separates_honest_deceptive is psiBond Bond.severed != psiBond Bond.misbound, by total != unknown. The general claim is believed and is a single `cases` away -- psiBond intact and psiBond withheld are both Q 0, and Q_ne_unknown is already in the same file -- but it is not a theorem today, so the README no longer asserts it. It is not added here because no Lean toolchain was available to check it, and an unverified theorem in a proof file is precisely what these gates exist to stop. INTERFACE-REPORT's F4 checklist said "the deceptive tier is forward-closed (L5)". The same checklist refutes that two bullets above: the fate TIER is not closed under the composition on the RIGHT, and fate-tier-meet-hom-fails is the witness -- dropped |>f atten unknown reduces to dropped, which is honestLossy, although atten unknown is tier-deceptive, because collapse discards the fidelity coordinate the deceptive unknown was living in. What Agda proves is deceptive-absorbs-|>: the grade-level PREDICATE, closed in its LEFT argument. Both qualifications now appear, with the distinction TB/Tier.agda already drew in a comment ("does not launder the GRADE-level deceptive predicate") lifted into the report. No proof statement, carrier or ADR decision is changed; this makes the prose match the proofs. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01J4QvDh3p24SCUjyM9HHT31 --- CHANGELOG.adoc | 22 +++++++++++++++++++ README.adoc | 9 ++++++-- .../agda/theorem-b/INTERFACE-REPORT.adoc | 16 ++++++++++++-- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 7d148b1..58a2e3a 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -10,6 +10,28 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. ==== Fixed +* *Two prose claims narrowed to what the provers actually state (2026-11-16).* +Both were raised in review on #114 and merged unaddressed. ++ +`+README.adoc+` said `+psiBond+` "separates honest from deceptive bonds". The Lean +file states one pair: `+psiBond_separates_honest_deceptive+` is +`+psiBond Bond.severed ≠ psiBond Bond.misbound+`, by `+total ≠ unknown+`. The +general claim is believed and is a single `+cases+` away — `+psiBond intact+` and +`+psiBond withheld+` are both `+Q 0+`, and `+Q_ne_unknown+` is already in the same +file — but it is *not* a theorem today, so the README no longer asserts it. It is +not added here because no Lean toolchain was available to check it, and an +unverified theorem in a proof file is the thing these gates exist to stop. ++ +`+INTERFACE-REPORT.adoc+`'s F4 checklist said "the deceptive tier is +forward-closed (L5)". The checklist refutes that two bullets above: the fate +*tier* is not closed under `+▷+` on the right, and `+fate-tier-meet-hom-fails+` is +the witness — `+dropped ▷f atten unknown+` reduces to `+dropped+`, which is +`+honestLossy+`, although `+atten unknown+` is tier-deceptive. What Agda proves is +`+deceptive-absorbs-▷+`: the grade-level *predicate*, closed in its *left* +argument. Both qualifications now appear, with the distinction `+TB/Tier.agda+` +already drew in a comment ("does not launder the GRADE-level deceptive +predicate") lifted into the report. + * *A receipt that records FAILURE no longer supports a grade (2026-11-16).* `+scripts/pwg-derive.sh+` read a receipt's `+state+` but never its `+result+`. Measured against `+main+` `+0dceab6+`: flipping this repository's Agda receipt to diff --git a/README.adoc b/README.adoc index b05686d..95bd613 100644 --- a/README.adoc +++ b/README.adoc @@ -74,8 +74,13 @@ rejects them at validation, naming the offending coordinate. The alternative | `verification/proofs/lean4/grade-boundary/` | The grade-algebra ground truth (Lean 4 + Mathlib): the three-tier honest/deceptive cancellation boundary. No `sorryAx` and no user axiom; the kernel reports `propext` and `Quot.sound`, and `Classical.choice` in three theorems. | `verification/proofs/lean4/grade-factorisation/` | The tropical factorisation probe (Lean 4 + Mathlib): imports the carrier and decides whether the grade admits a commutative cost-quotient. Verdict *(B) factors but veridicality-blind* on the *pre-ratification* carrier; re-run on the ratified carrier it becomes *(B′) sighted on the fate axis* — `piR` separates honest `Dropped` from deceptive `Falsified`, and reads the four fate slots -only; `psiBond` separates honest from deceptive bonds -(`GradeFactorisation.lean`). A precondition only; does not address recursion (CO-1). +only; on the bond axis `psiBond` is proved to separate the honest `severed` from +the deceptive `misbound` (`psiBond_separates_honest_deceptive`, via +`total ≠ unknown`, in `GradeFactorisation.lean`). That is the *one pair* the file +states; the general "separates every honest bond from every deceptive one" is +believed and is a single `cases` away — `psiBond intact = psiBond withheld = Q 0` +and `Q_ne_unknown` is already in the file — but it is not currently a theorem, +so it is not claimed here. A precondition only; does not address recursion (CO-1). | `verification/proofs/agda/theorem-b/` | Theorem B — the deferred calculus metatheory (Agda `--safe --without-K --cubical-compatible`, the PROOF-POLICY §2.1 invocation; zero postulates): intrinsic graded calculus, value-substitution, subject reduction (β/let; `fix` open), Honest Generation. | `verification/proofs/INTEGRATION-REPORT.adoc` | How the three streams reconcile: the unified R-id ↔ Lean ↔ Agda ↔ status table, the convergence (central open problem), and the divergence adjudication. | `docs/CONTRIBUTING-A-FRONTEND.adoc` | How a new front-end targets the IR (the portability contract). diff --git a/verification/proofs/agda/theorem-b/INTERFACE-REPORT.adoc b/verification/proofs/agda/theorem-b/INTERFACE-REPORT.adoc index 8ba8317..ab6cf69 100644 --- a/verification/proofs/agda/theorem-b/INTERFACE-REPORT.adoc +++ b/verification/proofs/agda/theorem-b/INTERFACE-REPORT.adoc @@ -279,9 +279,21 @@ realised dynamically: the deceptive states are unreachable by construction. (`cut-symmetric-fails`) and the tier finding (`fate-tier-meet-hom-fails`) both DEPEND on F2 and would be false under a commutative model. * F4 (three-tier boundary) is preserved as a *structure* subject reduction respects: - the cancellative core is closed and cancels; the deceptive tier is forward-closed - (L5); the honest-but-lossy middle is shown non-cancellative by witnesses; and the + the cancellative core is closed and cancels; the GRADE-LEVEL deceptive predicate + is closed under `▷` in its LEFT argument (`deceptive-absorbs-▷`, total — L5); + the honest-but-lossy middle is shown non-cancellative by witnesses; and the one place a clean homomorphism would over-claim is exhibited as a refuted finding. + *Both qualifications on that second clause are load-bearing, and an earlier + draft of this line carried neither.* It read "the deceptive tier is + forward-closed", which this very checklist refutes two bullets up: the fate + TIER is not closed under `▷` on the RIGHT, and `fate-tier-meet-hom-fails` is + the witness — `dropped ▷f atten unknown` reduces to `dropped`, which is + `honestLossy`, although `atten unknown` is tier-deceptive, because collapse + discards the fidelity coordinate the deceptive `unknown` was living in. What + is forward-closed is the grade-level *predicate* from the left, which is a + different statement and the one Agda proves. `TB/Tier.agda` records the + distinction explicitly: the collapse "does not launder the GRADE-level + deceptive predicate". No statement was silently restricted to make it go through; every scoping choice (presence-coarseness, `fuse` omission, `fix` NOT-REACHED) is stated explicitly. From f37b92c2c5781045718f55daa3d64fa8ba8818d0 Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Mon, 16 Nov 2026 19:54:26 +0000 Subject: [PATCH 3/7] fix(pwg): reject receipt results with trailing newlines --- CHANGELOG.adoc | 10 ++++++---- scripts/pwg-check.sh | 2 +- scripts/test-gate-falsifiability.sh | 7 ++++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 58a2e3a..2448e00 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -155,7 +155,7 @@ job in `+proofs.yml+` that needs no prover because the kernels already ran. + Falsified, not assumed: `+scripts/test-gate-falsifiability.sh+` gains seven PWG canaries plus a control, taking the suite to 18 cases at that point (it stands at -*21/21* after the later entries in this same block). Two are load-bearing — +*22/22* after the later entries in this same block). Two are load-bearing — removing the import cone collapses all 17 `+PWG-3+` to `+ungraded+` (census `+ungraded+` 24), and flipping one Lean leg to `+RECONCILED+` lifts that obligation to `+PWG-2i+` — so they fire only if the published table really is @@ -172,9 +172,11 @@ drafted this entry read "both theory groups derived as `+ungraded+`"; that reading was superseded within this same block* by the evidence ledger below, which records the §2.1-conformant Agda receipt the first reading treated as missing, and so derives `+PWG-3+` for 17 of the 24 theory obligations and -`+ungraded+` for 7 — on the two §8.1 grounds originally named: no -§2.1-conformant receipt, or no Agda source at all. The published census is the -derived one, and `+scripts/pwg-check.sh+` fails on any drift between them. Four published rows narrowed to what the provers actually state: L3 +`+ungraded+` for 7 — on three §8.1 grounds: no §2.1-conformant receipt, no +Agda source at all, or an incomplete Agda leg. The last applies to +`+retention-order+` and `+tier2-membership+`: their Agda token is `+OPEN+` +despite a current, passing Agda receipt, as the ledger and breakdown above record. +The published census is the derived one, and `+scripts/pwg-check.sh+` fails on any drift between them. Four published rows narrowed to what the provers actually state: L3 (two-sidedness is stated only for `+Falsified+` in Agda), L4 (Agda covers fate and fidelity; Lean covers fate; bond, merge and the grade-level lifting have an Idris2 leg only, which §8.1 excludes from the ladder), Target 3 (`+_↝_+` has two diff --git a/scripts/pwg-check.sh b/scripts/pwg-check.sh index c3cc80a..34a4907 100755 --- a/scripts/pwg-check.sh +++ b/scripts/pwg-check.sh @@ -79,7 +79,7 @@ badr=$(jq -r ' (if ($v.checker_version // "" | length) > 0 then empty else "\($k): no checker_version (8.2)" end), (if ($v.invocation // "" | length) > 0 then empty else "\($k): no invocation (8.2)" end), (if ($v.inputs_digest // "" | length) > 0 then empty else "\($k): no inputs_digest (8.2)" end), - (if ($v.result // "" | test("^(pass|fail)$")) then empty else "\($k): result must be pass|fail (8.2 -- the derivation reads it; an unrecognised value must not be treated as a pass)" end), + (if ($v.result == "pass" or $v.result == "fail") then empty else "\($k): result must be pass|fail (8.2 -- the derivation reads it; an unrecognised value must not be treated as a pass)" end), (if ($v.evidence // "" | length) > 0 then empty else "\($k): no evidence pointer" end), (if ($v.state // "" | test("^(current|superseded|regressed)$")) then empty else "\($k): state must be current|superseded|regressed (8.4 rule 5)" end), (if ($v | has("axioms")) then empty else "\($k): no axioms list (8.4 rule 6 — axioms travel with the grade)" end) ] diff --git a/scripts/test-gate-falsifiability.sh b/scripts/test-gate-falsifiability.sh index 348aa10..5460b77 100755 --- a/scripts/test-gate-falsifiability.sh +++ b/scripts/test-gate-falsifiability.sh @@ -241,6 +241,11 @@ pwg_canaries() { pwg_case reject "a receipt result outside the closed vocabulary is rejected" \ '.receipts["agda-c0eb4f1"].result = "probably-fine"' \ "result must be pass|fail" + # `$` in a regex can match before a final newline. Require the vocabulary + # diagnostic so rejection for derived-table drift cannot mask this defect. + pwg_case reject "a receipt result with a trailing newline is rejected" \ + '.receipts["agda-c0eb4f1"].result = "pass\n"' \ + "result must be pass[|]fail" } # --- META (R10 applied to R10): the suite must detect breakage in ITS OWN fixtures. @@ -274,7 +279,7 @@ meta_canary echo # A canary group that silently stops running used to report "10/10" and exit 0. # The count is part of the claim. -EXPECTED_CASES=21 +EXPECTED_CASES=22 if [ "$((PASS+FAIL))" -ne "$EXPECTED_CASES" ]; then echo "gate falsifiability canaries: $((PASS+FAIL)) cases ran, $EXPECTED_CASES expected — a canary group did not run" exit 1 From da0d68012d0c0f5f2d95611119181a41a5e4465e Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 22:28:08 +0000 Subject: [PATCH 4/7] Anchor every PWG vocabulary and commit check at the true string end jq's `$` matches before a final newline, so a 40-hex commit followed by "\n" passed rule 3 and both derivation predicates: measured, the whole gate accepted it and the grade stood on a malformed provenance field. The state, token, 2.2-state and route vocabularies had the same hole. All seven anchors are now \A...\z (f37b92c had fixed the eighth, `result`, by exact equality). Canaries 23 and 24 plant a trailing newline on a commit and on a token. Both FAIL against the pre-fix scripts (the commit case is accepted outright; the token case is rejected only for derived-table drift, not for the vocabulary) and PASS against the fix. Suite 24/24. CHANGELOG: the suite count read 21/21 in two places and 22/22 in a third; all three now read 24/24, and the entry records the anchor fix. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDim4mMEfCer9SiAV4H --- CHANGELOG.adoc | 17 +++++++++++++---- scripts/pwg-check.sh | 10 +++++----- scripts/pwg-derive.sh | 4 ++-- scripts/test-gate-falsifiability.sh | 11 ++++++++++- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 2448e00..fabe935 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -44,8 +44,17 @@ of the opposite. `+usable_receipt+` and `+pwg3_receipt+` now both require `+pass|fail+` so an unrecognised value is an error rather than a silent non-pass. With the fix the same planted receipt collapses the census to `+PWG-3+` 0, `+ungraded+` 24. Canaries 20 and 21 plant exactly these two cases -and were confirmed to FAIL against the pre-fix scripts; the suite is now -*21/21*. +and were confirmed to FAIL against the pre-fix scripts. Canary 22 plants a +`+result+` of `+"pass\n"+`: jq's `+$+` anchor matches before a final newline, so +the rule-3 check admitted it. Rule 3 now compares `+result+` by exact equality. ++ +The same defect sat in the seven sibling anchors: the commit check in rule 3 +and in both derivation predicates, and the `+state+`, token, §2.2-state and route +vocabularies. Measured: a 40-hex commit followed by a newline passed the *whole* +gate, derivation included, so a malformed provenance field could carry a grade. +All seven are now anchored with `+\A…\z+`. Canaries 23 and 24 plant a trailing newline on a +commit and on a token; both FAIL against the pre-fix scripts and PASS against +the fix. The suite is now *24/24*. + Two things this change did *not* do are worth recording, because each was tried and rejected on evidence. The ShellCheck `+SC1112+` warning on `+pwg-derive.sh+` @@ -116,7 +125,7 @@ count is now part of the claim. + Added canary 19, the *meta-canary*: it breaks one canary's own `+jq+` program and asserts the suite reports FAILURE. It fails against the pre-fix harness, which -is what makes it evidence rather than decoration. The suite stands at *21/21* +is what makes it evidence rather than decoration. The suite stands at *24/24* once the receipt-result canaries recorded below are counted, and all four breakages — a corrupted transform, a no-op fixture, a dropped group, and a suite that cannot see its own breakage — were each confirmed to fail it. @@ -155,7 +164,7 @@ job in `+proofs.yml+` that needs no prover because the kernels already ran. + Falsified, not assumed: `+scripts/test-gate-falsifiability.sh+` gains seven PWG canaries plus a control, taking the suite to 18 cases at that point (it stands at -*22/22* after the later entries in this same block). Two are load-bearing — +*24/24* after the later entries in this same block). Two are load-bearing — removing the import cone collapses all 17 `+PWG-3+` to `+ungraded+` (census `+ungraded+` 24), and flipping one Lean leg to `+RECONCILED+` lifts that obligation to `+PWG-2i+` — so they fire only if the published table really is diff --git a/scripts/pwg-check.sh b/scripts/pwg-check.sh index 34a4907..b907ee1 100755 --- a/scripts/pwg-check.sh +++ b/scripts/pwg-check.sh @@ -74,14 +74,14 @@ missing=$(jq -r ' badr=$(jq -r ' .receipts | to_entries[] | .key as $k | .value as $v - | [ (if ($v.commit // "" | test("^[0-9a-f]{40}$")) then empty else "\($k): commit is not a full 40-char sha" end), + | [ (if ($v.commit // "" | test("\\A[0-9a-f]{40}\\z")) then empty else "\($k): commit is not a full 40-char sha" end), (if ($v.checker // "" | length) > 0 then empty else "\($k): no checker" end), (if ($v.checker_version // "" | length) > 0 then empty else "\($k): no checker_version (8.2)" end), (if ($v.invocation // "" | length) > 0 then empty else "\($k): no invocation (8.2)" end), (if ($v.inputs_digest // "" | length) > 0 then empty else "\($k): no inputs_digest (8.2)" end), (if ($v.result == "pass" or $v.result == "fail") then empty else "\($k): result must be pass|fail (8.2 -- the derivation reads it; an unrecognised value must not be treated as a pass)" end), (if ($v.evidence // "" | length) > 0 then empty else "\($k): no evidence pointer" end), - (if ($v.state // "" | test("^(current|superseded|regressed)$")) then empty else "\($k): state must be current|superseded|regressed (8.4 rule 5)" end), + (if ($v.state // "" | test("\\A(current|superseded|regressed)\\z")) then empty else "\($k): state must be current|superseded|regressed (8.4 rule 5)" end), (if ($v | has("axioms")) then empty else "\($k): no axioms list (8.4 rule 6 — axioms travel with the grade)" end) ] | .[]' "$LEDGER") \ || die "rule 3 (receipt completeness) could not be evaluated over this ledger: malformed theorem/leg/receipt shape" @@ -93,7 +93,7 @@ badr=$(jq -r ' badtok=$(jq -r ' [ .theorems[] as $t | ($t.legs | to_entries[]) - | select((.value.token // "") | test("^(PROVEN|PROVEN-WITH-AXIOMS|TESTED|ASSUMED|OPEN)$") | not) + | select((.value.token // "") | test("\\A(PROVEN|PROVEN-WITH-AXIOMS|TESTED|ASSUMED|OPEN)\\z") | not) | "\($t.id)/\(.key): token \(.value.token)" ] | .[]' "$LEDGER") \ || die "rule 4 (section 5 tokens) could not be evaluated over this ledger: malformed theorem/leg/receipt shape" @@ -102,7 +102,7 @@ badtok=$(jq -r ' badstate=$(jq -r ' [ .theorems[] as $t | ($t.legs | to_entries[]) - | select((.value.state // "") | test("^(AGDA-PENDING|AGDA-VERIFIED|COQ-CHECKED|LEAN-CHECKED|BRIDGE-PENDING|RECONCILED|COUNTEREXAMPLE|QUARANTINED|NOT-INVENTORIED)$") | not) + | select((.value.state // "") | test("\\A(AGDA-PENDING|AGDA-VERIFIED|COQ-CHECKED|LEAN-CHECKED|BRIDGE-PENDING|RECONCILED|COUNTEREXAMPLE|QUARANTINED|NOT-INVENTORIED)\\z") | not) | "\($t.id)/\(.key): state \(.value.state)" ] | .[]' "$LEDGER") \ || die "rule 4 (2.2 states) could not be evaluated over this ledger: malformed theorem/leg/receipt shape" @@ -111,7 +111,7 @@ badstate=$(jq -r ' badroute=$(jq -r ' [ .theorems[] as $t | ($t.legs | to_entries[]) - | select((.value.route // "") | test("^(transported|re-proved|waived|unavailable)$") | not) + | select((.value.route // "") | test("\\A(transported|re-proved|waived|unavailable)\\z") | not) | "\($t.id)/\(.key): route \(.value.route)" ] | .[]' "$LEDGER") \ || die "rule 4 (8.5 routes) could not be evaluated over this ledger: malformed theorem/leg/receipt shape" diff --git a/scripts/pwg-derive.sh b/scripts/pwg-derive.sh index 72542c8..b1f9e80 100755 --- a/scripts/pwg-derive.sh +++ b/scripts/pwg-derive.sh @@ -62,7 +62,7 @@ DERIVE=' # and scripts/pwg-check.sh exited 0. A grade may not outlive the run that # earned it; a regressed run is 8.2 evidence of the opposite. def usable_receipt($rs): $rs - | map(select(.state == "current" and .result == "pass" and (.commit | test("^[0-9a-f]{40}$")))) + | map(select(.state == "current" and .result == "pass" and (.commit | test("\\A[0-9a-f]{40}\\z")))) | length > 0; # 8.2 PWG-3 additionally requires the receipt to record the checker version, @@ -71,7 +71,7 @@ DERIVE=' | map(select( .state == "current" and .result == "pass" - and (.commit | test("^[0-9a-f]{40}$")) + and (.commit | test("\\A[0-9a-f]{40}\\z")) and (.checker_version // "" | length > 0) and (.stdlib_pin // "" | length > 0) and (.import_cone // "" | length > 0) diff --git a/scripts/test-gate-falsifiability.sh b/scripts/test-gate-falsifiability.sh index 5460b77..82a6a44 100755 --- a/scripts/test-gate-falsifiability.sh +++ b/scripts/test-gate-falsifiability.sh @@ -246,6 +246,15 @@ pwg_canaries() { pwg_case reject "a receipt result with a trailing newline is rejected" \ '.receipts["agda-c0eb4f1"].result = "pass\n"' \ "result must be pass[|]fail" + # The same defect in the seven sibling anchors: jq's $ accepts a final + # newline, so a 40-hex commit + "\n" and a token + "\n" were admitted. The + # anchors are now \\A...\\z. Both canaries FAIL against the pre-fix scripts. + pwg_case reject "a receipt commit with a trailing newline is rejected" \ + '.receipts["agda-c0eb4f1"].commit += "\n"' \ + "not a full 40-char sha" + pwg_case reject "a section 5 token with a trailing newline is rejected" \ + '.theorems[0].legs.agda.token += "\n"' \ + "section 5 closed vocabulary" } # --- META (R10 applied to R10): the suite must detect breakage in ITS OWN fixtures. @@ -279,7 +288,7 @@ meta_canary echo # A canary group that silently stops running used to report "10/10" and exit 0. # The count is part of the claim. -EXPECTED_CASES=22 +EXPECTED_CASES=24 if [ "$((PASS+FAIL))" -ne "$EXPECTED_CASES" ]; then echo "gate falsifiability canaries: $((PASS+FAIL)) cases ran, $EXPECTED_CASES expected — a canary group did not run" exit 1 From bedc32f27c6aabe40c2f882ccb1abc959e061916 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 23:05:42 +0000 Subject: [PATCH 5/7] Contain the dispatch job's egress instead of auditing it Hypatia RE002 (high, gating) on main 0dceab6, scheduled run 43656845018: instant-sync.yml ran harden-runner with `egress-policy: audit`, which records but never blocks, on a push-to-main job that holds FARM_DISPATCH_TOKEN. That is the one current high finding keeping the Hypatia gate red on main and on every PR. The job's only outbound call is repository-dispatch's POST to api.github.com; action downloads happen at job set-up, before the hardening step arms. So the policy is now `block` with that single endpoint allowed, the same shape the estate's other block-mode instant-sync workflows use. Fixed at the source; nothing baselined. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDim4mMEfCer9SiAV4H --- .github/workflows/instant-sync.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/instant-sync.yml b/.github/workflows/instant-sync.yml index 01efebf..ce15e2a 100644 --- a/.github/workflows/instant-sync.yml +++ b/.github/workflows/instant-sync.yml @@ -18,14 +18,18 @@ jobs: env: HAS_DISPATCH_TOKEN: ${{ secrets.FARM_DISPATCH_TOKEN != '' }} steps: - # This job holds FARM_DISPATCH_TOKEN; monitor its outbound egress - # (Hypatia RE001). Audit mode first: record every endpoint without - # risking the dispatch; tighten to block+allowlist once a main run - # shows the observed set. - - name: Harden runner (egress audit) + # This job holds FARM_DISPATCH_TOKEN, so its egress is CONTAINED, not + # merely audited (Hypatia RE001/RE002: audit mode is telemetry-only and + # never blocks). The only outbound call any step makes is + # repository-dispatch's POST /repos/{repo}/dispatches on api.github.com; + # action tarballs are fetched at job set-up, before this step arms. Same + # shape as the estate's other block-mode instant-sync workflows. + - name: Harden runner (egress block) uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block + allowed-endpoints: > + api.github.com:443 - name: Trigger Propagation if: env.HAS_DISPATCH_TOKEN == 'true' uses: peter-evans/repository-dispatch@v4.0.1 From 7c289cbcf8a753d7032b29df8c36dd9072083b4d Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 23:06:50 +0000 Subject: [PATCH 6/7] Give the push/schedule Hypatia lane its fleet report-backs The scheduled grid on main (run 43656845018) rendered rhodibot, glambot and finishingbot permanently orange: the reusable downloads the `fleet-report-backs` artifact by default, but only fork-governance.yml (the PR lane) ran the fleet producer, so this lane never had one (`Artifact not found for name: fleet-report-backs`). Add the same `fleet` job, at the same gitbot-fleet pin, and run the scan after it whatever its result, exactly as fork-governance.yml does. The producer checks out `pull_request.head.sha || github.sha`, so it serves push and schedule events unchanged. Fixed in this caller rather than upstream: the reusable's behaviour (missing artifact => orange, the truth) is correct; the caller was not supplying the evidence. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDim4mMEfCer9SiAV4H --- .github/workflows/hypatia-scan.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/hypatia-scan.yml b/.github/workflows/hypatia-scan.yml index 651c6a8..aa12fa7 100644 --- a/.github/workflows/hypatia-scan.yml +++ b/.github/workflows/hypatia-scan.yml @@ -22,7 +22,23 @@ permissions: security-events: write jobs: + # The same producer fork-governance.yml runs on PRs. Without it this lane's + # reusable downloads `fleet-report-backs` (its default), finds no such + # artifact, and renders every enrolled fleet row 🟠 indeterminate — on + # every push and scheduled run, permanently. The reusable checks out + # `github.event.pull_request.head.sha || github.sha`, so it serves + # push/schedule unchanged. Same pin as fork-governance.yml. + fleet: + name: Fleet report-backs + uses: hyperpolymath/gitbot-fleet/.github/workflows/fleet-report-back-reusable.yml@8906f47f945d4675d7375eb78898ed0f1c48cc95 + permissions: + contents: read + scan: + # After the fleet job whatever its result: a dead fleet job renders as + # orange fleet rows, never as a missing gate. + needs: [fleet] + if: ${{ always() }} # Explicit on the calling job (a job-level block replaces, never merges # with, the workflow-level one). The previous pin (cc58c0c…) no longer # exists in standards, so this gate failed at startup with zero jobs — From e1a8cee93d7a0b6ed797beca85a329357f7888e6 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 23:41:32 +0000 Subject: [PATCH 7/7] Let operators cancel the Hypatia scan Review on #119: `if: always()` keeps the scan job running even when an operator cancels the workflow. `!cancelled()` still runs the scan after the fleet job succeeds or fails -- the property the guard exists for -- but honours cancellation. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDim4mMEfCer9SiAV4H --- .github/workflows/hypatia-scan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hypatia-scan.yml b/.github/workflows/hypatia-scan.yml index aa12fa7..e58b89e 100644 --- a/.github/workflows/hypatia-scan.yml +++ b/.github/workflows/hypatia-scan.yml @@ -38,7 +38,7 @@ jobs: # After the fleet job whatever its result: a dead fleet job renders as # orange fleet rows, never as a missing gate. needs: [fleet] - if: ${{ always() }} + if: ${{ !cancelled() }} # Explicit on the calling job (a job-level block replaces, never merges # with, the workflow-level one). The previous pin (cc58c0c…) no longer # exists in standards, so this gate failed at startup with zero jobs —