import type { EvolutionProposal, EvolutionVerdict, IndependentEvaluatorResult, RegressionSkepticResult } from './evolution-types.js'; import { type EvaluationPackage } from './independent-evaluator-runner.js'; /** * * The regression skeptic is a SEPARATE sub-agent (independent of * the author AND the independent evaluator). Its job is to * REFUTE the proposal — find drift, overfit, and safety * regression risks. A `blocker` field is a hard revert signal: * the proposal cannot be promoted while a blocker stands. * * Inputs: * - The same evaluation package the scorer sees * (target_kind / target_release_id / optimization_dimension / * before_snapshot / after_snapshot / diff / rubric / * red_lines / source_traces). * - The proposal verdict (from the post-evaluator aggregation). * - The independent evaluator's result. * * Output: RegressionSkepticResult { driftRisks, overfitRisks, * safetyRegressionRisks, blocker? }. * * M4 ships a deterministic default skeptic that does NOT call an * LLM. The real LLM-backed skeptic lands in M5; the M4 unit tests * exercise the contract via a stub `invokeLlm` factory. */ /** * Optional LLM call factory for the skeptic. The default * implementation (`deterministicInvokeSkepticLlm`) is fully * deterministic; tests can swap in a stub. */ export type SkepticLlmInvoke = (pkg: EvaluationPackage, prompt: string) => Promise; /** * Build the prompt handed to the skeptic LLM. By construction * this contains the SAME evaluation package the scorer saw * (independent context: separate call, separate model, separate * session), the proposal verdict, and the evaluator's result. */ export declare function buildSkepticPrompt(pkg: EvaluationPackage, verdict: EvolutionVerdict, evaluatorResult: IndependentEvaluatorResult): string; /** * Default skeptic LLM call: deterministic, no LLM dependency. * * The default skeptic looks for three classes of risk: * 1. Drift: any red_line that is NEW in the after_snapshot and * not present in the before_snapshot. * 2. Overfit: the diff mentions a tight `prompt_template` change * without an accompanying rubric entry (proxy for prompt * inflation). * 3. Safety regression: any red_line that the author DROPPED * from the after_snapshot. * * The skeptic emits a `blocker` when (a) the evaluator's score * is below the after_score the author claimed AND a red_line * was dropped, or (b) the red_lines count grew by more than 0 * (a "red line added" is treated as drift, not a hard blocker). */ export declare const deterministicInvokeSkepticLlm: SkepticLlmInvoke; /** * Public entry point: run the regression skeptic against the * evaluation package, the proposal verdict, and the independent * evaluator's result. The skeptic is a SEPARATE sub-agent call: * it does NOT share a context with the evaluator or the author. */ export declare function runRegressionSkeptic(proposal: EvolutionProposal, verdict: EvolutionVerdict, evaluatorResult: IndependentEvaluatorResult, invokeLlm?: SkepticLlmInvoke): Promise;