From 8032ee6144f0623a35a35b600070d70fc3ccbbd9 Mon Sep 17 00:00:00 2001 From: Mikael Hugo Date: Sat, 2 May 2026 17:29:44 +0200 Subject: [PATCH] fix(sf): gap-audit detects prompts loaded by direct filesystem read MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Orphan-prompt detection only checked loadPrompt() callsites. Three prompts (heal-skill, product-audit, review-migration) are loaded by direct readFileSync of ".md" — they got false-flagged as orphans. Add a literal-filename check so any source file containing ".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) --- src/resources/extensions/sf/gap-audit.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/resources/extensions/sf/gap-audit.ts b/src/resources/extensions/sf/gap-audit.ts index 07af35882..03380d863 100644 --- a/src/resources/extensions/sf/gap-audit.ts +++ b/src/resources/extensions/sf/gap-audit.ts @@ -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",