claudemd-cli 0.39.0 → 0.41.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 +24 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,30 @@ 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.41.0] - 2026-07-12
|
|
12
|
+
|
|
13
|
+
**Minor — latent-cleanup batch (roadmap B2): detector-parity, encoding-helper dedup, install validate-before-move, strict toggle argv, architecture-doc refresh.** Closes the five B2 items from the 2026-07-12 production-readiness audit. Spec unchanged (stays v6.17.0). No user-visible enforcement change.
|
|
14
|
+
|
|
15
|
+
- **DRIFT-1** (`scripts/sampling-audit.js`): `loadVocabPatterns` + `scanVocab` now delegate to lint.js `readPatterns`/`scan` — the sanctioned §10-V parser shared with the CLI and the bash hook. The prior inline loader used `indexOf('|')` (truncates any alternation-bearing regex) and omitted `posixClassesToJs`, so a future non-`@ratio` pattern with an alternation or POSIX class would be silently dropped/mis-matched here while active elsewhere → false-optimistic §10-V compliance. `@ratio` exclusion preserved via `excludeRatio`; raw-text baseline preserved (no identifier strip). +2 parity tests (alternation regex survives; POSIX class matches; `@ratio` excluded).
|
|
16
|
+
- **ARCH-1** (`hooks/lib/rule-hits.sh` + `hooks/lib/hook-common.sh` + 3 hooks): the CC projects-dir encoding (`tr -c 'a-zA-Z0-9-' '-'`) was hand-inlined in 4 places (a class with prior bug history). Extracted to a single `hook_encode_project` in the rule-hits leaf lib, eagerly sourced by hook-common so all consumers share ONE definition (no `declare -F`-guarded inline fallback — that silent-divergence antipattern). +1 binding test.
|
|
17
|
+
- **SCRIPT-1** (`scripts/install.js`): the shipped-spec completeness check now runs BEFORE the backup branch `renameSync`-moves the user's `~/.claude/CLAUDE.md` (pre-fix an incomplete plugin checkout left the user's spec only in the backup dir, home path empty, manifest unwritten). Added a closing post-copy sha256 integrity assertion so a partial/failed copy that doesn't throw surfaces at install time, not on the next doctor run. +1 test (incomplete spec → throws, user content untouched, no backup created).
|
|
18
|
+
- **SCRIPT-2** (`scripts/toggle.js`): the only CLI entrypoint reading `process.argv[2]` directly — `toggle banned-vocab --json` silently dropped `--json`. Now takes the first positional as the hook name and feeds the remainder to `parseStrict`, so an unknown flag / extra positional rejects loudly with exit 2 (shape error, distinct from exit 1). +2 tests.
|
|
19
|
+
- **DOC-1** (`docs/ARCHITECTURE.md`): "Three layers" → four (adds the `bin/claudemd-lint.js` npm-CLI layer the doc omitted); new "§8 is a guardrail, not a security boundary" positioning section.
|
|
20
|
+
- **Test-harness fix** (`tests/hooks/contract.test.sh`): the C-check event extraction now strips comments before matching `hook_record <hook> <event>`, so a docstring mentioning `hook_record` no longer false-flags schema drift (anchor on code syntax only).
|
|
21
|
+
- **OPS-1 confirmed no-op** (already shipped): jsonl size-capped rotation exists in `rule-hits.sh` (documented in the roadmap; the audit's "no rotation" finding was inaccurate).
|
|
22
|
+
- **Tests**: full `npm test` green; shellcheck + bash-3.2 gate clean; `lint:argv` 0 hits.
|
|
23
|
+
|
|
24
|
+
## [0.40.0] - 2026-07-12
|
|
25
|
+
|
|
26
|
+
**Minor — observability + test-robustness batch (roadmap B1): safety-hook fail-open telemetry + doctor hook-liveness self-checks + CI execution timeouts + README hook-count drift guard.** Product of the 2026-07-12 production-readiness audit (`docs/production-readiness-audit-2026-07-12.md`) B1 batch. Spec unchanged (stays v6.17.0). No user-visible enforcement change — these harden observability and the test harness.
|
|
27
|
+
|
|
28
|
+
- **OBS-1 fail-open telemetry** (`hooks/pre-bash-safety-check.sh`, `hooks/memory-read-check.sh`, `hooks/ship-baseline-check.sh`): the three safety-critical hooks (§8 / §11 / §7) previously `exit 0` silently on a missing jq or malformed stdin, indistinguishable in the §13.1 audit from "rule never fired". They now call `hook_record_failopen <hook> jq-missing|bad-event` on those early exits (the contract `banned-vocab-check.sh` already modeled). `tests/hooks/fail-open.test.sh` +3 (T5–T7).
|
|
29
|
+
- **OBS-2 doctor hook-liveness** (`scripts/doctor.js`): the deny self-tests covered only 2 of 16 hooks; the 6 Stop hooks + PostToolUse + other advisory hooks (which never emit a deny) had no liveness surface, so a silently-broken hook was invisible to `/claudemd-doctor`. Adds 12 liveness self-checks — each feeds a synthetic event of the hook's registered type under an isolated mkdtemp HOME (so state-writing hooks can't touch the real `~/.claude`) and asserts exit 0 with no shell-crash signature. Coverage now 14/16; `session-start-check` + `version-sync` are intentionally excluded (bootstrap / network / background-spawn side-effects unsafe to trigger from a health command; covered by their own suites + the upgrade-lifecycle integration test). `tests/scripts/doctor.test.js` +1 coverage-lock test. Known scope: liveness catches crashes on the path the synthetic event exercises (parse-time syntax errors, early `set -u` unbound-var), not breaks in untaken branches — those remain the unit suites' job.
|
|
30
|
+
- **TEST-1 CI execution timeouts** (`tests/run-all.sh` + new `tests/lib/run-suite.sh`): a hung test (a hook reading stdin with no EOF, a blocking spawnSync) previously stalled the whole run to the CI job-level kill with no diagnostic. New shared `run_suite` wraps each bash suite in `timeout`/`gtimeout` (hook 120s / integration 300s; degrades to no-cap when neither binary is present so the runner never breaks); `node --test` gets `--test-timeout=60000`. New `tests/hooks/timeout-guard.test.sh` (4 cases) exercises `run_suite` against a deliberately-hanging suite (killed with 124, bounded), asserting exit-code pass-through for normal and failing suites.
|
|
31
|
+
- **TEST-2 README hook-count drift guard** (`tests/scripts/readme-drift.test.js` +2): the "16 shell hooks" claim (capabilities table + project-layout tree) was guarded only indirectly via `HOOK_REGISTRY.length`; the README text could drift silently. Now asserts every "N shell hooks" mention matches `hooks/*.sh` count, and the enumerated capability list names exactly the real hooks (catches a hook dropped from the list even if the number still matches).
|
|
32
|
+
- **OPS-1 (no change — audit finding was inaccurate)**: the audit flagged `claudemd.jsonl` as having "no rotation". Verified against source: `hooks/lib/rule-hits.sh` has had size-capped rotation (`CLAUDEMD_LOG_MAX_MB`, default 5 MB → `.1` → `.2`) with test coverage (`rule-hits.test.sh` cases 4–6) since it shipped. No work needed; documented in the roadmap to prevent re-flagging.
|
|
33
|
+
- **Tests**: full `npm test` green; shellcheck clean; bash-3.2 portability gate clean.
|
|
34
|
+
|
|
11
35
|
## [0.39.0] - 2026-07-12
|
|
12
36
|
|
|
13
37
|
**Minor — §8 Bash-gate false-negative closure: command-name canonicalization + shell-lexer normalization (roadmap SEC-1).** Closes 4 novel §8 bypasses surfaced by the 2026-07-12 production-readiness audit (`docs/production-readiness-audit-2026-07-12.md`, all reproduced live before the fix). Spec unchanged (stays v6.17.0). **User-visible enforcement change**: commands previously ALLOWED are now denied — see below.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudemd-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.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": {
|