/** * Gold-set loading and anchor resolution. * * A gold span recorded as bare line numbers rots on the next refactor, and a * rotted gold set fails *silently* — it just scores lower. So each span also * carries an `anchor`: a literal snippet that must sit inside the range. The * anchor is the source of truth; the line numbers are a cache of where it was * when the fixture was last regenerated. * * That gives three properties the first gold set lacked: * - `resolveGoldSet` recomputes ranges from anchors, so `--fix` re-pins the * whole set after a refactor instead of someone hand-editing 60 numbers; * - `validateGoldSet` fails loudly when an anchor has moved out of its * recorded range, drifted, or become ambiguous; * - anchors are never used for scoring, so this cannot flatter retrieval — * `spanMatchesGold` still sees only a path and a line range. */ import type { EvalGoldSpan, EvalQuery } from "./eval.js"; export interface GoldValidationIssue { queryId: string; path: string; problem: string; } /** Re-pin one gold span's line range from its anchor. Returns the span * unchanged when it is file-scoped or has no anchor to resolve. */ export declare function resolveGoldSpan(corpusRoot: string, span: EvalGoldSpan): { span: EvalGoldSpan; problem?: string; }; /** Re-pin every gold span in the set. Problems are collected, not thrown, so * a regeneration run reports all drift at once. */ export declare function resolveGoldSet(corpusRoot: string, dataset: readonly EvalQuery[]): { dataset: EvalQuery[]; issues: GoldValidationIssue[]; }; /** * Check the committed fixture against the corpus without rewriting it. * * Catches the two ways a gold set goes wrong: the anchor no longer exists (the * code was deleted or renamed), or it exists but has moved outside the * recorded range (the fixture is stale and every score computed from it is * wrong). */ export declare function validateGoldSet(corpusRoot: string, dataset: readonly EvalQuery[]): GoldValidationIssue[]; /** Load the gold set from a fixture file. */ export declare function loadGoldSet(fixturePath: string): EvalQuery[]; //# sourceMappingURL=eval-gold.d.ts.map