/** * Pattern precision audit. * * Aggregate agreement says how the extractor does overall; it cannot say which pattern to fix. * This groups reference-labelled blocks by the detector evidence they carry and by the reasons * behind their final decision, so a single pattern that fires on authored text stands out even * when the headline numbers look fine. * * Two views, because they answer different questions: * * - Evidence: every block a pattern fired on, whatever the rules then did with it. This is the * pattern's own precision, the thing a pattern file edit changes. * - Reasons: every block whose final decision names a reason. This is the rule's precision, and * for hiding reasons the rows that matter most, since a wrong hide is content loss. * * Evidence sits on the block that matched, usually the attribution line or separator itself, so * the evidence view measures whether the boundary was real, not how far the region after it ran. * The reason view covers the region. */ import { type Label } from '../types'; /** One reference-labelled block with what the extractor saw and decided. Never carries content. */ export interface AuditBlock { reference: Label; predicted: Label; hidden: boolean; chars: number; evidence: readonly { id: string; kind: string; }[]; reasons: readonly string[]; } export interface AuditRow { key: string; /** Reference labels a hit is expected to carry, or null when the kind implies none. */ expected: readonly Label[] | null; blocks: number; chars: number; /** Blocks whose reference label is in `expected`. */ matching: number; /** Blocks precision is measured over: all of them, less those `neutral` excludes. */ scored: number; /** Blocks the reference says the sender wrote: NEW_CONTENT or INLINE_QUOTE. */ authored: number; /** Authored blocks the extractor hid. Each one is lost content. */ authoredHidden: number; authoredHiddenChars: number; byReference: Partial>; } export interface PatternAudit { blocks: number; evidence: AuditRow[]; reasons: AuditRow[]; } export declare function auditPatterns(blocks: readonly AuditBlock[]): PatternAudit; //# sourceMappingURL=pattern-audit.d.ts.map