Skip to the content.

← Command reference · lean-pkg palomar · CLI overview

lean-pkg palomar check

read-only, offline: every gap to Palomar’s mechanical rules at one commit (module headers, toolchain floor, comparator configs, formalization.yaml, licence, repository); exit 0 ready / 1 gaps.

Usage

lean-pkg palomar check [--rev REV] [--config PATH] [--rules FILE] [--repo DIR] [--json]
                       NAME

Arguments and flags

Argument or flag Description
NAME  
--rev REV the commit to judge (default: the gate-bound commit, else HEAD)
--config PATH judge only this comparator configuration (Palomar verifies the one a submission names); default: every configuration tracked at the commit
--rules FILE a newer PalomarSubmission browser-preflight-policy.json (schema 1) downloaded by hand; default: the rules pinned at PalomarSubmission d4e41c1d5b0d (read 2026-10-16)
--repo DIR judge the checkout DIR instead of the registered local_path (never saved)

Details

Form What it does Key flags
palomar check NAME read-only and offline (no network, nothing written, no event): every gap between the package at one commit (--rev REV, else the gate-bound commit, else HEAD; git objects, never the working tree) and Palomar’s mechanical rules, pinned at PalomarSubmission d4e41c1d5b0d (read 2026-10-16; --rules FILE takes a newer browser-preflight-policy.json): a module header in every tracked .lean file of the repository (exact list of the files without one), at most 10,000 lines, no symlinks; the toolchain floor v4.35.0-rc2; a Lake configuration, no submodules; each comparator configuration (--config PATH: only that one) with the required keys, no other keys (judged_as, lean_pkg_scaffold are refused), standard axioms, tracked module sources, a Challenge within 1,000 lines and 100 KiB; the headline configuration, when declared: the same checks, plus comparator.headline_uncovered (error) or comparator.headline_unjudged (warn) from the subset rule (JSON headline {config, source, judged, covered} or null); formalization.yaml tracked, v0.4-valid, no placeholders, Palomar’s metadata minimum; one root licence file matching license_spdx; a GitHub repository, public, the commit pushed (these two warn). Each gap {code, severity error\|warn, paths, detail, fix}; verdict first and last; a lean-toolchain on lean-pkg’s toolchain advisories list adds one WARN: toolchain advisory ... line per entry after the verdict, never a gap (JSON toolchain_advisories[]; toolchain advisories); --repo DIR judges another checkout; exit 0 no error gap, 1 error gaps, 2 usage (rules, source and date) [--rev REV] [--config PATH] [--rules FILE] [--repo DIR]

A Challenge’s imports beyond Mathlib’s vocabulary (Init, Std, Lean, Mathlib, Batteries and the other libraries Mathlib brings in) are warn gaps, never errors (#369): challenge.statements_module for the statements module claims.yaml declares (statements_module; “trusted by declaration, read it”, with lean-pkg’s refusal appended when the module fails its check) and challenge.import for any other module. A Challenge that imports Mathlib only gets neither (A statements module for conditional claims).

A comparator configuration whose challenge_module or solution_module has a top-level root R (the text before the first .) that is also a top-level R.lean or R/ of a dependency’s source tree is an error gap, challenge.module_root_shadowed or solution.module_root_shadowed, the code Palomar’s full preflight uses (#404): the resolver may take the dependency’s file instead of the submitted one. The check stays offline: it reads each dependency lake-manifest.json pins at the commit from its checkout under .lake/packages/<name>/ (a local build artifact) only when that checkout’s HEAD is the pinned revision, and a path dependency inside the repository from the commit; it looks at the package root and each srcDir the dependency’s lakefile states literally. A dependency it could not read (not checked out, another revision, not a git checkout) is named in not_checked, and then a bare root Challenge, Solution or Main is a warn gap, challenge.module_root_generic or solution.module_root_generic. The fix for both is a package-qualified module such as MOD.Challenge, the layout lean-pkg new scaffolds. When every dependency was read, not_checked no longer lists the shadowing check.

JSON output

Top-level keys of --json, as recorded in the golden contract (tests/golden/json-keys.json):

Examples

List every gap between the package at the gate-bound commit (else HEAD) and Palomar’s pinned mechanical rules, read-only and offline from git objects; exit 1 when any gap is an error.

lean-pkg palomar check my-proof

Sample output:

my-proof: Palomar check at 9f18d4268b03: NOT READY — 5 gap(s): 3 error, 2 warn [HEAD]
  ✗  formalization.missing: formalization.yaml is not tracked in the project
        formalization.yaml
        fix: render it (`lean-pkg formalization my-proof --write`), fill the placeholders, commit
  ✗  license.spdx_unset: license_spdx is not recorded in the registry
        fix: lean-pkg update my-proof --license-spdx ID
  ...
  WARN  commit.not_pushed: commit 9f18d4268b03 is in no remote-tracking branch (local refs; nothing fetched)
        fix: push it; Palomar pins a commit of the public repository
rules: PalomarSubmission@d4e41c1d5b0d (committed 2026-10-05, read 2026-10-16); toolchain minimum v4.35.0-rc2; 3 .lean file(s), 0 without a module header
...
my-proof: Palomar check at 9f18d4268b03: NOT READY — 5 gap(s): 3 error, 2 warn

Judge HEAD and only the named comparator configuration, with each gap as JSON {code, severity, paths, detail, fix}.

lean-pkg palomar check my-proof --rev HEAD --config comparator.json --json