Skip to the content.

← Command reference · CLI overview

lean-pkg verify

both receipts and the gate in one step on this machine: the comparator receipt, the lower-tier receipt (systemd user unit) at the same commit, then the gate; prints each command it runs.

Usage

lean-pkg verify [--work-dir DIR] [--unit UNIT] [--script FILE] [--judges N]
                [--agent AGENT] [--memory-max BYTES] [--reason TEXT] [--dry-run]
                [common flags] NAME

[common flags]: --json, --commit, --push, --no-commit, also accepted before the command name; see the CLI overview.

Run, at the checkout’s HEAD, receipt comparator, receipt systemd --run -- bash verify.sh and gate (an active package first moves to gate-pending; a gated one is re-gated), each as its own lean-pkg invocation with its own checks. First (step 0, read-only, also under –dry-run) the claims/1 check on the claims file committed at HEAD and, when coverage.yaml is committed, the offline coverage check: a refusal stops verify before any receipt; a module-headed file importing a non-module file of the package at HEAD is a warning naming palomar port-modules NAME --dry-run. Writes only what those commands write; commits nothing in the checkout. A package whose committed coverage.yaml declares an LTS stack (stack: NAME, docs/stacks/) is checked against it (lean-toolchain, the Mathlib commit, the comparator receipt’s tool digests): a warning per difference, never a refusal.

Arguments and flags

Argument or flag Description
NAME  
--work-dir DIR where the run’s log and unit output go, outside the checkout (default $XDG_STATE_HOME/lean-pkg/verify/NAME/<commit>-<UTC stamp>, else ~/.local/state/…)
--unit UNIT the systemd user unit (default NAME-verify)
--script FILE the committed lower-tier check, run as bash FILE LOG (default verify.sh)
--judges N comparator judge processes (receipt comparator --judges N)
--agent AGENT the agent acting: passed to the status move and the gate
--memory-max BYTES passed to receipt systemd --run as its MemoryMax (default there 8G): raise it when a receipt run warns that its memory peak was near the cap
--reason TEXT re-gate only: accept a commit that does not descend from the gated one (gate --regate --reason)
--dry-run print the steps and their commands; run nothing

Details

Form What it does Key flags
verify NAME the newcomer’s one step from a committed package to verified-private on this machine, at the checkout’s HEAD X: refused first (nothing run) for an unknown package, a checkout that is not a clean commit, no committed verify script, no comparator configuration, a status the gate cannot reach. Then step 0, the preflight (read-only, also under --dry-run): the claims/1 check claims check --file runs, on the claims file committed at HEAD, and, when coverage.yaml is committed, the offline coverage check against the claims file and the comparator configurations committed at HEAD (schema and length limits, claim ids, every comparator theorem the declaration of a claim a row names or of an internal or reusable claim); placeholder text and an unposted manuscript are warnings here, since coverage check and page refuse them later. A refusal stops verify with that message before any receipt work: no receipt, no unit, nothing written. Files present only in the working tree are never read. Step 0 also runs the import scan of palomar port-modules at HEAD: a module-headed file of the package that imports a non-module file of the package (which fails to build: a module cannot import a non-module) is a warning, never a refusal, naming the files and next: lean-pkg palomar port-modules NAME --dry-run; it is skipped silently when the tree at HEAD cannot be read. Then, each printed and run as its own invocation: (1) the comparator receipt, (2) the lower-tier receipt at the same commit, (3) for an active package the move to gate-pending, (4) the gate (--regate for a gated package). A receipt of X already present is reused; nothing is committed. --json steps[] begins with {step: "0/3 preflight", rc, output {ok, claims, coverage, module_imports[{file, line, module, target}], warnings[]}} [--dry-run] [--work-dir DIR] [--unit U] [--script FILE] [--judges N] [--memory-max BYTES] [--agent A] [--reason TEXT]

Exit codes

0 success (dry runs and no-ops included), 1 refused or failed, 2 usage error; see Exit codes.

Examples

Run the read-only preflight (claims.yaml and coverage.yaml at HEAD), then print the three steps (the comparator receipt, the lower-tier receipt at the same commit, the gate) and their exact commands; nothing else runs.

lean-pkg verify my-proof --dry-run

Run them in that order at the checkout’s HEAD; an active package first moves to gate-pending, a gated one is re-gated. Commit the receipts afterwards.

lean-pkg verify my-proof

Sample output:

verify: 0/3 preflight: claims and coverage files committed at a0a4fe68e46c
  PASS claims.yaml at a0a4fe68e46c: schema ok (1 claim(s))
  ...
verify: 1/3 comparator receipt: lean-pkg receipt comparator --repo .../my-proof
...
verify my-proof: verified-private at a0a4fe68e46c: lower-tier .lean-receipts/a0a4fe68e46c-systemd-user-my-proof-verify.service-<id>-h-<label>.json, comparator .lean-receipts/a0a4fe68e46c-comparator.json
next:
  git -C .../my-proof add .lean-receipts && git -C .../my-proof commit -m "evidence: receipts at a0a4fe68e46c"
  lean-pkg page my-proof --write