config-audit/tests/scanners
Kjell Tore Guttormsen 7df8e0d65b feat(scanners): a redundancy claim that belongs to one model is scoped to it
Anthropic documents that Claude Opus 5 verifies its own work, and that telling
it to double-check or to delegate verification to a subagent causes
over-verification -- token cost with no quality gain. The general subtraction
detector (BP-SUB-001) already surfaces those blocks for every user, with no
model-awareness at all.

`optimize --subtract --for-model <name>` adds the missing half. It ANNOTATES a
subset of the candidates --subtract already produced; it is not a second
detector and can never widen the candidate set. A second SUBTRACT_DETECTORS
entry would have collided with BP-SUB-001 on de-dup, and a prose-only signal in
the agent prompt would have been untestable.

There is no auto-detection, by measurement rather than omission: a CLAUDE.md has
no frontmatter and no resolvable target model, and this operator's own `route`
skill deliberately runs a different model per session -- the same file is read
by whichever model comes next. So the model is named, and the citation is
reported as conditional everywhere a human sees it (agent report copy, and the
Step 7a listing that is the last surface before an approval file).

Precision comes from the TARGET, not the verb list. Measured across the
409-file corpus: 392 BP-SUB-001 candidates, 31 (7.9%) carry a verify verb, and
0 also carry a reflexive or delegated target. Two independent raw-text greps
found 0 as well, so the zero is the corpus rather than an over-narrow regex.
Those 31 verb-only blocks -- "sjekk relevante config-filer", "Type-sjekk:
pyright", "To verify plugin functionality" -- are exactly the false positives a
verb-only version would have produced, which is BP-JUDG-001's 7/7 failure
arriving one lens over. The numbers live in the register entry's note and are
pinned by a test, because a session that cannot see the measurement reads the
zero as a broken detector and loosens it.

`recognized` is reported separately from `matchedCount`: a typo'd model name and
a genuinely clean config both yield zero, and without the distinction the CLI
would report a silent no-op as good news. Dogfooded on the real machine --
`opus-5` gives recognized:true/matchedCount:0, `oppus5` gives recognized:false.

source.published is absent because the guide carries no visible publish date;
its absence is asserted so a later session does not invent one to match the
other entries' shape. Both quoted sentences were verified verbatim 2026-08-12.

The payload stays additive -- forModel and per-candidate modelScope appear only
under the flag, so a plain --subtract run is byte-identical to before (asserted
on the serialized bytes, since a key set to undefined passes a shallow check).

