MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / eligibleForSubprojectScan

Function eligibleForSubprojectScan

src/directory.ts:260–267  ·  view source on GitHub ↗

* Whether `base` is a plausible workspace root for the sub-project down-scan. * Mirrors `planFrontload`'s manifest gate, widened to accept a bare `.git` * entry — the #1606 shape is a workspace container holding only agent config * and a `.git`, with every build manifest living in the indexed chi

(base: string)

Source from the content-addressed store, hash-verified

258 * unrelated project (#1454 documents that failure mode for the prompt-hook).
259 */
260function eligibleForSubprojectScan(base: string): boolean {
261 if (base === path.parse(base).root) return false;
262 let home: string | null = null;
263 try { home = os.homedir(); } catch { home = null; }
264 if (home && (base === home || base === path.resolve(home))) return false;
265 if (looksLikeProjectRoot(base)) return true;
266 return fs.existsSync(path.join(base, '.git'));
267}
268
269/**
270 * Resolve the project root an MCP server should serve as its DEFAULT project

Callers 1

resolveServerRootFunction · 0.85

Calls 3

looksLikeProjectRootFunction · 0.85
resolveMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected