diff --git a/.kit/shared/memory.jsonl b/.kit/shared/memory.jsonl index e5bbc15b..114449c5 100644 --- a/.kit/shared/memory.jsonl +++ b/.kit/shared/memory.jsonl @@ -29,3 +29,4 @@ {"id":"c8b0dc","area":"ci","kind":"convention","title":"A gate's verdict must never come from a pipeline — GitHub's default step shell has no pipefail","body":"GitHub Actions runs a bare 'run:' with 'bash -e {0}' — the -o pipefail flag is NOT set unless the step declares 'shell: bash' or sets it itself. So any condition of the form 'if ! check | tee log' takes its status from the LAST command, and tee always exits 0. kit's publish.yml carried exactly that around git verify-tag, so the tag-signature gate could not fail: an unsigned v6.6.4-predecessor (v6.6.3) published while the pinned MAINTAINER_KEY_FPR, the single-key keyring check and the ownertrust import were all correct and all unconsumed. Fix: 'set -o pipefail' plus a redirect instead of the pipe, and print the log only on failure. Enforced by self-audit R1-fail-open-ci (flags a condition piped into tee/cat unless the step really sets pipefail) — note the first version of that helper matched the word 'pipefail' anywhere in the step and was satisfied by the fixed step's own explanatory comment, so it now requires a real 'set' line. Applies to every repo: a green step that never evaluates its check is worse than no step.","refs":[],"author":"Peter Sandström ","ts":"2026-08-18T12:45:25.113Z","source_ref":"d7897ed","kid":"kid_31cd7bffcece85256671f0fced3b42df","sig":"TktNTzlDZRtUHvl+Tj11dtgf6UlHNWpWPfDby4qJT/u8M5Zu0eNjWqKNV3IcQbkTTLYZOOKN3Gm4j+rwC1KzBg=="} {"id":"3b986a","area":"ci","kind":"convention","title":"A gate's verdict must never come from a pipeline — any status-blind sink, not just tee","body":"Supersedes the tee/cat-only formulation. GitHub Actions runs a bare 'run:' with 'bash -e {0}' (confirmed in a runner log: 'shell: /usr/bin/bash -e {0}') — pipefail is NOT set unless the step asks. A condition whose pipeline ENDS in a status-blind sink is therefore decided by the sink: tee, cat, head, tail, wc, sort, uniq, tr. head and tail exit 0 on EMPTY input, which is the trap: 'if grep -rE pattern src/ | head -1' is always true. Two instances shipped in kit: publish.yml around git verify-tag (an unsigned v6.6.3 published) and security.yml around the security-headers grep (the warning branch was unreachable while the grep matched 0 lines). 'grep -q' as the last element is fine — there the pipe's last command IS the question. Enforced by self-audit R1-fail-open-ci. Two second-order lessons: widening the rule from the first instance immediately surfaced the second, so write the rule rather than patch the line; and the rule's pipefail-detection helper first matched the word anywhere in the step and was satisfied by the fixed step's own comment, so it requires a real 'set' line. Also: fixing such a check can turn it into a permanently-firing warning, which trains people to ignore warnings — gate it on the condition it presupposes (kit has no HTTP surface, so the header check now runs only when a server pattern exists) instead of shipping expected noise.","refs":[],"author":"Peter Sandström ","ts":"2026-08-18T13:12:09.922Z","source_ref":"2e5dee4","supersedes":"c8b0dc","kid":"kid_31cd7bffcece85256671f0fced3b42df","sig":"4nafrRffOdlakMEPoYhDak1VF0cL9I9AtGQIhPfMBluPlKf7VrrQxAH21+PiTPlZcZNci6Aoh1RDhOnGC066CQ=="} {"id":"443cac","area":"release","kind":"decision","title":"Removing the token IS the switch to OIDC — npm prefers a token whenever one is present","body":"Configuring trusted publishers changes nothing on its own: npm authenticates with NODE_AUTH_TOKEN whenever that env exists, so OIDC only takes effect once the token is removed from the workflow. The two cannot both be in effect, which makes a re-added token a SILENT downgrade back to the credential npm is retiring (direct publishing by bypass-2FA tokens dies ~Jan 2027) — so gate it: a test that fails if any EXECUTING line of the publish workflow carries a token, comments excluded. Second-order facts from doing it on 13 packages: the per-package UI save requires step-up 2FA and npm does NOT keep the session elevated (one security-key tap per package, a timed-out prompt loses that save, nothing half-saves so retrying is free); the CLI equivalent 'npm access set mfa=publish ' returns EOTP and needs --otp from a TOTP app, which a security-key-only account cannot produce, and npm offers no way to add TOTP beside an existing key (only disable-and-re-enroll, a worse trade); driving the UI fast trips Cloudflare's bot check, which only a human may clear. And the honest limit of a prerelease smoke test: an unchanged workspace version is skipped as already-published, so per-package publishers stay UNEXERCISED until that package's next version bump — with no token fallback, a wrong field then fails that package's step and is fixed in the registry UI, not worked around.","refs":[],"author":"Peter Sandström ","ts":"2026-08-19T14:44:50.690Z","source_ref":"e8909b2","kid":"kid_31cd7bffcece85256671f0fced3b42df","sig":"fgbdc5Xql/c7oWPZFLhcjOj5gYQqpebS65vE4tvb9tczSrowyIA5nw1BYujFrFNT4rWT0DUHwtTr+cAryYuMDQ=="} +{"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=="}