Suite 1724 -> 1752 (+28). The one remaining failure is the pre-existing
drift-cli --output-file crash, untouched by this work.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BRuXt6tZyowi8QYNKLSHQm
2026-08-12 23:16:23 +02:00
..
accurate-tokens.test.mjs test: isolate HOME in all CLI-spawning tests (close leak class) 2026-06-18 18:17:09 +02:00
agent-listing-scanner.test.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.test.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.test.mjs feat(campaign): machine-wide always-loaded token roll-up — pure layer (v5.9 B2a) 2026-06-23 16:57:31 +02:00
campaign-export-cli.test.mjs feat(scanners): the write gate now runs in code, not in the templates' prose 2026-08-12 21:15:16 +02:00
campaign-write-cli.test.mjs fix(commands): stop answering questions the caller did not ask 2026-08-01 21:26:39 +02:00
claude-md-dead-prose-ref.test.mjs feat(scanners): a path written in prose is now resolved, not assumed (C3) 2026-08-12 20:11:12 +02:00
claude-md-linter.test.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
cli-humanizer.test.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
cli-missing-target-rejection.test.mjs fix(scanners): a target path that does not exist is an error, not a grade 2026-08-09 21:18:18 +02:00
cli-pipe-integrity.test.mjs fix(scanners): stop discarding our own stdout when it is a pipe 2026-07-31 21:40:15 +02:00
cli-unknown-flag-rejection.test.mjs feat(scanners): the subtraction axis can now remove what it proposes (SUB-WRITE) 2026-08-10 06:10:42 +02:00
collision.test.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.test.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.test.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.test.mjs fix(commands): close the promises the command templates could not keep 2026-07-31 21:27:07 +02:00
feature-gap-scanner.test.mjs feat(scanners): model/effort routing becomes a lever, not a 25th dimension (C4) 2026-08-10 05:07:23 +02:00
finding-code-coverage.test.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
finding-id-stability.test.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
fix-cli.test.mjs feat(scanners): the write gate now runs in code, not in the templates' prose 2026-08-12 21:15:16 +02:00
fix-engine.test.mjs feat(scanners): the write gate now runs in code, not in the templates' prose 2026-08-12 21:15:16 +02:00
fix-verify-instance-identity.test.mjs feat(scanners): the write gate now runs in code, not in the templates' prose 2026-08-12 21:15:16 +02:00
gap-agent-model-routing.test.mjs feat(scanners): model/effort routing becomes a lever, not a 25th dimension (C4) 2026-08-10 05:07:23 +02:00
hook-additional-context.test.mjs feat(hooks): additionalContext injection advisory + filter-before lever (v5.10 B5) [skip-docs] 2026-06-23 20:28:33 +02:00
hook-validator.test.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.test.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.test.mjs feat(knowledge): model + effort routing enter the register, dated [skip-docs] 2026-08-10 04:36:09 +02:00
lint-default-output.test.mjs test(snapshots): make byte/snapshot tests hermetic + re-seed baseline 2026-06-18 12:26:00 +02:00
manifest.test.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.test.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
mcp-deferral.test.mjs feat(tokens): MCP tool-schema deferral check + CLI-over-MCP lever (v5.10 B4) 2026-06-23 19:59:14 +02:00
optimization-lens-scanner.test.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.test.mjs feat(scanners): a redundancy claim that belongs to one model is scoped to it 2026-08-12 23:16:23 +02:00
output-file-robustness.test.mjs fix(commands): stop answering questions the caller did not ask 2026-08-01 21:26:39 +02:00
output-style-scanner.test.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.test.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
posture-grade-stability.test.mjs feat(skill-listing): add CA-SKL-002 aggregate listing-budget check 2026-06-18 18:06:17 +02:00
posture-humanizer.test.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
posture.test.mjs test: isolate HOME in all CLI-spawning tests (close leak class) 2026-06-18 18:17:09 +02:00
published-ids-on-real-output.test.mjs test(scanners): assert the published IDs off real output, by title 2026-08-09 23:34:02 +02:00
rollback-engine.test.mjs feat(scanners): the write gate now runs in code, not in the templates' prose 2026-08-12 21:15:16 +02:00
rollback-paths.test.mjs feat(scanners): the write gate now runs in code, not in the templates' prose 2026-08-12 21:15:16 +02:00
rules-validator.test.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-humanizer.test.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.test.mjs feat(ultraplan-local): v1.6.0 — /ultraresearch-local deep research command 2026-04-08 08:58:35 +02:00
self-audit.test.mjs feat(config-audit): self-audit --check-readme flag (v5 F6) [skip-docs] 2026-05-01 07:09:26 +02:00
settings-validator.test.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.test.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00
subtraction-write-cli.test.mjs fix(commands): the removal gate was classified against the wrong root 2026-08-10 06:15:25 +02:00
subtraction-write.test.mjs fix(commands): the removal gate was classified against the wrong root 2026-08-10 06:15:25 +02:00
token-hotspots-cli.test.mjs test: isolate HOME in all CLI-spawning tests (close leak class) 2026-06-18 18:17:09 +02:00
token-hotspots-deferral.test.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.test.mjs fix(scanners)!: a finding ID names the check, not the emission (M-BUG-28) 2026-08-09 23:26:36 +02:00