← Command reference · lean-pkg receipt · CLI overview
lean-pkg receipt check
validate a published package’s receipts from git alone: no registry, no network, never runs Lean (an outside referee’s check; exit 0 only when every check passes).
Also spelled: lean-pkg verify-receipts (all aliases).
Usage
lean-pkg receipt check --repo DIR --commit SHA [--at REF] [--docs-descendants]
[--evidence-only] [--name NAME] [--corroborate]
[--github OWNER/REPO] [--attested] [--trusted-root FILE] [--json]
Arguments and flags
| Argument or flag | Description |
|---|---|
--repo DIR |
a local clone of the package (the package directory; cloned privately, never modified). Required. |
--commit SHA |
the commit the receipts bind (the page’s git checkout <commit> line). Required. |
--at REF |
the published ref whose .lean-receipts/, coverage.yaml and README.md are read (default HEAD of –repo); it must be the commit or an evidence-only descendant of it (or a docs-only one, when the docs-only rule applies) |
--docs-descendants |
for a package without lean-pkg-binding.yaml at the commit: also accept a docs-only descendant (no build input changed) as the referee’s choice, printed in the result; a committed file that says false or does not validate overrides it |
--evidence-only |
accept only evidence-only descendants: ignore the author’s committed opt-in (lean-pkg-binding.yaml at the commit, applied by default) |
--name NAME |
the package name the claims must carry (default: package in coverage.yaml, else claims.yaml, else the directory name) |
--corroborate |
also corroborate every receipt with a ci block (a GitHub Actions run) against the public GitHub REST API, level 2, and fail when one does not reach it (404, rate limit, network error and a redirect off api.github.com fail closed). GH_TOKEN or GITHUB_TOKEN, when set, only raises the rate limit and is never printed. The one networked check |
--github OWNER/REPO |
with –corroborate or –attested: the package’s own GitHub repository, whose numeric id the run’s must equal (default: the receipt’s ci.repository, and the output says so) |
--attested |
also verify every receipt with a ci block at level 3: its committed Sigstore bundle (ci.attestation) with gh attestation verify, an optional outside tool (missing: a failure), and the certificate’s repository, commit, run and signer against the ci block; fail when one does not reach level 3 |
--trusted-root FILE |
with –attested: verify offline against this Sigstore trusted root (gh attestation verify –custom-trusted-root) |
Details
| Form | What it does | Key flags |
|---|---|---|
receipt check |
an outside referee’s check of a published package: reads no registry, opens no network connection and never runs Lean. Clones --repo privately (local transport only; its working tree is never read or changed), checks out the published ref (--at, default HEAD) and runs gate’s and comparator’s own validators on the receipts under .lean-receipts/ that bind --commit (a JSON file named for the commit that is not a receipt fails, unless its schema is one of the comparator runner’s own records, such as comparator-stages/1, which is skipped and listed): the binding (evidence-only descendants, with gate’s exemption for a formalization.yaml at the package root that differs only in derived keys, printed when applied; docs-only ones too when lean-pkg-binding.yaml committed at the commit opts in, by default, reported first as an opt-in check (PASS, or SKIP with the reason for a file that says false, does not validate, was added after the commit, or is ignored by --evidence-only); for a package without that file, with --docs-descendants, the referee’s choice, printed with the result, which a committed false or invalid file overrides; never with --evidence-only; the rule: line says which rule bound and who chose it, --json docs_descendants, evidence_only and opt_in {source, commit, path, build_inputs, file, problems}), the toolchain and Mathlib pins at the commit, every SHA-256 (configurations, logs, the redacted verify log, manifest_sha256 and the other additive evidence keys, the olean manifest record), the claims at the commit, the comparator configurations naming every reusable theorem claim, the conditional claims (a hypotheses check, only when claims.yaml at the commit uses hypotheses, discharges or witness: the discharge states recomputed from the sealed log’s hyp-probe/1 section, PASS hypotheses: 2 conditional claim(s); discharged Hyp.A (demo/main-of-b); outstanding Hyp.B, failing on a failed-class code; --json hypotheses; the hypotheses check), coverage.yaml (R11) and the README page block against the receipts. One line per check, PASS, FAIL or SKIP (not applicable, with the reason); --json lists them all. A toolchain on lean-pkg’s toolchain advisories list adds one WARN: toolchain advisory ... line per entry after the verdict, never a failure (JSON toolchain_advisories[]; toolchain advisories). --corroborate is the one networked check: each receipt with a ci block (a GitHub Actions run) is corroborated against the public GitHub REST API (level 2: the attempt it names completed with success on the commit, in the package’s repository by numeric id, a job on a GitHub-hosted runner, exactly one lean-pkg-receipt annotation binding the committed receipt and log bytes, the workflow calling lean-pkg’s pinned verify.yml at a 40-hex commit whose content is in the shipped pin list), one ci level 2 CHECK row per check, failing when it does not reach level 2; a 404, 403 or 429 (naming GH_TOKEN), a network error and a redirect off api.github.com fail closed. --github OWNER/REPO names the package’s repository (default: the receipt’s ci.repository, printed); GH_TOKEN or GITHUB_TOKEN only raises the rate limit and is never printed or written; --json gains ci {level, rows[]}, github and network: true (level 2). --attested (level 3): each such receipt’s Sigstore bundle (ci.attestation, committed beside it) has exactly the committed receipt and log as subjects and verifies with gh attestation verify --repo ci.repository --signer-workflow lean-pkg/lean-pkg/.github/workflows/verify.yml --deny-self-hosted-runners (an optional outside tool: missing, a failure), and the certificate names the ci block’s repository and id, commit, run and attempt, signer and a GitHub-hosted runner; one ci level 3 CHECK row per check, failing below level 3; --trusted-root FILE verifies offline (--custom-trusted-root); --json gains ci, github, attested: true and trusted_root. Without --attested a receipt naming a bundle gets a ci attestation skip row and gh never runs (level 3). Exit 0 only when no check fails, 1 otherwise, 2 on a usage error (--docs-descendants with --evidence-only is one). Re-running Lean is the comparator step of docs/trust-model.md, “Re-verify a page yourself”. The 1.0 command tree’s read-only verb on the receipt noun; the spelling verify-receipts is reserved for its alias table |
--repo DIR --commit SHA --at REF --docs-descendants [--corroborate] [--attested [--trusted-root FILE]] [--github OWNER/REPO] --evidence-only --json |
Examples
In a fresh clone of a published package, check its receipts for the page’s bound commit from git alone; no registry, no network, no Lean run.
lean-pkg receipt check --repo . --commit 0123456789abcdef0123456789abcdef01234567
Sample output:
receipt check: PASS my-proof at 0123456789ab (tier comparator; 13 passed, 1 skipped)
commit 0123456789abcdef0123456789abcdef01234567 (published ref 89abcdef0123)
rule: evidence-only descendants (docs-only not accepted; --docs-descendants to accept them)
...
PASS binding: evidence-only descendant of 0123456789ab (+3 evidence file(s))
...
receipt check: PASS my-proof at 0123456789ab (tier comparator; 13 passed, 1 skipped)
At a release tag after the page commit, for a package that committed lean-pkg-binding.yaml at the bound commit; its opt-in to the docs-only rule is applied without a flag, and the binding line lists what changed.
lean-pkg receipt check --repo . --commit 0123456789abcdef0123456789abcdef01234567 --at v1.0.0
Sample output:
receipt check: PASS my-proof at 0123456789ab (tier comparator; 14 passed, 1 skipped)
commit 0123456789abcdef0123456789abcdef01234567 (published ref 89abcdef0123)
rule: evidence-only or docs-only descendants (docs-only: the author's opt-in, lean-pkg-binding.yaml committed at 0123456789ab; --evidence-only to refuse them)
...
PASS opt-in: lean-pkg-binding.yaml at 0123456789ab opts in to docs-only descendants (build_inputs: 0 glob(s))
PASS binding: docs-only descendant of 0123456789ab (1 non-build file(s): README.md; opted in at 0123456789ab by lean-pkg-binding.yaml)
...
receipt check: PASS my-proof at 0123456789ab (tier comparator; 14 passed, 1 skipped)
The strict rule over the author’s committed opt-in, where only an evidence-only descendant binds; every check with its verdict as JSON.
lean-pkg receipt check --repo . --commit 0123456789abcdef0123456789abcdef01234567 --at v1.0.0 --evidence-only --json
For a package without lean-pkg-binding.yaml, also accept a README or notes committed after the evidence (the docs-only rule, the referee’s choice); every check with its verdict as JSON.
lean-pkg receipt check --repo . --commit 0123456789abcdef0123456789abcdef01234567 --at v1.0.0 --docs-descendants --json
Also corroborate a GitHub Actions receipt against the public run API (level 2), the package’s repository named by –github; GH_TOKEN only raises the rate limit.
lean-pkg receipt check --repo . --commit 0123456789abcdef0123456789abcdef01234567 --corroborate --github OWNER/REPO
Also verify a GitHub Actions receipt’s committed Sigstore bundle with gh attestation verify (level 3), which holds after the run’s records expire.
lean-pkg receipt check --repo . --commit 0123456789abcdef0123456789abcdef01234567 --attested