// SPDX-License-Identifier: CC-BY-SA-4.0 = Hyperpolymath Proof and Verification Policy Jonathan D.A. Jewell :toc: :toc-placement: preamble Which prover carries which kind of obligation, how theory proofs are rechecked, and when another tool is allowed. Owner ruling of 2026-10-26; it records the policy half of standards#692; the enforcing gate and the rollout are tracked there. Every hyperpolymath repository follows this file, and the repositories' `CLAUDE.md` files point here. A `CLAUDE.md` may carry a short summary of the mapping for agents arriving there; it names this file as normative and changes in the same change as this file. §8 names how much independent witness a theory theorem has, as Proof Witness Grades (`PWG-3`, `PWG-2i`, `PWG-2ii`, `PWG-1`). It was added by owner ruling of 2026-11-04, together with the clarifications to §1.1, §2, §2.1, §2.2, §4, §6 and §7 that close standards#1389. Owner ruling of 2026-11-07 adopts *Creusot, Pearlite and Verus* as the default first-party Rust verification toolset (§1.2). It supersedes the previous exclusion of Verus in §4.1. Adoption is a policy decision, not a claim that existing repositories already run or pass both verifiers. This policy decides *where a proof lives*. What counts as an escape hatch in a proof, and how such debt is recorded, stays with link:../docs/TRUSTED-BASE-REDUCTION-POLICY.adoc[`docs/TRUSTED-BASE-REDUCTION-POLICY.adoc`]. == 1. The mapping [cols="1,1,2",options="header"] |=== |Code or obligation |Verifier |Scope |Rust code |*Creusot* with *Pearlite* contracts, and *Verus* |Default toolset for contracts and proofs on first-party Rust (§1.2). Verification sits on the implementation; a separately rewritten model does not establish implementation correctness on its own. |Ada code |*SPARK* |SPARK applies where the code is Ada. It is not the verifier for Rust. |APIs, ABIs and engineering properties |*Idris2* |Interface and ABI contracts, totality, serialisation round-trips, dispatch and ordering invariants, bounds, and other properties of a system as built. |Theory |*Agda*, rechecked in *Rocq* and *Lean* |Mathematical content that does not depend on one system's code: lattices, orders, convergence, completeness, soundness of a calculus. Agda is the source of truth; the recheck is §2. |=== The word "Rust" in estate documents means Rust. The 2026-04-10 note that read "Rust always means Rust/SPARK" is withdrawn: SPARK belongs to Ada code, and Rust uses Creusot with Pearlite contracts and Verus by default. Deciding between *engineering* and *theory*: if the statement names a type, function or wire format of one repository, it is engineering (Idris2). If it would be true of any implementation, it is theory (Agda). When an engineering property is about the behaviour of first-party Rust or Ada code (a function's pre- and postconditions, a loop invariant, absence of run-time errors), the code mapping takes precedence: it is verified with Creusot/Pearlite and Verus for Rust (§1.2), or SPARK for Ada, on that code, not restated in Idris2. Idris2 carries the *interface* contract that stands apart from any one implementation: types, ABI layouts, wire formats, and the protocols several languages share. === 1.1 Third-party code This policy binds first-party code: what the estate writes and owns. Code the estate depends on but does not own (crates such as Bevy, libraries, vendored or forked upstream code) is not converted, re-proved, or annotated to meet it, and is never edited to add contracts. Where a first-party proof relies on a dependency's behaviour, state that reliance at the boundary as an assumption: a trusted specification of the called function (Creusot `#[trusted]` extern specs, a SPARK `Import` contract, an Idris2 FFI type), recorded in the repo's proof-status file as `ASSUMED` with the dependency and version it describes. A row is only as strong as the weakest step it depends on (link:../docs/README-EXPLAINME-STANDARD.adoc[`README-EXPLAINME-STANDARD.adoc`]), so a caller whose obligations were discharged using that contract is recorded as proved *relative to the assumption*: its row names the `ASSUMED` contract it rests on and is never counted as unconditionally `PROVEN` until the contract itself is checked. A dependency that the prover itself checks is not an assumption. When the whole import closure of a proof (the *import cone*: every module it transitively imports, first-party or library) compiles under the prover's safe mode with zero postulates, the dependency is *checked, not assumed*. Record the cone instead of an `ASSUMED` row: the root module, the flags in force, the postulate count (zero), and the library name, version and pin. A cone that contains a postulate, or that was compiled outside safe mode, is not checked; its postulates are recorded as §5 and link:../docs/TRUSTED-BASE-REDUCTION-POLICY.adoc[`TRUSTED-BASE-REDUCTION-POLICY.adoc`] require. When choosing between dependencies that fit equally well, prefer one that carries its own checking: published proofs (Creusot, Kani, Verus, Aeneas, SPARK, or kernel-checked Lean or Rocq), a model-checked or formally specified core, or at least sustained fuzzing. Record that choice where the dependency is added. This is a preference, not a gate: a dependency with no verified alternative is still allowed, and its absence of proofs is an assumption to record, not a reason to fork and convert it. === 1.2 Default Rust toolset: Creusot, Pearlite and Verus Name all three in first-party Rust verification plans, proof-status files and agent-facing policy summaries so none is lost between work sessions: * *Creusot* verifies Rust implementations against contracts. * *Pearlite* expresses Creusot's contracts, predicates and mathematical models. It is a specification language, not a third verifier or an additional independent proof result. * *Verus* is the complementary default verifier, using its own executable, specification and proof code. Pearlite contracts are not automatically Verus specifications or proofs. Plan scopes for both verifiers by default. For each obligation, name its implementation entrypoint, verifier, specification, assumptions and result. Scopes may differ: this default does not require rewriting every function or duplicating every proof. Where both verify the same property, record how the statements correspond and how each proof is connected to the shipped implementation. Two separately implemented models are not two proofs of the production code. Preserve established Creusot/Pearlite proofs when adding Verus. If either verifier is not applicable, unsupported, blocked or not yet run, record the specific reason, actual scope and next action in the proof-status file; never omit it silently or represent an unexecuted check as a pass. Keep the closed §5 status vocabulary: a pending required proof remains `OPEN`, with the explanation in a separate field. An exception to a required obligation follows §4. Each proof receipt records exact tool and solver versions, source revision, invocation, discharged obligations and trust boundary (§5–§7). Shared SMT solvers and shared specification assumptions remain shared trust. Using Creusot and Verus does not by itself establish independent witnesses or increase a theory theorem's Proof Witness Grade (§8). == 2. Rechecking theory proofs Every Agda theory proof is rechecked in Rocq and in Lean: . *Transport first.* The Agda proof term is carried across through Dedukti (Agda → Dedukti/Lambdapi → Rocq and Lean). echidna's exchange layer (`src/rust/exchange/`) already speaks Dedukti. A transported witness that the target kernel accepts is the strongest recheck, but the kernel checks the term only against the *translated* statement. So compare the translated statement with the Agda one (by reading it, or by a round trip back through Dedukti) and record how. Until that comparison is made, the translator is part of the trusted base for that theorem and the leg is `ASSUMED`, not `PROVEN`. . *Re-proof as fallback.* Where a construct does not translate (for example, a feature Agda2Dedukti does not cover), or where the pinned exporter has no route into the target, restate the theorem in the target prover and prove it there by hand. Check the pinned Lambdapi release for a Lean exporter before planning a transported Lean leg; until a released one exists, the Lean leg is re-proved. The statement must match the Agda statement; say how that was checked. . *Record which.* Each rechecked theorem lists, next to it in the repo's proof-status file, which route each target used: `transported` or `re-proved`, with the reason for any re-proof. No Mathlib, in Lean or elsewhere: a missing tactic or lemma is reproved by hand in the core library. A proof that needs a large external library to compile is a dependency, not a proof the estate owns. This rule forbids the *dependency*. Whether a *necessary axiom* is admissible is decided by disposition (c) of link:../docs/TRUSTED-BASE-REDUCTION-POLICY.adoc[`TRUSTED-BASE-REDUCTION-POLICY.adoc`]. An axiom's justification may cite a formalisation in Mathlib or elsewhere as the canonical statement of that axiom. The axiom must not enter the proof by importing that library. === 2.1 Canonical Agda invocation (2026-11-01) First-party Agda theory proof entrypoints shall use the following default, explicitly in local recipes and CI: [source,shell] ---- agda --safe --without-K --cubical-compatible ---- The Agda CLI option is \`--without-K\` with a capital K. \`--cubical-compatible\` is not the same as full \`--cubical\`. Pin and record the Agda version and standard library with each source commit and proof result. Missing tools, incompatible dependencies or failed theorems are open obligations: do not silently skip proofs or weaken compiler flags to make a check green. Theory proofs genuinely needing full Cubical Agda or incompatible options require an explicit, separately reviewed proof profile. Prior \`--safe\` or \`--safe --without-K\` successes are historical evidence, not receipts for this new combined profile. This section fixes how a theory proof *entrypoint* is invoked. It does not decide which escape-hatch markers a repository must budget, or how. The budgets, dispositions and detection are set by link:../docs/TRUSTED-BASE-REDUCTION-POLICY.adoc[`TRUSTED-BASE-REDUCTION-POLICY.adoc`]. That document's statement that prover invocation is a repository's own business covers its debt tooling only. It does not license a weaker entrypoint invocation than the one above. Existing Idris2 source/ABI proofs, Rust verification under §1.2 and Ada/SPARK engineering checks remain active as their source repos reconcile theory: a translated model does not prove runtime refinement. === 2.2 Lean and Rocq/Coq correspondence evidence The independent witness policy in section 2 operates per *theorem*, not on matching filenames. Record for the Agda source and each target prover: exact proposition, assumptions, type/universe discipline, source revision, compiler/library versions, invocation and observed result. Declare \`transported\`, \`re-proved\` or \`unavailable\` and record the separate justification connecting their semantics and statements. A successful compilation in each prover does not establish that all proved the same proposition. Keep distinguishable statuses: AGDA-PENDING, AGDA-VERIFIED, COQ-CHECKED, LEAN-CHECKED, BRIDGE-PENDING, RECONCILED, COUNTEREXAMPLE, QUARANTINED. A reconciled claim requires a checked bridge or justified statement correspondence, independent kernel results and explicit residual assumptions. A prover cannot inspect an arbitrary Agda witness by name alone. These are *correspondence states*. They say how far the statements in different provers have been tied together. They are not the §5 status tokens, which say how one leg was discharged, and they are not the §8 Proof Witness Grades, which say how many independent witnesses a theorem has. A record carries all three, and none may be written in another's field. A leg can be `PROVEN` and still `BRIDGE-PENDING`. Such a leg does not count towards a grade. Mathesis may catalogue proof receipts, but source projects retain local proof ownership. ECHIDNA is the longer-term automation destination, not a prerequisite for current independent checks. Do not force independent type, trope or identity projects into a Hypatia-specific proof architecture. === 2.3 Evidence-first event-chain rollout . Preserve and test existing proof gates before any migration. . Enforce this Agda invocation in the actual project scripts and CI. . Recover an exact theory theorem, port or independently reprove it faithfully in Agda and retain all assumptions. . Check a semantically matched statement in Rocq and Lean. . Establish and record the bridge, including unresolved assumptions. . Retain OPEN statuses and revalidation triggers rather than claiming estate-wide reconciliation from policy adoption. This text records a policy, not successful proof executions. The implementation PRs and their CI receipts establish those separately. == 3. Existing proofs Proofs written before this ruling are re-homed by kind, not rewritten for their own sake: * An existing Lean or Rocq proof of a *theory* statement keeps its value. The Agda statement becomes the source. The existing file counts as that prover's leg under §2 only once the Agda proof itself is `PROVEN` or `PROVEN-WITH-AXIOMS` and the file's theorem statement and assumptions have been compared with the Agda statement, with the comparison recorded. Any axioms the Agda proof rests on are listed in that leg's trust boundary too. Until then it is target-only evidence, recorded with its own status, and the Agda row stays `OPEN`. * An existing Isabelle proof of a *theory* statement is supplementary evidence. It satisfies neither the Rocq leg nor the Lean leg. * An existing proof of an *interface or ABI engineering* statement in a theorem prover other than Idris2 moves to Idris2 when it is next touched, unless it has a recorded §4 exception. Until then it stays, labelled with its prover. This migration rule does not apply to implementation proofs assigned by §1: Rust proofs remain with Creusot/Pearlite and Verus (§1.2), and Ada proofs remain with SPARK. Preserve their checked evidence rather than moving it into a parallel Idris2 model. * Corpora that exist to exercise provers are not obligations. echidna's `proofs//` trees and similar fixtures are test material for a multi-prover system and are outside this policy. == 4. Exceptions Use another tool where it is plainly the right one: when the mapped prover would take far longer, or cannot express the property at all. Isabelle/HOL, F*, TLA+, an SMT solver or anything else is allowed on that basis. In every reasonable case, follow §1. An exception is recorded beside the artefact (a header comment) and in the repo's proof-status file. The record names the obligation, the tool used, and why the mapped prover was not the right fit. Where the reason is that a theory statement cannot be expressed in Rocq or Lean, the recorded exception stands in for that recheck leg. The leg gets no status token; instead its row carries a `waiver` field pointing to the exception record, so the closed vocabulary of §5 is unchanged. The theorem is complete when the Agda proof is `PROVEN` or `PROVEN-WITH-AXIOMS` and every leg that is not waived is too. "Complete" is a statement about this policy's ledger, not about a grade. A waived leg is not a witness. A theorem with one leg waived is at most `PWG-2i`, and a theorem with both legs waived is at most `PWG-3` (§8). Worked exception: *TLA+ model checking* of concurrency protocols, as in hypatia's `verification/proofs/tlaplus/KinGate.tla`. A finite model check is reported as `TESTED`, with its bounds, not as `PROVEN`. === 4.1 Standing exceptions for Rust Two further tools are standing exceptions for Rust. Each one runs alongside the default §1.2 toolset and never replaces it. The record in the repo's proof-status file still names the obligation; the reason below need not be restated. *Kani* (bounded model checking) covers `unsafe` blocks and FFI seams, the code where Creusot's safe-Rust assumptions can fail. A Kani harness is reported as `TESTED`, with its unwinding and size bounds, as in the TLA+ case above. *Aeneas* is used only where Rust code implements a theorem proved in Agda. It translates the Rust into a Lean (or Rocq) model, and the proof about that model is checked by the target kernel. Its statement is compared with the Agda theorem's Lean or Rocq recheck as in §2. Two rows are recorded: the theorem about the model is `PROVEN`, and the correspondence between the model and the Rust code (Aeneas's translation) is a separate `ASSUMED` row, so the implementation is never counted as proved on the model alone. The backend's own axioms are part of the trust base. A backend with an axiom from which `False` is derivable cannot support any status above `ASSUMED`; Aeneas's Rocq backend is in that state (its `mk_array` axiom, Aeneas issue #1116, and it is unmaintained). Its Lean backend depends on Mathlib, which §2 rules out. Until a backend qualifies on both counts, the Rust-to-model correspondence row is recorded as `ASSUMED`. The model theorem remains `PROVEN` because its proof must be independently checked by the target kernel without those disallowed backend axioms or libraries. Adopting a backend needs a recorded owner decision. Verus belongs to the default toolset (§1.2), not to this exception list. The earlier exclusion is superseded by the owner ruling of 2026-11-07; shared solver trust is still recorded and is not claimed as independence. == 5. Status vocabulary Proof-status files use the closed proof-ledger vocabulary of link:../docs/README-EXPLAINME-STANDARD.adoc[`docs/README-EXPLAINME-STANDARD.adoc`]. The uppercase names below are this policy's labels for those terms. A machine-readable proof ledger records the canonical lowercase token; prose and tables may use either. * `PROVEN` is `proven`: machine-checked with no escape hatch. Either a kernel accepted a proof term, or a mapped verifier (Creusot through Why3, Verus, GNATprove, or a §4 exception tool such as F* or a direct SMT run) discharged every generated obligation with its automatic provers. In the second case the trust boundary names the tool, the provers and their versions. For a direct SMT result under §4, `PROVEN` additionally requires an independently checked certificate or an explicitly trusted checking boundary documented in that record. Without either, record `ASSUMED`; a bounded check is `TESTED`, with its bounds. * `PROVEN-WITH-AXIOMS` is `proven-with-postulates`: a kernel checked the proof, and it rests on named necessary axioms as link:../docs/TRUSTED-BASE-REDUCTION-POLICY.adoc[`TRUSTED-BASE-REDUCTION-POLICY.adoc`] allows. List the axioms. * `TESTED` is `tested-only`: checked on a bounded or sampled domain, such as property tests or model checking. Give the bounds. * `ASSUMED` is `argued`: a stated hypothesis, or a transcription that no kernel checked. * `OPEN` is `open`: not done. == 6. Toolchains The proof toolchains must be installable where the work runs: * *CI:* through the repo's Guix manifest or its container, per link:LANGUAGE-POLICY.adoc[`LANGUAGE-POLICY.adoc`] §2. * *Agent sessions:* through the cloud environment's setup script. Versions follow what each repo pins: Agda and its standard library as in CI, and Lean per project `lean-toolchain`. Creusot builds from its own repository with Cargo (its `INSTALL` script), which then uses opam for the Why3 and Why3find back ends. Lambdapi and Dedukti build through opam, and SPARK's `gnatprove` comes from Alire or its release bundles. A session or runner without access to those hosts cannot run those legs; say so instead of reporting the leg as passing. A repository may install a proof toolchain another way, for example from the upstream package index or a release archive. It must then record a `deviation` with the same discipline as a §4 exception. The record goes in the repo's proof-status file and in the workflow that installs the toolchain, and it names: * the leg or obligation affected; * the tool, its asserted version, and a digest of what was installed; * why the Guix manifest or the container could not be used; * its state: `open`, or `closed` with the change that closed it. The run asserts the version it got and fails on a mismatch. Silence is not compliance: a CI lane that installs a proof toolchain outside Guix or the container without a deviation record breaks this section. == 7. Amending this document Change the mapping only by owner ruling, and update the repositories' `CLAUDE.md` pointers in the same campaign. A gate that enforces this policy cites this file by repository, path and full 40-character commit. A path alone silently follows later amendments. The gate fails when the pin is missing, and moving the pin is a reviewed change. Verify any such gate both ways, as link:LANGUAGE-POLICY.adoc[`LANGUAGE-POLICY.adoc`] §3 requires: it passes on conforming input and fails on a planted violation. [[proof-witness-grades]] == 8. Proof Witness Grades (PWG) Owner ruling 2026-11-04. This section adopts as estate policy the grade ladder proposed in the Mathesis architecture brief (`hyperpolymath/mathesis`, `docs/proposals/estate-mathematical-architecture.adoc` §5–§6), with the corrections below. This section is normative. The brief is kept for provenance, and where the two differ this section governs. It binds every repository, bot and person that states or computes a grade for a proof. A Proof Witness Grade says *how many independent machine-checked witnesses a theory theorem has*. It describes an artefact. It is not a status token (§5), not a correspondence state (§2.2), and not a statement that the theorem complies with this policy. [IMPORTANT] .Which "grade" is this? ==== The estate has several schemes called "grade". Always write a PWG with its prefix: `PWG-3`, `PWG-2i`, `PWG-2ii`, `PWG-1`. Do not write a bare "Grade 2" or "Grade B" in a status line, README, ledger, issue or bot output. In prose, `PWG-2a` and `PWG-2b` are accepted aliases for `PWG-2i` and `PWG-2ii`. Records use the canonical labels only. [cols="1,2,3,2",options="header"] |=== |Scheme |Values |What it measures |Where |*PWG* |`3`, `2i`, `2ii`, `1`. *Lower is stronger*: the numbers count down. |Independent machine witnesses for one theory theorem |This section |CRG |`X F E D C B A` |Readiness of a software component |`4-readiness/component-readiness-grades/` |TRG |`X F E D C B A` |Readiness of a language toolchain |`4-readiness/toolchain-readiness-grades/` |ARG |`X F E D C B A` |Readiness of a language for adoption |`4-readiness/adoption-readiness-grades/` |FRG |`X F E D C B A` |Readiness of a language's formal foundations |`4-readiness/foundations-readiness-grades/` |ECHIDNA `TrustLevel` |`1`–`5`. *Higher is stronger*: the opposite direction to PWG. |Confidence in one dispatch result |`hyperpolymath/echidna`, `src/rust/verification/confidence.rs` |ECHIDNA `EpistemicLevel` |`Belief < Epi < Sound` |Whether fused prover verdicts denote the same statement |`hyperpolymath/echidna`, `src/rust/verification/result_arbiter.rs` |=== None of these converts into another. A `PWG-1` theorem says nothing about the CRG of the code that uses it, and an ECHIDNA `TrustLevel` of 5 is not a `PWG-1`. ECHIDNA may compute a PWG from receipts. It must report the PWG under that name, separately from its own levels. ==== === 8.1 Scope PWG applies to *theory* obligations (§1): theorems whose source of truth is Agda and which §2 requires to be rechecked in Rocq and Lean. Engineering proofs (Creusot, Verus, SPARK, Idris2) are not graded on this ladder. They use the §5 tokens only. A theory theorem that does not reach `PWG-3` is `ungraded`. Write `ungraded`, never a grade with a qualifier. This covers an Agda proof that is `OPEN` or `ASSUMED`, a theorem with no Agda source, and a theorem with only target-prover evidence (§3). === 8.2 The grades `PWG-3` — Agda source checked:: The Agda proof is `PROVEN` or `PROVEN-WITH-AXIOMS` under the §2.1 invocation, and no recheck leg counts yet. The receipt records the Agda version, the standard-library pin, the flags actually in force and the import cone (§1.1). A development that needs full `--cubical`, or any option outside §2.1, reaches `PWG-3` only under the separately reviewed proof profile §2.1 requires. + The brief's example `--safe --erasure` is not the canonical invocation. `PWG-2i` — one recheck leg:: `PWG-3`, plus exactly one of the §2 legs (Rocq or Lean) *counts*. + A leg counts when the target kernel accepted it as `PROVEN` or `PROVEN-WITH-AXIOMS` and its §2.2 correspondence state is `RECONCILED`. `RECONCILED` means the statement was compared with the Agda statement, the comparison was recorded, and the residual assumptions are listed. A leg counts whether it was `transported` or `re-proved` (§2). + These legs do not count: + * a transported leg whose statement comparison is not done (it is `ASSUMED`, §2); * a waived leg (§4); * an `unavailable` leg; * any leg still `BRIDGE-PENDING`. `PWG-2ii` — both recheck legs:: `PWG-3`, plus both the Rocq leg and the Lean leg count. This is the grade at which §2's recheck obligation is discharged. `PWG-1` — receipts per commit:: `PWG-2ii`, plus every counted witness (Agda, Rocq and Lean) has a current receipt from a headless, isolated, pinned checker run on the exact source commit. A receipt records: + * the checker and its version; * the image the checker ran in, pinned by its digest (`:image`, §8.5.1); * the invocation; * a digest of the inputs (`:inputs-sha256`, computed as §8.5.1 says); * the observed result; * the axioms reported, each with its disposition (`(axioms …)`, §8.4); * for Agda, the prover's trusted base: each prover-supplied postulate the import cone reaches, by name, with its binding (§8.4); * the source repository and its full 40-character commit. + The brief named checker services as the route: AXLE for Lean, `isabelle server`, and coq-lsp. These are examples, not requirements. A pinned kernel run in CI (`agda`, `rocq compile` or `coqc`, `lean` under `lake`) qualifies on the same terms. A checker service is no stronger than the kernel behind it. A hosted service counts only if it reports its checker version, and that version is recorded on the receipt. + *Isolated* means that the checker ran in a container image pinned by its digest, and the receipt names that image (owner ruling 2026-11-16). A fresh CI runner on its own, with the prover pinned by package version or by checksum, is not isolated: the runner image underneath it changes without notice. Such a witness still counts toward `PWG-3`, `PWG-2i` and `PWG-2ii`. The reader of §8.5.1 derives `PWG-1` only when the current receipt of every counted witness names an image. === 8.3 Foundational diversity is a tag, not a grade Agda, Rocq and Lean all belong to the dependent-type-theory family. A witness in a different foundation (Isabelle/HOL, HOL4, HOL Light, Metamath and the like) guards against a blind spot the three share. It is recorded as the tag `+foundation-diverse` beside whatever grade the theorem has, for example `PWG-2ii +foundation-diverse`. The tag needs a kernel-checked witness whose statement correspondence is recorded as in §2.2. It never stands in for the Rocq or the Lean leg (§3). This corrects the brief, which made a non-DTT second translation the condition for its Grade 2ii. === 8.4 Rules that apply to every grade . *A grade is not a discharge.* `PWG-3` and `PWG-2i` describe the artefact. They do not say the theorem meets §2. A theorem at those grades still owes its missing legs. . *Grades are derived, not asserted.* A grade is computed from the receipts and the §2.2 records. A grade written by hand that the receipts do not support is drift. A gate or a bot may recompute it at any time and reports the computed value. . *Claims need receipts.* A statement that a theory theorem is "verified", "machine-checked" or "kernel-checked" *through* a named checker, service or CI lane is a claim about the legs it names. Each of those legs needs a current receipt as `PWG-1` describes. This applies in a README, EXPLAINME, AFFIRMATION, release note, issue or bot output. A `PWG-1` label needs receipts for every witness. A grade that is not reached is not worded as if it were. . *Regression drops the grade.* If a later commit breaks a counted leg, the grade falls to the highest grade the current receipts support. Breaking includes a leg that fails, or one whose receipt cannot be reproduced at the new commit. Grades are never carried forward from an older commit. . *Lineage lives on the receipt.* A receipt that is kept but no longer current carries `state: superseded` (a newer receipt replaced it) or `state: regressed` (the source no longer checks), with the reason. These are receipt states. The §5 vocabulary stays closed, and no `Superseded` or `Regressed` status token exists. . *Axioms travel with the grade.* Every counted witness lists its axioms: `#print axioms` for Lean, `Print Assumptions` for Rocq. For Agda the mechanism has three parts: `--safe`, so the compiler refuses `postulate`; a comment-aware postulate scan of the import cone; and the recorded import cone itself (§1.1). A `PROVEN-WITH-AXIOMS` witness counts only if each axiom is admissible under disposition (c) of link:../docs/TRUSTED-BASE-REDUCTION-POLICY.adoc[`TRUSTED-BASE-REDUCTION-POLICY.adoc`]. The receipt lists each reported axiom with its disposition (§8.5.1). A witness that reports an axiom with a disposition other than (c) does not count. The prover-supplied postulates of the next rule are its trusted base, not reported axioms, and are not listed there. A grade never hides axioms. A summary that shows the grade shows whether it rests on axioms. . *The prover's own modules are in the cone.* For Agda, the import cone is the module set Agda reports for the graded roots (`--dependency-graph` gives it), and that set includes modules supplied with the prover, such as `Agda.Primitive` and `Agda.Builtin.*`. The postulate scan covers those modules too. Some of them declare primitives by `postulate`, and `--safe` accepts them, because a `BUILTIN` or `primitive` binding gives each one its meaning in the prover. Such a postulate is part of the prover's trusted base, not an axiom of the development, and it is admissible only under three conditions: + * the receipt lists it by name, with the binding that gives it its meaning; * the gate checks that exact list: the declared names and their bindings, not the file they sit in; * no other postulate appears in a prover-supplied module of the cone. + A postulate outside the list fails the gate. A change to the list, which a prover pin bump can cause, means the receipt must be earned again. + For example, Agda 2.6.4.3's `Agda.Primitive` postulates exactly `Level`, `lzero`, `lsuc` and `_⊔_`, bound by `BUILTIN LEVEL`, `LEVELZERO`, `LEVELSUC` and `LEVELMAX`. A `--cubical` development reaches more prover-supplied modules (`Agda.Primitive.Cubical`, `Agda.Builtin.Cubical.*`), and their list is longer. The scan must lex as Agda does: comments, string and character literals, pragma bodies and Agda's whitespace. Otherwise it can miss a postulate. hyperpolymath/januskey#170 (`scripts/check-agda.sh`, `scripts/scan-postulates.sh`) is a reference implementation with positive and negative controls. . *A census, never a percentage.* Grade counts may be published only as a census: a count per grade with the denominator, and the `ungraded` and lower rungs named in the same line. Never publish "X% proved", an average grade, or a single confidence score. === 8.5 Where a grade is recorded Each theorem's grade is recorded in its home repository's proof-status file, or in the machine ledger where there is one (README-EXPLAINME §5). The record holds: * `pwg`: one of `3`, `2i`, `2ii`, `1`, `ungraded`; * `foundation_diverse`: a boolean; * for each leg: its route (`transported`, `re-proved`, `waived`, `unavailable`), its §5 token, its §2.2 state, and its receipts, with their lineage states. Mathesis may catalogue grades. It derives them from those receipts and does not assign them (§2.2). The home repository owns the theorem and its evidence. ==== 8.5.1 The machine-readable receipt A repository that records grades keeps them in a *proof receipt*. This is a praxis deed (`*_praxis.deed`, conventionally under `verification/receipts/`) with `:profile proof-receipt`. It is the record above in a form a gate and mathesis can both read: * top-level fields: ** `:repository`, as `OWNER/REPO`; ** `:source-commit`, the full 40-character commit the receipt describes; * `(trusted-base (primitive :prover … :module … :name … :binding …) …)`: the prover-supplied postulates of §8.4, by name and binding; * one `(claim :id … :pwg … :foundation-diverse …)` per theorem, holding one `(leg …)` per witness: ** each leg carries `:prover`, `:route` (`source` for the Agda leg; `transported`, `re-proved`, `waived` or `unavailable` for the others), its §5 `:token` and §2.2 `:state`; ** each leg holds its `(receipt :run … :commit … :checker … :invocation … :inputs-sha256 … :state … (inputs-manifest …) (axioms …))` records, with a `:reason` on any that is not `current`; ** a receipt may carry `:image`, the image its checker ran in, as `NAME[:TAG]@sha256:<64 hex>`; a witness counts toward `PWG-1` only through a current receipt that has one (§8.2); * zero or more `(echo …)` records (§8.5.2). Every `current` receipt carries `:inputs-sha256`, `(inputs-manifest …)` and `(axioms …)`. A receipt that is kept but is not current may omit them, because it can predate them. `:inputs-sha256` is the digest of the files the checker run read from the repository. It is 64 lowercase hex digits, computed in the same way in every repository: . Take the leg's *input set* at the receipt's `:commit`: ** Agda: each module of the `--dependency-graph` cone of the graded roots that is a file of the repository, and each `.agda-lib` and `libraries` file the run reads; ** Rocq: each `.v` file the run compiles, and the `_CoqProject`, `dune` and `dune-project` files it reads; ** Lean: each `.lean` file the build reads, and `lakefile.lean` or `lakefile.toml`, `lean-toolchain` and `lake-manifest.json`; ** any other prover: the files of the repository that the run reads, as the gate lists them. + Modules supplied with the prover are not in the input set. The `:checker` and the `(trusted-base …)` clause cover them. + *A Lean `lake-manifest.json` is a pinned input.* Owner ruling. A repository with a Lean leg commits its `lake-manifest.json` and treats it as a lockfile, not as build output. The receipt cites it by hash: it is in the input set above, so it is a `(file …)` of `(inputs-manifest …)`, and its SHA-256 is covered by `:inputs-sha256`. . Write the *manifest*: one line per file, sorted by path in bytewise (C locale) order. Each line is the SHA-256 of the file's bytes as 64 lowercase hex, two spaces, the path relative to the repository root with `/` separators, and one LF. The file's bytes are the git blob at the commit, before any checkout filter. A path with a newline or a backslash is refused. . The digest is the SHA-256 of the manifest bytes. The reference implementation is link:../scripts/proof-inputs-sha256.sh[`scripts/proof-inputs-sha256.sh`] (`COMMIT PATH…`), and `scripts/tests/proof-inputs-sha256-test.sh` tests it. On a clean checkout with no checkout filters, this shell line gives the same value: printf '%s\n' PATH… | LC_ALL=C sort | xargs -d '\n' sha256sum -- | sha256sum Owner ruling 2026-11-13: the receipt lists the manifest itself, so that a consumer can recompute the digest with git alone. An Agda import cone, for example, cannot be rebuilt without the prover. (inputs-manifest (file :path "src/A.agda" :sha256 "<64 hex>") …) There is one `(file …)` per line of the manifest, in the same order. The reader refuses a manifest: * that lists no file, or that a receipt without `:inputs-sha256` carries; * whose paths are not in strictly increasing bytewise order of their UTF-8 bytes (so a path also appears only once); * with a path that holds a newline or a backslash, or that has an empty, `.` or `..` part (this refuses a leading `/` or `./`); * with a `:sha256` that is not 64 lowercase hex digits; * whose SHA-256, rebuilt as above, is not the receipt's `:inputs-sha256`. So the digest is derived from the manifest, not asserted. Two manifests for one commit and one prover cannot differ, because their digests would then differ (§8.5.2). *Imported repositories.* Owner ruling 2026-11-14. A run can read files of another repository that it fetches at a pinned commit, for example a sibling library that the proofs import. Those files are not files of the home repository, so they are not in `(inputs-manifest …)`. The receipt records each such repository in its own clause: (import :repository "OWNER/REPO" :commit "<40 hex>" :inputs-sha256 "<64 hex>" (file :path "…" :sha256 "<64 hex>") …) The files are the files of the imported repository that the run read, and their paths are relative to its root. The `:inputs-sha256` is the §8.5.1 digest of those files at that commit. The reader checks the same form as for `(inputs-manifest …)`, and it refuses an `:inputs-sha256` that is not the SHA-256 of the rebuilt manifest. It also refuses a `:repository` that is not `OWNER/REPO`, an import of the home repository itself, two imports of one repository, and a `:commit` that is not a full 40-character lowercase commit. Two names are the same repository when they agree without regard to case (GitHub names are case-insensitive) or through the alias of §8.6. The reader cannot know every other alias, so `scripts/check-proof-receipt.sh` also refuses an import whose clone holds the home `:source-commit`, or whose pinned `:commit` is in the home clone (§8.5.3). The script that holds the pin is a file of the home repository, so it is in the home input set: a repin changes the home `:inputs-sha256`. `(axioms …)` lists each axiom the checker reported, as `(axiom :name "…" :disposition c)`. The name is the name the checker reports (`#print axioms` for Lean, `Print Assumptions` for Rocq, and for Agda each postulate that the scan of §8.4 finds outside the trusted base). The disposition is `c`, `b` or `debt`, as link:../docs/TRUSTED-BASE-REDUCTION-POLICY.adoc[`TRUSTED-BASE-REDUCTION-POLICY.adoc`] defines them. An empty `(axioms)` means that the checker reported none. A leg whose current receipt lists an axiom that is not disposition `c` does not count (§8.4). `:pwg` and `:foundation-diverse` are recorded *and* derived. The reader recomputes both from the legs and receipts under §8.2 and §8.3, and it refuses a receipt whose recorded value differs. That is §8.4's "grades are derived, not asserted", made executable. The reader is `readProofReceipt` in link:../1-formats/deed/tools/deed_lint.js[`1-formats/deed/tools/deed_lint.js`]: bun 1-formats/deed/tools/deed_lint.js --proof-receipt-json FILE It is the normative definition of the profile's fields, vocabularies and derivation, and `deed_lint.test.js` tests it. The worked example is `1-formats/deed/tools/fixtures/proof-receipt/example_praxis.deed`. A gate that writes receipts validates them with this reader. Mathesis reads receipts through it and catalogues the result as a census (§8.4). `echo_praxis.deed` in the same directory is a worked example of §8.5.2. The shared generator is link:../scripts/proof-receipt.sh[`scripts/proof-receipt.sh`]. A home repository's receipt script defines its ledgers (claims, runs, echoes) and the hooks that name each leg's invocation, input set and imported files, then sources the generator, which writes the receipt, checks it and runs the reader and the git checker of §8.5.3. A home repository pins it with the reader, the reference digest and the checker at one standards commit, each file by its sha256. `scripts/tests/proof-receipt-test.sh` tests it, including an `(import …)` of a pinned sibling. Using it is a convenience, not a rule: the reader decides what a receipt is. ==== 8.5.2 Echoes: receipts across a history rewrite Owner ruling 2026-11-13. A receipt is earned on a commit. A squash merge or a rebase rewrites commits, so the receipt can name a commit that the default branch does not contain: after a squash merge the receipt names a commit of the pull request, and the squash commit replaced it. An *echo* records that such a receipt still describes the commit on the default branch. Then the receipt is recorded, not earned again. The vocabulary is that of hyperpolymath/echo-types. Let `f` be the rewrite, from commits before the rewrite to commits on the default branch. For an image `y`, the echo is the fibre `Echo f y := Σ (x : A), (f x ≡ y)`. One `(echo …)` record is one element of that fibre: a *source* commit `x`, its *image* `y`, and a *witness* that `x` and `y` agree on what the receipt depends on. A squash of several commits gives several records with one image. That is the fibre over the image. (echo :source "<40 hex>" :image "<40 hex>" :witness inputs-sha256 (inputs :prover agda :sha256 "<64 hex>") …) (echo :source "<40 hex>" :image "<40 hex>" :witness tree-sha256 :tree-sha256 "<64 hex>") `:witness` is one of: * `inputs-sha256`: for each prover named in an `(inputs …)`, the inputs digest (§8.5.1) is the same at the source and at the image. It covers that prover's legs only. * `tree-sha256`: the digest of §8.5.1, taken over every file that git tracks at the commit, is the same at the source and at the image. The whole tree agrees, so the record covers every leg. `scripts/proof-inputs-sha256.sh COMMIT`, with no paths, computes it. Both witnesses are SHA-256. The commit names stay git object ids. They are identifiers, not security digests. The reader refuses a receipt in which: * `:source` or `:image` is not a full 40-character lowercase commit, or they are the same commit; * `:source` is the `:source-commit` (that commit is on the default branch, so it is an image, never a source); * one source has two records (`f` is a function); * the records form a cycle; * the witness fields do not match `:witness`, or a digest is not 64 lowercase hex digits; * two different digests are stated for one commit and one prover, or for the tree of one commit, anywhere in the receipt (in an echo or in a receipt's `:inputs-sha256`); * a `tree-sha256` record joins two commits whose inputs digests for one prover differ. *Grading rule.* A current receipt whose `:commit` is the `:source-commit` describes that commit. A current receipt whose `:commit` is another commit describes the `:source-commit` only if a chain of echoes leads from its `:commit` to the `:source-commit`, and every link of the chain covers the receipt's leg: a `tree-sha256` link, or an `inputs-sha256` link whose digest for that leg's prover equals the receipt's `:inputs-sha256`. Chains are allowed. `PWG-1` needs every counted witness to have a current receipt that describes the `:source-commit`. A receipt that does not still counts toward `PWG-3`, `PWG-2i` and `PWG-2ii`. ==== 8.5.3 What a gate with git must check The reader checks only what the text of a receipt shows. It cannot see git. The checks below need git, so they are duties of the gates that use receipts. The *home repository's gate* (the gate that writes or checks the receipt in the repository that owns the theorem) MUST, before it records or accepts a receipt that derives `PWG-1`: . check that the `:source-commit` is on the default branch (for example `git merge-base --is-ancestor origin/`); . check that each entry of each current receipt's `(inputs-manifest …)` is a file at the receipt's `:commit`, and that the SHA-256 of its git blob is the recorded `:sha256` (then `:inputs-sha256` holds, because the reader derived it from the manifest); . for each echo link that a counted receipt's chain uses, check the witness at the link's source and at its image: for `inputs-sha256`, that the receipt's manifest with that digest holds at both commits; for `tree-sha256`, that the digest of every tracked file is the recorded value at both commits. If the source is no longer reachable from a branch, fetch it by the reference that the forge keeps for the pull request (on GitHub, `refs/pull//head`). If a check fails, the gate fails, and the grade falls as §8.4 says. link:../scripts/check-proof-receipt.sh[`scripts/check-proof-receipt.sh`] `[--branch REF] [--import OWNER/REPO=DIR]... RECEIPT REPO` does these checks. It checks every echo, not only the links that a chain uses. It also checks the manifest of each current receipt of a negative control (§8.5.4), and each `(import …)` in the clone of that repository that `--import` gives. An import with no clone given fails. So does an import whose clone holds the home `:source-commit`, or whose pinned `:commit` is in the home clone: that is the home repository under another name, even in a shallow clone. The home clone must be full, not shallow, or the script does not run: a shallow home clone hides the history that these two checks read. The `--import` name matches the receipt's name without regard to case. `scripts/tests/check-proof-receipt-test.sh` tests it on a scratch repository: a receipt carried to its squash commit by an echo passes, and a forged echo, a `:source-commit` off the default branch, a manifest that is false at its commit, a missing source commit, an import whose files differ at its pin, an import with no clone and a negative control whose manifest is false each fail. A gate or a consumer that runs it at a pinned standards commit meets the duty below in the same way as every other. A *consumer* that catalogues grades, such as Mathesis, MUST do the same checks against the home repository before it catalogues a `PWG-1`. If it cannot do them, it catalogues the grade that the receipt supports without `PWG-1`, and it records why. ==== 8.5.4 Negative controls Owner ruling 2026-11-14. A negative control is a file that the checker must refuse. It is evidence that the check can fail: a check that accepts everything proves nothing. A claim may record its negative controls: (control :path "tests/reject/RoundTripIsFidelity.agda" :prover agda :expect refused (receipt :run … :commit … :checker … :invocation … :inputs-sha256 … :state current (inputs-manifest …) (axioms))) `:path` is the refused file, relative to the repository root. `:expect` is `refused`, the only value. Each `(receipt …)` has the same fields and the same rules as a leg's receipt (§8.5.1). A current receipt records a run in which the checker refused the file. The refused file must be in the `(inputs-manifest …)` of the current receipt. The reader refuses a control with a path of the wrong form, two controls with one path and one prover, a control with no receipt or with more than one current receipt, and a current receipt whose manifest does not list the refused file. A control's `:inputs-sha256` does not join the per-commit agreement of §8.5.2, because its input set holds the refused file and the leg's input set does not. Controls are recorded, not graded. A grade counts witnesses (§8.2), and a control is not a witness, so a control never raises or lowers a grade. A control that the checker accepts is a failure of the home repository's gate: the gate must not record a current receipt for it. === 8.6 Naming `hyperpolymath/standards` (the former name) and `metadatastician/standards` are the same repository. GitHub redirects the older name, and both names resolve to the same commits. Cite either name, and pin by commit (§7).