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
57 changes: 52 additions & 5 deletions .github/workflows/agda-proof-policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,21 @@ jobs:
if: ${{ !cancelled() && steps.toolchain.outcome == 'success' }}
run: |
guix time-machine -C build/channels.scm -- shell -m build/manifest.scm -- sh -euc '
bash scripts/check-proofs.sh agda
PROOF_REPORT_DIR="$RUNNER_TEMP/proof-report" bash scripts/check-proofs.sh agda
bash tests/proofs/gate_controls_test.sh agda'

- name: Rocq lane (gate, then planted controls)
if: ${{ !cancelled() && steps.toolchain.outcome == 'success' }}
run: |
guix time-machine -C build/channels.scm -- shell -m build/manifest.scm -- sh -euc '
bash scripts/check-proofs.sh coq
PROOF_REPORT_DIR="$RUNNER_TEMP/proof-report" bash scripts/check-proofs.sh coq
bash tests/proofs/gate_controls_test.sh coq'

- name: Lean lane (gate, then planted controls)
if: ${{ !cancelled() && steps.toolchain.outcome == 'success' }}
run: |
guix time-machine -C build/channels.scm -- shell -m build/manifest.scm -- sh -euc '
bash scripts/check-proofs.sh lean4
PROOF_REPORT_DIR="$RUNNER_TEMP/proof-report" bash scripts/check-proofs.sh lean4
bash tests/proofs/gate_controls_test.sh lean4'

# The golden path (re-anchoring plan WO 2.5): `just check` runs the view
Expand Down Expand Up @@ -125,8 +125,8 @@ jobs:
git init -q "$r"
git -C "$r" remote add origin https://github.com/metadatastician/standards.git
git -C "$r" config core.sparseCheckout true
printf '1-formats/deed/tools/\nscripts/check-proof-receipt.sh\nscripts/proof-inputs-sha256.sh\n' > "$r/.git/info/sparse-checkout"
git -C "$r" fetch -q --depth 1 origin 940a27af1e25a73a2d55daa78d0763e6749fd935
printf '1-formats/deed/tools/\nscripts/check-proof-receipt.sh\nscripts/proof-inputs-sha256.sh\nscripts/proof-receipt.sh\n' > "$r/.git/info/sparse-checkout"
git -C "$r" fetch -q --depth 1 origin 84c2d1c1b040c9d7b8924532fa77e71e63d72c66
git -C "$r" checkout -q FETCH_HEAD

- name: Golden path (just check), then its controls
Expand All @@ -142,3 +142,50 @@ jobs:
bun --version
just check
bash tests/golden/check_controls_test.sh'

