/** * validateTrialCorpus — scan a trial JSONL file for integrity issues. * * SLICE-100 (FEAT-183 S5a). Catches problems the file-store SIGKILL * invariant alone cannot — duplicate trial_ids, orphan agent refs, * trials missing required metrics fields. Designed to run as a periodic * audit or before a champion-promotion decision. * * Torn lines are detected separately because the store's `recall()` * silently discards them per the SIGKILL invariant (AC-6 here just * counts them so the audit surfaces the count even when recall hides * them from downstream consumers). */ export interface ValidationReport { ok: boolean; tornLines: number; /** Trials whose `agent` field is not seen elsewhere in the corpus (defensive — catches * pipeline misconfig where a stale agent name slips through; not strictly an error). */ orphanAgentRefs: number; /** Distinct trial_ids that appear in 2+ lines. */ collisions: number; /** Trials missing required numeric fields (`score.cost_usd`, `score.latency_ms`). */ missingMetrics: number; /** Distinct agent names referenced in the corpus. */ agentsSeen: string[]; /** trial_ids implicated in collisions (for caller reporting). */ collidingTrialIds: string[]; /** trial_ids missing metric fields (for caller reporting). */ trialIdsMissingMetrics: string[]; } export interface ValidateCorpusOpts { /** * Optional set of agent names known to be valid. When provided, any agent * appearing on a trial but NOT in this set counts as an orphanAgentRef. * When omitted, orphanAgentRefs counts agents that appear ONCE in the entire * corpus (heuristic — most agents have many trials). */ knownAgents?: Set; } /** * Validate a trial JSONL file at `corpusPath`. File does not need to exist * (returns an empty-but-OK report). Each line is parsed independently; a * torn (truncated mid-JSON) line counts toward `tornLines` and is skipped. * * The function does NOT mutate the file. Callers wanting to repair a corpus * should re-write surviving valid trials to a new file. */ export declare function validateTrialCorpus(corpusPath: string, opts?: ValidateCorpusOpts): Promise; //# sourceMappingURL=validate-trial-corpus.d.ts.map