config-audit/scanners
Kjell Tore Guttormsen 1543830c52 feat(commands): a write that leaves the repo says so before you approve it (M-BUG-41)
The chain observed configuration across repos but presented every write it then
proposed as though it landed where the session stands. STATE named two arms;
measuring found five, and two of them are worse than the two already known:

- implement — the approval prompt named NO path at all, only a count, so a plan
  editing ~/.claude/CLAUDE.md and one editing ./CLAUDE.md produced byte-identical
  prompts.
- rollback — the file list rendered `.claude/settings.json`, a repo-relative
  FORM, while the restore writes to the absolute original. The other arms were
  silent; this one pointed the wrong way.
- fix — paths were visible but unclassified, and --global mixed machine-wide and
  project rows into one unmarked table.

The gate's strength comes from the target's scope class, never from the command
asking: five command-owned policies would drift apart the way five copies of the
lever table did. SCOPE_CLASSES is one source for class, gate, wording and
predicate; templates render `disclosures[]` from the CLI instead of restating
what a class means.

Two orderings in that table are load-bearing, and both were measured:

- plugin-managed before user-scope. Both ~/.claude/config-audit/ and the legacy
  ~/.config-audit/ are live, and every command writes session state there. The
  other order fires the gate on every write ever made and gets it switched off,
  which is worse than no gate.
- user-scope before cross-repo. ~/.claude/.git EXISTS, so a plain .git-upward
  walk answers "another repo" for ~/.claude/CLAUDE.md and silently downgrades
  the strongest gate on the subtraction axis's primary target to disclosure.

disclose is not require-ok: campaign export is cross-repo by design, so the gate
there says so rather than refusing. Distinct from require-target-dir.mjs, which
asks whether a scan ROOT is readable (exit 3) — a different invariant, left
unmerged along with its four inline copies.

Also structural, both found while building this: the hand-maintained GUARDED
list in the unknown-flag sweep now derives its completeness from the directory
(measured complete at 14 of 14 first, so nothing was hiding — but the 15th CLI
would have been swept by nothing); and prose shape-guards use whitespace-
tolerant patterns, after one went red against a command file that did say the
right thing, line-wrapped.

Gated: implement, fix, rollback, plan, campaign export. Suite 1596 -> 1625/0,
frozen v5.0.0 and default-output baselines 0 changed files. No new GAP dimension,
no lever, no finding code — utilization denominators untouched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013941cEohSD5Aw56FVAtBgZ
2026-08-10 05:40:12 +02:00
..
lib feat(commands): a write that leaves the repo says so before you approve it (M-BUG-41) 2026-08-10 05:40:12 +02:00
agent-listing-scanner.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
cache-prefix-scanner.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
campaign-cli.mjs fix(scanners): close the CLI argument class across all fourteen CLIs 2026-08-09 21:42:00 +02:00
campaign-export-cli.mjs fix(commands): stop answering questions the caller did not ask 2026-08-01 21:26:39 +02:00
campaign-write-cli.mjs fix(scanners): close the CLI argument class across all fourteen CLIs 2026-08-09 21:42:00 +02:00
claude-md-linter.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
collision-scanner.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
conflict-detector.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
disabled-in-schema-scanner.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
drift-cli.mjs fix(scanners): a target path that does not exist is an error, not a grade 2026-08-09 21:18:18 +02:00
feature-gap-scanner.mjs feat(scanners): model/effort routing becomes a lever, not a 25th dimension (C4) 2026-08-10 05:07:23 +02:00
fix-cli.mjs fix(scanners): a target path that does not exist is an error, not a grade 2026-08-09 21:18:18 +02:00
fix-engine.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
hook-validator.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
import-resolver.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
knowledge-refresh-cli.mjs fix(scanners): close the CLI argument class across all fourteen CLIs 2026-08-09 21:42:00 +02:00
manifest.mjs feat(scanners): model/effort routing becomes a lever, not a 25th dimension (C4) 2026-08-10 05:07:23 +02:00
mcp-config-validator.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
optimization-lens-scanner.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
optimize-lens-cli.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
output-style-scanner.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
plugin-health-scanner.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
posture.mjs fix(scanners): close the CLI argument class across all fourteen CLIs 2026-08-09 21:42:00 +02:00
rollback-engine.mjs fix(rollback): restore the backup path contract the engine and the commands disagreed on 2026-07-31 17:23:30 +02:00
rules-validator.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
scan-orchestrator.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
self-audit.mjs fix(scanners): close the CLI argument class across all fourteen CLIs 2026-08-09 21:42:00 +02:00
settings-validator.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
skill-listing-scanner.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
token-hotspots-cli.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
token-hotspots.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
whats-active.mjs fix(scanners): close the CLI argument class across all fourteen CLIs 2026-08-09 21:42:00 +02:00
write-scope-cli.mjs feat(commands): a write that leaves the repo says so before you approve it (M-BUG-41) 2026-08-10 05:40:12 +02:00