MCPcopy Index your code
hub / github.com/PatrickSys/codebase-context / requireValidIndex

Function requireValidIndex

src/index.ts:663–676  ·  view source on GitHub ↗
(rootPath: string, paths: ToolPaths)

Source from the content-addressed store, hash-verified

661};
662
663async function requireValidIndex(rootPath: string, paths: ToolPaths): Promise<IndexSignal> {
664 const meta = await readIndexMeta(rootPath);
665 await validateIndexArtifacts(rootPath, meta);
666
667 // Optional artifact presence informs confidence.
668 const hasIntelligence = await fileExists(paths.intelligence);
669
670 return {
671 status: 'ready',
672 confidence: hasIntelligence ? 'high' : 'low',
673 action: 'served',
674 ...(hasIntelligence ? {} : { reason: 'Optional intelligence artifact missing' })
675 };
676}
677
678async function ensureValidIndexOrAutoHeal(project: ProjectState): Promise<IndexSignal> {
679 if (project.indexState.status === 'indexing') {

Callers 1

Calls 3

readIndexMetaFunction · 0.85
validateIndexArtifactsFunction · 0.85
fileExistsFunction · 0.70

Tested by

no test coverage detected