import type { SourceWithContent } from "./synthesize.js"; export declare const DEFAULT_CITE_MIN_RECALL = 0.4; export interface CitationCheck { sentence: string; citedIds: number[]; unsupportedIds: number[]; recallByCite: Record; supported: boolean; } export interface VerificationReport { threshold: number; totalCitations: number; supportedCitations: number; checks: CitationCheck[]; unsupported: CitationCheck[]; /** * Sentences excluded from citation accounting because they talk ABOUT sources * rather than cite them (see isSourceDisclaimer). Recorded rather than dropped * so the exclusion is auditable — a verifier that silently ignores sentences * is worse than one that miscounts them. */ disclaimers: CitationCheck[]; } export interface VerifyOptions { threshold?: number; } /** * True when a sentence is a source-DISCLAIMER: it names sources only to say * they were discarded. * * Why this exists (issue #186): the synthesizer sometimes writes an honest * aside like * * "note that sources [3], [5], [7], [8], [9], [11], and [12] contain no * information about ternary LLM accuracy and are not cited below." * * extractCiteIds pulls seven ids out of that, each is recall-checked against * the disclaimer sentence, each correctly fails (they ARE irrelevant), and all * seven land in unsupportedIds. The answer is penalised precisely for being * transparent about which sources it rejected — one live run scored 0.52 with * 7 of its 10 "unsupported citations" coming from a single such sentence. * * The caller applies this ONLY when every cited id in the sentence also fails * the recall threshold. Both conditions are required, and that pairing is the * safety property: a sentence with even one supported cite is a real claim and * is never skipped, so this cannot quietly bury a partially-hallucinated * citation. The residual gap is a fully-unsupported claim that also happens to * name "sources" and negate them — rare phrasing, and it still surfaces in * `disclaimers` rather than vanishing. */ export declare function isSourceDisclaimer(sentence: string): boolean; export declare function verifyCitations(answer: string, sources: SourceWithContent[], opts?: VerifyOptions): VerificationReport; export declare function stripSourcesBlock(answer: string): string; export declare function splitSentences(text: string): string[]; export declare function extractCiteIds(sentence: string): number[]; export declare function contentTokens(text: string): string[]; export declare function recall(claim: string[], source: Set): number; //# sourceMappingURL=verify.d.ts.map