import { A as AgentProfileCell, a as AgentProfileJson } from './run-record-DEwidcqn.js';
import { V as ValidationError } from './errors-CzMUYo7b.js';
import { A as AnalystFinding, E as EvidenceRef } from './types-BEzCBMQD.js';

type PolicyEditSchemaVersion = 'policy-edit/v1';
declare const POLICY_EDIT_AXES: readonly ["carrier", "representation", "budget", "sampling", "output_contract", "tool_contract", "routing", "memory", "agent_profile", "deployment_target"];
type PolicyEditAxis = (typeof POLICY_EDIT_AXES)[number];
declare const POLICY_EDIT_TARGET_SURFACES: readonly ["prompt", "tool-contract", "runtime-config", "memory", "agent-profile", "deployment"];
type PolicyEditTargetSurface = (typeof POLICY_EDIT_TARGET_SURFACES)[number];
type PolicyEditRisk = 'low' | 'medium' | 'high' | 'unknown';
type PolicyEditGainDirection = 'increase' | 'decrease';
type PolicyEditGainUnit = 'absolute' | 'relative' | 'percent' | 'score';
interface PolicyEditTarget {
    surface: PolicyEditTargetSurface;
    /** Stable path inside the target surface, for example `system-prompt:tools`
     * or `budget.maxTurns`. */
    path?: string;
    /** Optional canonical deployment identity. Store the existing cell, not a
     * local profile shape. */
    agentProfileCell?: AgentProfileCell;
    /** Human label when the path is not enough for a readable audit trail. */
    label?: string;
}
type PolicyEditChange = {
    kind: 'text';
    mode: 'append' | 'prepend' | 'replace';
    value: string;
    /** Required when `mode === 'replace'`; exact match only. */
    find?: string;
} | {
    kind: 'json';
    mode: 'set' | 'merge' | 'remove';
    path: string;
    value?: AgentProfileJson;
};
interface PolicyEditExpectedGain {
    /** Metric this edit is expected to move, e.g. `holdout.composite`. */
    metric: string;
    direction: PolicyEditGainDirection;
    /** Positive magnitude in the metric's native units. */
    amount: number;
    unit?: PolicyEditGainUnit;
    rationale?: string;
}
interface PolicyEditSource {
    findingIds: string[];
    analystIds: string[];
    evidenceRefs: EvidenceRef[];
    /** Mirrors `AnalystFinding.derived_from_judge`; admission rejects it. */
    derivedFromJudge?: boolean;
}
interface PolicyEdit {
    schemaVersion: PolicyEditSchemaVersion;
    editId: string;
    axis: PolicyEditAxis;
    target: PolicyEditTarget;
    change: PolicyEditChange;
    claim: string;
    expectedGain: PolicyEditExpectedGain;
    confidence: number;
    risk: PolicyEditRisk;
    source: PolicyEditSource;
    rationale?: string;
    validationPlan?: string;
    metadata?: Record<string, unknown>;
}
type PolicyEditInit = Omit<PolicyEdit, 'schemaVersion' | 'editId'> & {
    schemaVersion?: PolicyEditSchemaVersion;
    editId?: string;
};
declare class PolicyEditValidationError extends ValidationError {
    readonly path: string;
    constructor(message: string, path?: string);
}
interface FindingToPolicyEditOptions {
    expectedGain?: PolicyEditExpectedGain | ((finding: AnalystFinding) => PolicyEditExpectedGain | null | undefined);
    risk?: PolicyEditRisk | ((finding: AnalystFinding) => PolicyEditRisk);
    defaultAxis?: PolicyEditAxis;
    defaultTargetSurface?: PolicyEditTargetSurface;
}
interface PolicyEditAdmissionOptions {
    minScore?: number;
    minExpectedGain?: number;
    allowHighRisk?: boolean;
    requireEvidence?: boolean;
}
interface PolicyEditAdmission {
    edit: PolicyEdit;
    decision: 'admit' | 'reject';
    score: number;
    reasons: string[];
}
declare function makePolicyEdit(init: PolicyEditInit): PolicyEdit;
declare function computePolicyEditId(edit: Omit<PolicyEdit, 'editId'> | PolicyEdit): string;
declare function validatePolicyEdit(input: unknown): PolicyEdit;
declare function isPolicyEdit(input: unknown): input is PolicyEdit;
declare function policyEditsFromFindings(findings: ReadonlyArray<AnalystFinding>, opts?: FindingToPolicyEditOptions): PolicyEdit[];
declare function policyEditFromFinding(finding: AnalystFinding, opts?: FindingToPolicyEditOptions): PolicyEdit | null;
declare function scorePolicyEditReadiness(edit: PolicyEdit, opts?: PolicyEditAdmissionOptions): number;
declare function admitPolicyEdit(edit: PolicyEdit, opts?: PolicyEditAdmissionOptions): PolicyEditAdmission;
declare function applyPolicyEditToSurface(surface: unknown, edit: PolicyEdit): unknown;

export { type FindingToPolicyEditOptions as F, POLICY_EDIT_AXES as P, POLICY_EDIT_TARGET_SURFACES as a, type PolicyEdit as b, type PolicyEditAdmission as c, type PolicyEditAdmissionOptions as d, type PolicyEditAxis as e, type PolicyEditChange as f, type PolicyEditExpectedGain as g, type PolicyEditGainDirection as h, type PolicyEditGainUnit as i, type PolicyEditInit as j, type PolicyEditRisk as k, type PolicyEditSchemaVersion as l, type PolicyEditSource as m, type PolicyEditTarget as n, type PolicyEditTargetSurface as o, PolicyEditValidationError as p, admitPolicyEdit as q, applyPolicyEditToSurface as r, computePolicyEditId as s, isPolicyEdit as t, makePolicyEdit as u, policyEditFromFinding as v, policyEditsFromFindings as w, scorePolicyEditReadiness as x, validatePolicyEdit as y };
