claudemd-cli 0.65.1 → 0.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -8,12 +8,32 @@ All notable changes to the `claudemd` plugin. This changelog tracks plugin artif
8
8
  - **Canonical spec version source**: `spec/CLAUDE.md` top-line title (`# AI-CODING-SPEC vX.Y.Z — Core`) + `spec/CLAUDE-changelog.md` top `##` entry.
9
9
  - **Plugin semver vs spec semver** are independent: plugin patch (0.2.0 → 0.2.1) may ship when spec is unchanged (this release); plugin minor (0.1.9 → 0.2.0) ships when spec minor updates (v0.2.0 shipped spec v6.10.0).
10
10
 
11
+ ## [0.66.0] - 2026-08-09
12
+
13
+ Ships spec **v6.25.0** — a compression + relocation minor that restores attention-budget headroom. No hook, script, or command behavior change; the shipped artifact delta is the four spec files + manifests.
14
+
15
+ - **spec: core 24793 → 23042 bytes (−7.1%), extended 49964 → 42999 bytes (−14%)** with zero rule-semantics change, zero section renames, and the enforcement partition unchanged (6 hook / 16 self / 2 both / 1 external). What left: version archaeology, rationale essays (rules keep one-line incident citations), duplicated enumerations, operator bookkeeping. What moved: §13.2 promotion gates, §13.3 gate tables, and the Recent-changes operator carry-forward now live in `OPERATOR.md` (which grows accordingly — it is not Agent-loaded, so the growth is free at runtime).
16
+ - Basis: per-clause audit (`tasks/spec-lean-cut-candidates-2026-08-09.md`, local) against 30d rule-hits telemetry and incident memories; `hard-rules-audit.js` reported `demoteCandidates: []`, so every HARD rule survives verbatim at anchor level — `hard-rules.json` bumps `spec_version` only. An externally-drafted "lean v7" (core→11.4K, new caps, changelog restart) was evaluated and rejected; the decision record enumerates 8 rejected items with reasons.
17
+ - Users upgrading: nothing to do. The spec reads ~1.1k tokens lighter per turn (core ≈6.0k → ≈4.9k estimated); every obligation, AUTH surface, and hook contract is unchanged. Revert path: pin the previous plugin version (0.65.2) or `CLAUDEMD_ALLOW_DOWNGRADE=1 node scripts/install.js` from a 0.65.2 checkout.
18
+
19
+ ## [0.65.2] - 2026-07-28
20
+
21
+ The v0.65.0 red leg has an explanation, and the guidance v0.65.1 left behind was wrong. No shipped **code** changed: the tarball delta is the version field and this changelog entry (`CHANGELOG.md` is itself the largest shipped file, so "byte-identical apart from the version" — the first draft of this sentence — would have been self-falsifying). No hook, script, command or spec changed. It is released so the correction carries a version and reaches the marketplace channel, which serves the whole repository.
22
+
23
+ - **fix: `contract.test.sh` splits `grep`'s exit-code spectrum.** The C-direction membership test collapsed exit 1 ("no match") and exit ≥2 ("failed to run" — fork / ENOMEM / signal) into a single else branch, so a transient runner spawn failure was reported as documentation drift. Exit ≥2 is now an explicit infrastructure fault. Same class as the repo's own recorded lesson that `grep` exit 2 is an error, not a zero-match — the gate had stepped on a rule this project already wrote down.
24
+ - **Retraction: v0.65.1's "if the assertion flakes again, the awk extraction is the next suspect" was wrong — do not start there.** The load-bearing evidence is the re-run: attempt 1 (failure) and attempt 2 (success) of the identical v0.65.0 commit ran on the **same runner version and the same image** (`macos-26-arm64 / 20260720.0258.1`) and disagreed. Identical code, identical image, different outcome — that alone excludes every deterministic cause, and it also means v0.65.1's hardening was not what fixed it.
25
+ - Two weaker arguments were used at first and are recorded here as *weaker*, not as co-equal proof: the failing leg parsed the same **47** documented pairs and ran the same **46** assertions as every passing leg (45 PASS + 1 FAIL, `110/111`), and the pair carries no regex metacharacter. The 47 is counted **before** the `sort -u`, so it cannot by itself exclude a collation drop; and the collision check was run on glibc, which is not the collator that was on trial. The re-run is what settles it.
26
+ - v0.65.1's two hardenings (`LC_ALL=C` on the dedups, `grep -Fqx` for the lookup) stay: BSD `sort -u` deduplicating by collation and a literal compared as a BRE are real portability hazards on their own merits. They were simply not the cause, and the earlier entry now says so.
27
+ - **What is proven, and what is not.** Proven: the gate could not distinguish "not found" from "did not run", and the failure is non-deterministic on a fixed image. Not proven: that a spawn failure actually occurred on that runner — GitHub does not log it, so the transient-fault account is inferred, not observed. Every mechanism *we enumerated* (parse, extraction, collation, pattern interpretation) is excluded; that is not the same as closure over an unenumerable space. The fix removes the conflation rather than asserting the fault.
28
+ - The new branch is verified by a three-arm control rather than assumed reachable: a hit reports PASS, a miss reports drift, and a stub `grep` exiting 2 reports an infrastructure fault — three distinct outcomes.
29
+
11
30
  ## [0.65.1] - 2026-07-28
