diff --git a/.kit/shared/memory.jsonl b/.kit/shared/memory.jsonl index 69aa97d7..4136a00f 100644 --- a/.kit/shared/memory.jsonl +++ b/.kit/shared/memory.jsonl @@ -32,3 +32,5 @@ {"id":"716c68","area":"cli","kind":"convention","title":"A flag kit does not recognize must fail loudly, never fall through","body":"hasFlag matches exact tokens, so a near-miss flag simply is not seen and the command silently takes a different branch: 'kit upgrade --self.' (trailing period) skipped the self-upgrade path and rewrote every installedAt in the lock file instead. Rule: any command that parses flags rejects unknown ones with exit 1 and prints its accepted set; command allowlists must include GLOBAL_FLAGS (--read-only/--readonly/--non-interactive/--env/--help/--version) so a documented global never reads as unknown. Globals may also precede the command word, so strip them before positional dispatch — command modules read subcommands off raw argv indices.","refs":[],"author":"Peter Sandström ","ts":"2026-08-20T06:46:50.620Z","source_ref":"e54507f","provenance":"operator","confidence":"high","kid":"kid_31cd7bffcece85256671f0fced3b42df","sig":"EyOCS27Kxkb94NfhHjrP1eeU2WdozepNBXTsdKALqcRi7xOdNE7wsQkDDb3mbKEC29Re50IC8n7Xx/C1RNhwCA=="} {"id":"ed415f","area":"cli","kind":"convention","title":"Scattered guards become a declared surface plus one refusal at dispatch","body":"When a guarantee is enforced by N per-module guards, nothing can answer 'did we cover everything?' — read-only mode was guarded in 11 modules and four commands still wrote (identity init minted a private key), and flag validation covered 2 of 45 modules. The pattern that fixed both: enumerate the surface in a declared table (read-only-surface.ts, flag-surface.ts), enforce once at dispatch, and keep per-module guards as extras for library callers that bypass the CLI. Generate the table from the source and fail a drift test when it rots, because a table that falls behind REJECTS something that works — worse than the silence it replaced. An allowlist authored from the handler file alone is the known trap: CHECK_FLAGS rejected kit check --attest, documented and read one import away.","refs":[],"author":"Peter Sandström ","ts":"2026-08-20T08:26:14.117Z","source_ref":"012a04a","provenance":"operator","confidence":"high","kid":"kid_31cd7bffcece85256671f0fced3b42df","sig":"QkUXpku7vGeNQWYFQcA2QOIENFZfCObhgKhiX8Dv2lkBZL5RXKDzbKwPo9DshgV6NcRGIJ1nS8DgmuzkFniRBQ=="} {"id":"b305ca","area":"cli","kind":"decision","title":"A coverage oracle must measure the property, not the shape of the fix","body":"self-audit's flag-validation row grepped src/commands/*.ts for the string unknownFlags(, which measured whether a file contained a guard: a module with several handlers could hold one and leave its other verbs open, and the verbs fix and plugin do not live under src/commands at all, so no grep there could ever see them. Rewritten to 'every verb in COMMAND_REGISTRY has an entry in the declared surface'. Same trap as trap 5 (a correct decision function with no caller is not a working control) and as #470, where the anchor record was correct, complete, 0600 and read by nothing. When changing an oracle to make a rule pass, the new oracle has to be strictly stronger — and a missing table must report every verb as missing, never as covered.","refs":[],"author":"Peter Sandström ","ts":"2026-08-20T08:26:14.373Z","source_ref":"012a04a","provenance":"operator","confidence":"high","kid":"kid_31cd7bffcece85256671f0fced3b42df","sig":"dHJ5Y2b///FV4xU/JmKSz1/VdBb/Dce/h4SIpgxbUlt0DEq7dfM6zpyZqfiM44dAcapyid/mlJ4KkQ2lNFdLCg=="} +{"id":"2ca60e","area":"cli","kind":"decision","title":"Report a fact and you must assert it, or mark the output as possibly partial","body":"kit makes three kinds of statement — measurement (vercel 53.1.1), assertion (matches what the repo declared), verdict (green) — and the defect class is a verdict that refers to something other than the measurement while the reader takes them as the same. Measured instances: a latest pin printed the installed version while green meant 'the binary answered --version'; cli-lock.json recorded a guessed installer while green meant 'a key with that name exists'; identity was printed with NO verdict, which forces the reader to supply one, and an agent always does. Two branches, both required: if the fact can be compared to a declaration, compare it (git.email and gcloud.account already did; vercel.user did not — that was the whole gap); if it cannot, label the output unknown or skip WITH THE REASON, never green. Unknown is not failure — unknown must be visible, and kit already has the vocabulary. Generalises to anything whose COMPLETENESS depends on the caller's authority or on a lookup that may not have run: a scanner without a token, a registry offline, a listing filtered by a role, and a verdict whose oracle can only see one working tree.","refs":[],"author":"Peter Sandström ","ts":"2026-08-20T14:11:06.090Z","source_ref":"b998b3e","provenance":"operator","confidence":"high","kid":"kid_31cd7bffcece85256671f0fced3b42df","sig":"d+3FDsSSWm0Xpg4W+NQ81ohjmqZblgVLD/pe1d5WD7ZuKBYDGfffDL4yot9KRYosb7fgFi9uVi3Dhrb7tBZiDA=="} +{"id":"15128e","area":"cli","kind":"convention","title":"A gate never calls the network: it reads a cache and says when the cache is cold","body":"Resolution of a real conflict between two of kit's own rules — no false green (verify against the registry) versus the gate must stay fast and offline-safe (do not call out). A gate that makes network calls becomes slow, flaky, skipped, and false-green the moment a call fails and the code shrugs. The design: split who FILLS the cache from who READS it. An explicit user-initiated command fills it (kit tools list --latest, ~12s cold); the gate reads only, reports drift it already knows, and otherwise prints 'not looked up yet — run '. Two details carry the honesty: a failed lookup is NOT cached, or a flaky network becomes a day-long policy; and air-gap gets a different reason string from cache-cold, because 'we did not call' and 'we have not looked yet' are different facts for the reader. The next verification that wants to live in a gate answers three questions instead of one: who fills, who reads, and what do we say when it is cold.","refs":[],"author":"Peter Sandström ","ts":"2026-08-20T14:11:06.353Z","source_ref":"b998b3e","provenance":"operator","confidence":"high","kid":"kid_31cd7bffcece85256671f0fced3b42df","sig":"ULQPpX0YQLTO5At7DssEV7dFyC7WC1EPNC2IoK4hoJJbXfnaxA7zZAMb8jqimkfxPKKqltono8lNVeC0AHImBg=="}