claudemd-cli 0.48.1 → 0.49.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,25 @@ 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.49.1] - 2026-07-15
12
+
13
+ Audit follow-up (2026-07-15 four-dimension review): three duplicated seams consolidated to a single source with a parity gate. No spec change (spec stays **v6.20.0**); all `fix:`/refactor, no user-facing feature.
14
+
15
+ - **fix(§8): curl-to-shell gate reached parity with the rm/npx gates.** `pre-bash-safety-check.sh`'s curl-sh detector never learned the transparent-exec-wrapper set the rm/npx gates strip, and its per-segment grep is line-based, so `curl … | env bash`, `curl … | command sh`, `curl … | nice bash` (and chains like `| sudo env bash`) plus a pipe-then-newline continuation (`curl … |⏎bash`) all ALLOWED — ordinary install one-liners running unknown-origin code. Both false-negatives reproduced against the live hook. Fix: a shared wrapper alternation on both the pipe and process-substitution sinks + an awk pass that joins a single-pipe line continuation before segmenting (`||` OR-lists are NOT joined, so `curl … || bash` stays correctly out of the gate). FN-direction change → verified through the full corpus, not just the FP set. Residual (documented, same as the rm gate): `env FOO=x bash` / `FOO=x bash` assignment args and path-prefixed wrappers; `[allow-curl-sh]` is the escape.
16
+ - **fix: `lesson-bypass-audit.js` project-cwd encoder diverged from the hooks' encoder.** It used `/[/._]/g` while every production hook locates transcript/project dirs via `hook_encode_project` (`tr -c 'a-zA-Z0-9-' '-'`); a project path with a space/`+`/`@` encoded differently → the script pointed at a non-existent dir and silently computed cite-recall over an empty set. The five hand-copied JS encoders (lesson-bypass, sampling-audit, memory-maintenance, spec-coherence, doctor) are now one exported `encodeProjectCwd` in `scripts/lib/paths.js`.
17
+ - **test: §10-V dual-engine parity gate.** `banned-vocab.patterns` is consumed by two regex engines (`grep -iE` in the commit hook, `RegExp` in `lint.js`/the CLI) with no test proving they agree. New `banned-vocab-engine-parity.test.js` asserts identical verdicts across all patterns × a probe corpus + a coverage gate (every pattern exercised by ≥1 probe).
18
+ - **Corpus + regression tests**: 6 new curl-sh deny rows + 2 FP-guards (`bash-safety/corpus.tsv` → 365/365); encoder divergence stressor added to `lesson-bypass-audit.test.js`.
19
+ - **Tests**: full `npm test` green (686 script tests + all hook/integration suites); `node scripts/version-cascade-check.js` exit 0 (plugin semver 0.49.1 across 4 sites; spec v6.20 unchanged; Sizing within ±20B).
20
+
21
+ ## [0.49.0] - 2026-07-15
22
+
23
+ Spec **v6.20.0** — §2.1 Model tiering rule removed (spec-only; no hook/script change).
24
+
25
+ - **Removed the spawned-agent model-tiering rule** (core §2.1 paragraph + `spec/CLAUDE-extended.md §2.1-EXT MODEL TIERING`): downgrade-eligible category enumeration, the NEVER-downgrade list, the verifier ≥ generator invariant, and the anomalous-output re-run clause are all deleted. The model now self-allocates subagent tiers on its own judgment — quality-first with zero spec constraint. Rationale: the `Agent` tool already defaults to inheriting the parent (session) model when `model` is omitted, so quality-first is the harness default without any spec text. SHOULD-level rule — `spec/hard-rules.json` untouched, so no hook behavior changes and no enforcement surface moves.
26
+ - **Why now**: the first real-world sample of the rule firing (2026-07-15, a sibling project running subagents) showed the orchestrator self-allocating verify/review subagents to a lower tier including same-tier self-review — the exact pattern the guardrail targeted. The operator chose to trust the model's own allocation over re-adding the constraint (tracked in the durable-memory note `feedback_tiering_verify_downgrade_gap.md`, reopenable if the pattern recurs and hurts quality).
27
+ - **Manifest descriptions** bumped `AI-CODING-SPEC v6.19 → v6.20` (major.minor per the versioning policy above). README spec-version references bumped to v6.20.
28
+ - **Tests**: full `npm test` green; `node scripts/version-cascade-check.js` exit 0 (v6.20 consistent across spec trio + README + 3 manifests; plugin semver 0.49.0 consistent across 4 sites; Sizing drift within ±20B).
29
+
11
30
  ## [0.48.1] - 2026-07-15
12
31
 
13
32
  **Patch — three §8 pre-detector silent bypasses closed (D1 brace-subpath, D2 arithmetic/quoted `<<` fakes a heredoc). Bugfix restoring intended deny behavior; no new gate, no §8 detector added.**
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.19**, 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.20**, 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.19 — 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.20 — 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
  | 16 shell hooks | `banned-vocab-check` · `pre-bash-safety-check` · `ship-baseline-check` · `residue-audit` · `memory-read-check` · `memory-prompt-hint` · `mid-spine-yield-scan` · `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.19 | `~/.claude/CLAUDE.md` · `CLAUDE-extended.md` · `CLAUDE-changelog.md` · `OPERATOR.md` (backup-before-overwrite) |
63
+ | Spec v6.20 | `~/.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.
@@ -347,7 +347,7 @@ claudemd/
347
347
  ├── commands/ # 16 slash-command markdown files
348
348
  ├── bin/ # standalone CLI entrypoint (claudemd-lint.js → `npx claudemd-cli` on npmjs.org)
349
349
  ├── scripts/ # 18 Node.js scripts + scripts/lib/ (single-source registry, lint, etc.)
350
- ├── spec/ # shipped v6.19.0 CLAUDE*.md trio + OPERATOR.md + hard-rules.json manifest
350
+ ├── spec/ # shipped v6.20.0 CLAUDE*.md trio + OPERATOR.md + hard-rules.json manifest
351
351
  ├── tests/ # hook shell tests + Node.js tests + integration + fixtures
352
352
  ├── docs/ # ADDING-NEW-HOOK.md + RULE-HITS-SCHEMA.md + superpowers/
353
353
  └── .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.48.1",
3
+ "version": "0.49.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": {