12
31
 
13
32
  Hotfix for a red `ci@main` leg on the v0.65.0 push. No hook, script or spec behavior changes — the failing assertion is in a test, and the released artifact is not affected.
14
33
 
15
34
  - **fix: `contract.test.sh` pins the two locale-sensitive operations in its (event, emitter) comparison.** BSD `sort -u` removes lines that *collate* equal rather than lines that are byte-equal, so under a UTF-8 locale it can silently drop a distinct pair; the membership test also used `grep -qx`, treating a literal pair as a basic regex. Both are now `LC_ALL=C`, and the lookup is `grep -Fqx`.
16
- - **Mechanism not established, and the comment says so.** v0.65.0's `ci@main` leg failed `C emitted 'fail-open' by 'ship-baseline' is NOT documented` on macos-latest/22 while **the same commit passed on the tag run** (all four legs), on both Linux legs, and on macos-latest/20. It did not reproduce locally across repeated runs or under `C` / `en_US.UTF-8` / `C.UTF-8`. A "the table row got too long" theory was checked and discarded the `bypass-escape-hatch` row is 1691 chars against fail-open's 1102 and parses fine. So this hardens two real portability hazards rather than claiming a root cause. If the assertion flakes again, the extraction itself is the next suspect, not the collation.
35
+ - **Correction (2026-07-28, after this version shipped): a defect that explains the failure was found, and this entry's closing guidance was wrong.** (The *mechanism* on the runner remains unproven — see v0.65.2.) Re-running the identical v0.65.0 commit without the hardening below passed, so the hardening is not what fixed it and the failure is not deterministic. The failing leg parsed the same **47** documented pairs and ran the same **46** assertions as every passing leg; no collation collision exists among those 47 under `C` or `en_US.UTF-8`; the pair contains no regex metacharacter. That exonerates the awk extraction this entry named as "the next suspect" **do not start there.** What remains is that the C-direction membership test collapsed `grep` exit 1 ("no match") and exit ≥2 ("failed to run") into one branch, so a transient runner spawn failure was reported as documentation drift. Same class as the repo's own recorded lesson that grep exit 2 is an error, not a zero-match. The exit-code spectrum is now split. The two hardenings below remain — they are real portability hazards on their own merits — but they were not the cause.
36
+ - **Mechanism not established at the time, and the comment said so.** v0.65.0's `ci@main` leg failed `C emitted 'fail-open' by 'ship-baseline' is NOT documented` on macos-latest/22 while **the same commit passed on the tag run** (all four legs), on both Linux legs, and on macos-latest/20. It did not reproduce locally across repeated runs or under `C` / `en_US.UTF-8` / `C.UTF-8`. A "the table row got too long" theory was checked and discarded — the `bypass-escape-hatch` row is 1691 chars against fail-open's 1102 and parses fine. So this hardens two real portability hazards rather than claiming a root cause. If the assertion flakes again, the extraction itself is the next suspect, not the collation.
17
37
  - Worth stating plainly: v0.65.0's tag run passed all four matrix legs and `npm-publish` succeeded, so **0.65.0 on npm is not broken** — no deprecate. The red run is the duplicate `ci@main` run that the atomic ship flow fires on the same commit.
18
38
 
19
39
  ## [0.65.0] - 2026-07-28
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # claudemd
2
2
 
3
- > A **personal AI-coding discipline harness**: one developer's opinionated **AI-CODING-SPEC v6.24**, encoded as Claude Code shell hooks and shipped with the plugin. Built and dogfooded on my own repos — fork and adapt, don't adopt wholesale.
3
+ > A **personal AI-coding discipline harness**: one developer's opinionated **AI-CODING-SPEC v6.25**, encoded as Claude Code shell hooks and shipped with the plugin. Built and dogfooded on my own repos — fork and adapt, don't adopt wholesale.
4
4
 
