Skip to the content.

← 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]
                            [--json]

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:

Examples

Print the kept view of formalization.yaml in the current directory (every key formalization render derives removed) as JSON and the SHA-256 of its canonical bytes; it reads no registry and writes nothing.

lean-pkg formalization kept

Read the file committed at HEAD and list the kept keys that differ from HEAD~1; exit 1 when any does, so a derived-key refresh alone passes.

lean-pkg formalization kept --at HEAD --against HEAD~1

Sample output:

...
kept-view sha256 b52beedad1b9b64e5c551e4987a130471861913ece8ae0f7cd1e7e63dfbdb962  formalization.yaml at HEAD (055bf9995e82)
changed kept key(s) since HEAD~1 (28fbec50ee3e): status.scope