/**
 * `skillOptProposer` — a patch-mode `SurfaceProposer` implementing SkillOpt
 * (Microsoft, arXiv:2605.23904). Where `gepaProposer` regenerates the whole
 * surface by reflection, SkillOpt proposes BOUNDED, anchored edits
 * (add/delete/replace) to ONE skill document, so a good rule introduced
 * earlier is not clobbered by a later sweeping rewrite. The edit budget is the
 * paper's "textual learning rate"; a rejected-edit buffer + a slow-update
 * meta-note steer the optimizer away from dead ends.
 *
 * This module is the PROPOSER — the LLM call that turns evidence into
 * structured patches. The accept-only-if-held-out-improves loop, the budget
 * annealing, and the rejected buffer live in the `runSkillOpt` preset, which
 * owns the epoch hill-climb. The proposer also conforms to `SurfaceProposer`
 * (`propose` applies its patches to the current surface and returns the
 * candidate surfaces) so it is a drop-in for `runOptimization` and a fair
 * entrant in `compareProposers`.
 */
import { type LlmClientOptions } from '../../llm-client';
import { type SkillPatch } from '../skill-patch';
import type { SurfaceProposer } from '../types';
/** Evidence the optimizer reflects on: where the current surface is weakest.
 *  Computed by the caller (the preset uses a TRAIN campaign so proposals never
 *  see the held-out split; the generic loop derives it from history). */
export interface SkillOptEvidence {
    /** Lowest-scoring scenarios (drives WHICH behavior to patch). */
    weakScenarios: Array<{
        scenarioId: string;
        composite: number;
    }>;
    /** Lowest-scoring judge dimensions (drives WHAT to patch for). */
    weakDimensions: Array<{
        dimension: string;
        score: number;
    }>;
}
/** A patch that was tried and not accepted — fed back to the model so it does
 *  not re-propose a dead end (SkillOpt's rejected-edit buffer). */
export interface RejectedEdit {
    label: string;
    rationale: string;
    reason: string;
}
export interface ProposePatchesArgs {
    surface: string;
    evidence: SkillOptEvidence;
    /** Max ops per patch this round (the annealed textual learning rate). */
    editBudget: number;
    rejectedBuffer: RejectedEdit[];
    /** Slow-update meta guidance accumulated across epochs. */
    metaNote?: string;
    /** Analyst findings + research report rendered as a prompt block so a patch
     *  targets a NAMED diagnosed root cause. Built by
     *  the proposer from `ctx.findings`/`ctx.report`; the patch-native `runSkillOpt`
     *  path may also supply it. */
    findingsNote?: string;
    /** How many candidate patches to propose. */
    count: number;
    signal: AbortSignal;
}
export interface SkillOptProposerOptions {
    llm: LlmClientOptions;
    model: string;
    /** What the skill document governs — orients the prompt. */
    target: string;
    /** Default ops-per-patch cap when used as a bare `SurfaceProposer`. The
     *  `runSkillOpt` preset overrides this per epoch as it anneals. Default 3. */
    editBudget?: number;
    temperature?: number;
    maxTokens?: number;
    /** Top-K weak scenarios/dimensions surfaced as evidence. Default 3. */
    evidenceK?: number;
}
export interface SkillOptProposer extends SurfaceProposer {
    /** Patch-native path used by `runSkillOpt` (the SkillOpt epoch loop owns
     *  acceptance/budget/buffer). Returns structured patches, NOT surfaces. */
    proposePatches(args: ProposePatchesArgs): Promise<SkillPatch[]>;
}
export declare function skillOptProposer(opts: SkillOptProposerOptions): SkillOptProposer;
/** Parse + validate the patch response. Throws `SkillPatchParseError` when the
 *  response is not valid JSON at all (a router/model failure the caller must
 *  see — never a silent no-op epoch). Returns `[]` only for the legitimate
 *  "valid JSON, zero usable patches" case. Malformed ops within a patch are
 *  dropped (not silently mutated); each patch is truncated to the edit budget. */
export declare class SkillPatchParseError extends Error {
    constructor(message: string);
}
export declare function parseSkillPatchResponse(raw: string, maxPatches: number, editBudget: number): SkillPatch[];
//# sourceMappingURL=skill-opt.d.ts.map