From d32463815bf60e27863d6fa18ef2f93939bbdd30 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 22:26:05 +0000 Subject: [PATCH 1/2] feat(receipt): write the receipt with the shared generator (standards f6ebc5e) scripts/grade-receipt.sh keeps this repository's ledgers and hooks and sources the standard's scripts/proof-receipt.sh (metadatastician/standards#1620), which writes and checks the receipt. The generator, the reader, the reference digest and the git checker are pinned at standards f6ebc5e, each by sha256, and fetched by --fetch-reader. - The receipt is unchanged but for the line naming the reader's commit; all six claims stay PWG-1. - The shared generator binds each Agda run row to the sha256 of the trusted base it checked (PROOF-POLICY 8.4). The current Agda row predates that field. Its value is the sha256 of proof_trusted_base in scripts/proof-flags.sh at the run's own commit 7dfeab2, the list that run's trusted-base gate checked the cone against; the list is unchanged since. The script says so beside the ledger. - proofs.yml: the proofs and legs jobs fetch the pinned tools before --run-row (every mode now sources the generator), and the Agda container installs curl to fetch them. - verification/legs/README.adoc no longer says the grade is PWG-2ii; the receipt derives PWG-1. Local: --write, then --check (git checks with the shared checker, the pinned reader at PWG-1 for N-1..N-3, N-7..N-9, the negative control) pass; --run-row for each leg gives the recorded inputs digest, and for Agda the same trusted-base binding. Not run here: the provers (CI runs them). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BYbQRtNu216R13jtZLmoqs --- .github/workflows/proofs.yml | 10 +- CHANGELOG.adoc | 15 + scripts/grade-receipt.sh | 605 ++++--------------------- verification/legs/README.adoc | 10 +- verification/receipts/agda_praxis.deed | 2 +- 5 files changed, 122 insertions(+), 520 deletions(-) diff --git a/.github/workflows/proofs.yml b/.github/workflows/proofs.yml index db470f0..bcc61ef 100644 --- a/.github/workflows/proofs.yml +++ b/.github/workflows/proofs.yml @@ -45,7 +45,7 @@ jobs: - name: Install the pinned prover run: | apt-get update - apt-get install --no-install-recommends -y ca-certificates git agda-bin=2.6.4.3-1+b2 + apt-get install --no-install-recommends -y ca-certificates curl git agda-bin=2.6.4.3-1+b2 - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -93,6 +93,10 @@ jobs: run: bash scripts/check-trusted-base.sh 2>&1 | tee /tmp/trusted-base.log - name: Which laws generic TINI uses run: bash scripts/minimal-laws.sh + # The receipt script sources the shared generator (standards + # scripts/proof-receipt.sh), fetched at its pin and sha256-checked. + - name: Fetch the pinned receipt tools (sha256-checked) + run: bash scripts/grade-receipt.sh --fetch-reader # The ledger row of this run's Agda leg: what the receipt job records. # Every field is read from this run: the checker's own version line, the # commit checked out, and the trusted-base lines the gates printed. @@ -143,6 +147,10 @@ jobs: run: test "$(git rev-parse HEAD)" = "$SOURCE_COMMIT" - name: Both legs check, with no axioms run: bash scripts/check-legs.sh 2>&1 | tee /tmp/legs.log + # The receipt script sources the shared generator (standards + # scripts/proof-receipt.sh), fetched at its pin and sha256-checked. + - name: Fetch the pinned receipt tools (sha256-checked) + run: bash scripts/grade-receipt.sh --fetch-reader # The ledger rows of this run's Rocq and Lean legs, read from this run. - name: Ledger rows of the Rocq and Lean legs id: row diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 566552d..5fbfe44 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -10,6 +10,21 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. ==== Fixed +* **The receipt is written by the shared generator (standards `f6ebc5e`, + metadatastician/standards#1620).** +** `scripts/grade-receipt.sh` keeps this repository's ledgers and hooks and + sources the standard's `scripts/proof-receipt.sh`, which writes and checks + the receipt. The generator, the reader, the reference digest and the git + checker are pinned at `f6ebc5e`, each by sha256. +** The receipt is unchanged but for the line naming the reader's commit; + every claim stays `PWG-1`. +** The shared generator binds each Agda run to the trusted base it checked + (PROOF-POLICY §8.4). The current Agda row predates that field; its value + is the sha256 of `proof_trusted_base` at the run's own commit `7dfeab2`, + unchanged since. +* `verification/legs/README.adoc` no longer says the grade is `PWG-2ii`; the + receipt derives `PWG-1`. + * **The receipt lists its inputs, and the gate runs the shared git checker (standards `e5a39d7`, #1545).** ** Each current receipt carries `(inputs-manifest (file :path :sha256) ...)`, diff --git a/scripts/grade-receipt.sh b/scripts/grade-receipt.sh index 4679aac..eca45d4 100755 --- a/scripts/grade-receipt.sh +++ b/scripts/grade-receipt.sh @@ -7,21 +7,15 @@ # standards/3-practice/PROOF-POLICY.adoc §8.5.1 and §8.5.2 (profile # proof-receipt), with the git checks of §8.5.3. # -# --write write the receipt from the tree and the ledgers -# --check regenerate it, refuse any difference, do the git -# checks of §8.5.3, check that each current receipt -# still describes the tree, and run the pinned reader -# with a negative control -# --digest PROVER print the §8.5.1 inputs digest of one leg (agda|rocq|lean) -# --inputs PROVER print the §8.5.1 input set of one leg, one path a line -# --run-row PROVER --run URL --commit SHA --checker TEXT --reported TEXT -# print one ledger row for a run that just passed -# --emit-run ROWS --out FILE -# write a receipt for the run whose rows are in ROWS: -# they become current, and the earlier current receipts -# of the same legs become superseded (CI does this) -# --fetch-reader fetch the pinned reader and the pinned reference -# digest script into _build/ and check both +# This script holds what is this repository's: the three ledgers below, the +# header of the receipt, and the hooks that name each leg's invocation and +# inputs. The generator and gate are standards' scripts/proof-receipt.sh, +# fetched with the reader, the reference digest and the shared git checker at +# ONE pinned standards commit, each file checked against its sha256. +# +# --fetch-reader fetch the four pinned standards files into _build/ +# --write | --check | --digest P | --inputs P | --run-row P ... | --emit-run ROWS --out FILE +# the modes of proof-receipt.sh (see its header) # # What is derived and what is typed. Three lists are typed in this file: the # claim list (cross-checked against PROOF-STATUS.adoc and @@ -29,37 +23,58 @@ # log that printed it) and the echo ledger (history rewrites). Everything else # is read from the one definition the gate also reads: the flags, the root, the # invocation and the trusted base from scripts/proof-flags.sh; the leg -# invocations and pins from scripts/check-legs.sh. Every digest is a git fact: -# this script computes it, and the pinned reference script of the standard -# checks it. The grade is never typed: it is derived here under §8.2 and -# §8.5.2 and derived again by the pinned reader, which refuses a receipt whose -# :pwg its legs and receipts do not support (§8.4). +# invocations and pins from scripts/check-legs.sh. Every digest is a git fact. +# The grade is never typed: the generator derives it under §8.2 and §8.5.2 and +# the pinned reader derives it again, refusing a receipt whose :pwg its legs +# and receipts do not support (§8.4). set -euo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." export LC_ALL=C.UTF-8 . scripts/proof-flags.sh -out=verification/receipts/agda_praxis.deed -repo="hyperpolymath/secret-types" -default_branch=main +RECEIPT_OUT=verification/receipts/agda_praxis.deed +RECEIPT_REPOSITORY="hyperpolymath/secret-types" +RECEIPT_DEFAULT_BRANCH=main +RECEIPT_CANONICAL_NAME="secret-types-proof-receipt" +RECEIPT_SCRIPT=scripts/grade-receipt.sh # The pinned standard, all at one standards commit, each file with its -# sha256: the reader readProofReceipt (1-formats/deed/tools/deed_lint.js, -# PROOF-POLICY §8.5.1 to §8.5.3), the reference digest +# sha256: the generator (scripts/proof-receipt.sh), the reader readProofReceipt +# (1-formats/deed/tools/deed_lint.js), the reference digest # (scripts/proof-inputs-sha256.sh) and the shared git checker of §8.5.3 # (scripts/check-proof-receipt.sh). They keep the standards layout under # _build/standards, because the checker finds the reader and the digest # script by their paths. Mathesis pins the same reader and runs the same # checker. -STANDARDS_COMMIT=e5a39d7e5c66f9d24d7e0ffa3f8dbd01f2d42d9d -READER_SHA256=37ff85be499b35dd9d74399e05d9ae1e57ccf095362c355f93e04b3bbf4c9491 +RECEIPT_STANDARDS_COMMIT="${RECEIPT_STANDARDS_COMMIT_OVERRIDE:-f6ebc5ec6ba5d7f79ce996bf74c5237481a2a2fb}" +GENERATOR_SHA256=bfe35c08397ab85d7d33998ae126e189988994598320ffd2b139f2038e8eec4c +READER_SHA256=8978546740ca2d6a1d90b769fe02159883cb18f1eb2c44b2eeb737bab341dcd2 DIGEST_SHA256=dfc6dde01a3a79df638eebe4cad0eae584d8f17280077e149174c0667e9508f4 -CHECKER_SHA256=831f5a43c906c3edc8cfa68ab5fe13c37e7a41b35e40068481d988d887f4bd3f -STANDARDS_RAW="https://raw.githubusercontent.com/metadatastician/standards/$STANDARDS_COMMIT" -std_dir=_build/standards -reader="$std_dir/1-formats/deed/tools/deed_lint.js" -digest_script="$std_dir/scripts/proof-inputs-sha256.sh" -checker="$std_dir/scripts/check-proof-receipt.sh" +CHECKER_SHA256=f2375747238464535d1b4a61f658f07cb2f8504c69bfb1812311c79429a4e23e +RECEIPT_STD="${RECEIPT_STD_OVERRIDE:-_build/standards}" + +pinned_files() { + printf '%s %s\n' scripts/proof-receipt.sh "$GENERATOR_SHA256" \ + 1-formats/deed/tools/deed_lint.js "$READER_SHA256" \ + scripts/proof-inputs-sha256.sh "$DIGEST_SHA256" \ + scripts/check-proof-receipt.sh "$CHECKER_SHA256" +} +fetch_pinned() { + local path sum dest raw="https://raw.githubusercontent.com/metadatastician/standards/$RECEIPT_STANDARDS_COMMIT" + while read -r path sum; do + dest="$RECEIPT_STD/$path"; mkdir -p "$(dirname "$dest")" + curl --proto '=https' --tlsv1.2 -fsSL "$raw/$path" -o "$dest.tmp" + echo "$sum $dest.tmp" | sha256sum --check --strict >/dev/null || { rm -f "$dest.tmp"; printf 'ERROR: the fetched %s does not match its pinned sha256\n' "$path" >&2; exit 1; } + mv "$dest.tmp" "$dest"; printf 'FETCHED %s (standards %s) to %s\n' "$path" "${RECEIPT_STANDARDS_COMMIT:0:12}" "$dest" + done < <(pinned_files) +} +check_pinned() { + local path sum + while read -r path sum; do + [[ -f "$RECEIPT_STD/$path" ]] || { printf 'ERROR: the pinned %s is missing: run bash %s --fetch-reader\n' "$path" "$RECEIPT_SCRIPT" >&2; exit 1; } + [[ "$(sha256sum "$RECEIPT_STD/$path" | cut -d' ' -f1)" == "$sum" ]] || { printf 'ERROR: %s is not the pinned file (sha256 differs)\n' "$RECEIPT_STD/$path" >&2; exit 1; } + done < <(pinned_files) +} # ── The claim list ──────────────────────────────────────────────────────────── # id | §5 token of the Agda proof | kind | Rocq route | Rocq §2.2 state | @@ -69,7 +84,7 @@ checker="$std_dir/scripts/check-proof-receipt.sh" # (graded, §8.1) or demonstration (a checked example; §8.1 grades theorems # only, so a demonstration has no claim in the receipt). Routes: transported # | re-proved | waived | unavailable. States: §2.2; only RECONCILED counts. -claims() { +receipt_claims() { cat <<'ROWS' N-1|proven|theorem|re-proved|RECONCILED|re-proved|RECONCILED|| N-2|proven|theorem|re-proved|RECONCILED|re-proved|RECONCILED|| @@ -97,9 +112,16 @@ ROWS # §8.5.1, and the receipt does not state it. The axioms column lists each # axiom the checker reported as name:disposition, comma-separated; it is # empty when the checker reported none, and the gates fail on any axiom. -runs() { +# An Agda row then carries an imports field (empty here: this repository +# imports no other) and the sha256 of the trusted base the run checked +# (PROOF-POLICY 8.4), which --run-row writes. The current Agda row was +# recorded before the shared generator wrote that field. Its value is the +# sha256 of proof_trusted_base in scripts/proof-flags.sh at the run's own +# commit 7dfeab2, the list the run's trusted-base gate checked the cone +# against (its reported column); that list is unchanged since. +receipt_runs() { cat <<'ROWS' -agda|https://github.com/hyperpolymath/secret-types/actions/runs/43455458225/attempts/1|7dfeab2dc13142fac476ee9c698cf009deb709c9|Agda version 2.6.4.3 (Debian 13 agda-bin=2.6.4.3-1+b2, container debian:13-slim)|agda --safe --without-K --cubical-compatible --no-libraries --ignore-interfaces --double-check -W error -i src src/SecretTypes/All.agda|96b2f0237fcc31a0ab60cc6952edbe4e9c1b3ca5f267d79bf6491f81432b0c9e|--safe; trusted base (no postulates under src/SecretTypes or tests); trusted base: 4 prover postulates in 6 prover-supplied modules of the cone, each BUILTIN-bound and listed; no other postulate|current|| +agda|https://github.com/hyperpolymath/secret-types/actions/runs/43455458225/attempts/1|7dfeab2dc13142fac476ee9c698cf009deb709c9|Agda version 2.6.4.3 (Debian 13 agda-bin=2.6.4.3-1+b2, container debian:13-slim)|agda --safe --without-K --cubical-compatible --no-libraries --ignore-interfaces --double-check -W error -i src src/SecretTypes/All.agda|96b2f0237fcc31a0ab60cc6952edbe4e9c1b3ca5f267d79bf6491f81432b0c9e|--safe; trusted base (no postulates under src/SecretTypes or tests); trusted base: 4 prover postulates in 6 prover-supplied modules of the cone, each BUILTIN-bound and listed; no other postulate|current||||0c1f64c3c7f0a26cbc92595168858485a9883f6196d287497dcc805faf5c58eb rocq|https://github.com/hyperpolymath/secret-types/actions/runs/43455458225/attempts/1|7dfeab2dc13142fac476ee9c698cf009deb709c9|The Coq Proof Assistant, version 8.18.0 (Ubuntu 24.04 coq=8.18.0+dfsg-1build2)|coqc -q SecretTypes.v (in verification/legs/rocq)|4c96fb9c7d22685ae08d71fc2f200e394e93f07711b2b0619d2a154dbd19bc60|Rocq leg (Coq 8.18.0), 11 theorems closed under the global context|current|| lean|https://github.com/hyperpolymath/secret-types/actions/runs/43455458225/attempts/1|7dfeab2dc13142fac476ee9c698cf009deb709c9|Lean (version 4.24.0, x86_64-unknown-linux-gnu, commit 797c613eb9b6d4ec95db23e3e00af9ac6657f24b, Release) (release tarball, sha256 b14f5e5159219dd1a1956c3b806813319f5e94ccd5bdfd56f54520609a5bb5ec)|lake build; lake env lean Axioms.lean (in verification/legs/lean)|7ed75659e1520a28b949c7b004609485605f1b9e017b810352be4285390a13d6|Lean leg (Lean 4.24.0, core only), 11 theorems depend on no axioms|current|| agda|https://github.com/hyperpolymath/secret-types/actions/runs/43448301280/attempts/1|88a763ac6101b8d9e59c71caa6959abb4bffe4bd|Agda version 2.6.4.3 (Debian 13 agda-bin=2.6.4.3-1+b2, container debian:13-slim)|agda --safe --without-K --cubical-compatible --no-libraries --ignore-interfaces --double-check -W error -i src src/SecretTypes/All.agda|a0a8d66d74bf9deb5beeba6739c377290ce7399cf8ef60dc6214da211d086cb4|--safe; trusted base (no postulates under src/SecretTypes or tests); trusted base: 4 prover postulates in 6 prover-supplied modules of the cone, each BUILTIN-bound and listed; no other postulate|superseded|the inputs of the Agda leg changed after this run (scanner hardening from review); the CI run of the hardened commit replaces it| @@ -118,252 +140,15 @@ ROWS # reachable. The witness digests are not typed: --write and --check compute # them at both commits and refuse the row unless they are equal. # source (40 hex) | image (40 hex) | witness (inputs-sha256) | fetch ref -echoes() { +receipt_echoes() { cat <<'ROWS' 7dfeab2dc13142fac476ee9c698cf009deb709c9|292d566a81a9bafcd6bdf7f3caab7fc2ebad36bd|inputs-sha256|refs/pull/40/head ROWS } -die() { printf 'ERROR: %s\n' "$*" >&2; exit 1; } - -# ── Inputs of each leg (§8.5.1) ─────────────────────────────────────────────── -# The legs' invocations, read from their one definition. -legvar() { local name="$1"; sed -n "s/^$name='\\{0,1\\}\\([^']*\\)'\\{0,1\\}\$/\\1/p" scripts/check-legs.sh; } -invocation() { - local prover="$1" - case "$prover" in - agda) proof_agda_invocation ;; - rocq) printf '%s (in %s)\n' "$(legvar ROCQ_INVOCATION)" "$(legvar ROCQ_DIR)" ;; - lean) printf '%s; %s (in %s)\n' "$(legvar LEAN_BUILD)" "$(legvar LEAN_AXIOMS)" "$(legvar LEAN_DIR)" ;; - *) die "unknown prover: $prover" ;; - esac -} - -# The Agda cone: the graded root and every module of the repository that it -# imports, directly or not (include path src, as the invocation says). A text -# scan of import statements; scripts/check-trusted-base.sh checks it against -# agda --dependency-graph on every gate run, so a scan that drifts from Agda -# fails there. Modules supplied with the prover are not in the input set. -agda_cone() { - local f m p - local -A seen=() - local -a queue=("$(proof_agda_root)") - while (( ${#queue[@]} )); do - f="${queue[0]}"; queue=("${queue[@]:1}") - [[ -z "${seen[$f]:-}" ]] || continue - seen[$f]=1 - printf '%s\n' "$f" - while read -r m; do - p="src/${m//.//}.agda" - [[ -f "$p" ]] && queue+=("$p") - done < <(sed -e 's/--.*$//' "$f" | grep -oE '(^|[[:space:];])import[[:space:]]+[A-Za-z0-9_.]+' | awk '{print $NF}') - done -} -# The input set of one leg, as paths of files that git tracks, sorted: -# Agda, the cone; Rocq, the file the invocation compiles; Lean, every tracked -# .lean file of the leg (Axioms.lean imports the library, which imports the -# rest) and the lakefile, toolchain and manifest that exist. -inputs() { - local prover="$1" dir - case "$prover" in - agda) agda_cone ;; - rocq) dir="$(legvar ROCQ_DIR)"; printf '%s/%s\n' "$dir" "$(legvar ROCQ_INVOCATION | awk '{print $NF}')" ;; - lean) dir="$(legvar LEAN_DIR)" - git ls-files -- "$dir" | grep -E '(\.lean|/lakefile\.(lean|toml)|/lean-toolchain|/lake-manifest\.json)$' ;; - *) die "unknown prover: $prover" ;; - esac | LC_ALL=C sort -u -} -# The §8.5.1 digest of a leg's inputs in the working tree: the SHA-256 of the -# sorted "sha256 path" manifest. On a clean checkout this is the reference -# digest at HEAD; --check confirms that with the reference script. -digest() { - local prover="$1" paths - paths="$(inputs "$prover")" - [[ -n "$paths" ]] || die "the $prover leg has no inputs" - while read -r p; do git ls-files --error-unmatch -- "$p" >/dev/null 2>&1 || die "$p is not tracked by git"; done <<< "$paths" - printf '%s\n' "$paths" | xargs -d '\n' sha256sum -- | sha256sum | cut -d' ' -f1 -} -# The reference digest (the pinned standard script) of a leg's inputs at a -# commit, over the input set of the working tree. If a file of that set is -# missing at the commit, the script fails and so does the gate. Equal bytes -# of the whole set at two commits mean an equal set: the cone is fixed by the -# contents of its own files, and the other legs' sets are fixed by name. -ref_digest() { - local commit="$1" prover="$2" - check_pinned "$digest_script" "$DIGEST_SHA256" 'reference digest script' - mapfile -t paths < <(inputs "$prover") - bash "$digest_script" "$commit" "${paths[@]}" -} -check_pinned() { - local file="$1" sum="$2" what="$3" - [[ -f "$file" ]] || die "the pinned $what is missing at $file: run bash scripts/grade-receipt.sh --fetch-reader" - [[ "$(sha256sum "$file" | cut -d' ' -f1)" == "$sum" ]] || die "$file is not the pinned $what (sha256 differs)" -} -# Make a commit available, fetching the forge reference that keeps it. -ensure_commit() { - local commit="$1" ref="${2:-}" - git cat-file -e "$commit^{commit}" 2>/dev/null && return 0 - [[ -n "$ref" ]] || die "commit $commit is not here and has no fetch reference" - git fetch -q origin "+$ref:refs/remotes/origin/receipt-fetch/${commit:0:12}" \ - || die "cannot fetch $ref for commit $commit" - git cat-file -e "$commit^{commit}" 2>/dev/null || die "$ref does not hold commit $commit" -} -echo_ref() { local c="$1"; echoes | awk -F'|' -v c="$c" '$1==c{print $4}'; } - -# ── Ledger rows ─────────────────────────────────────────────────────────────── -# Validate one row; print nothing. A field may not hold " or \ (deed strings) -# and may not be empty, except the reason of a current receipt and the axioms. -check_row() { - local row="$1" prover run commit checker inv dig said state reason axioms a - IFS='|' read -r prover run commit checker inv dig said state reason axioms <<< "$row" - [[ "$(tr -cd '|' <<< "$row" | wc -c)" == 9 ]] || die "a ledger row needs 10 fields: $row" - [[ "$row" != *'"'* && "$row" != *'\'* ]] || die "a ledger row holds a quote or backslash: $row" - [[ "$prover" =~ ^(agda|rocq|lean)$ ]] || die "unknown prover in row: $row" - [[ "$commit" =~ ^[0-9a-f]{40}$ ]] || die "a row's commit must be 40 lowercase hex: $row" - [[ "$dig" =~ ^[0-9a-f]{64}$ ]] || die "a row's inputs digest must be a sha256: $row" - [[ -n "$run" && -n "$checker" && -n "$inv" && -n "$said" ]] || die "an empty field in row: $row" - case "$state" in - current) [[ -z "$reason" ]] || die "a current row carries no reason: $row" ;; - superseded|regressed) [[ -n "$reason" ]] || die "a $state row needs a reason: $row" ;; - *) die "unknown receipt state in row: $row" ;; - esac - if [[ -n "$axioms" ]]; then - IFS=',' read -ra a <<< "$axioms" - for x in "${a[@]}"; do [[ "$x" =~ ^[^:]+:(c|b|debt)$ ]] || die "an axiom must be name:c, name:b or name:debt: $row"; done - fi -} -check_echo() { - local row="$1" src img wit ref - IFS='|' read -r src img wit ref <<< "$row" - [[ "$src" =~ ^[0-9a-f]{40}$ && "$img" =~ ^[0-9a-f]{40}$ ]] || die "an echo needs two 40-hex commits: $row" - [[ "$src" != "$img" ]] || die "an echo joins a commit to itself: $row" - [[ "$wit" == inputs-sha256 ]] || die "this gate writes the inputs-sha256 witness only: $row" - [[ "$ref" =~ ^refs/ ]] || die "an echo needs the forge reference that keeps its source: $row" -} - -# The ledger in force: runs(), plus the rows of $extra (a file) as current; -# an earlier current row of a prover that $extra covers becomes superseded. -extra= -ledger() { - local row prover run state - local -A replaced=() - if [[ -n "$extra" ]]; then - while IFS= read -r row; do - [[ -n "$row" ]] || continue - IFS='|' read -r prover run _ <<< "$row" - replaced[$prover]="$run" - printf '%s\n' "$row" - done < "$extra" - fi - while IFS= read -r row; do - [[ -n "$row" ]] || continue - IFS='|' read -r prover _ _ _ _ _ _ state _ <<< "$row" - if [[ "$state" == current && -n "${replaced[$prover]:-}" ]]; then - printf '%s|superseded|replaced by the later run %s|%s\n' "$(cut -d'|' -f1-7 <<< "$row")" "${replaced[$prover]}" "$(cut -d'|' -f10 <<< "$row")" - else - printf '%s\n' "$row" - fi - done < <(runs) -} -# ── Grade (§8.2 and §8.5.2, the same rules as readProofReceipt) ─────────────── -has_current() { local prover="$1"; awk -F'|' -v p="$prover" '$1==p && $8=="current"{f=1} END{exit !f}' "$ledger_file"; } -current_field() { local prover="$1" field="$2"; awk -F'|' -v p="$prover" -v f="$field" '$1==p && $8=="current"{print $f}' "$ledger_file"; } -canonical() { - local w=" $1 " - [[ "$w" == *' --safe '* && "$w" == *' --without-K '* ]] && [[ "$w" == *' --cubical-compatible '* || "$w" == *' --cubical '* ]] -} -# A leg's witness counts only if every axiom its current receipt reports has -# disposition c (§8.4). -axioms_ok() { local prover="$1"; [[ ",$(current_field "$prover" 10)," != *':b,'* && ",$(current_field "$prover" 10)," != *':debt,'* ]]; } -# §8.5.2: the leg's current receipt describes the :source-commit when its -# commit is that commit, or an echo chain leads there and every link's digest -# for this prover equals the receipt's digest. -describes_source() { - local prover="$1" c d img - c="$(current_field "$prover" 3)"; d="$(current_field "$prover" 6)" - while :; do - [[ "$c" != "$source_commit" ]] || return 0 - img="$(awk -F'|' -v c="$c" '$1==c{print $2}' "$echo_file")" - [[ -n "$img" ]] || return 1 - [[ "$(awk -F'|' -v c="$c" -v p="$prover" '$1==c && $2==p{print $3}' "$echo_digest_file")" == "$d" ]] || return 1 - c="$img" - done -} -pwg_of() { - local token="$1" coq_route="$2" coq_state="$3" lean_route="$4" lean_state="$5" n=0 p - [[ "$token" == proven || "$token" == proven-with-postulates ]] || { printf 'ungraded'; return; } - has_current agda && axioms_ok agda && canonical "$(current_field agda 5)" || { printf 'ungraded'; return; } - for p in rocq lean; do - local route state - if [[ $p == rocq ]]; then route="$coq_route" state="$coq_state"; else route="$lean_route" state="$lean_state"; fi - [[ "$route" == transported || "$route" == re-proved ]] && [[ "$state" == RECONCILED ]] && has_current "$p" && axioms_ok "$p" && n=$((n + 1)) - done - case "$n" in - 0) printf 'PWG-3' ;; - 1) printf 'PWG-2i' ;; - 2) if describes_source agda && describes_source rocq && describes_source lean; then printf 'PWG-1'; else printf 'PWG-2ii'; fi ;; - *) die "unexpected recheck count: $n" ;; - esac -} - -# ── Emit ────────────────────────────────────────────────────────────────────── -emit_axioms() { - local list="$1" x - if [[ -z "$list" ]]; then printf ' (axioms))\n'; return; fi - printf ' (axioms' - IFS=',' read -ra a <<< "$list" - for x in "${a[@]}"; do printf '\n (axiom :name "%s" :disposition %s)' "${x%:*}" "${x##*:}"; done - printf '))\n' -} -# §8.5.1: the inputs manifest of a leg's current receipt, one (file ...) per -# line of the reference script's --manifest output at the receipt's commit. -# The reader recomputes :inputs-sha256 from it. -emit_manifest() { - local prover="$1" sha path - printf ' (inputs-manifest' - while read -r sha path; do - printf '\n (file :path "%s" :sha256 "%s")' "$path" "$sha" - done < "$manifest_dir/$prover" - printf ')\n' -} -emit_receipts() { - local prover="$1" row p run commit checker inv dig said state reason axioms - # Current first, then the lineage in ledger order. - for want in current other; do - while IFS= read -r row; do - IFS='|' read -r p run commit checker inv dig said state reason axioms <<< "$row" - [[ "$p" == "$prover" ]] || continue - if [[ $want == current ]]; then [[ $state == current ]] || continue; else [[ $state != current ]] || continue; fi - printf ' ; the run reported: %s\n' "$said" - printf ' (receipt :run "%s"\n' "$run" - printf ' :commit "%s"\n' "$commit" - printf ' :checker "%s"\n' "$checker" - printf ' :invocation "%s"\n' "$inv" - if [[ $state == current ]]; then - printf ' :inputs-sha256 "%s"\n' "$dig" - printf ' :state current\n' - emit_manifest "$prover" - emit_axioms "$axioms" - else - printf ' :state %s\n :reason "%s")\n' "$state" "$reason" - fi - done < "$ledger_file" - done -} -emit_echoes() { - local src img wit ref p - while IFS='|' read -r src img wit ref; do - printf ' ; %s was rewritten into %s on %s; %s keeps it.\n' "${src:0:12}" "${img:0:12}" "$default_branch" "$ref" - printf ' (echo :source "%s" :image "%s" :witness %s' "$src" "$img" "$wit" - for p in agda rocq lean; do - printf '\n (inputs :prover %s :sha256 "%s")' "$p" "$(awk -F'|' -v c="$src" -v p="$p" '$1==c && $2==p{print $3}' "$echo_digest_file")" - done - printf ')\n' - done < "$echo_file" -} -emit() { - local id token kind coq coq_state lean lean_state coq_reason lean_reason m name binding +# ── Hooks of the generator ─────────────────────────────────────────────────── +receipt_header() { printf ';; SPDX-License-Identifier: CC-BY-SA-4.0\n' printf ';; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath)\n' printf ';; The proof receipt of secret-types (PROOF-POLICY §8.5.1, §8.5.2).\n' @@ -373,250 +158,44 @@ emit() { printf ';; checked with the reference script of the standard. The grade is derived,\n' printf ';; never typed:\n' printf ';; bun deed_lint.js --proof-receipt-json verification/receipts/agda_praxis.deed\n' - printf ';; with the reader at standards %s.\n' "$STANDARDS_COMMIT" + printf ';; with the reader at standards %s.\n' "$RECEIPT_STANDARDS_COMMIT" printf ';; Demonstrations N-4, N-5 and N-6 are not theorems (§8.1) and have no claim here.\n' printf ';; The trusted base is what scripts/check-trusted-base.sh finds in the\n' printf ';; prover-supplied modules of the import cone of %s.\n' "$(proof_agda_root)" - printf '(praxis-deed\n' - printf ' :schema-version "1.0.0"\n' - printf ' :canonical-name "secret-types-proof-receipt"\n' - printf ' :profile proof-receipt\n' - printf ' :repository "%s"\n' "$repo" - printf ' :source-commit "%s"\n' "$source_commit" - printf ' (trusted-base' - while IFS='|' read -r m name binding; do - printf '\n (primitive :prover agda :module "%s" :name "%s" :binding "%s")' "$m" "$name" "$binding" - done < <(proof_trusted_base) - printf ')\n' - emit_echoes - while IFS='|' read -r id token kind coq coq_state lean lean_state coq_reason lean_reason; do - [[ "$kind" == theorem ]] || continue - printf ' (claim :id "%s" :pwg %s :foundation-diverse #f\n' "$id" "$(pwg_of "$token" "$coq" "$coq_state" "$lean" "$lean_state")" - printf ' (leg :prover agda :route source :token %s :state AGDA-VERIFIED' "$token" - if has_any agda; then printf '\n'; emit_receipts agda | sed '$ s/$/)/'; else printf ')\n'; fi - emit_leg rocq "$coq" "$coq_state" "$coq_reason" ')' - emit_leg lean "$lean" "$lean_state" "$lean_reason" '))' - done < <(claims) - printf ')\n' } -# Print one recheck leg, then $5 (the closing parentheses). A waived or -# unavailable leg carries only its reason (§8.5.1); a transported or -# re-proved leg carries its token, its §2.2 state and its receipts. -emit_leg() { - local prover="$1" route="$2" state="$3" reason="$4" close="$5" - case "$route" in - waived|unavailable) - [[ -n "$reason" && "$reason" != *'"'* ]] || die "a $route $prover leg needs a reason without a quote" - printf ' (leg :prover %s :route %s :reason "%s"%s\n' "$prover" "$route" "$reason" "$close" ;; - transported|re-proved) - printf ' (leg :prover %s :route %s :token %s :state %s' "$prover" "$route" "$(leg_token "$state")" "$state" - if has_any "$prover"; then printf '\n'; emit_receipts "$prover" | sed "\$ s/\$/$close/"; else printf '%s\n' "$close"; fi ;; - *) die "unknown route for the $prover leg: $route" ;; +receipt_trusted_base() { proof_trusted_base; } +# The legs' invocations, read from their one definition. +legvar() { local name="$1"; sed -n "s/^$name='\\{0,1\\}\\([^']*\\)'\\{0,1\\}\$/\\1/p" scripts/check-legs.sh; } +receipt_invocation() { + case "$1" in + agda) proof_agda_invocation ;; + rocq) printf '%s (in %s)\n' "$(legvar ROCQ_INVOCATION)" "$(legvar ROCQ_DIR)" ;; + lean) printf '%s; %s (in %s)\n' "$(legvar LEAN_BUILD)" "$(legvar LEAN_AXIOMS)" "$(legvar LEAN_DIR)" ;; + *) receipt_die "unknown prover: $1" ;; esac } -has_any() { local prover="$1"; awk -F'|' -v p="$prover" '$1==p{f=1} END{exit !f}' "$ledger_file"; } -# A leg's §5 token: a RECONCILED re-proof is kernel-checked with no axiom -# (scripts/check-legs.sh refuses any), so it is proven; any other state is open. -leg_token() { local state="$1"; [[ "$state" == RECONCILED ]] && printf 'proven' || printf 'open'; } - -# ── Cross-checks of the typed claim list ────────────────────────────────────── -check_claim_ids() { - local decl doc - decl="$(claims | cut -d'|' -f1 | LC_ALL=C sort)" - doc="$(grep -oE '^\| N-[0-9]+ ' PROOF-STATUS.adoc | tr -d '| ' | LC_ALL=C sort -u || true)" - [[ -n "$doc" ]] || die 'no claim ids found in PROOF-STATUS.adoc; the table layout changed' - if [[ "$decl" != "$doc" ]]; then - diff <(printf '%s\n' "$doc") <(printf '%s\n' "$decl") \ - | sed 's/^/ only in grade-receipt.sh:/' >&2 - die 'claim ids differ between this receipt and PROOF-STATUS.adoc' - fi -} -check_leg_records() { - local rec=verification/legs/README.adoc counted recorded - counted="$(claims | awk -F'|' '$5=="RECONCILED"||$7=="RECONCILED"{print $1}' | LC_ALL=C sort)" - recorded="$(grep -oE '^\| N-[0-9]+$' "$rec" 2>/dev/null | tr -d '| ' | LC_ALL=C sort -u || true)" - if [[ "$counted" != "$recorded" ]]; then - diff <(printf '%s\n' "$recorded") <(printf '%s\n' "$counted") \ - | grep -E '^[<>]' | sed "s|^<| only in $rec:|; s/^>/ only in grade-receipt.sh:/" >&2 - die "claims with a RECONCILED leg differ from the rows of $rec" - fi -} - -# Prepare $ledger_file, $echo_file, $echo_digest_file and $source_commit. The -# current receipts must name one commit; the :source-commit is the end of the -# echo chain from it (§8.5.2), or that commit if it has no echo. With no -# current receipt it is $fallback_commit (nothing is graded then). Each echo -# link's witness digests are computed at its source and at its image with the -# reference script, and must be equal (§8.5.3, check 3). -prepare() { - ledger_file="$(mktemp)"; echo_file="$(mktemp)"; echo_digest_file="$(mktemp)" - tmpfiles+=("$ledger_file" "$echo_file" "$echo_digest_file") - ledger > "$ledger_file" - echoes | grep . > "$echo_file" || true - local row p commits src img wit ref a b - while IFS= read -r row; do check_row "$row"; done < "$ledger_file" - while IFS= read -r row; do check_echo "$row"; done < "$echo_file" - [[ "$(cut -d'|' -f1 "$echo_file" | sort | uniq -d | wc -l)" == 0 ]] || die 'an echo source has two images' - commits="$(awk -F'|' '$8=="current"{print $3}' "$ledger_file" | sort -u)" - [[ "$(grep -c . <<< "$commits" || true)" -le 1 ]] || die "the current receipts name different commits: $(tr '\n' ' ' <<< "$commits")" - for p in agda rocq lean; do - [[ "$(awk -F'|' -v p="$p" '$1==p && $8=="current"' "$ledger_file" | wc -l)" -le 1 ]] || die "the $p leg has more than one current row" - done - while IFS='|' read -r src img wit ref; do - ensure_commit "$src" "$ref"; ensure_commit "$img" "refs/heads/$default_branch" - for p in agda rocq lean; do - a="$(ref_digest "$src" "$p")" || die "cannot compute the $p digest at $src" - b="$(ref_digest "$img" "$p")" || die "cannot compute the $p digest at $img" - [[ "$a" == "$b" ]] || die "echo $src -> $img: the $p inputs differ ($a at the source, $b at the image)" - printf '%s|%s|%s\n' "$src" "$p" "$a" >> "$echo_digest_file" - done - done < "$echo_file" - # The inputs manifest of each current receipt, at its commit (§8.5.1). Its - # SHA-256 is the digest the ledger records, or the row is wrong. - manifest_dir="$(mktemp -d)"; tmpfiles+=("$manifest_dir") - local c paths - for p in agda rocq lean; do - has_current "$p" || continue - c="$(current_field "$p" 3)" - ensure_commit "$c" "$(echo_ref "$c")" - check_pinned "$digest_script" "$DIGEST_SHA256" 'reference digest script' - mapfile -t paths < <(inputs "$p") - bash "$digest_script" --manifest "$c" "${paths[@]}" > "$manifest_dir/$p" || die "cannot list the $p inputs at $c" - a="$(sha256sum < "$manifest_dir/$p" | cut -d' ' -f1)" - [[ "$a" == "$(current_field "$p" 6)" ]] \ - || die "the $p receipt records inputs $(current_field "$p" 6), but the manifest at $c gives $a" - done - source_commit="${commits:-$fallback_commit}" - local steps=0 next - while next="$(awk -F'|' -v c="$source_commit" '$1==c{print $2}' "$echo_file")" && [[ -n "$next" ]]; do - source_commit="$next"; steps=$((steps + 1)) - (( steps < 64 )) || die 'the echoes form a cycle' - done - [[ "$source_commit" =~ ^[0-9a-f]{40}$ ]] || die "no 40-hex source commit (got '${source_commit}')" -} - -# §8.5.3: the git checks, by the shared checker of the standard -# (scripts/check-proof-receipt.sh), so this gate and every consumer check in -# the same way: the reader accepts the receipt, the :source-commit is on the -# default branch, every manifest entry is the git blob at its receipt's -# commit, and every echo's manifests hold at its source and its image. -check_git_facts() { - local file="$1" base - base="refs/remotes/origin/$default_branch" - git rev-parse -q --verify "$base" >/dev/null || base="refs/heads/$default_branch" - check_pinned "$checker" "$CHECKER_SHA256" 'git checker' - check_pinned "$reader" "$READER_SHA256" 'reader' - bash "$checker" --branch "$base" "$file" . || die "the git checks of PROOF-POLICY §8.5.3 failed for $file" - printf 'PASS: git checks of §8.5.3 (shared checker, standards %s, --branch %s)\n' "${STANDARDS_COMMIT:0:12}" "$base" -} - -# Each current receipt must still describe the tree: its inputs digest is the -# digest of the inputs now, and the reference script agrees. Otherwise the -# grade cannot be carried forward (§8.4, regression drops the grade): record a -# new run, or mark the row superseded or regressed with its reason. -check_currency() { - local p want got - for p in agda rocq lean; do - has_current "$p" || continue - want="$(current_field "$p" 6)"; got="$(digest "$p")" - [[ "$want" == "$got" ]] || die "the $p inputs changed since run $(current_field "$p" 2) (recorded $want, now $got): record a new CI run, or mark that row superseded or regressed" - done -} - -# Run the pinned reader on $1 and print each claim's derived grade. Then the -# negative control: the same receipt with one claim's :pwg changed must be -# refused, so a reader that stopped deriving grades cannot pass this gate. -read_with_reader() { - local file="$1" json first wrong ctl err - command -v bun >/dev/null || die 'bun is needed to run the pinned reader' - check_pinned "$reader" "$READER_SHA256" 'reader' - json="$(bun "$reader" --proof-receipt-json "$file")" || die "the pinned reader refused $file" - printf 'PASS: the pinned reader (standards %s) accepts %s\n' "${STANDARDS_COMMIT:0:12}" "$file" - grep -oE '"source_commit":"[0-9a-f]{40}"' <<< "$json" | sed 's/"source_commit":"\(.*\)"/ source-commit \1/' - grep -oE '"id":"[^"]*","pwg":"[^"]*","foundation_diverse":(true|false)' <<< "$json" \ - | sed -E 's/"id":"([^"]*)","pwg":"([^"]*)","foundation_diverse":(.*)/ \1 \2 foundation-diverse \3/' - first="$(grep -m1 -oE ':pwg [A-Za-z0-9-]+' "$file" | cut -d' ' -f2)" - case "$first" in PWG-1) wrong=PWG-2ii ;; *) wrong=PWG-1 ;; esac - ctl="$(mktemp -d)"; tmpfiles+=("$ctl") - awk -v w="$wrong" '!done && /:pwg /{sub(/:pwg [A-Za-z0-9-]+/, ":pwg " w); done=1} {print}' "$file" > "$ctl/control_praxis.deed" - if err="$(bun "$reader" --proof-receipt-json "$ctl/control_praxis.deed" 2>&1)"; then - die "negative control: the reader accepted a receipt whose first claim records :pwg $wrong" - fi - grep -q 'records :pwg' <<< "$err" || { printf '%s\n' "$err" >&2; die 'negative control: refused for another reason than the grade'; } - printf 'PASS: negative control (the first claim recorded as :pwg %s is refused: its legs support %s)\n' "$wrong" "$first" -} - -fetch_pinned() { - local path="$1" sum="$2" dest="$3" - mkdir -p "$(dirname "$dest")" - curl --proto '=https' --tlsv1.2 -fsSL "$STANDARDS_RAW/$path" -o "$dest.tmp" - echo "$sum $dest.tmp" | sha256sum --check --strict >/dev/null || { rm -f "$dest.tmp"; die "the fetched $path does not match its pinned sha256"; } - mv "$dest.tmp" "$dest"; printf 'FETCHED %s (standards %s) to %s\n' "$path" "${STANDARDS_COMMIT:0:12}" "$dest" -} - -tmpfiles=() -cleanup() { (( ${#tmpfiles[@]} )) && rm -rf "${tmpfiles[@]}"; return 0; } -trap cleanup EXIT - -mode=--write; fallback_commit=; target="$out" -r_prover=; r_run=; r_commit=; r_checker=; r_reported= -while (( $# )); do +# The input set of one leg (§8.5.1): Agda, the cone of the graded root under +# src (scripts/check-trusted-base.sh checks the scan against +# agda --dependency-graph); Rocq, the file the invocation compiles; Lean, every +# tracked .lean file of the leg and the lakefile, toolchain and manifest that +# exist. +receipt_inputs() { + local dir case "$1" in - --write|--check|--fetch-reader) mode="$1" ;; - --digest) mode=--digest; r_prover="${2:-}"; shift ;; - --inputs) mode=--inputs; r_prover="${2:-}"; shift ;; - --run-row) mode=--run-row; r_prover="${2:-}"; shift ;; - --emit-run) mode=--emit-run; extra="${2:-}"; shift ;; - --out) target="${2:-}"; shift ;; - --commit) fallback_commit="${2:-}"; r_commit="${2:-}"; shift ;; - --run) r_run="${2:-}"; shift ;; - --checker) r_checker="${2:-}"; shift ;; - --reported) r_reported="${2:-}"; shift ;; - -h|--help) sed -n '5,25p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;; - *) printf 'unknown argument: %s\n' "$1" >&2; exit 2 ;; + agda) receipt_agda_cone "$(proof_agda_root)" src ;; + rocq) dir="$(legvar ROCQ_DIR)"; printf '%s/%s\n' "$dir" "$(legvar ROCQ_INVOCATION | awk '{print $NF}')" ;; + lean) dir="$(legvar LEAN_DIR)" + git ls-files -- "$dir" | grep -E '(\.lean|/lakefile\.(lean|toml)|/lean-toolchain|/lake-manifest\.json)$' ;; + *) receipt_die "unknown prover: $1" ;; esac - shift -done +} +receipt_status_ids() { grep -oE '^\| N-[0-9]+ ' PROOF-STATUS.adoc | tr -d '| ' || true; } +receipt_recorded_legs() { grep -oE '^\| N-[0-9]+$' verification/legs/README.adoc 2>/dev/null | tr -d '| ' || true; } -case "$mode" in - --digest) digest "$r_prover" ;; - --inputs) inputs "$r_prover" ;; - --run-row) - # A run that passed its gate reported no axiom: every gate fails on one. - row="$r_prover|$r_run|$r_commit|$r_checker|$(invocation "$r_prover")|$(digest "$r_prover")|$r_reported|current||" - check_row "$row"; printf '%s\n' "$row" ;; - --fetch-reader) - fetch_pinned 1-formats/deed/tools/deed_lint.js "$READER_SHA256" "$reader" - fetch_pinned scripts/proof-inputs-sha256.sh "$DIGEST_SHA256" "$digest_script" - fetch_pinned scripts/check-proof-receipt.sh "$CHECKER_SHA256" "$checker" ;; - --write|--emit-run) - check_claim_ids; check_leg_records - [[ -n "$fallback_commit" ]] || fallback_commit="$(git rev-parse HEAD)" - [[ "$mode" == --write || -f "$extra" ]] || die "--emit-run needs a rows file" - prepare - # A run's receipt must describe the tree it was emitted from. - if [[ "$mode" == --emit-run ]]; then check_currency; fi - mkdir -p "$(dirname "$target")" - emit > "$target" - printf 'WROTE %s (source-commit %s)\n' "$target" "$source_commit" - if [[ "$mode" == --emit-run ]]; then - read_with_reader "$target" - printf 'To record this run, add these rows to runs() in scripts/grade-receipt.sh:\n' - sed 's/^/ /' "$extra" - fi ;; - --check) - check_claim_ids; check_leg_records - [[ -f "$out" ]] || die "$out is missing" - fallback_commit="$(sed -n 's/^ :source-commit "\([0-9a-f]*\)"$/\1/p' "$out")" - prepare - check_currency - tmp="$(mktemp)"; tmpfiles+=("$tmp") - emit > "$tmp" - if ! diff -u "$out" "$tmp" >&2; then - die 'the receipt does not match the tree and the ledgers: regenerate with bash scripts/grade-receipt.sh --write' - fi - printf 'PASS: %s matches the tree and the ledgers (source-commit %s)\n' "$out" "$source_commit" - check_git_facts "$out" - read_with_reader "$out" ;; - *) die "unknown mode: $mode" ;; +case "${1:-}" in + -h|--help) sed -n '5,19p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;; + --fetch-reader) fetch_pinned; exit 0 ;; esac +check_pinned +. "$RECEIPT_STD/scripts/proof-receipt.sh" +receipt_main "$@" diff --git a/verification/legs/README.adoc b/verification/legs/README.adoc index 2707638..39a7a6a 100644 --- a/verification/legs/README.adoc +++ b/verification/legs/README.adoc @@ -177,8 +177,8 @@ N-4, N-5 and N-6 have no leg. They are checked demonstrations, not theorems independent of Agda's, but all three are dependent type theories. The tag needs a witness in a different foundation, such as Isabelle/HOL, and none exists. -* The grade is `PWG-2ii`, not `PWG-1`. `PWG-1` needs a receipt per witness, - per commit, recording the observed result of a pinned checker run on that - commit (§8.2). The receipt here records the legs' versions, invocations and - input digests; the CI log of the `legs` job is the observed result, and it - is not yet captured as a receipt. +* The grade, `PWG-1`, rests on the receipts of one CI run + (https://github.com/hyperpolymath/secret-types/actions/runs/43455458225[43455458225] + on commit `7dfeab2`), carried to `292d566` on main by an echo (§8.5.2). + A change to any leg's inputs drops it until a new run is recorded (§8.4); + link:../../PROOF-STATUS.adoc[`PROOF-STATUS.adoc`] gives the derivation. diff --git a/verification/receipts/agda_praxis.deed b/verification/receipts/agda_praxis.deed index 6dfae63..fb022b5 100644 --- a/verification/receipts/agda_praxis.deed +++ b/verification/receipts/agda_praxis.deed @@ -7,7 +7,7 @@ ;; checked with the reference script of the standard. The grade is derived, ;; never typed: ;; bun deed_lint.js --proof-receipt-json verification/receipts/agda_praxis.deed -;; with the reader at standards e5a39d7e5c66f9d24d7e0ffa3f8dbd01f2d42d9d. +;; with the reader at standards f6ebc5ec6ba5d7f79ce996bf74c5237481a2a2fb. ;; Demonstrations N-4, N-5 and N-6 are not theorems (§8.1) and have no claim here. ;; The trusted base is what scripts/check-trusted-base.sh finds in the ;; prover-supplied modules of the import cone of src/SecretTypes/All.agda. From e8617808b4ad484f465bff0bbbd4ba1ec3019605 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 22:28:05 +0000 Subject: [PATCH 2/2] ci(proofs): fetch the receipt tools before the trusted-base gate check-trusted-base.sh calls grade-receipt.sh --inputs agda, which now sources the shared generator, so the fetch has to come before it. The proofs job failed at that step with "the pinned scripts/proof-receipt.sh is missing"; locally, with _build/standards removed, the same call fails the same way and passes once --fetch-reader has run. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BYbQRtNu216R13jtZLmoqs --- .github/workflows/proofs.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/proofs.yml b/.github/workflows/proofs.yml index bcc61ef..f6278a1 100644 --- a/.github/workflows/proofs.yml +++ b/.github/workflows/proofs.yml @@ -87,16 +87,17 @@ jobs: printf '::error title=Agda gate failed (rc=%s)::%s\n' "$rc" "$out" fi exit 0 + # The receipt script sources the shared generator (standards + # scripts/proof-receipt.sh), fetched at its pin and sha256-checked. + # check-trusted-base.sh below already calls it (--inputs agda). + - name: Fetch the pinned receipt tools (sha256-checked) + run: bash scripts/grade-receipt.sh --fetch-reader # PROOF-POLICY §8.4: the prover-supplied postulates of the import cone # are exactly the trusted base the receipt lists (scripts/proof-flags.sh). - name: Trusted base of the import cone run: bash scripts/check-trusted-base.sh 2>&1 | tee /tmp/trusted-base.log - name: Which laws generic TINI uses run: bash scripts/minimal-laws.sh - # The receipt script sources the shared generator (standards - # scripts/proof-receipt.sh), fetched at its pin and sha256-checked. - - name: Fetch the pinned receipt tools (sha256-checked) - run: bash scripts/grade-receipt.sh --fetch-reader # The ledger row of this run's Agda leg: what the receipt job records. # Every field is read from this run: the checker's own version line, the # commit checked out, and the trusted-base lines the gates printed.