Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/hypatia-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ${{ !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 —
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/instant-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
82 changes: 75 additions & 7 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,66 @@ 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
`+"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. 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+`
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
Expand Down Expand Up @@ -65,7 +125,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 *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.

Expand Down Expand Up @@ -102,7 +163,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
*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
Expand All @@ -113,11 +175,17 @@ 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 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
Expand Down
9 changes: 7 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
12 changes: 6 additions & 6 deletions scripts/pwg-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 // "" | length) > 0 then empty else "\($k): no result (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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
26 changes: 21 additions & 5 deletions scripts/pwg-derive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,38 @@ 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("\\A[0-9a-f]{40}\\z"))))
| length > 0;

# 8.2 PWG-3 additionally requires the receipt to record the checker version,
# the standard-library pin, the flags actually in force, and the import cone (1.1).
def pwg3_receipt($rs): $rs
| map(select(
.state == "current"
and (.commit | test("^[0-9a-f]{40}$"))
and .result == "pass"
and (.commit | test("\\A[0-9a-f]{40}\\z"))
and (.checker_version // "" | length > 0)
and (.stdlib_pin // "" | length > 0)
and (.import_cone // "" | length > 0)
Expand All @@ -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"
Expand Down
Loading
Loading