import type { EvalReport } from "./eval.js"; import { type Comparison } from "./stats.js"; /** Bumped only on a breaking change to the on-disk shape. */ export declare const BASELINE_VERSION = 1; /** The committed baseline: the recorded `EvalReport`s, keyed by report name. */ export interface BaselineFile { readonly version: number; /** ISO-8601 timestamp the baseline was recorded (provenance / future trend). */ readonly recordedAt: string; /** Recorded reports, keyed by `report.name` (so multiple eval files coexist). */ readonly reports: Record; } /** How a metric moved between baseline and current run. */ export type DiffStatus = "regressed" | "improved" | "unchanged"; /** One arm×metric comparison of a current run against the baseline. */ export interface MetricDiff { /** The `report.name` this entry belongs to. */ readonly report: string; readonly arm: string; readonly metric: string; readonly status: DiffStatus; /** Welch comparison, current vs. baseline (`delta = current − baseline`). */ readonly comparison: Comparison; } export interface BaselineDiff { /** Every arm×metric present in BOTH the baseline and the current run. */ readonly entries: readonly MetricDiff[]; /** The subset that regressed (significant move in the bad direction). */ readonly regressions: readonly MetricDiff[]; /** The subset that improved (significant move in the good direction). */ readonly improvements: readonly MetricDiff[]; /** True when there are no regressions — the gate. */ readonly passed: boolean; } export interface DiffOptions { /** Significance level for the Welch test. Default 0.05. */ readonly alpha?: number; /** * Metrics where a DECREASE is the improvement (e.g. `cost`, `latency`, * `turns`). For these, a significant increase is the regression. Everything * else is treated as higher-is-better. */ readonly lowerIsBetter?: readonly string[]; } /** Build a `BaselineFile` envelope from a run's reports (keyed by name). */ export declare function toBaselineFile(reports: readonly EvalReport[], recordedAt?: string): BaselineFile; /** Parse + validate a baseline JSON string (throws on a bad version/shape). */ export declare function parseBaselineFile(json: string): BaselineFile; /** * Diff a current run against a committed baseline. Compares every arm×metric * present in both (by report name), flagging a *significant* move in the * undesired direction as a regression. Metrics absent from one side are skipped * (a new arm/metric is not a regression). */ export declare function diffReports(baseline: BaselineFile, current: readonly EvalReport[], opts?: DiffOptions): BaselineDiff; /** Format a baseline diff as a compact console report. */ export declare function formatBaselineDiff(diff: BaselineDiff): string; /** * Render a baseline diff as JUnit XML — one `` per arm×metric, a * `` for each regression. Lets a CI provider show eval regressions in * the same place as unit-test failures. */ export declare function diffToJUnit(diff: BaselineDiff): string; /** Read + parse a baseline file, or null if it doesn't exist yet. */ export declare function readBaseline(path: string): BaselineFile | null; /** Write reports as the committed baseline (pretty JSON, parent dirs created). */ export declare function writeBaseline(path: string, reports: readonly EvalReport[]): void; //# sourceMappingURL=eval-baseline.d.ts.map