/** * Coverage contract — after a multi-source research or summarize call, * detect which source paths the model's output actually covered. * * A two-file summary that only mentions one file is a real quality bug * (observed in the first adoption pass: commandui.md + hardware-m5-max.md * → summary only covered CommandUI). Silently accepting that makes the * flagship less trustworthy. This module surfaces omissions so the caller * knows when to rerun, re-prompt, or read the omitted file themselves. * * Detection is deterministic and cheap — no extra LLM calls. We pull a * small set of "distinctive tokens" per source and check how many show * up in the output. Accurate enough to catch whole-file omissions, * conservative enough to avoid false-alarm on tight summaries. */ import type { LoadedSource } from "./sources.js"; export interface CoverageReport { covered_sources: string[]; omitted_sources: string[]; coverage_notes: string[]; } export interface DetectCoverageOptions { /** Paths the caller already knows are covered (e.g. from research citations). */ explicitlyCovered?: string[]; /** Maximum signal tokens to extract per source. Default 12. */ maxTokensPerSource?: number; } /** * Detect which source paths the output covers. * * A source is "covered" when: * - it appears in `explicitlyCovered` (citations etc.), OR * - any of its signal tokens appear in the output. * * Everything else is "omitted" and a coverage note is added. */ export declare function detectCoverage(output: string, sources: LoadedSource[], options?: DetectCoverageOptions): CoverageReport; //# sourceMappingURL=coverage.d.ts.map