← Command reference · lean-pkg formalization · CLI overview
lean-pkg formalization kept
the canonical kept view of formalization.yaml (derived keys removed) and its SHA-256, for a release-input audit; –against REV: exit 1 when a kept key changed (read-only).
Usage
lean-pkg formalization kept [--repo DIR] [--file REL] [--at REV] [--against REV2]
[common flags]
[common flags]: --json, --commit, --push, --no-commit, also accepted before the command name; see the CLI overview.
lean-pkg formalization kept [--repo DIR] [--file REL] [--at REV] [--against REV2] [--json]: print formalization.yaml without the keys formalization render derives (formalization.DERIVED_PATHS and the renderer’s acknowledgements lines), as canonical JSON (sort_keys, separators ‘,’ ‘:’, UTF-8, no trailing newline) and the SHA-256 of those bytes; the recipe is in docs/formalization.md, “The kept view”. –against REV2 lists the kept keys that differ from REV2 and exits 1 when any does. Reads no registry; writes nothing
Arguments and flags
| Argument or flag | Description |
|---|---|
--repo DIR |
the package checkout (default: the current directory) |
--file REL |
the file’s path inside the checkout (default formalization.yaml) |
--at REV |
read the file committed at REV (git objects) instead of the working tree |
--against REV2 |
compare with the file committed at REV2: changed_kept_keys, exit 1 when any |
Details
| Form | What it does | Key flags |
|---|---|---|
formalization kept |
the canonical kept view of formalization.yaml (every key formalization render derives removed: formalization.DERIVED_PATHS and the renderer’s acknowledgements lines) as JSON with sorted keys, separators , :, UTF-8, no trailing newline, and the SHA-256 of those bytes, so a release-input audit can pin what a person wrote without tripping over a derived-key refresh; --at REV reads the committed file instead of the working tree; --against REV2 lists changed_kept_keys and exits 1 when any; --json schema formalization-kept/1 {kept_view, canonical, sha256, commit, derived_paths, against, changed_kept_keys, same}; reads no registry, writes nothing; the recipe is in The kept view |
[--repo DIR] [--file REL] [--at REV] [--against REV2] |
Exit codes
Exit 1 is also a negative answer here:
formalization kept --against: a kept (hand-written) key changed