fix(sf): gap-audit detects prompts loaded by direct filesystem read
Orphan-prompt detection only checked loadPrompt() callsites. Three prompts (heal-skill, product-audit, review-migration) are loaded by direct readFileSync of "<name>.md" — they got false-flagged as orphans. Add a literal-filename check so any source file containing "<name>.md" counts as a load. Cheap one-pass grep, same shape as the existing loadPrompt patterns. Verified with live runGapAudit: 0 new findings (was previously logging the 3 false positives every session_start). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
617608347d
commit
8032ee6144
1 changed files with 6 additions and 1 deletions
|
|
@ -89,7 +89,12 @@ function findOrphanPrompts(): GapFinding[] {
|
|||
grepImports(EXTENSION_SRC, `loadPrompt("${name}"`) ||
|
||||
grepImports(EXTENSION_SRC, `loadPrompt('${name}'`) ||
|
||||
grepImports(EXTENSION_SRC, `loadPrompt("${name}",`) ||
|
||||
grepImports(EXTENSION_SRC, `loadPrompt('${name}',`);
|
||||
grepImports(EXTENSION_SRC, `loadPrompt('${name}',`) ||
|
||||
// Some prompts are loaded by direct filesystem read (skill-health.ts,
|
||||
// migrate/command.ts, product-audit-tool.ts) rather than via loadPrompt.
|
||||
// Check for the bare filename literal as a strong indicator of intent.
|
||||
grepImports(EXTENSION_SRC, `"${name}.md"`) ||
|
||||
grepImports(EXTENSION_SRC, `'${name}.md'`);
|
||||
if (!loaded) {
|
||||
findings.push({
|
||||
kind: "orphan-prompt",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue