/** * @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 `componentsPresentIn`. * - 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/codex/component"; /** * A golden-set candidate row, as `golden-expand` writes and `golden-promote` reads. * * `source` names the producer (`expand-golden:`); the seed/provenance fields trace the candidate back to the * corpus row and LLM call that produced it. A committed golden entry is the {@link GoldenEntry} narrowing. */ export interface GoldenCandidateEntry { raw: string; components: Partial>; country: string; source: string; notes?: string; seed_source_id?: string; seed_source_adapter?: string; dropped_components?: string[]; provenance?: { provider: string; model: string; }; } /** * One entry in a golden `.jsonl` file. */ export interface GoldenEntry extends GoldenCandidateEntry { source: "golden"; } /** * 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`. * * A golden entry's `raw` is hand-written ground truth, not a render, so the question here really is containment: does * this labeled span occur in the string a person typed. That is the weaker of the two reconciliations, and the right * one for a string no layout produced. */ 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