/**
 * Agreement judge for teacher→student distillation. Scores a STUDENT artifact
 * (the cheap analyst's produced label) against the GoldScenario's gold label
 * (the teacher's verdict). The score IS the distillation objective: 1.0 means
 * the student reproduced the teacher exactly, 0.0 means total disagreement.
 *
 * The comparison function is INJECTED (`compareLabels`) so the judge is
 * domain-agnostic — distilling a skill-audit analyst, a triage analyst, or any
 * other student is a one-line comparator swap. A default `fieldAgreement`
 * comparator is provided for the common case: a flat verdict object with
 * categorical and array fields.
 *
 * Everything here is PURE + unit-testable — no LLM. (The student spends tokens
 * producing the artifact; scoring it against frozen gold does not.)
 */
import type { JudgeConfig } from '../types';
import type { GoldScenario } from './gold-scenarios';
/** What an injected comparator returns: a [0,1] composite plus the per-field
 *  (per-dimension) agreement breakdown the GEPA proposer reflects on to learn
 *  WHICH part of the verdict the student is getting wrong. */
export interface AgreementResult {
    /** Overall agreement in [0,1]. */
    score: number;
    /** Per-dimension agreement in [0,1] — keyed by field/aspect name. The
     *  reflective proposer surfaces the weakest of these as the lever to fix. */
    dimensions: Record<string, number>;
}
/** Compare a produced label against a gold label → agreement. Injected so the
 *  judge is domain-agnostic. */
export type CompareLabels<TProduced = unknown, TLabel = unknown> = (produced: TProduced, gold: TLabel) => AgreementResult;
export interface BuildAgreementJudgeOptions<TProduced = unknown, TLabel = unknown> {
    /** Judge name surfaced in `CampaignResult.aggregates.byJudge` + the gate. */
    name?: string;
    /** The agreement function — produced student label vs gold teacher label. */
    compareLabels: CompareLabels<TProduced, TLabel>;
    /** Dimension keys the judge declares up-front (for `JudgeConfig.dimensions`).
     *  When omitted, the dimensions present on the first scored result are used
     *  for display only; the composite is unaffected. */
    dimensionKeys?: string[];
    /** Only score `gold`-kind scenarios. Default true — a mixed campaign won't
     *  mis-apply the agreement judge to non-gold scenarios. */
    goldOnly?: boolean;
}
/** Build a `JudgeConfig` that scores a produced student artifact against the
 *  scenario's gold label. Conforms to the substrate `JudgeConfig` contract:
 *  `score({artifact, scenario, signal}) => JudgeScore`. The `composite` is the
 *  comparator's `score`; `dimensions` carries its per-field breakdown plus the
 *  scalar `agreement` so a single-dimension consumer still sees the number. */
export declare function buildAgreementJudge<TProduced, TInput, TLabel>(options: BuildAgreementJudgeOptions<TProduced, TLabel>): JudgeConfig<TProduced, GoldScenario<TInput, TLabel>>;
export interface FieldAgreementSpec {
    /** Categorical fields — scored exact-match (1 if equal, else 0). Compared
     *  with `===` after `JSON`-normalizing so `true`/`'high'`/`3` all work. */
    categorical?: string[];
    /** Array fields — scored by Jaccard overlap (|A∩B| / |A∪B|). Two empty
     *  arrays agree perfectly (1.0). Order-insensitive; elements compared by
     *  their `JSON.stringify`. */
    array?: string[];
}
/** Default comparator: average per-field agreement over a flat verdict object.
 *  Categorical fields score exact-match; array fields score set-overlap
 *  (Jaccard). The composite is the unweighted mean across all declared fields,
 *  so missing a single boolean (e.g. `public_leak_risk`) costs `1/nFields` of
 *  the score — the leak-detection lever the audit cares about is a real,
 *  non-trivial fraction of the objective, not rounding noise.
 *
 *  Pure. A field absent from BOTH produced + gold is treated as agreeing
 *  (both undefined ⇒ 1.0); a field present in only one side disagrees. */
export declare function fieldAgreement<TProduced extends Record<string, unknown>, TLabel>(spec: FieldAgreementSpec): CompareLabels<TProduced, TLabel>;
//# sourceMappingURL=agreement-judge.d.ts.map