(rootPath: string, paths: ToolPaths)
| 661 | }; |
| 662 | |
| 663 | async 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 | |
| 678 | async function ensureValidIndexOrAutoHeal(project: ProjectState): Promise<IndexSignal> { |
| 679 | if (project.indexState.status === 'indexing') { |
no test coverage detected