From 6ef4c8059e5b023787e37f740d5ed1dd3a63dbb0 Mon Sep 17 00:00:00 2001 From: Stefano Amorelli Date: Mon, 6 Jul 2026 00:25:42 +0300 Subject: [PATCH] fix: match path-exclude fragments as segments, not substrings --- src/recon/code-ingest.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/recon/code-ingest.ts b/src/recon/code-ingest.ts index 68df627..ec8d394 100644 --- a/src/recon/code-ingest.ts +++ b/src/recon/code-ingest.ts @@ -212,14 +212,13 @@ const EXPOSURE_BASE: Record = { // ============================================================================= function isExcluded(path: string, excludeGlobs: string[]): boolean { - // Loose match: any exclude fragment appearing as a path segment (or substring) - // rejects the path. Prototype-grade — not a real glob engine. + // Bare fragments match a path SEGMENT only; glob (`*`) entries match as a + // substring. const segments = path.split(sep); for (const ex of excludeGlobs) { if (!ex) continue; - // Treat a bare fragment as "matches any segment equal to it OR any substring". if (segments.includes(ex)) return true; - if (path.includes(ex)) return true; + if (ex.includes('*') && path.includes(ex.replace(/\*/g, ''))) return true; } return false; }