/**
 * Reflective mutation — primitives for trace-conditioned prompt rewriting.
 *
 * Used by `prompt-evolution.ts` (and any consumer running iterative
 * improvement). Given a parent prompt + concrete trace evidence (top trials,
 * bottom trials, missed expectations), produce an LLM-ready prompt that
 * proposes targeted mutations — not blind rephrasings.
 *
 * Why this lives outside `prompt-evolution.ts`: any consumer that wants to
 * run reflective rewriting WITHOUT the population/Pareto machinery can
 * import these primitives directly.
 *
 * Quality bar (vs. naive "mutate this prompt"):
 *   - Show parent ↔ children diff, not just one variant
 *   - Quote specific missed goldens with their match phrases
 *   - Surface the model's actual emitted output side-by-side with what was expected
 *   - Quote concrete mutation primitives so the model has a vocabulary
 */
export interface TrialTrace {
    /** Stable id for the trial — surfaces in the prompt for grounding. */
    id: string;
    /** Score the trial received on its primary metric. */
    score: number;
    /** Candidate inputs the agent was given (e.g., the fixture or scenario). */
    inputName?: string;
    /**
     * Goldens / expectations this trial was tested against, with whether each
     * was matched. The reflection prompt quotes the missed ones specifically.
     */
    expectations?: Array<{
        id: string;
        phrase: string;
        matched: boolean;
    }>;
    /** Free-form text — what the agent actually emitted (e.g., findings, plan). */
    emitted?: string;
    /** The judge's free-form note on WHY this trial scored low — the failure
     *  evidence the reflection targets. Should be a generalizable pattern (which
     *  checks/lines/dimensions failed, and how), never case-specific ground
     *  truth (that would teach memorization, not capability). */
    failureNote?: string;
    /** Optional structured metrics (recall, precision, cost, latency). */
    metrics?: Record<string, number>;
}
export interface ReflectionContext {
    /** What is being mutated — appears in the system prompt for orientation. */
    target: string;
    /** Current variant's payload — JSON-serialised for the prompt. */
    parentPayload: unknown;
    /** Best-performing trials this generation. */
    topTrials: TrialTrace[];
    /** Worst-performing trials this generation — the missed-golden source. */
    bottomTrials: TrialTrace[];
    /** How many children the mutator should propose. */
    childCount: number;
    /** Optional: domain-specific mutation primitives the model can pick from. */
    mutationPrimitives?: string[];
}
export declare const DEFAULT_MUTATION_PRIMITIVES: string[];
/**
 * Build the LLM-ready reflection prompt. Output is plain text — pass it as
 * the user message. The system message should be small and stable (e.g.
 * "Output ONLY a JSON object matching the schema below.").
 */
export declare function buildReflectionPrompt(ctx: ReflectionContext): string;
/** Render analyst findings + an optional analysis report into a prompt evidence
 *  block. A findings producer diagnoses the generation's traces; this surfaces
 *  that diagnosis to the proposer so a mutation targets a NAMED root cause instead of blindly
 *  rephrasing. Duck-types the finding shape (claim / severity / area /
 *  recommended_action) so any findings producer's rows render. Returns null when
 *  there is nothing to add, so callers append nothing. */
export declare function renderAnalystEvidence(findings: unknown[], report?: unknown): string | null;
export interface ReflectionProposal {
    label: string;
    rationale: string;
    payload: unknown;
}
export declare function parseReflectionResponse(raw: string, maxProposals?: number): ReflectionProposal[];
//# sourceMappingURL=reflective-mutation.d.ts.map