/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * Golden eval-set validator (Phase 1 task #9 in the plan). * * The golden set is hand-labeled ground truth for the neural classifier. Each entry must carry * components whose surface forms actually occur in `raw` — otherwise the entry will silently rot * the eval signal. This module: * * - Defines `GoldenEntry` (schema check). * - Loads `.jsonl` files (one entry per line). * - Validates every entry: schema shape, ComponentTag membership, reachability of each component in * `raw` via the same `reconcileComponents` helper alignment uses. * - Returns a structured report of per-entry errors so the CLI / CI surface can act on it. * * The 1000-entry target (500 US + 500 FR) is a human task. This module catches the regressions that * creep in over time as new entries land. */ import { type ComponentTag } from "@mailwoman/core/types"; /** * One entry in a golden `.jsonl` file. */ export interface GoldenEntry { raw: string; components: Partial>; country: string; source: "golden"; notes?: string; } /** * Per-entry validation failure. */ export interface GoldenIssue { file: string; line: number; reason: string; } /** * Aggregate report from `validateGoldenDir`. */ export interface GoldenReport { entries: number; files: number; issues: GoldenIssue[]; } /** * Parse a single JSONL line into a `GoldenEntry`. Throws on schema violations. */ export declare function parseGoldenLine(line: string): GoldenEntry; /** * Check that every component in `entry` appears in `entry.raw` (reconciliation-equivalent). */ export declare function unreachableComponents(entry: GoldenEntry): ComponentTag[]; /** * Validate one `.jsonl` file end-to-end, returning a list of issues. * * Parses line by line over `TextSpliterator` rather than `JSONSpliterator`: every issue this returns carries the LINE * NUMBER it was found on, and a malformed line has to be REPORTED rather than thrown. `JSONSpliterator` parses each row * for you and throws on the first bad one — correct for consumers that want the rows, wrong for the validator whose * whole job is locating the bad ones. */ export declare function validateGoldenFile(path: string): Promise; /** * Validate every `.jsonl` in a golden directory. */ export declare function validateGoldenDir(dir: string): Promise; //# sourceMappingURL=golden.d.ts.map