← Command reference · lean-pkg comparator · CLI overview
lean-pkg comparator attach
attach a comparator receipt to a gated package; no status change (comparator NAME --receipt R is the same).
Also spelled: lean-pkg comparator NAME (all aliases).
Usage
lean-pkg comparator attach [--receipt RECEIPT] [--refuse-private] [--refuse-dirty]
[--replace] [--agent AGENT] [common flags] NAME
[common flags]: --json, --commit, --push, --no-commit, also accepted before the command name; see the CLI overview.
Arguments and flags
| Argument or flag | Description |
|---|---|
NAME |
|
--receipt RECEIPT |
path to comparator receipt JSON (required) |
--refuse-private |
refuse (exit 1, nothing copied) when the receipt holds private strings; default is a WARN line and the receipt is kept |
--refuse-dirty |
refuse when tracked files are modified in the checkout; default is a WARN line |
--replace |
when .lean-receipts/ already holds a different comparator receipt for the same commit: keep it as <c12>-comparator.replaced-<UTC stamp>.json, attach the new one, record comparator-replaced |
--agent AGENT |
the agent acting (recorded as the event’s actor; another agent’s live lease then refuses) |
Details
| Form | What it does | Key flags |
|---|---|---|
comparator attach NAME |
attach comparator evidence to a gated package (event comparator-attached); comparator check NAME validates only (the same ✓ binding lines as gate --check, plus the comparator ones; JSON adds checks[] and head); same private-string scan, dirty-tree WARN, off-default-branch WARN and git-ignored evidence WARN (ignored_evidence[]) as gate; without --receipt a usage error (exit 2). When .lean-receipts/ already holds a different receipt for the same commit it refuses, naming the file; --replace moves that file to .lean-receipts/<commit12>-comparator.replaced-<UTC stamp>.json (never overwriting one), copies the new receipt in, and records comparator-replaced with replaced (the kept file) in history, the event log and the JSON; with nothing to replace it is a plain attach. comparator check NAME --repo DIR validates against the checkout DIR (a worktree or feature branch where the receipt was made) instead of the registered local_path, with the rules of gate --check --repo: this call only, never saved, stderr note, JSON repo_override {path, registered_path, remote_match} (null without it), remote matching as there; attaching refuses --repo (exit 2); see Pre-checking a receipt made in another checkout |
--receipt PATH [--replace] [--refuse-private] [--refuse-dirty]; check: --receipt PATH [--repo DIR] |
Examples
Attach the comparator receipt to the gated package (event comparator-attached); publish –yes needs it.
lean-pkg comparator attach my-proof --receipt .lean-receipts/cb3d68a21454-comparator.json