/** * Mechanical (judge-free) evidence-quote verification — FEAT-542/FEAT-551 * single-source-of-truth. * * Originally lived only inside the extraction bench's `computeEvidenceAccuracy` * (scripts/eval/extraction-bench/lib/mechanical-checks.ts, FEAT-542). FEAT-551's * stage-8 production admission gate (src/distill/evidence-gate.ts) needs the * EXACT SAME quote-verification logic — a hallucinated passB atom is only * unsafe to admit if the bench and the gate could ever disagree about whether * a quote "really" appears in the transcript. Promoting the check to this * shared util (and having the bench import it back) closes that drift risk * by construction: there is exactly one implementation, not two that must be * kept in sync by hand. See tests/distill/evidence-gate.test.ts's * "bench/gate agreement" case, which asserts both call sites agree on a * shared fixture (AC-3). * * FEAT-552 sub-scope C (AC-C2): added a token-window FUZZY fallback tier, * tried only after the exact whitespace-normalized substring check above * fails. Measured basis: 18 `evidence-not-found` gate drops in the FEAT-551 * run include near-misses (whitespace/ellipsis variants) that are real * quotes a human would recognize instantly but the exact-substring check * rejects. `verifyEvidenceQuote` (the boolean the bench's * `computeEvidenceAccuracy` already delegates to) now tries exact THEN * fuzzy internally — the ONE-implementation rule this module's own doc * comment above describes means the bench inherits the fuzzy tier for free, * with no separate wiring. Callers that need to know WHICH tier admitted a * quote (the production gate, for distinct-reason observability) call * `verifyEvidenceQuoteTier` directly instead. */ /** * Trim + collapse internal whitespace runs to a single space. Deliberately * NOT lowercasing and NOT stripping punctuation — a fabricated-but-similar * quote must never count as real evidence, only a true (modulo whitespace) * verbatim match. */ export declare function normalizeWhitespace(s: string): string; export type EvidenceMatchTier = 'exact' | 'fuzzy' | 'none'; /** * Does `evidence` appear inside `transcriptText`, and via which tier? * Empty/whitespace-only evidence never verifies — always `'none'` (mirrors * the bench's own denominator-exclusion rule for an absent `evidence` field * — see `computeEvidenceAccuracy`'s doc comment). Tries the exact * whitespace-normalized substring match FIRST (unchanged FEAT-542/551 * behavior); only on failure falls back to the FEAT-552 sub-scope C token- * window fuzzy match (AC-C2). */ export declare function verifyEvidenceQuoteTier(evidence: string, transcriptText: string): EvidenceMatchTier; /** * Does `evidence` appear (exact OR fuzzy — see `verifyEvidenceQuoteTier`) * inside `transcriptText`? Boolean convenience wrapper every pre-FEAT-552 * caller (the bench's `computeEvidenceAccuracy`, callers that don't need to * distinguish tiers) already uses — kept so the ONE-implementation rule * means the fuzzy tier is inherited automatically, no separate wiring. */ export declare function verifyEvidenceQuote(evidence: string, transcriptText: string): boolean;