import type { CompareOptions } from '../evaluate/compare.js'; import type { Experiment, ExperimentStore } from '../types/evaluate.js'; import type { GateResult } from './errors.js'; import type { PromotionGate } from './registry.js'; /** Options for `experimentGate()`. */ export interface ExperimentGateOptions { /** Where experiments are stored. */ store: ExperimentStore; /** Requires an experiment with this name. Any name counts when omitted. */ experiment?: string; /** Requires the experiment to have run over this dataset. */ dataset?: string; /** Minimum mean per metric, such as `{ correctness: 0.9 }`. A metric the experiment lacks fails. */ thresholds?: Record; /** Examples that may produce no output at all. Defaults to 0. */ maxErrors?: number; /** * Also compares with the newest experiment for the version the label serves now, and refuses a * regression beyond noise. Options pass through to `compareExperiments()`. */ noRegression?: boolean | CompareOptions; /** Experiments searched, newest first. Defaults to 50. */ limit?: number; /** Names the gate in reports. Defaults to `experiment`. */ name?: string; } /** * The verdict of an experiment gate, for anything versioned whose experiments name it in metadata. * Shared by the prompt and context-bundle gates, so both judge a promotion the same way. */ export declare function experimentVerdict(options: ExperimentGateOptions, subject: (experiment: Experiment) => { name?: string; version?: string; } | undefined, name: string, version: string, currentVersion: string | undefined): Promise; /** * Refuses a promotion until an experiment has passed for the exact version being promoted. * * An experiment counts for a version when its `metadata.prompt` names it, which `evaluatePrompt()` * records. With `thresholds` each named metric must reach its minimum mean; with `noRegression` the * candidate must not be worse, beyond noise, than the version it would replace. */ export declare function experimentGate(options: ExperimentGateOptions): PromotionGate; /** * Refuses a promotion unless the version is what another label serves now, such as requiring * `staging` before `production`. */ export declare function servedByGate(label: string): PromotionGate;