/**
 * `runSkillOpt` — the SkillOpt epoch hill-climb (Microsoft, arXiv:2605.23904).
 * Unlike `runOptimization`'s population/promote-top-K search, SkillOpt is a
 * sequential, held-out-gated hill-climb on ONE skill document:
 *
 *   each epoch:
 *     1. reflect on the CURRENT surface's weakest TRAIN scenarios/dimensions
 *        (never the held-out split — proposals must not see the acceptance axis)
 *     2. propose ≤ `patchesPerEpoch` bounded patches (≤ `editBudget` ops each)
 *     3. apply each; score the candidate on the HELD-OUT split
 *     4. ACCEPT the first patch that STRICTLY improves the held-out composite;
 *        otherwise push it to the rejected-edit buffer (fed back so the model
 *        does not re-propose dead ends)
 *     5. anneal the edit budget down after consecutive rejections (the
 *        "textual learning rate" decay); refresh the slow-update meta note
 *     6. stop at `maxEpochs` or after `patience` epochs with no acceptance
 *
 * The accept-only-if-held-out-improves rule is the same discipline as
 * `HeldOutGate`/`defaultProductionGate`, applied per edit instead of once at
 * the end — which is why the held-out composite is monotonically
 * non-decreasing and a regression can never ship. `runCampaign` is the
 * measurement; `applySkillPatch` applies the edits; `skillOptProposer` proposes
 * them.
 */
import type { RejectedEdit, SkillOptProposer } from '../proposers/skill-opt';
import { type RunCampaignOptions } from '../run-campaign';
import type { DispatchContext, Scenario } from '../types';
export interface RunSkillOptOptions<TScenario extends Scenario, TArtifact> extends Omit<RunCampaignOptions<TScenario, TArtifact>, 'dispatch' | 'scenarios'> {
    /** The skill document being optimized. */
    baselineSurface: string;
    /** Dispatcher taking the CURRENT skill surface + scenario → artifact. */
    dispatchWithSurface: (surface: string, scenario: TScenario, ctx: DispatchContext) => Promise<TArtifact>;
    proposer: SkillOptProposer;
    /** Scenarios the optimizer reflects on for evidence. MUST be disjoint from
     *  `holdoutScenarios` — proposals never see the acceptance axis. */
    trainScenarios: TScenario[];
    /** Held-out scenarios. An edit is accepted ONLY if it strictly improves the
     *  mean composite here. */
    holdoutScenarios: TScenario[];
    maxEpochs: number;
    /** Candidate patches proposed per epoch. Default 2. */
    patchesPerEpoch?: number;
    /** Initial ops-per-patch cap (the textual learning rate). Default 3. */
    editBudget?: number;
    /** Strict acceptance margin: accept iff the held-out composite improves by
     *  MORE than this. Default 0 (any strict improvement). */
    minImprovement?: number;
    /** Stop after this many consecutive epochs with no acceptance. Default =
     *  `maxEpochs` (never early-stop). */
    patience?: number;
    /** Shrink the edit budget by 1 after 2 consecutive rejected epochs (min 1).
     *  Default true. */
    budgetAnneal?: boolean;
    /** Cap on the rejected-edit buffer (most-recent kept). Default 12. */
    rejectedBufferSize?: number;
    /** Refresh the slow-update meta note every N epochs. Default 2. 0 disables. */
    slowMetaEvery?: number;
    /** Top-K weak scenarios/dimensions surfaced as evidence each epoch. Default 3. */
    evidenceK?: number;
    /** Abort signal forwarded to the patch-proposing LLM calls. */
    signal?: AbortSignal;
}
export interface AcceptedEdit {
    epoch: number;
    label: string;
    rationale: string;
    /** Held-out composite improvement vs the surface before this edit. */
    holdoutDelta: number;
}
export interface SkillOptEpochRecord {
    epoch: number;
    editBudget: number;
    proposed: number;
    /** The accepted edit this epoch, or null if every proposal was rejected. */
    accepted: AcceptedEdit | null;
    rejected: RejectedEdit[];
    /** Held-out composite of the CURRENT surface at the END of the epoch. */
    holdoutComposite: number;
}
export interface RunSkillOptResult {
    winnerSurface: string;
    baselineHoldoutComposite: number;
    winnerHoldoutComposite: number;
    /** `winnerHoldoutComposite - baselineHoldoutComposite` — monotonically ≥ 0
     *  by construction (only strictly-improving edits are accepted). */
    lift: number;
    acceptedEdits: AcceptedEdit[];
    rejectedEdits: RejectedEdit[];
    epochsRun: number;
    history: SkillOptEpochRecord[];
    /** Total cost across every scoring campaign (train evidence + holdout
     *  acceptance) the hill-climb ran. */
    totalCostUsd: number;
}
export declare function runSkillOpt<TScenario extends Scenario, TArtifact>(opts: RunSkillOptOptions<TScenario, TArtifact>): Promise<RunSkillOptResult>;
//# sourceMappingURL=run-skill-opt.d.ts.map