/** * Corpus audit: what the detectors actually did across a whole store. * * This exists because fixtures cannot establish precision. A detector and its * fixture are written by the same person from the same assumption, so a green * suite says only that the code does what its author meant — not that what they * meant is right. Every defect found in this project's detectors was found by * measuring against real data, and each time the fixtures were passing. * * `docs/DECISIONS.md` makes that check a requirement for detector changes; * this is the tool that makes it a single command rather than ad-hoc SQL. * * Nothing here writes: it reads a store and returns counts. */ import type { Store } from "./store.js"; export interface Counted { key: string; n: number; pct: number; } export interface DetectorRow { detector: string; runs: number; pct: number; /** Highest severity this detector reached anywhere in the corpus. */ worstSeverity: string; } export interface SensitivePathRow { path: string; hits: number; tier: string; why: string; } export interface OutcomeRow { source: string; known: number; unknown: number; failed: number; pctKnown: number; } export interface CorpusReport { coverage: { runs: number; sessions: number; projects: number; trivial: number; withDiff: number; /** * Synthetic runs left out of every number above. Reported rather than merely * dropped: a total that quietly excluded rows would read as full coverage. */ syntheticExcluded: number; }; verdicts: Counted[]; detectors: DetectorRow[]; verification: Counted[]; commandOutcomes: OutcomeRow[]; sensitivePaths: SensitivePathRow[]; redaction: { masksApplied: number; runsWithSurvivors: number; survivingKinds: Counted[]; }; } /** * Build the audit. Runs are read one at a time and discarded: a real corpus is * hundreds of traces and holding them all would cost more memory than the * report is worth. */ export declare function auditCorpus(store: Store, opts?: { includeSynthetic?: boolean; }): CorpusReport; /** Human-readable rendering. `--json` prints the object instead. */ export declare function formatCorpusReport(r: CorpusReport): string;