← Command reference · CLI overview
lean-pkg page
render the README verification section from coverage.yaml, claims, the ledger and the receipts; stdout unless –write/–check/–out/–site/–html.
Usage
lean-pkg page [--write] [--write-binding-file] [--check] [--out PATH] [--site DIR]
[--html PATH] [--repo DIR] [--strict-preview] [--corroborate] [--attested]
[--trusted-root FILE] [--allow-private-manuscript] [--agent AGENT]
[--json] NAME
Arguments and flags
| Argument or flag | Description |
|---|---|
NAME |
|
--write |
replace the marked block in the package README.md (append it when absent); prose outside the markers is untouched. For a gated package without lean-pkg-binding.yaml at the gated commit it then keeps the receipts bound through the deprecated registry route (when the record says nothing: update NAME --accept-docs-descendants, its own registry write; a record false is left alone), with a WARN, and prints the move to lean-pkg-binding.yaml as deferred advice (–json deferred[]): the file is a build input, committed on its own right before the next verify run |
--write-binding-file |
with –write: also write that lean-pkg-binding.yaml into the working tree (never staged or overwritten); commit it on its own right before the next verify run, never with README.md |
--check |
exit 1 when the README block is missing or stale, the lean-pkg credit is missing, or a site sentence has no backing receipt (or, for GitHub Actions, no corroborated run: –corroborate); with –site/–html also when those files are missing or stale; writes nothing |
--out PATH |
write the block here instead; README untouched |
--site DIR |
also write DIR/verification.md (the full page) and DIR/coverage.md (every row, its claims, inputs and notes) for MkDocs; with –check, compare them instead |
--html PATH |
also write one static HTML file (no script, no external asset) from the same data; with –check, compare it instead |
--repo DIR |
read the checkout DIR instead of the registered local_path, for this call only (never saved; for CI): DIR must be a git work tree, and when it has remotes one must be the package’s repo; not with –write. Its committed HEAD is read: when the recorded gate receipt does not bind that HEAD (or an evidence-only descendant), the links and Lean statements are read at HEAD, no receipt fact is shown and the page says so; with –check, differences of such a preview from the receipt-bound files are warnings (exit 0) |
--strict-preview |
with –check –repo: a preview’s differences from the receipt-bound README block and –site/–html files fail the check (exit 1) instead of warning |
--corroborate |
ask the public GitHub REST API about each GitHub Actions job coverage.yaml lists (level 2: the run, its job, the pinned verify.yml, the receipt annotation), and render the GitHub Actions sentence, with its run links, only when every one reaches it; a failure is named and fails closed. GH_TOKEN or GITHUB_TOKEN, when set, only raises the rate limit and is never printed |
--attested |
verify each GitHub Actions job coverage.yaml lists at level 3: its committed Sigstore bundle (ci.attestation) with gh attestation verify, an optional outside tool, and the certificate against the ci block; the sentence renders at level 3, which holds after the run’s records expire (with –corroborate too, level 2 must also hold); a failure is named |
--trusted-root FILE |
with –attested: verify offline against this Sigstore trusted root (gh attestation verify –custom-trusted-root) |
--allow-private-manuscript |
render against manuscript.version ‘unposted’; the page then says so |
--agent AGENT |
with –write: the lease holder, when the package is leased |
Details
| Form | What it does | Key flags |
|---|---|---|
page NAME |
render the README verification section (status capsule, paper-to-Lean map, Not formalized, trust boundary, reproduce, evidence, citation, license, acknowledgments) between <!-- lean-pkg:page:begin --> and <!-- lean-pkg:page:end --> from coverage.yaml, claims.yaml, the claims ledger (a row is verified only when the ledger closes it) and the receipts committed under .lean-receipts/ (allow-listed fields only); deterministic; the public-safety scanner runs over the block and a blocking hit refuses; stdout by default; --write replaces only the marked block in the package README.md (appends it when absent) and never commits; for a gated package without lean-pkg-binding.yaml at the gated commit it then keeps the receipts bound through the deprecated registry route (when the record says nothing: its own update NAME --accept-docs-descendants invocation, the one registry write; a record false is left alone), prints WARN: deprecated: ... (--json deprecations[]) and prints the move to lean-pkg-binding.yaml as deferred advice: the file is a build input, committed on its own right before the next verify run (lean-pkg update NAME --write-binding-file), never with the README; --json outputs[] lists the files of this documentation commit and deferred[] the migration {id, path, state, written, command, when, advice} (binding_file {path, state, written}, state: deferred); --write-binding-file also writes the file into the working tree, never staged or overwritten (the docs-only opt-in); with the file at that commit it does none of this; --check exits 1 when the block is missing or stale, the lean-pkg credit is missing, or the README mentions a site (the Easley Cluster, GitHub Actions) without a backing receipt, or the GitHub Actions sentence without a corroborated run; --corroborate asks the public GitHub REST API about each GitHub Actions job coverage.yaml lists (level 2, as receipt check --corroborate, against the registry’s repository) and renders the GitHub Actions sentence, {runs} filled with the runs’ links, only when every one reaches level 2; a failure is a warning naming why, and fails closed (GH_TOKEN or GITHUB_TOKEN only raises the rate limit; JSON sites.github-actions gains corroboration {job: rows} and runs[]; GitHub Actions); --attested verifies each listed job’s committed Sigstore bundle with gh attestation verify (level 3, as receipt check --attested; --trusted-root FILE offline), so the sentence renders after the run’s records expire, and sites.<name>.level/levels reach 3 (with --corroborate too, level 3 needs both answers); toolchain advisory lines (- Toolchain advisory: ..., one per entry of lean-pkg’s toolchain advisories list naming the gate receipt’s toolchain) are left out of that comparison, so a new advisory never makes a page stale: --check prints a non-failing NOTE: toolchain advisory ID applies; the next page --write will show it instead, and --json lists toolchain_advisories[]; an unposted manuscript whose registry record says paper.status: published is cited as published, with its exact source not publicly anchored, never as an unposted draft (--json paper_status, manuscript_note: "published-unanchored"; manuscript.version); --out PATH writes the block elsewhere; --site DIR also writes DIR/verification.md (the full page) and DIR/coverage.md (every row with its claims, declarations, ledger statuses, inputs and notes) for MkDocs, and --html PATH one static HTML file of both (no script, no external asset); with --check those files are compared instead (missing or stale: exit 1), and every hand-written page under DIR is read: an HTML block (<details>, <div>, …) holding Markdown without a markdown attribute exits 1, since GitHub Pages and MkDocs would publish it as literal text (--check --site --json html_blocks[]; Hand-written pages); user text is escaped in every output; --repo DIR reads that checkout instead of local_path for this call (CI; not with --write), at its committed HEAD: when the recorded gate receipt does not bind that HEAD (or an evidence-only descendant), the file links and Lean statements are read at HEAD, no receipt fact (axioms, sorry count, statement comparison, the receipt used) is shown, a Preview of commit note names both commits, and JSON repo_override gains head, anchor_commit and receipt_facts {receipt, commit, included, binds_head, reason}; with --check on such a preview, its differences from the receipt-bound README block and --site/--html files are warnings (exit 0, JSON preview: true, current: null) while real problems still exit 1, and --strict-preview (only with --check --repo; otherwise exit 2) makes them fail; --json gains preview, site_files[] {path, status} and repo_override (The verification page). A row whose claims are verified or conditional (a claim with hypotheses, proposal 0003) reads Conditional. “Verified under assumptions … Discharged: … Outstanding: …” (or “Verified (all assumptions discharged: …)”), each hypothesis linked to its declaration at the gate-bound commit when the page can form the link; only when a claim uses the keys, the fixed paragraph adds “A conditional result says nothing when an outstanding assumption is false.”, the counts line the conditional count, and --json conditional_rows (Conditional results) |
[--write \| --check \| --out PATH] [--site DIR] [--html PATH] [--repo DIR] [--strict-preview] [--corroborate] [--attested [--trusted-root FILE]] [--allow-private-manuscript] [--agent A] |
Exit codes
0 success (dry runs and no-ops included), 1 refused or failed, 2 usage error; see Exit codes.
JSON output
Top-level keys of --json, as recorded in the golden contract (tests/golden/json-keys.json):
page(exit 0):counts,current,easley,kind,ledger_digest,ledger_status,manuscript,manuscript_note,markdown,name,ok,paper_status,preview,private_manuscript,problems,readme,receipts,repo_override,rows,site_files,sites,toolchain_advisories,unchanged,verified_rows,warnings,written
Examples
Print the README verification section rendered from coverage.yaml, the claims, the ledger and the receipts.
lean-pkg page my-proof
Replace the marked block in the package README.md (append it when absent). Without lean-pkg-binding.yaml at the gated commit it keeps the receipts bound through the deprecated registry route (a WARN) and writes that file into the working tree; commit README.md without it.
lean-pkg page my-proof --write
Exit 1 when the README block is missing or stale; a CI step for the package.
lean-pkg page my-proof --check
Also write the docs pages and one self-contained HTML file.
lean-pkg page my-proof --site docs --html docs/verification.html
The same check with each GitHub Actions run corroborated against the public run API, so the GitHub Actions sentence (with its run links) is earned; for CI, with GITHUB_TOKEN set.
lean-pkg page my-proof --check --corroborate
The same check with each GitHub Actions run’s committed attestation verified by gh attestation verify (level 3), so the sentence stays earned after the run expires.
lean-pkg page my-proof --check --attested