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

Function eligibleForSubprojectScan

src/directory.ts:475–482  ·  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

473 * unrelated project (#1454 documents that failure mode for the prompt-hook).
474 */
475function eligibleForSubprojectScan(base: string): boolean {
476 if (base === path.parse(base).root) return false;
477 let home: string | null = null;
478 try { home = os.homedir(); } catch { home = null; }
479 if (home && (base === home || base === path.resolve(home))) return false;
480 if (looksLikeProjectRoot(base)) return true;
481 return fs.existsSync(path.join(base, '.git'));
482}
483
484/**
485 * Resolve the project root an MCP server should serve as its DEFAULT project

Callers 1

findServerRootFunction · 0.85

Calls 4

looksLikeProjectRootFunction · 0.85
parseMethod · 0.80
resolveMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected