feat(discovery): version-aware cache filtering + --exclude-cache flag (v5.9 B3a) [skip-docs]
Stale ~/.claude/plugins/cache versions polluted token-hotspots ranking and
inflated CNF duplicate-hook findings with config that loads on zero turns.
installPaths point INTO the cache, so a blunt "skip all of plugins/cache"
would drop ACTIVE plugins — the filter is therefore version-aware: it reads
the adjacent installed_plugins.json, keeps active version dirs, drops only
stale ones (and exposes them via discovery.staleCacheVersions for B3b).
- file-discovery: cacheVersionKey() + applyCacheFilter() (active vs stale via
installed_plugins.json; HOME-independent, derives the manifest from the cache
path); discoverConfigFiles/Multi gain { excludeCache } + staleCacheVersions.
Absent/unparseable manifest -> no filtering (never silently drop live config).
- token-hotspots-cli + scan-orchestrator: --exclude-cache (default ON for these
live-cost scans) / --no-exclude-cache restores the full walk.
- Tests: cacheVersionKey unit cases; stale-dropped/active-kept/no-manifest
discovery cases; CNF-drop proof (soft-spot verified, not assumed:
include=1 -> exclude=0 duplicate-hook findings).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a17823a9af
commit
a371832688
5 changed files with 335 additions and 8 deletions
|
|
@ -56,6 +56,10 @@ async function main() {
|
|||
let includeGlobal = false;
|
||||
let withTelemetryRecipe = false;
|
||||
let accurateTokens = false;
|
||||
// Default ON for this live-cost scan: stale plugin-cache versions pollute the
|
||||
// hotspot ranking with config that loads on zero turns. --no-exclude-cache
|
||||
// restores the full walk. (B3)
|
||||
let excludeCache = true;
|
||||
|
||||
for (let i = 0; i < args.length; i++) {
|
||||
if (args[i] === '--json') jsonMode = true;
|
||||
|
|
@ -63,6 +67,8 @@ async function main() {
|
|||
else if (args[i] === '--global') includeGlobal = true;
|
||||
else if (args[i] === '--with-telemetry-recipe') withTelemetryRecipe = true;
|
||||
else if (args[i] === '--accurate-tokens') accurateTokens = true;
|
||||
else if (args[i] === '--exclude-cache') excludeCache = true;
|
||||
else if (args[i] === '--no-exclude-cache') excludeCache = false;
|
||||
else if (args[i] === '--output-file' && args[i + 1]) outputFile = args[++i];
|
||||
else if (!args[i].startsWith('-')) targetPath = args[i];
|
||||
}
|
||||
|
|
@ -80,7 +86,7 @@ async function main() {
|
|||
}
|
||||
|
||||
resetCounter();
|
||||
const discovery = await discoverConfigFiles(absPath, { includeGlobal });
|
||||
const discovery = await discoverConfigFiles(absPath, { includeGlobal, excludeCache });
|
||||
const result = await scan(absPath, discovery);
|
||||
|
||||
const payload = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue