/**
 * Baseline regression detection.
 *
 * Lifted from ADC baseline.ts. Every promotion-blocking signal boils down
 * to: "is this run measurably worse than baseline?" — with enough
 * statistical rigor to distinguish noise from drift.
 *
 * Uses:
 *   - Welch's t-test (unequal variance) for per-metric mean comparison
 *   - Cohen's d for effect size magnitude
 *   - IQR for stability flag (unstable samples can't be trusted for comparisons)
 *
 * Returns a structured verdict: improved | regressed | stable | unstable.
 */
export interface MetricSamples {
    /** Stable metric key (e.g. "overallScore", "firstTokenMs"). */
    metric: string;
    /** Whether higher values are better. */
    higherIsBetter: boolean;
    baseline: number[];
    candidate: number[];
}
export interface MetricVerdict {
    metric: string;
    baselineMean: number;
    candidateMean: number;
    delta: number;
    cohensD: number;
    welchT: number;
    welchDf: number;
    welchP: number;
    stable: boolean;
    /** IQR of the combined samples — used as a rough stability indicator. */
    iqr: number;
    verdict: 'improved' | 'regressed' | 'stable' | 'unstable';
}
export interface BaselineReport {
    metrics: MetricVerdict[];
    /** True if any critical metric regressed. */
    hasRegression: boolean;
    /** True if any metric is unstable (too noisy to judge). */
    hasUnstable: boolean;
}
export interface BaselineOptions {
    /** Effect size threshold for meaningful delta (default 0.5 — medium effect). */
    effectThreshold?: number;
    /** p-value threshold for statistical significance (default 0.05). */
    alpha?: number;
    /** IQR/mean ratio above which samples are flagged unstable (default 0.30). */
    unstableCvThreshold?: number;
}
/**
 * Compare candidate samples against baseline per metric. Verdict logic:
 *   - unstable: IQR/|mean| > threshold on either set — not enough signal
 *   - improved: meaningful effect in the "better" direction AND p < alpha
 *   - regressed: meaningful effect in the "worse" direction AND p < alpha
 *   - stable: otherwise (no significant change)
 */
export declare function compareToBaseline(samples: MetricSamples[], options?: BaselineOptions): BaselineReport;
/** Inter-quartile range; 0 when the sample has no spread. */
export declare function iqr(xs: number[]): number;
/**
 * Welch's t-test — unequal-variance two-sample t. Uses the same Student-t
 * CDF as `pairedTTest` (via incomplete beta); falls back to normal tail
 * when df is large.
 */
export declare function welchsTTest(a: number[], b: number[]): {
    t: number;
    df: number;
    p: number;
};
//# sourceMappingURL=baseline.d.ts.map