# The ledger rows of this run (PROOF-POLICY §8.5.1; standards
# scripts/proof-receipt.sh, which scripts/grade-receipt.sh sources). On
# main only: a receipt names a commit on the default branch (§8.5.3). Each
# lane's gate wrote its own report above (check-proofs.sh,
# PROOF_REPORT_DIR), and only a run that passed writes one; nothing is read
# back from the log. --emit-run checks the rows with the ledger and reads
# the receipt they give with the pinned reader and its negative control.
# The rows go to the job summary. `bash scripts/grade-receipt.sh --record
# ROWS` adds them to the ledger and rewrites the receipt, in a pull request
# that --check and review accept: CI does not write to the repository.
- name: Ledger rows of this run (main only)
if: ${{ success() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
env:
MATHESIS_STANDARDS: ${{ runner.temp }}/receipt-reader
run: |
set -euo pipefail
report="$RUNNER_TEMP/proof-report"
# The one channel pin, read with the Scheme comments removed, so an old
# pin quoted in a comment is never taken for the active one.
guix="$(sed 's/;.*//' build/channels.scm | grep -oE '\(commit "[0-9a-f]{40}"\)' | grep -oE '[0-9a-f]{40}' || true)"
if [ -z "$guix" ] || [ "$(grep -c . <<<"$guix")" -ne 1 ]; then
echo "::error::build/channels.scm must pin exactly one 40-hex Guix commit outside its comments"; exit 1
fi
run="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/attempts/$GITHUB_RUN_ATTEMPT"
rows="$RUNNER_TEMP/ledger-rows"
: > "$rows"
for lane in agda:agda coq:rocq lean4:lean; do
gate="${lane%%:*}"; prover="${lane#*:}"; f="$report/$gate"
if [ ! -f "$f" ] || [ "$(wc -l < "$f")" -ne 3 ]; then
echo "::error::the $gate gate wrote no receipt report"; exit 1
fi
[ "$(sed -n 2p "$f")" = none ] || { echo "::error::the $gate gate reported axioms: $(sed -n 2p "$f")"; exit 1; }
bash scripts/grade-receipt.sh --run-row "$prover" --run "$run" --commit "$GITHUB_SHA" \
--checker "$(sed -n 1p "$f") (Guix ${guix:0:7})" --reported "$(sed -n 3p "$f")" --axioms none >> "$rows"
done
bash scripts/grade-receipt.sh --emit-run "$rows" --out "$RUNNER_TEMP/receipt/theory_praxis.deed"
{
echo "### Ledger rows of this run"
echo
echo "Record them in a pull request: put these lines in a file ROWS, then run"
echo "\`bash scripts/grade-receipt.sh --record ROWS\`."
echo
echo '```'
cat "$rows"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
4 changes: 2 additions & 2 deletions .github/workflows/proven-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ jobs:
git init -q "$r"
git -C "$r" remote add origin https://github.com/metadatastician/standards.git
git -C "$r" config core.sparseCheckout true
printf '1-formats/deed/tools/\nscripts/check-proof-receipt.sh\nscripts/proof-inputs-sha256.sh\n' > "$r/.git/info/sparse-checkout"
git -C "$r" fetch -q --depth 1 origin 940a27af1e25a73a2d55daa78d0763e6749fd935
printf '1-formats/deed/tools/\nscripts/check-proof-receipt.sh\nscripts/proof-inputs-sha256.sh\nscripts/proof-receipt.sh\n' > "$r/.git/info/sparse-checkout"
git -C "$r" fetch -q --depth 1 origin 84c2d1c1b040c9d7b8924532fa77e71e63d72c66
git -C "$r" checkout -q FETCH_HEAD
for f in verification/receipts/*_praxis.deed; do
bun "$r/1-formats/deed/tools/deed_lint.js" --proof-receipt-json "$f"
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,23 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning].

==== Changed

* **The receipt of Mathesis is generated from a run ledger.** Mathesis adopts
the shared generator of standards (`scripts/proof-receipt.sh`, PROOF-POLICY
§8.5.1) through `scripts/grade-receipt.sh`, a file of hooks, and
`verification/receipts/theory_runs.ledger`, one row a run and prover.
`just receipt-check` now regenerates the receipt and refuses a difference,
then runs the git checks of §8.5.3 and the pinned reader with a negative
control. `just receipt-record ROWS` records a run. The Proof Policy Gate writes
the ledger rows of each green run on main to its job summary, from a report
that `scripts/check-proofs.sh` writes when `PROOF_REPORT_DIR` is set; no log
is read, and a run that fails, a missing prover included, leaves no report.
The current receipts and grades are unchanged. Superseded receipts
keep their run's inputs digest and axioms, and the inputs manifest where it
can be rebuilt (`RECEIPT_KEEP_LINEAGE_DETAIL=1`, standards#1705). The canon
reader, the git checker and the generator are pinned at standards `84c2d1c`
(was `940a27af`); `claims-registry.mjs receipt` is removed, and
`claims-registry.mjs standards` checks the four pinned files for the home
script.
* `CI/gate` now also starts on `pull_request`, and a tamper guard is added.
`.github/workflows/ci-gate.yml` is rewritten from the suite's
`templates/ci-gate-caller.yml`: a same-repository `gate-pr` job on
Expand Down
21 changes: 15 additions & 6 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -772,13 +772,22 @@ registry-check:
bun scripts/registry/theory-ledger.mjs verify
bun test tests/registry/

# The git checks of PROOF-POLICY §8.5.3 on the receipt of Mathesis: its
# :source-commit is on origin/main, each current receipt's inputs manifest holds
# at its commit, and each echo's witness holds. The shared checker of the pinned
# standards commit runs them (MATHESIS_STANDARDS, as above). Needs origin/main
# with its history.
# The receipt of Mathesis (PROOF-POLICY §8.5.1) against its run ledger: the
# shared generator of the pinned standards commit (scripts/grade-receipt.sh)
# regenerates it from verification/receipts/theory_runs.ledger and the tree and
# refuses any difference, runs the git checks of §8.5.3 (the :source-commit is
# on origin/main, each current receipt's inputs manifest holds at its commit),
# and reads it with the pinned reader and a negative control
# (MATHESIS_STANDARDS, as above). Needs origin/main with its history.
receipt-check:
bun scripts/registry/claims-registry.mjs receipt
bash scripts/grade-receipt.sh --check

# Record a green Proof Policy Gate run on main: ROWS is a file holding the
# ledger rows that the run's job summary lists ("Ledger rows of this run").
# The generator checks them with the ledger, appends them, and rewrites the
# receipt; commit both in a pull request, which receipt-check then holds.
receipt-record rows:
bash scripts/grade-receipt.sh --record {{ quote(rows) }}

# Append each change of the theory shelf to docs/theory/ledger.jsonl, the only
# way the ledger changes (needs MATHESIS_STANDARDS, as above). A note tells the
Expand Down
2 changes: 1 addition & 1 deletion docs/atlas/generated/registry.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Each row is a claim in its home repository at a pinned commit. The grade is
*derived* here from that repository's receipt by the canon reader of
PROOF-POLICY §8.5.1 (`metadatastician/standards` at `940a27af1e25`), never
PROOF-POLICY §8.5.1 (`metadatastician/standards` at `84c2d1c1b040`), never
assigned (§8.5). A grade is not a discharge (§8.4): `PWG-3` theorems still
owe their Rocq and Lean legs. Status of this slice: accepted in
link:../../decisions/0004-claims-registry.adoc[ADR 0004], ratified by the owner.
Expand Down
44 changes: 39 additions & 5 deletions docs/status/PROOF-STATUS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,10 @@ same hypotheses and conclusions. The differences are encoding only:
Residual assumptions: none in any leg.

|Machine receipt (§8.5.1)
|`verification/receipts/theory_praxis.deed`. The canon reader
(`deed_lint.js --proof-receipt-json`, standards `940a27af`) derives
|`verification/receipts/theory_praxis.deed`, generated by the shared
generator of standards (`scripts/grade-receipt.sh`) from the run ledger
`verification/receipts/theory_runs.ledger`. The canon reader
(`deed_lint.js --proof-receipt-json`, standards `84c2d1c`) derives
`PWG-2ii` from it, the grade below, and CI runs that reader on each change. The claims registry lists
the claim as `hyperpolymath/mathesis#THY-1` and shows the grade that the
same reader derives
Expand Down Expand Up @@ -337,9 +339,10 @@ Residual assumptions: none in any leg.
come from CI run 44190913019 on main `8c55804` (Agda 2.7.0.1, Rocq 8.18.0,
Lean 4.29.0, pinned Guix `8edb9da`), the first under the gate of #107; the
receipts of run 43498592499 on main `034f215` are superseded. Each records the inputs manifest of its
prover and no axiom. The canon reader at standards `940a27af` derives `PWG-2ii`
for each of APP-1 to APP-4 (no digest-pinned checker image, standards#1625), and the shared git checker (`just receipt-check`)
passes. The Rocq and Lean legs are `RECONCILED` by the comparison above, done
prover and no axiom. The canon reader at standards `84c2d1c` derives `PWG-2ii`
for each of APP-1 to APP-4 (no digest-pinned checker image, standards#1625), and `just receipt-check`
(the shared generator: the receipt regenerated from the run ledger, the git
checks of §8.5.3, the reader with a negative control) passes. The Rocq and Lean legs are `RECONCILED` by the comparison above, done
by reading. The trusted base gains `Char` and `String`, the postulates that
`Applied/IntLaws` reaches through `Agda.Builtin.Int`.
|===
Expand All @@ -354,6 +357,14 @@ guix time-machine -C build/channels.scm -- shell -m build/manifest.scm -- just c

# The planted controls: each must fail the gate
bash tests/proofs/gate_controls_test.sh agda

# The receipt against its run ledger (MATHESIS_STANDARDS: a standards checkout
# at the pinned commit; needs origin/main with its history)
just receipt-check

# Record a green Proof Policy Gate run on main: ROWS holds the ledger rows that
# its job summary lists ("Ledger rows of this run")
just receipt-record ROWS
----

== Changelog
Expand All @@ -362,6 +373,29 @@ bash tests/proofs/gate_controls_test.sh agda
|===
|Date |Change

|2026-11-23
|The receipt is generated, not written: Mathesis adopts the shared generator
of standards (`scripts/proof-receipt.sh`, PROOF-POLICY §8.5.1) through
`scripts/grade-receipt.sh` and a run ledger,
`verification/receipts/theory_runs.ledger`, one row a run and prover. The
ledger holds the 12 rows behind the receipt (the local run of 2026-11-09 and
runs 42896264290, 43498592499 and 44190913019). The 15 current receipts keep
their run, commit, checker, inputs digest, inputs manifest and axioms, and the
reader derives `PWG-2ii` for all five claims, as before. Two things change.
The receipts of runs 43498592499 and 44190913019, which checked all five
claims, name the gate's invocation for their prover, which is what the gate
runs, not each claim's root module. The superseded receipts are
written oldest first and, with `RECEIPT_KEEP_LINEAGE_DETAIL=1` (standards#1705),
keep what their run read: the inputs digest and the axioms of their ledger row,
and the inputs manifest where it can be rebuilt to that digest. That holds for
the receipts of run 43498592499; the two runs before it predate their input set,
so their receipts carry no manifest, and the generator says so. None of it
counts toward a grade. The canon reader, the git checker and the generator are
pinned at standards `84c2d1c` (was `940a27af`). The Proof Policy Gate now writes the ledger rows of each
green run on main to its job summary, from a report the gate script writes
itself (`check-proofs.sh`, `PROOF_REPORT_DIR`), and `just receipt-record`
adds them.

|2026-11-18
|The claim pins of THY-1 and APP-1 to APP-4 name the receipt at main
`10f9f46` (PR 115). The registry catalogues `PWG-2ii` for all five, and
Expand Down
13 changes: 13 additions & 0 deletions docs/status/ROADMAP.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,19 @@ One pull request that changes census rows is open at a time (atlas README,
secret-types' and lintel's: the new reader refuses their receipts (a `#u5`
identity literal, and secret-types' recorded `PWG-1` that the image rule
no longer supports) until they are recorded again.
** Seventh change (2026-11-23): the receipt is generated by the shared
generator of standards (`scripts/proof-receipt.sh`, pinned with the
reader at standards `84c2d1c`) through `scripts/grade-receipt.sh`, from
a run ledger, `verification/receipts/theory_runs.ledger`. `just
receipt-check` regenerates it and refuses a difference. The Proof Policy
Gate writes the ledger rows of each green run on main to its job summary;
`just receipt-record ROWS` adds them in a pull request. The current
receipts and the grades are unchanged (`PWG-2ii` for all five).
Superseded receipts keep their run's inputs digest and axioms, and the
inputs manifest where it can be rebuilt (`RECEIPT_KEEP_LINEAGE_DETAIL=1`).
Open: CI does not write the rows to the repository. A recorder that does
(a trusted publisher) is the piece standards PR 1675 leaves open, in
standards, not here.

[[stages]]
== Stages
Expand Down
Loading
Loading