claudemd-cli 0.9.38 → 0.10.1

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,6 +8,96 @@ 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.10.1] - 2026-05-11
12
+
13
+ **Patch — feat: §13.1 demote-analysis denominator signal.** New PreToolUse:Read hook `session-extended-read` records once per session when `~/.claude/CLAUDE-extended.md` is read (per spec §2.2 EXT LOADING). Backlog item 1C from v0.10.0 closed: extended-scope rules with "0 hits in 90d" can now be qualified against the count of sessions that actually loaded extended, instead of conflating "rule cold" with "extended rarely loaded."
14
+
15
+ ### What changed
16
+
17
+ - **New hook** `hooks/session-extended-read.sh` (~40 LOC). PreToolUse:Read matcher; matches only the canonical user-global path (`$HOME/.claude/CLAUDE-extended.md`), not the project source `spec/CLAUDE-extended.md` (which maintainers Read while editing — that's spec-edit traffic, not §2.2 EXT-load).
18
+ - **Per-session dedup** via `~/.claude/.claudemd-state/ext-read-<sid>.ts` sentinel. Without dedup, agents Reading the same file N times mid-session would inflate the denominator from "binary did-load" into a frequency metric that §13.1 doesn't evaluate.
19
+ - **GC**: `session-end-check.sh` drops the sentinel for the ending SID — best-effort cleanup so `.claudemd-state/` doesn't accumulate one file per ended session.
20
+ - **Schema additive**: `event="read"` + `spec_section="§13.1-extended-read"` documented in `docs/RULE-HITS-SCHEMA.md` Events table + Spec section taxonomy.
21
+ - **Registry sync**: 13 → 14 hooks. `scripts/lib/hook-registry.js` adds the entry; tests/scripts/{install,hook-registry}.test.js MCOUNT pin moved; tests/integration/full-lifecycle.test.sh manifest count moved; README + commands/claudemd-toggle.md kill-switch list extended.
22
+ - **Kill-switch**: `DISABLE_SESSION_EXTENDED_READ_HOOK=1`.
23
+
24
+ ### Why patch, not minor
25
+
26
+ Pure additive: new hook, new event, new spec_section. No existing schema field changes; no existing audit-output shape changes (consumer side — extending `hard-rules-audit.js` to qualify extended-scope demote candidates against this denominator — is deferred to a follow-up patch). All existing rows continue to parse; new rows are tagged with a new `hook`/`event`/`spec_section` triple that pre-v0.10.1 audit code simply ignores.
27
+
28
+ ### Tests
29
+
30
+ - New `tests/hooks/session-extended-read.test.sh`: 9 cases — canonical path records, dedup, new-session new-row, project source skipped, wrong tool skipped, missing session_id fail-open, kill-switch, silent stdout.
31
+ - `tests/hooks/contract.test.sh` DOCUMENTED array: `read:session-extended-read` added (closes Invariants B + C).
32
+ - Suite: 19/19 hook + 384/384 JS + 2/2 integration pass.
33
+
34
+ ### Sizing
35
+
36
+ No spec changes; same `spec/CLAUDE.md` v6.11.13 / `spec/CLAUDE-extended.md` baseline as v0.10.0.
37
+
38
+ ## [0.10.0] - 2026-05-11
39
+
40
+ **Minor — roll-up of v0.9.33 → v0.9.38: in-session dogfood-driven hardening of the §0.1 / §13.1 / §13.2 audit data pipeline + the §11 enforcement chain.** Zero new code in this commit (3 manifest version files + this index). First plugin minor bump since v0.2.0; semver shift justified by the coherent feature surface added across the 6 patches — additive Δ-contract on `rule-hits.jsonl` schema (2 new columns), new `audit.js` top-level fields, new `claudemd-doctor` check.
41
+
42
+ ### What the 6 patches collectively delivered
43
+
44
+ | Patch | Delivered |
45
+ |---|---|
46
+ | [0.9.33] | `rule_hits_append` 5th arg `session_id`; 7 of 12 emitter hooks threaded. Schema-additive Δ-contract on the JSONL artifact. |
47
+ | [0.9.34] | `rule_hits_append` 6th arg `tool_use_id` (PreToolUse / PostToolUse only); remaining 5 hooks plumbed `session_id`; `audit.js` `uniqueInvocations()` dedup view by `(ts, hook, session_id, tool_use_id)`. |
48
+ | [0.9.35] | `scripts/lib/memory-tags.js` + `claudemd-doctor` `memory-tag-specificity` check — closes spec §11-EXT (SHOULD, v6.11.11) tooling gap. |
49
+ | [0.9.36] | `memory-read-check.sh` deny `extra.match_count` + bypass `extra.bypass_reason` (with `[skip-memory-check: <reason>]` form). |
50
+ | [0.9.37] | `detectCutover()` + `bySection` / `byTrend` cutover-split — `(unset)` → `(unset-historical)` + `(unset-current)`. |
51
+ | [0.9.38] | `GENERIC_WORDLIST` +10 entries (`design`, `brainstorm`, +8 preventive ship-prose words). |
52
+
53
+ ### Schema shape after v0.10.0
54
+
55
+ `~/.claude/logs/claudemd.jsonl` row format:
56
+ ```json
57
+ {
58
+ "ts": "2026-05-11T...Z",
59
+ "hook": "<hook-name>",
60
+ "event": "<event-class>",
61
+ "project": "-mnt-data-ssd-...",
62
+ "session_id": "...", // added v0.9.33
63
+ "tool_use_id": "toolu_...", // added v0.9.34; PreToolUse/PostToolUse only
64
+ "spec_section": "§...",
65
+ "extra": { ... }
66
+ }
67
+ ```
68
+
69
+ `scripts/audit.js` top-level shape:
70
+ ```
71
+ windowDays, totalHits,
72
+ dataIntegrity: { totalLines, parsed, skipped, skipRatio,
73
+ cutoverTs }, // added v0.9.37
74
+ byHook, bySection, byBypass, byFailOpen, byTrend,
75
+ uniqueInvocations, // added v0.9.34
76
+ topPatterns
77
+ ```
78
+
79
+ ### Why minor, not patch
80
+
81
+ Each individual sub-patch was patch-level (atomic, additive, back-compat). Aggregated, they constitute the first deliberate semver shift since v0.2.0: rule-hits.jsonl schema gains 2 stable columns that downstream tooling can rely on; `audit.js` JSON shape gains 2 top-level fields; doctor gains 1 new check class. Anyone with audit dashboards parsing the older shape needs to handle the new keys. Patch-level was correct per individual commit; minor is correct as the index marker.
82
+
83
+ ### Compat (re-confirmed)
84
+
85
+ - All 6 sub-patches are back-compat: optional schema args, JSONL `null` for absent fields, legacy `(unset)` bucket falls back when cutoverTs is null, pre-v0.9.36 bypass form still works.
86
+ - Tests: 19/19 hook + 388/388 JS pass across the entire 6-patch sequence.
87
+
88
+ ### In-session self-dogfood evidence
89
+
90
+ The work itself stress-tested the §11 enforcement chain twice during ship:
91
+ - **v0.9.34 ship → `semantic` tag FP** caught by Read of `plugin_code_graph_mcp.md`. Drove v0.9.35 detector design.
92
+ - **v0.9.37 ship → `design` tag FP** caught by Read of `feedback_brainstorm_for_design_tasks.md`. Drove v0.9.38 wordlist补全.
93
+ - **v0.9.38 ship → used `[skip-memory-check: <reason>]` form** to bypass the §11 hook on a release whose notes literally mention `design`. First production use of the v0.9.36 `bypass_reason` capture.
94
+
95
+ The §11 enforcement worked correctly all three times — each FP was the spec doing its job, not failing.
96
+
97
+ ### Plugin
98
+
99
+ - Plugin manifests bumped 0.9.38 → 0.10.0 (package.json + plugin.json + marketplace.json). Spec content unchanged — manifest `description` fields stay at `v6.11` family per `Versioning policy` (set in v0.2.1).
100
+
11
101
  ## [0.9.38] - 2026-05-11
12
102
 
13
103
  **Patch — §11-EXT Tag-specificity wordlist补全.** Self-applied follow-up to v0.9.35: this session's own ship flow tripped two §11 FPs (`semantic` in 1B body / `design` in cutover-split body), and only the first was caught by v0.9.35's wordlist. Adds 10 entries: 2 from the observed FP (`design`, `brainstorm`) + 8 preventive picks from words that appeared ≥2× in this session's release notes / CHANGELOG entries (`architecture`, `behavior`, `schema`, `default`, `pattern`, `format`, `system`, `process`). Live doctor finding count 22 → 24 (+2 catches `design` + `brainstorm` in `feedback_brainstorm_for_design_tasks.md`; other 8 are preventive — no current MEMORY.md uses them as single-word tags yet).
package/README.md CHANGED
@@ -177,6 +177,7 @@ export DISABLE_TRANSCRIPT_VOCAB_SCAN_HOOK=1 # PostToolUse §10-V advisory s
177
177
  export DISABLE_TRANSCRIPT_STRUCTURE_SCAN_HOOK=1 # v0.9.10+ — Stop §10 four-section advisory
178
178
  export DISABLE_MEM_AUDIT_HOOK=1 # v0.9.4+ — Stop Why:-less citation advisory
179
179
  export DISABLE_SESSION_END_CHECK_HOOK=1 # v0.9.27+ — SessionEnd §11-session-exit mid-SPINE check
180
+ export DISABLE_SESSION_EXTENDED_READ_HOOK=1 # v0.10.1+ — PreToolUse:Read §13.1-extended-read denominator signal
180
181
  ```
181
182
 
182
183
  **2a. Per-sub-feature** (v0.4.0+). Sub-flags inside an enabled hook, named without the `_HOOK` suffix:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudemd-cli",
3
- "version": "0.9.38",
3
+ "version": "0.10.1",
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": {