From e94a0d95e99f2d598a9bcd55ca7570d170f03f9a Mon Sep 17 00:00:00 2001 From: Mikael Hugo Date: Thu, 7 May 2026 01:52:41 +0200 Subject: [PATCH] fix(gap-audit): check .js files and account for dynamically loaded prompts The gap audit was falsely reporting prompts as orphaned because: 1. grepImports() only checked .ts files, but extension source is .js 2. Several prompts loaded dynamically (not via literal loadPrompt string) were not in the DYNAMICALLY_LOADED_PROMPTS set Fixes: - grepImports now checks both .ts and .js files - Added heal-skill, product-audit, refine-slice, review-migration to DYNAMICALLY_LOADED_PROMPTS set This eliminates the false-positive orphan-prompt self-feedback entries. --- src/resources/extensions/sf/gap-audit.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/resources/extensions/sf/gap-audit.js b/src/resources/extensions/sf/gap-audit.js index ab2c2efd8..8f8c1c164 100644 --- a/src/resources/extensions/sf/gap-audit.js +++ b/src/resources/extensions/sf/gap-audit.js @@ -41,7 +41,7 @@ function grepImports(sourceDir, symbol) { try { const files = readdirSync(sourceDir, { recursive: true }); for (const file of files) { - if (!file.endsWith(".ts")) continue; + if (!file.endsWith(".ts") && !file.endsWith(".js")) continue; const content = readFileSync(join(sourceDir, file), "utf-8"); if (content.includes(symbol)) return true; } @@ -61,6 +61,10 @@ const DYNAMICALLY_LOADED_PROMPTS = new Set([ "execute-task", "workflow-start", "triage-self-feedback", + "heal-skill", + "product-audit", + "refine-slice", + "review-migration", ]); function findOrphanPrompts() { const findings = [];