export { summarizeParserEvidence } from '../parser-evidence.js';
const MAX_PARSER_GAPS_IN_DIAGNOSTIC = 8;
/**
 * One deterministic, bounded diagnostic for graph files whose parser evidence
 * cannot support an exhaustive relationship or exact-body claim.
 */
export function parserEvidenceDiagnostic(index, relativePaths, operation) {
    const files = new Map(index.files.map(file => [file.relativePath, file]));
    const gaps = [];
    for (const relativePath of [...new Set(relativePaths)].sort()) {
        const file = files.get(relativePath);
        const provenance = file?.provenance;
        const calls = provenance?.capabilities.calls ?? 'unknown';
        const exactSpans = provenance?.capabilities.exactSpans ?? 'unknown';
        const templateUses = file?.language === 'vue'
            ? (provenance?.capabilities.templateUses ?? 'unknown')
            : provenance
                ? 'not-applicable'
                : 'unknown';
        if (calls === 'full' && exactSpans === 'full' && (templateUses === 'full' || templateUses === 'not-applicable')) {
            continue;
        }
        gaps.push({ relativePath, calls, exactSpans, templateUses });
    }
    if (gaps.length === 0)
        return undefined;
    const shown = gaps.slice(0, MAX_PARSER_GAPS_IN_DIAGNOSTIC);
    const details = shown
        .map(gap => `${gap.relativePath} (calls=${gap.calls}, templateUses=${gap.templateUses}, exactSpans=${gap.exactSpans})`)
        .join(', ');
    const omitted = gaps.length - shown.length;
    return {
        code: 'evidence-unavailable',
        message: `Parser relationship/exact-span evidence is not full for ${gaps.length} ${operation} graph ` +
            `${gaps.length === 1 ? 'file' : 'files'}: ${details}${omitted > 0 ? `, and ${omitted} more` : ''}.`,
        ...(gaps.length === 1 ? { relativePath: gaps[0].relativePath } : {}),
        total: gaps.length,
        kept: shown.length,
        limit: MAX_PARSER_GAPS_IN_DIAGNOSTIC,
    };
}
//# sourceMappingURL=parser-honesty.js.map