/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * Validates the hand-labeled golden eval set, where every labeled component must occur in `raw`. */ import { type ComponentTag } from "@mailwoman/codex/component"; import { type PathBuilderLike } from "path-ts"; /** * A golden-set candidate row, as `golden-expand` writes and `golden-promote` reads. * * `source` identifies the producer, such as `expand-golden:`. * The seed and provenance fields trace the candidate to its corpus row and LLM call. * {@link GoldenEntry} narrows this type to a committed entry. */ 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"; } /** * A validation failure for one line of a golden file. */ export interface GoldenIssue { file: string; line: number; reason: string; } /** * The aggregate report that `validateGoldenDir` returns. */ export interface GoldenReport { entries: number; files: number; issues: GoldenIssue[]; } /** * Parses one JSONL line into a `GoldenEntry`. * * `validateGoldenFile` records the thrown message against the line number, so this parse must stay strict. * * @throws On schema violations. */ export declare function parseGoldenLine(line: string): GoldenEntry; /** * Returns the tags in `entry` whose values do not occur in `entry.raw`. * * A golden `raw` is hand-written, so this check uses containment instead of * reconciling against a rendered layout. */ export declare function unreachableComponents(entry: GoldenEntry): ComponentTag[]; /** * Validates one `.jsonl` file and returns its issues. * * This reads lines with `TextSpliterator` because `JSONSpliterator` throws on the first malformed row. * The validator must instead report every bad row with its line number. */ export declare function validateGoldenFile(source: PathBuilderLike): Promise; /** * Validates every `.jsonl` file directly inside a golden directory. */ export declare function validateGoldenDir(dir: PathBuilderLike): Promise; //# sourceMappingURL=golden.d.ts.map