kempt v0.122.0 spec
kempt.toml)This is the spec as it ships in kempt v0.122.0, generated from docs/spec.md at v0.122.0.
A kempt config repo is one kempt.toml plus the config files it references.
The manifest is fully declarative: kempt executes only built-in, versioned
primitives. There is no exec/script escape hatch. Every action is reviewable
before it runs.
This document is the standard, versioned by the spec field.
[kempt]
spec = 1
[packages.core]
description = "shell, prompt, history, modern CLI tools"
[[packages.core.install]]
brew = { formulas = ["starship", "atuin", "ripgrep", "jq"] }
winget = ["BurntSushi.ripgrep.MSVC", "jqlang.jq"]
apt = ["ripgrep", "jq"]
[[packages.core.symlink]]
from = "config/zsh"
to = "~/.config/zsh"
backup = true
[packages.terminal]
description = "Ghostty + tmux + yazi workspace"
needs = ["core"]
[[packages.terminal.git-clone]]
repo = "https://github.com/tmux-plugins/tmux-resurrect"
to = "~/.tmux/plugins/tmux-resurrect"
[packages.muster]
description = "local multi-agent coordination bus"
only = { os = "darwin" }
[[packages.muster.github-release]]
repo = "subaud-tools/muster"
asset = "muster_{os}_{arch}.tar.gz"
bin = "muster"
[[packages.muster.json-merge]]
file = "~/.claude/settings.json"
merge = { mcpServers.muster = { command = "muster", args = ["mcp"] } }
[[packages.muster.service]]
label = "tools.muster.serve"
program = ["muster", "serve"]
[[packages.muster.verify]]
command-exists = "muster"
version-current = { repo = "subaud-tools/muster", command = "muster version" }
[profiles.developer]
description = "full toolchain: terminal, editors, agents"
packages = ["core", "terminal", "muster"]
[profiles.minimal]
description = "just a pleasant shell"
packages = ["core"]
The muster package above is a minimal illustration. For the complete,
production package — MCP registration and session hooks for Claude, Codex, and
Cursor, the tmux mailbox, and the daemon service — run muster setup --print kempt (muster emits this exact block, so it never drifts from what
muster setup applies for non-kempt users).
The primitive set is closed. When a real capability gap appears, the answer is a new versioned primitive in kempt, not a script hook.
| Primitive | Safety class | Notes |
|---|---|---|
install |
software | Per-OS/cross-platform backends: brew (formulas/casks/taps), winget, apt, npm (global packages), pi, node (more later). Backends are additive — npm/pi install on any host that has the runtime, alongside the OS backend. Kempt selects the applicable backends at plan time: brew, winget and apt are OS-exclusive (one wins per OS); on linux an apt list wins over brew (a Linux host has no Homebrew), on darwin brew is used. apt reads the installed packages once per run with dpkg-query -W -f '${Package} ${Status}\n', and installs the missing ones with sudo -n apt-get update (once per run) then sudo -n apt-get install -y --no-install-recommends <missing>; with no apt-get, or sudo -n refused (apt needs passwordless sudo), the step is blocked naming why. winget is not implemented yet (a windows step with it is blocked). A platform with no matching backend skips or plan-errors per only/needs. install.npm and install.pi entries may be pinned as name@version (version embedded in the string — no schema change): kempt then converges to that exact version, reinstalling on kempt update when the installed version differs. Unversioned npm/pi entries are ROLLING: they track the newest published version (for a git: pi source, the head of the repo's default branch, compared by commit sha), rolled forward by kempt upgrade and by the kempt update roll step, and reported by kempt outdated; the offline plan/apply treat them as presence-only (install if absent, never rolled), so the plan stays deterministic. install.node is a Linux-only source naming a Node major (node = "24", digits only): it does nothing when node on PATH or ~/.local/bin/node already reports that major, and otherwise installs the newest <major>.x from nodejs.org (the linux-<arch>.tar.gz named in latest-v<major>.x/SHASUMS256.txt, checked against its release's SHASUMS256.txt) into ~/.local (bin, include, lib, share), staged and moved in only after the checksum passes and the whole archive unpacks, then puts ~/.local/bin on kempt's PATH so a later npm step in the same apply finds npm; npm's global prefix is then ~/.local. It runs after the OS backend and before npm/pi. Offline plan is presence-only; the kempt update roll and kempt upgrade move a kempt-installed Node (~/.local/bin/node on linux) to the newest release of that major, and kempt outdated reports it. The field is ignored on other OSes. |
github-release |
software | Asset templating {os}/{arch}; downloads asset + checksums.txt, sha256-verifies, stages to a unique fsynced temp beside the target, atomic rename into ~/.local/bin (running daemons keep their inode). |
managed-file |
files | Spec 2: writes one verified release-bundle file with explicit destination/mode and recorded ownership; foreign content blocks. See release-owned setup below. |
download |
software | Fetch a binary from a domain distribution (not GitHub). Resolves version (latest by default, or a pinned semver), downloads the family URL, verifies its .sha256 sidecar, and installs bin into ~/.local/bin via the same stage-and-atomic-mv path as github-release. See the family-URL contract below. |
git-clone |
software | Pinned ref or branch. |
service |
software | Backend: launchd user agents (macOS); other platforms report a blocked step. Renders the plist and compares before reload, so unchanged successfully configured services never restart. An activation begun but not successfully bootstrapped retains a pending receipt under kempt's state directory; ordinary apply retries it and clears the receipt after success. This is recovery of an incomplete operation, not continuous service-health monitoring. Fields: label, program (argv), plus optional env, stdout, stderr, keep-alive, run-at-load, process-type, throttle-interval, start-interval (seconds; a periodic job — requires keep-alive = false), session-type (mapped to the backend's native keys). |
symlink |
files | Repo-relative from; backup = true moves a real file to .bak first. Windows requires Developer Mode — detected and reported in plan, not failed mid-apply. |
json-merge |
files | Additive deep merge (jq semantics); idempotent; multiple packages may merge into the same file. arrays selects list behavior: append (default, union) or replace (desired list wins). Covers MCP registration and harness hooks. The literal token ${HOME} in any merged string value is expanded to the machine's home at write time — for files that do not themselves expand ~ (e.g. codex hooks.json, whose command strings need absolute paths). Bare ~ is left untouched. remove lists dotted key paths ("mcpServers.daybook.command") deleted before the merge, since TOML has no null to unset a key; a missing path is skipped, and a path merge sets again is replaced. |
toml-merge |
files | Additive deep merge for TOML config files (e.g. an agent's config.toml); idempotent; maps recurse, arrays append-missing, scalars overwrite. Expands the ${HOME} token in string values like json-merge. |
line-in-file |
files | Ensure-line/ensure-block for shell includes and PATH nudges. |
verify |
read-only | Declared checks: command-exists, command-exists-any (any of a list on PATH), http-ok (URL returns 2xx), symlink target, version-current (GitHub latest-release drift). |
download family-URL contractThe download primitive resolves assets from a predictable URL family so a
vendor need only publish files at these paths:
https://<site>/dl/<tool>/<ver>/<tool>_<os>_<arch>.tar.gz1.4.2),
used when version is latest or omitted, to resolve <ver>..sha256 sidecar alongside the artifact
(<artifact>.sha256), verified before install.<file>.receipt, which is
{"tool":"<tool>","version":"<version>","file":"<file>","sha256":"<hex>"},
and <file>.receipt.sig, its Ed25519 signature. A download from one of the
family's sites (the fixed list in release.FamilySite) is installed only
when the receipt is signed by a key the family trusts (tools-common's
receipt: the release key or the offline backup key) and names this tool,
this version, this file and its checksum. The same holds for a release
setup's bundle, whose cached copy keeps both receipts: offline it is checked
against them again, and a cached release without them (one cached by a
kempt from before receipts) is not used until an online kempt apply
fetches it again. The binary is taken from the tarball only as a regular,
non-empty file named exactly <bin>, as every family release packs it. On
macOS the binary must also be signed by the family's Apple Developer ID. latest never moves a tool backwards: when it is
older than the version on disk nothing is fetched or installed and the step
succeeds, as for a tool that is up to date. outdated, update and
upgrade decide "behind" by the same rule (X.Y.Z or X.Y.Z-rc.N, rc
numbers read as numbers, an rc older than its final version), so an older
latest is never offered. A pinned version is the
manifest's choice and installs even when it is older than the one on disk,
provided its receipt is valid. A failure is one line, install of <tool> <version> refused: <which check failed>, and nothing is replaced. No
flag, environment variable or config skips a check. Another site's download
is checked against its .sha256 only.<os>/<arch> use kempt's normalized platform tokens (same as github-release
asset templating).
download version fieldThe version field controls whether a download rolls automatically or locks to a
manifest-pinned version. When omitted, version defaults to "latest".
version = "latest" (rolling): without setup = true, offline inspection
checks presence, not remote currency. An absent binary is an install change;
an installed one is a no-op. Apply fetches the latest version when installing
an absent binary, but does not roll an already present one. outdated checks
remote currency; upgrade and update roll installed tools. Update holds a
higher major version and names kempt upgrade as the explicit action; a 0.x
minor is not a major bump. Unversioned npm/pi entries also hold major bumps.
With setup = true, preparation resolves an exact candidate before review,
including the matching setup; see below.
version = "x.y.z" (pinned): The download locks to the specific semver. If
the installed version differs, plan shows upgrade <bin> <old> -> <pin> drift
offline, and apply converges to the pinned version (including a downgrade if
necessary). Version currency is managed separately via kempt upgrade and kempt outdated.
download product fieldOn a gated site (one whose /dl is closed to anyone; kempt knows which), each
file is fetched through a signed link the subaud.tools access service gives
this machine's token, asked for a product and a path. The product is the
step's product, or its tool when product is omitted. Set it when one
product covers several tools: tackle's six each say product = "tackle".
apply, outdated, upgrade and the kempt update roll step all ask for it.
An ungated site ignores it.
Opt in per download, only for a release that publishes a setup bundle:
[kempt]
spec = 2
[packages.proj]
[[packages.proj.download]]
site = "tackle.tools"
product = "tackle"
tool = "proj"
bin = "proj"
version = "latest"
setup = true
This is the consumer syntax, not a claim that every family release has migrated.
Omitting setup retains the ordinary binary-only download behavior.
Resolution and review. init, apply, update and explicit upgrade
prepare opted-in releases online before displaying their combined binary/setup
plan. Preparation verifies both assets and caches their bytes and checksums
under kempt's state directory. It does not write installation targets or run a
tool's installer. Rolling preparation holds major upgrades and does not downgrade;
pins select their exact release. upgrade can explicitly take a held major.
Application uses the frozen bytes shown in that invocation's plan, not a second
lookup of latest. A separate later apply prepares again; a printed plan
is not a saved approval artifact.
plan, doctor, verify and refresh's setup inspection use cached declarations,
with no release-client requests. Missing, invalid or mismatched cached setup
blocks the download and names kempt apply as the resolution action. Release-owned
remote verification checks also report a blocker offline instead of fetching.
This does not make every existing operation network-free: an explicitly remote
-manifest still needs fetching, refresh retains its repo fetch, and legacy
non-setup verification retains its existing behavior. Files-only refresh holds
candidate integration when its matching binary still requires a software change.
Bundle format. Publish
https://<site>/dl/<tool>/<version>/<tool>_setup.tar.gz and its .sha256
sidecar beside the binary archive. Both use the same exact version and the same
product/entitlement routing. The gzip tar contains only regular files:
setup.json: {"format":1,"tool":"proj","version":"1.2.3"}. Bundle
format 1 is independent of kempt manifest spec 2.setup.toml: a spec-2 fragment with exactly [packages.integration], no
profiles or layer declaration, and no download, github-release or
git-clone steps. Normal supported primitives provide merges, verification,
services and other integration work; there is no arbitrary exec primitive.files/<relative-path>: referenced assets, with no traversal or symlinks.The fragment is namespaced as <parent-package>/setup/<bin>, depends on its
binary parent, and participates in normal composition: it counts as its own
layer, so an exclusive target it shares with another package follows the
later-wins rule (see Layers).
Its repo-relative paths use the actual selected checkout, not ~/dotfiles.
For bundle assets use explicit managed-file steps, one per file:
[kempt]
spec = 2
[packages.integration]
[[packages.integration.managed-file]]
from = "zsh/proj.zsh"
to = "~/.config/zsh/proj.zsh"
mode = "0644"
[[packages.integration.managed-file]]
from = "skills/proj/SKILL.md"
to = "~/.claude/skills/proj/SKILL.md"
mode = "0644"
[[packages.integration.managed-file]]
from = "skills/proj/reference.md"
to = "~/.claude/skills/proj/reference.md"
mode = "0644"
from is relative to bundle files/; to expands like other destinations;
mode is explicitly 0644 or 0755. A standalone managed-file declaration
without a verified bundle source is blocked. A multi-file skill lists every
owned file; no directory-wide replacement or removal of unlisted files occurs.
Ownership and failure. Kempt records tool, destination and content digest in
managed-files.json in its state directory. Missing files are created;
unchanged owned content can be updated; identical content can be adopted.
A different recorded owner, locally modified recorded content, a symlink or
other non-regular destination, or foreign content blocks replacement. Existing
tool-installed SKILL.md files are recognized by the shared skills ownership
rule; auxiliary files still need identical content or kempt's own matching
record. Unchanged repeats do not rewrite contents or ownership records.
Taking off a dropped release (kempt 0.122.0). Kempt records each family
tool release it installed in releases.json beside managed-files.json:
tool, site, product, binary name, version, setup bundle digest and the layer
whose package declared it ("" for the base), written after a run of the
saved selection leaves a family download with a resolved setup bundle
installed (a one-off -packages, -profile or -manifest run records
nothing). With no releases.json, the record is built from what kempt
already keeps, for the tools the saved selection declares and those that own
a managed file only: one release per such family tool with a cached setup
bundle in setup/ (its newest version), its binary taken as
~/.local/bin/<tool>, plus one per tool that owns a managed file and has no
cached bundle.
On a run of the saved selection (plan, apply and update with no
-packages, -profile or -manifest, and plan with no -os/-arch), a
recorded release that the base installed and that no download step of any
selected package names (by tool or binary, whatever its only) is taken off,
unless a layer is skipped or held on that run: then nothing is taken off and
the plan says so in one line.
Its cached setup bundle says what it installed; each of these still there,
inside the home and not declared by a selected package, is a remove line in
the plan, under package <tool> (no longer declared), ahead of every other
package:
service: launchctl bootout, then its plist is deleted;line-in-file line: every full line equal to it is taken out of its
file, written in place with its mode, and the rest of the file kept; a file
reached through a link (a ~/.zshrc linked into a dotfiles layer) is never
edited: the line is kept and reported, to take out where it lives;managed-files.json gives the
tool): deleted while its content has the recorded digest; one changed since
kempt wrote it is kept and reported, as kempt keeps a changed file today,
and stays the dropped release's, so another release declaring it is
blocked rather than adopting it over the change;~/.local/bin/<bin>: deleted while it is still the release's,
its version naming the tool or its bytes those of the release's tarball;
anything else there is kept and reported.apply and update run every removal before any install. Once a release's
removals have all run without error, its release record and managed-file
records are dropped, so another release may declare those files in the same
run; the first failed removal stops that release (the rest, its binary last,
stays), its records stay, and the next run continues. A release
whose setup bundle is not cached is reported and nothing of it is removed.
Only family tool releases come off. Homebrew formulas and casks, npm and pi
packages are never removed, and kempt layer remove still uninstalls nothing:
kempt has no record telling its installs from ones made by hand. A release a
layer installed is not taken off.
Failures are not transactional: earlier changes may remain. A failed binary
blocks dependent setup; folded setup merges also wait for their contributing
binary parents. Incomplete selected release setup fails the command, and the
next plan exposes remaining work. Resolve foreign-file conflicts explicitly;
kempt does not silently overwrite edits. Doctor attributes missing/drifted
managed-file findings to the namespaced owning package through its normal rollup,
with kempt apply for convergible changes and plan inspection for blockers.
Hook and skill reconciliation (kempt 0.13.0). Spec 2 adds exact owned-hook removal before the canonical merge:
[[packages.integration.json-merge]]
file = "~/.claude/settings.json"
remove-hooks = [{ event = "Stop", matcher = "", commands = ["muster hook Stop claude", "~/.local/bin/muster hook Stop claude"] }]
merge = { hooks = { Stop = [{ hooks = [{ type = "command", command = "~/.local/bin/muster hook Stop claude" }] }] } }
Rules match command hooks by exact event, matcher and command; absent matcher matches the empty string only. Unrelated siblings, group metadata and different matchers remain. Only groups emptied by removal are pruned. ${HOME} expands in declarations, never in the existing file; bare ~ stays literal. Later layers remove earlier aliases before their canonical merge. Planning compares the final result, so remove-and-readd does not cause perpetual drift.
A managed SKILL.md can declare adopt-markers = { muda-owned = "muda" }. Before adopting an untracked skill, both its existing and desired contents must meet the shared name rule and every exact string marker. Muda's value is the skill's name, not true. Without markers the existing name-only rule remains. Recorded provenance and local-edit protection are unchanged.
Doctor uses these declarations to attribute duplicate owned hook registrations and still-configured retired paths (including plugin registrations), with kempt apply remediation. Different hooks on one event are not duplicates; configuration counts do not prove runtime delivery or that a plugin is active. These fields require kempt 0.13.0 or later; kempt 0.12.0 rejects them. Producers must wait for the supporting engine release before publishing declarations that require them.
Producing bundles. Generate from the same canonical sources used by the
tool's own setup/embedded skills, using tools-common setupbundle.Build(tool, version, manifestBytes, filesFS) (available since v0.36.0). Write its bytes as
dist/<tool>_setup.tar.gz before the shared go-release action runs. List that
file explicitly in the action's existing extra-assets input:
extra-assets: dist/proj_setup.tar.gz
Use tools-actions v0.13.0 or later for extra-asset publication to /dl, with
its normal dl-tool, bucket and release version inputs. The publisher creates
the shasum sidecar and publishes alongside the matching binaries; do not add a
second uploader or installer. For a product with several tools, publish each
bundle under its tool's versioned path. Older action pins that only attach
extras to GitHub are insufficient. Keep all family action pins aligned when
upgrading a producer. Kempt consumes bundles; this engine change does not add
bundle production to every tool's release workflow.
Safety class comes from kempt's primitive table — a manifest cannot declare its own software installs "safe."
Every package may carry a notes field — an array of free-form strings surfaced
in plan output (post-install hints, manual follow-ups). Notes are documentation
only; they run nothing.
needs) order. Planned for a later spec revision, not part of spec = 1: step-level
requires preflights (e.g. "git exists") that fail the plan, not the apply. A spec = 1
parser rejects requires as an unknown key.only = { os, arch } on packages or steps restricts where they apply; always
visible in plan output.Profiles are named package sets (personas: developer, minimal, …), not
conditionals. The first-run picker preseeds from the chosen profile. There is no
hostname/env conditional language in v1 — only = { os, arch } is the only
conditional.
A machine saves the profile's name, not its packages: its base selection is the
profile's packages as the manifest lists them now, plus the packages it adopted,
minus those it dropped (kempt adopt/drop, or the picker's changes to the
profile at init). With no profile saved (a custom picker selection) it is the
adopted packages alone. A saved profile the manifest no longer has is warned
about and selects nothing; adopted or dropped names the manifest no longer has
are removed from the machine's state. A selection that resolves to nothing
selects nothing, never every package.
A machine can apply layers on top of its base manifest: work, personal,
machine-only, or a project's own configuration. Which layers a machine uses is
its saved state (kempt layer add), never a conditional in any manifest, and
the base manifest never names them. Full design:
docs/superpowers/specs/2026-09-29-layers-design.md.
kempt.toml whose [kempt] table sets layer = "user" (it
configures the user's machine) or layer = "project" (it configures one
checkout: file primitives only, relative targets inside the checkout).
A manifest with no layer key (a base, such as the starter) can be added
by kempt layer add <name> <git-url | path> as a user layer, so it sits on
top of a machine whose own config repo stays the base; it is never added
with -project.on = "<git url>" in [kempt] (only
with layer set, and only a git URL). A user layer used only as a layer
needs no on; on is required where a layer is used as a base. kempt init on a layer stops before saving anything and names kempt init <on>
and kempt layer add <name> <url>. When kempt update pulls a base that
has become a layer with on, it moves the machine before it plans: it
saves state.json.before-move, moves the old clone to
~/.local/share/kempt/layers/<name> and clones on in its place; the new
base keeps the machine's profile, or takes its only profile, and adopts what
the machine selected from the old base that it has outside that profile; the
old base becomes the first user layer with the machine's profile, adopted and
dropped; packages in neither are listed with kempt adopt. Any failure
before the plan builds puts the state and both clones back and prints the
commands to finish by hand. A base that became a layer with no on stops
before anything changes.kempt init on a machine with a saved state keeps its layers; on the same
base it also keeps the profile, adopted and dropped packages (-profile
replaces only the profile).git (a checkout update pulls) or path (a
directory on this machine). When a path layer is inside a git clone,
update fetches it and fast-forwards it to its upstream, and only that:
with uncommitted changes, no upstream or a diverged branch it says so with
the commands to bring it up to date, and converges from what is on disk. A
project checkout is never pulled.kempt layer add -under <name> <git-url | path> adds a user layer under the base (saved as under: true on the
layer in state.json, shown as user under by kempt layer list), so the
base, and every layer on it, comes later and wins where they overlap; layers
added under keep the order they were added in. Only a user layer can go
under: -under with -project is refused. A layer's packages are namespaced <layer>/<pkg>; relative
paths resolve against the layer file's directory (a project layer: the
checkout).json-merge / toml-merge steps into one file fold into
one step, so a replace array is the ordered union of what every layer
declares (a layer's append to that array joins the union; on a key two
layers set, the later layer's value wins); line-in-file steps add up and
never overlap.bin, a service by its
label), the later layer wins: its step is kept, the earlier layer's is
dropped, and the plan notes it on the later package (binary casebook: personal replaces subaud). Identical definitions keep one copy. A dropped
download with setup = true takes its release fragment
(<package>/setup/<bin>) with it, so the kept release's setup applies. A
choice saved for one target (see kempt overlap) keeps the layer it names
instead, and the note ends (your choice).kempt layer add lists every overlap between the layer being added and
what the machine already has before it saves anything: same (identical
in both, listed once, never asked) or differs, shown side by side: for a
symlink or managed file a unified diff of the two sources (for a linked
folder, the files only one side has, then a diff of each file both have);
for a binary the two definitions (site, product, tool and version, or repo
and asset); for a clone the two URLs and refs; for a service the two
programs and environments. At a terminal, without -yes, it asks, for each
overlap that differs, that the added layer is in and that has no saved
choice, which layer to keep, the later layer (the rule) first, and saves
each answer typed in state.json (overlaps, keyed by the target); Enter
saves nothing and the rule stands;
update and apply never ask. With -yes, or with no terminal, nothing is
asked and the rule settles each overlap.kempt layer add -dry-run fetches a git layer into a temporary folder
(never the layer's checkout), prints the overlaps and the plan, asks
nothing, saves nothing and exits 0.kempt plan, apply and update list each overlap that differs under
Overlaps, with the layer kept and why (the rule or your choice), and
mark [new] one the last list did not have (the targets listed are saved as
overlaps_seen; not under plan -os/-arch). They never remove a saved
choice: an overlap can be out of view for one run (another OS, a layer
whose source is missing, a release not cached yet). kempt overlap, when
every layer loads, removes a choice whose overlap no longer differs or whose
layer no longer declares it; kempt layer remove removes the choices that
keep the removed layer, and prunes the rest the same way.kempt overlap lists every overlap, same and differs, with the two sides;
kempt overlap '<target>' -keep <layer> (base for the base; quote the target: kempt overlap 'symlink ~/.zshrc' -keep base) saves a choice
for one target, and refuses a layer that does not declare it.-project is held, not applied, when its file changes,
until kempt layer apply <name>.kempt adopt/drop -layer). A layer
added with -packages has no profile and adopts what it was given. A layer
added with neither -profile nor -packages saves all: every package the
layer file has now stands in for the profile. adopt -layer also saves the
package's needs in the same layer that are not selected; drop -layer
refuses a package another selected package in the layer needs. A layer
selection that resolves to nothing selects nothing from that layer.-manifest,
-profile or -packages runs on exactly what it names.The engine accepts spec = 1 and spec = 2, rejecting all other versions.
Spec 1 retains the existing primitives; setup = true and managed-file
require spec 2 and are rejected in spec-1 declarations.
Future spec revisions bump this field, and older engines refuse manifests from
the future rather than mis-parse them. A published JSON Schema gives TOML LSPs
(taplo) completion and validation while authoring.
kempt doctor is a read-only machine-vs-manifest drift and health check. It
reports divergence the other commands cannot see by design — the tolerant
semantics that keep plan honest also make some drift invisible to it — and it
never mutates the machine. Selection resolves identically to plan/verify
(the saved selection when flags are omitted); it accepts -manifest,
-profile, and -packages, plus -json (machine-readable findings) and
-strict (treat warn-level findings as failures for the exit code).
Each check yields zero or more findings, each carrying a check id, a
severity (error/warn/info), the attributable package, a detail, and
a concrete remediation string. doctor is report-only in v1 — there is no
--fix; the remediation is always an existing command (kempt apply,
kempt adopt, …).
| Check | What it reports | Severity |
|---|---|---|
| D1 extra-array drift | Live elements of a json-merge-managed array the manifest does not declare (the inverse of the subset check plan uses, so it fires even for arrays = "append" merges). |
warn (error when the step is arrays = "replace") |
| D2 duplicate identity | Entries in a managed array that normalize to the same identity — a trailing @version and the npm:/git: scheme are stripped, so npm:pi-quiet@0.2.0 ≡ npm:pi-quiet; git identity is the repo URL without @ref, local is the resolved path. |
warn |
| D3 orphaned installs | Installed software absent from the manifest: pi list vs the union of install.pi specs, and (opt-in) npm ls -g vs install.npm. |
warn (pi), info (npm) |
| D4 broken/foreign managed symlinks | For every symlink step, lstat the to path and report broken (dangling), foreign (a real file/dir where the repo symlink belongs — the backup-would-fire case), or mispointed links, covering links with no verify step. |
error (broken), warn (foreign/mispointed) |
| D5 plan/verify rollup | Runs the plan and the verify steps for the selection and summarizes pending changes, blocked steps, and verify pass/fail, so ordinary "machine is behind the manifest" state shows in the same report. |
info (managed-file changes, blocked steps and verify failures promoted to error, with package attribution) |
The D3 orphan check is selection-scoped: it compares the machine's full
installed set against the declared installs of the selected packages only. Run
doctor with the full saved selection (omit -packages) for an accurate orphan
report — a narrow -packages selection reports everything the other packages
install as an orphan, which is correct but noisy.
0 — healthy: no findings at the failing threshold.1 — findings present at the failing threshold (error by default; -strict
lowers it to warn, so CI can gate hard; info never fails).2 — usage/parse error, consistent with the other commands.[doctor] configA top-level [doctor] block tunes the machine-health checks:
[doctor]
checkNpmOrphans = false
ignore = ["pi-quiet", "npm:some-tool", "glob:internal-*"]
checkNpmOrphans (bool, default false) — enable D3's npm-orphan comparison.
Off by default because a global npm install set is noisy with hand-installed
tools.ignore (array of strings) — suppress known-intentional out-of-band installs
from the orphan check. Each entry is either an exact spec, a backend-qualified
id (npm:<id>), or a glob (glob:<pattern>).kempt lint enforces one manifest-internal rule that doctor does not: when a
package declares both an install.pi list and a json-merge that writes the pi
settings' packages array, the two lists must match string-for-string
(order-insensitive set equality, exact strings). This replaces the previous
comment-and-discipline convention so a mismatch fails offline at lint time before
it ever reaches a machine. The rule keys on "an install.<backend> list and a
json-merge writing that backend's registry array in the same package," so it
generalizes to a future npm equivalent.
kempt lint — shipped (unknown keys, spec validation, structural checks,
install-list ↔ settings-merge packages string-for-string invariant).kempt doctor — shipped (read-only machine-vs-manifest drift/health check;
D1–D5 findings, [doctor] config, -json, -strict).kempt plan / apply / init / update — in progress (phases 1b–1c).