feat(config-audit): cache-prefix stability scanner CPS (v5 N3) [skip-docs]
New CPS scanner walks CLAUDE.md cascade and flags volatile content
between lines 31 and 150 — the cache-prefix window beyond TOK Pattern
A's top-30 territory. Volatile content anywhere in the cached prefix
forces a fresh cache write from that line down on every turn.
Volatile-pattern set extends TOK Pattern A with:
- shell-exec lines (! prefix) — common in CLAUDE.md to inject git/date
- ${VAR} substitutions — vary per-shell, defeat cache reuse
Severity: medium per finding. Skips lines 1-30 to avoid duplicating
Pattern A's range; CPS' value is in the 31-150 zone.
Wired into scan-orchestrator + scoring SCANNER_AREA_MAP. CPS shares
the "Token Efficiency" area with TOK; scoreByArea now deduplicates by
area name and combines counts across scanners contributing to the
same area, so the 9-area scorecard contract holds.
Fixtures volatile-mid-section/{volatile-line-60, volatile-line-200}
verify both positive (line 60) and out-of-window (line 200) cases.
[skip-docs] reason: v5 plan fences off README/CLAUDE.md badge updates
to Session 5; Forgejo pre-commit-docs-gate hook requires this tag.
Tests: 604 → 611 (+7).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
0420b8cc4a
commit
65087e624f
6 changed files with 517 additions and 9 deletions
79
plugins/config-audit/tests/fixtures/volatile-mid-section/volatile-line-60/CLAUDE.md
vendored
Normal file
79
plugins/config-audit/tests/fixtures/volatile-mid-section/volatile-line-60/CLAUDE.md
vendored
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
# Project
|
||||
|
||||
Stable preamble.
|
||||
Body line 4.
|
||||
Body line 5.
|
||||
Body line 6.
|
||||
Body line 7.
|
||||
Body line 8.
|
||||
Body line 9.
|
||||
Body line 10.
|
||||
Body line 11.
|
||||
Body line 12.
|
||||
Body line 13.
|
||||
Body line 14.
|
||||
Body line 15.
|
||||
Body line 16.
|
||||
Body line 17.
|
||||
Body line 18.
|
||||
Body line 19.
|
||||
Body line 20.
|
||||
Body line 21.
|
||||
Body line 22.
|
||||
Body line 23.
|
||||
Body line 24.
|
||||
Body line 25.
|
||||
Body line 26.
|
||||
Body line 27.
|
||||
Body line 28.
|
||||
Body line 29.
|
||||
Body line 30.
|
||||
Body line 31.
|
||||
Body line 32.
|
||||
Body line 33.
|
||||
Body line 34.
|
||||
Body line 35.
|
||||
Body line 36.
|
||||
Body line 37.
|
||||
Body line 38.
|
||||
Body line 39.
|
||||
Body line 40.
|
||||
Body line 41.
|
||||
Body line 42.
|
||||
Body line 43.
|
||||
Body line 44.
|
||||
Body line 45.
|
||||
Body line 46.
|
||||
Body line 47.
|
||||
Body line 48.
|
||||
Body line 49.
|
||||
Body line 50.
|
||||
Body line 51.
|
||||
Body line 52.
|
||||
Body line 53.
|
||||
Body line 54.
|
||||
Body line 55.
|
||||
Body line 56.
|
||||
Body line 57.
|
||||
Body line 58.
|
||||
Body line 59.
|
||||
!git log -5 # volatile shell-exec at line 60
|
||||
More body.
|
||||
More body.
|
||||
More body.
|
||||
More body.
|
||||
More body.
|
||||
More body.
|
||||
More body.
|
||||
More body.
|
||||
More body.
|
||||
More body.
|
||||
More body.
|
||||
More body.
|
||||
More body.
|
||||
More body.
|
||||
More body.
|
||||
More body.
|
||||
More body.
|
||||
More body.
|
||||
More body.
|
||||
Loading…
Add table
Add a link
Reference in a new issue