/**
 * Bootstrap-CI promotion gate.
 *
 * In any iterative-improvement loop (GEPA, prompt evolution, dataset
 * curation), the question is "did this generation actually improve, or are
 * we celebrating noise?". With small N and noisy outcomes, point-estimate
 * deltas lie. Bootstrap confidence intervals tell the operator whether the
 * delta is real before code or prompts get promoted.
 *
 * This module is pure functions — no I/O, no model calls. Easy to unit-test
 * and to compose into any verdict gate.
 *
 * Default gate:
 *   - Bootstrap mean baseline vs candidate (1k resamples).
 *   - Compute the delta distribution; pass if the lower CI bound > 0.
 *   - Tunable confidence (default 95%) and resample count.
 *
 * Verdict semantics intentionally match the existing `experiments.jsonl`
 * vocabulary:
 *   - ADVANCE: candidate's CI lower bound > baseline mean (real win)
 *   - KEEP:    overlap, but candidate point estimate >= baseline (neutral)
 *   - REVERT:  candidate's CI upper bound < baseline mean (real regression)
 *   - INCONCLUSIVE: not enough samples or CI straddles zero with no signal
 */
export type Verdict = 'ADVANCE' | 'KEEP' | 'REVERT' | 'INCONCLUSIVE';
export interface BootstrapResult {
    baselineMean: number;
    candidateMean: number;
    /** candidateMean - baselineMean, point estimate. */
    delta: number;
    /** Lower bound of the (1 - alpha) CI on the delta. */
    ciLower: number;
    /** Upper bound of the (1 - alpha) CI on the delta. */
    ciUpper: number;
    /** Number of bootstrap resamples used. */
    iterations: number;
    alpha: number;
    verdict: Verdict;
}
export interface BootstrapOptions {
    /** Confidence level alpha (default 0.05 → 95% CI). */
    alpha?: number;
    /** Number of resamples (default 1000). */
    iterations?: number;
    /**
     * Minimum total samples (baseline + candidate) below which we always
     * return INCONCLUSIVE — bootstrap with too few samples is meaningless.
     * Default 6 (combined).
     */
    minTotalSamples?: number;
    /** RNG seed for reproducibility. Default: Math.random. */
    seed?: number;
}
/**
 * Compute the bootstrap CI on (candidateMean - baselineMean) and a verdict.
 *
 * Uses simple percentile bootstrap on the difference of resampled means.
 * That's the standard non-parametric primitive — no distributional
 * assumptions, robust to skew, easy to reason about.
 */
export declare function bootstrapCi(baseline: number[], candidate: number[], options?: BootstrapOptions): BootstrapResult;
/**
 * Judge-replay promotion gate.
 *
 * The cheap inner-loop judge that drives an evolution run is by definition
 * fast and noisy. When you're about to promote a winning variant to the
 * canonical default, you want a STRONGER judge (a more expensive model, a
 * human grader, a separately-trained reward model) to confirm the win
 * generalises beyond the inner loop.
 *
 * This helper takes raw winner + baseline outputs, scores both through the
 * stronger judge, and applies `bootstrapCi`. ADVANCE means the stronger
 * judge agrees the winner is real with the configured confidence. Doesn't
 * matter what shape your "output" is — pass a string, an object, anything
 * the judge can read.
 */
export interface JudgeReplayGateArgs<TOutput> {
    baselineOutputs: TOutput[];
    candidateOutputs: TOutput[];
    /** Stronger judge — async to allow LLM calls. Return a 0..N scalar score. */
    judge: (output: TOutput) => Promise<number> | number;
    alpha?: number;
    iterations?: number;
    /** RNG seed for reproducibility. */
    seed?: number;
    /** Maximum concurrent judge calls. Default 4. */
    judgeConcurrency?: number;
}
export declare function judgeReplayGate<TOutput>(args: JudgeReplayGateArgs<TOutput>): Promise<BootstrapResult & {
    baselineSamples: number;
    candidateSamples: number;
}>;
//# sourceMappingURL=promotion-gate.d.ts.map