5
5
  [![CI](https://github.com/sdsrss/claudemd/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/sdsrss/claudemd/actions/workflows/ci.yml)
6
6
  [![npm](https://img.shields.io/npm/v/claudemd-cli.svg)](https://www.npmjs.com/package/claudemd-cli)
7
7
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
8
8
 
9
- claudemd plugs into the Claude Code hook system to **block commits, pushes, and bash commands** that violate AI-CODING-SPEC v6.24 — banned vocabulary in commit messages, `rm -rf $VAR` without variable validation, ship-on-red-CI, unread `MEMORY.md` entries during release flows, and more. The spec itself (`CLAUDE.md` + `CLAUDE-extended.md` + `CLAUDE-changelog.md` + `OPERATOR.md`) ships with the plugin and installs into `~/.claude/`, so the rules Claude Code reads at session start match the rules the hooks enforce. (`OPERATOR.md` is the human-only spec-maintenance handbook — Agent-loaded files are the CLAUDE trio.)
9
+ claudemd plugs into the Claude Code hook system to **block commits, pushes, and bash commands** that violate AI-CODING-SPEC v6.25 — banned vocabulary in commit messages, `rm -rf $VAR` without variable validation, ship-on-red-CI, unread `MEMORY.md` entries during release flows, and more. The spec itself (`CLAUDE.md` + `CLAUDE-extended.md` + `CLAUDE-changelog.md` + `OPERATOR.md`) ships with the plugin and installs into `~/.claude/`, so the rules Claude Code reads at session start match the rules the hooks enforce. (`OPERATOR.md` is the human-only spec-maintenance handbook — Agent-loaded files are the CLAUDE trio.)
10
10
 
11
11
  A standalone CLI (`npx claudemd-cli`) reuses the same `banned-vocab.patterns` source for git pre-commit hooks, GitHub Actions, and other agents that don't run inside Claude Code.
12
12
 
@@ -60,7 +60,7 @@ Verify in one command (Linux): `node --version && jq --version && gh --version &
60
60
  | 15 shell hooks | `banned-vocab-check` · `pre-bash-safety-check` · `ship-baseline-check` · `residue-audit` · `memory-read-check` · `memory-prompt-hint` · `sandbox-disposal-check` · `session-start-check` · `session-extended-read` · `session-summary` · `session-end-check` · `transcript-vocab-scan` · `transcript-structure-scan` · `version-sync` · `mem-audit` |
61
61
  | 16 slash commands | `/claudemd-install` · `/claudemd-status` · `/claudemd-update` · `/claudemd-refresh` · `/claudemd-audit` · `/claudemd-toggle` · `/claudemd-doctor` · `/claudemd-analyze` · `/claudemd-uninstall` · `/claudemd-rules` · `/claudemd-clean-residue` · `/claudemd-sparkline` · `/claudemd-sampling-audit` · `/claudemd-bypass-audit` · `/claudemd-design-adopt` · `/claudemd-statusline` |
62
62
  | 1 standalone CLI | `claudemd-cli lint` · `claudemd-cli audit` ([npm: `claudemd-cli`](https://www.npmjs.com/package/claudemd-cli)) |
63
- | Spec v6.24 | `~/.claude/CLAUDE.md` · `CLAUDE-extended.md` · `CLAUDE-changelog.md` · `OPERATOR.md` (backup-before-overwrite) |
63
+ | Spec v6.25 | `~/.claude/CLAUDE.md` · `CLAUDE-extended.md` · `CLAUDE-changelog.md` · `OPERATOR.md` (backup-before-overwrite) |
64
64
  | StatusLine (opt-out) | PS1-style line — `user@host:dir (branch) Model [ctx:N% · 5h:N% · 7d:N%]` (`dir` = cwd basename; context / 5-hour quota / weekly quota, all **used %**, read from Claude Code's `rate_limits` payload; quota segments auto-hide when the data is absent, or force-hide with `DISABLE_STATUSLINE_QUOTA=1`) — wired into `~/.claude/settings.json` on install **only when the slot is empty**; an existing statusline is left untouched. Skip entirely with `CLAUDEMD_NO_STATUSLINE=1`. Manage via `/claudemd-statusline`. |
65
65
 
66
66
  Install backs up a hand-written `~/.claude/CLAUDE.md` (any file without the `# AI-CODING-SPEC` H1) to `~/.claude/backup-<ISO>/` before overwriting (last 5 kept automatically). An already-installed claudemd spec is overwritten **without** a backup — deliberate (v0.23.11): the sole backup is always your own content, so `restore` can never return a stale spec instead. Uninstall offers `keep / restore / delete`; `delete` requires an extra confirmation.
@@ -352,7 +352,7 @@ claudemd/
352
352
  ├── commands/ # 16 slash-command markdown files
353
353
  ├── bin/ # standalone CLI entrypoint (claudemd-lint.js → `npx claudemd-cli` on npmjs.org)
354
354
  ├── scripts/ # 18 Node.js scripts + scripts/lib/ (single-source registry, lint, etc.)
355
- ├── spec/ # shipped v6.24.0 CLAUDE*.md trio + OPERATOR.md + hard-rules.json manifest
355
+ ├── spec/ # shipped v6.25.0 CLAUDE*.md trio + OPERATOR.md + hard-rules.json manifest
356
356
  ├── tests/ # hook shell tests + Node.js tests + integration + fixtures
357
357
  ├── docs/ # ADDING-NEW-HOOK.md + RULE-HITS-SCHEMA.md + superpowers/
358
358
  └── .github/workflows/ # ci.yml (ubuntu+macOS × node 20) + npm-publish.yml (tag-triggered)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudemd-cli",
3
- "version": "0.65.1",
3
+ "version": "0.66.0",
4
4
  "description": "Standalone CLI for §10-V banned-vocab + transcript scanning. Companion to the claudemd Claude Code plugin (github.com/sdsrss/claudemd) for use in git pre-commit hooks, GitHub Actions, and other agents.",
5
5
  "type": "module",
6
6
  "bin": {