/** * Judge pass 2 (M7): refine only the ambiguous pass-1 results, within a budget. * * Judge calls are capped at 30% of all answers AND gated by the cost guard * (main phase). Hitting either bound stops the pass without throwing - the * remaining ambiguous results are simply left as pass-1 decided them. */ import { CostGuard } from '../costs.js'; import type { BrandProfile, EngineAnswer, JudgeClient, MentionResult, Sentiment } from '../types.js'; /** Default fraction of answers that may receive a judge call. */ export declare const JUDGE_RATE_CAP = 0.3; export interface RefineDeps { judge: JudgeClient; guard: CostGuard; /** Projected per-call cost for authorization; defaults to a per-model estimate. */ projectedCostUsd?: number; } export interface RefineOptions { /** Max share of answers judged (default {@link JUDGE_RATE_CAP}). */ judgeRateCap?: number; } export interface RefineResult { results: MentionResult[]; /** * Rows a verdict was actually applied to. A call that came back unusable, or * failed, is NOT counted here - it resolved nothing - though it does count * against the rate cap, which bounds REQUESTS rather than resolutions. */ judged: number; } interface Verdict { mentioned: boolean; sentiment?: Sentiment; } /** Parse the judge's JSON verdict; defaults conservatively on malformed output. */ export declare function parseVerdict(text: string): Verdict; /** * Re-judge the ambiguous results (up to the rate cap and the cost cap), * returning a new results array plus how many were judged. */ export declare function refineAmbiguous(results: MentionResult[], answers: EngineAnswer[], profile: BrandProfile, deps: RefineDeps, opts?: RefineOptions): Promise; export {};