/** * ollama_verify_claims — F1. Cross-family flagship verification of claims. * * The strategic gap this fills: `ollama_code_review` GENERATES findings; * nothing ADJUDICATES them. This atom takes caller-supplied claims (review * findings, design assertions, "the fix handles X" statements) and runs a * panel of DISJOINT-FAMILY Ollama Cloud flagships to confirm/refute each, * riding F2's per-call cloud escalation with a per-juror model override. * * Research grounding (every design choice traces to a finding): * - Cross-family panel, never the generator's family: LLM judges over-rate * their own family mechanistically (Panickssery/Bowman/Feng 2024, * arXiv:2404.13076; Wataoka 2024, arXiv:2410.21819). * - 3-model PoLL jury beats one big judge at lower cost; diversity ceiling * is ~2 effective votes, so never naive-majority (Verga 2024, * arXiv:2404.18796; arXiv:2605.29800). Aggregation below is * lone-dissent-never-decides: REFUTED needs ≥ min_refute_votes (2). * - Generative verdicts (short rationale + enum) beat bare scoring by * 16–40% (Zhang 2024, arXiv:2408.15240). * - Reference answers sharply raise verifier reliability — pass the * caller's ground truth (test output, lint, measured facts) into the * juror prompt (arXiv:2510.09738; MT-Bench arXiv:2306.05685). * - Reasoning-stripped: jurors see claims + evidence, NEVER the * generator's reasoning (CoT is post-hoc rationalization — Turpin 2023). * The claim schema is strict() so a reasoning channel cannot exist. * - Honest ceiling: verifier scale alone doesn't catch a strong * generator's subtle errors (Ai 2025, arXiv:2509.17995). A CONFIRMED * on Claude-authored claims is WEAK evidence, not proof; the panel is * reliable at flagging gross errors and honest about the rest via * `confidence` + the `weak` flag. * * This is a CLOUD tool: it refuses without a configured cloud (a local-8B * panel is too weak to adjudicate flagship-authored claims — documented * future extension, not silently substituted). Each juror call escalates * via `backend:'cloud'`; a juror served by local fallback, or whose served * model ≠ the requested juror (normalized: strip /[-:]cloud$/ — cloud tags * come in BOTH `:cloud` and `-cloud` forms), is EXCLUDED from the vote and * flagged. Shape discipline mirrors codeReview: zod schema + closed enums + * runTool + coerce-before-trust (malformed juror output is dropped, never * thrown). * * Registration note: this tool exports its handler + schema but does NOT * self-register; the server.tool block lives in src/index.ts. */ import { z } from "zod"; import type { Envelope } from "../envelope.js"; import type { RunContext } from "../runContext.js"; declare const JUROR_VERDICTS: readonly ["CONFIRMED", "REFUTED", "UNCERTAIN"]; declare const AGGREGATE_VERDICTS: readonly ["CONFIRMED", "REFUTED", "NEEDS_REVIEW"]; declare const SEVERITIES: readonly ["critical", "high", "medium", "low"]; declare const CONFIDENCES: readonly ["high", "medium", "low"]; export type JurorVerdict = (typeof JUROR_VERDICTS)[number]; export type AggregateVerdict = (typeof AGGREGATE_VERDICTS)[number]; export type VerifySeverity = (typeof SEVERITIES)[number]; export type VerifyConfidence = (typeof CONFIDENCES)[number]; /** * Default 3-model cross-family flagship panel (PoLL: 3, not 1, not 9). * Disjoint vendor families — DeepSeek / Moonshot / Z.ai — per the * cross-family doctrine: same-family judges over-rate mechanically. * Roster checked against ollama.com/search?c=cloud 2026-07-06; cloud ids * are VOLATILE (rotate/retire server-side) — when a juror 404s, re-check * the live roster and pass a current trio via `panel`. A retired juror * degrades visibly (excluded seat + degraded envelope), never silently. */ export declare const DEFAULT_VERIFY_PANEL: readonly string[]; export declare const verifyClaimsSchema: z.ZodObject<{ claims: z.ZodArray>; source_paths: z.ZodOptional>; reference: z.ZodOptional; panel: z.ZodOptional>; min_refute_votes: z.ZodOptional>; }, z.core.$strip>; export type VerifyClaimsInput = z.infer; export interface ClaimJurorVote { /** Requested juror model id (as configured, e.g. deepseek-v4-pro:cloud). */ model: string; verdict: JurorVerdict; severity: VerifySeverity; rationale: string; } export interface ClaimAggregate { id: string; statement: string; verdict: AggregateVerdict; /** * Agreement-based, per arXiv:2509.17995's honesty requirement: 'high' = * unanimous decisive votes from ≥2 jurors; 'medium' = decisive with * dissent (or a single-juror decision); 'low' = NEEDS_REVIEW. A 'high' * CONFIRMED on claims authored by a frontier model is still WEAK * evidence, not proof. */ confidence: VerifyConfidence; refute_votes: number; confirm_votes: number; uncertain_votes: number; /** Included jurors' votes on THIS claim (excluded jurors never appear). */ jurors: ClaimJurorVote[]; } export interface PanelSeat { /** Requested juror model id. */ model: string; /** Model the backend reported serving, when the call produced a response. */ served_model?: string; /** True when this juror's votes counted toward aggregates. */ included: boolean; /** * Why the seat was excluded: `call_failed:` | `local_fallback:` * | `served_model_mismatch:` | `no_valid_verdicts`. */ exclude_reason?: string; /** * Bounded head-sample (≤ RAW_SAMPLE_MAX_CHARS) of the raw juror reply, * present ONLY on `no_valid_verdicts` exclusions — enough to tell * "returned prose" from "wrong schema" from "empty verdicts array" * without a re-run. Never on included seats, and never the full reply * (a juror reply echoes the caller's claims/evidence, which must not * bloat the envelope or the NDJSON log). */ raw_sample?: string; /** Valid verdict entries that survived coercion (0 for excluded seats). */ verdicts_returned: number; } export interface VerifyClaimsResult { claims: ClaimAggregate[]; panel: PanelSeat[]; /** One-line operator triage: counts + how much of the panel actually served. */ summary: string; min_refute_votes: number; /** * True when fewer than 2 jurors were cloud-served — the aggregates below * cannot reach CONFIRMED and any REFUTED rests on a thin panel. Treat * every verdict as NEEDS_REVIEW-grade evidence. */ weak: boolean; } /** * Normalize a model id for the served-vs-requested comparison. Cloud tags * come in BOTH forms — `glm-5.2:cloud` AND `qwen3-coder:480b-cloud` — and * the served echo strips whichever suffix was used, so strip /[-:]cloud$/ * from both sides (the two-tag-form rule; stripping only one form * false-flags every model of the other form as a local fallback). */ declare function normModel(model: string): string; interface JurorVote { id: string; verdict: JurorVerdict; severity: VerifySeverity; rationale: string; } /** * Coerce one juror's raw output into votes. Drop rules (never throw): * - id must be a known claim id (unknown/missing → drop) * - verdict must be in the closed enum (else drop) * - rationale must be non-empty (the prompt says so — else drop) * - severity is ADVISORY metadata: invalid/missing coerces to 'medium' * instead of dropping (unlike codeReview's drop rule — discarding a * juror's whole VOTE over a severity typo would silently shrink the * panel, which is worse than an imprecise severity) * - duplicate ids from one juror: first vote wins */ declare function coerceJurorVerdicts(data: Record, validIds: Set): JurorVote[]; /** Aggregate one claim over the included jurors — lone-dissent-never-decides. */ declare function aggregateClaim(claim: { id: string; statement: string; }, included: Array<{ model: string; votes: JurorVote[]; }>, minRefuteVotes: number): ClaimAggregate; /** * One prompt, identical for every juror (independence comes from family * diversity, not prompt variation). Contains claims + evidence + reference * ONLY — never the claim author's reasoning (the input schema makes that * structurally impossible). Encodes the refute-discipline symmetrically: * hunt for counter-evidence, but a genuinely supported claim MUST be * CONFIRMED (an all-refute-biased jury that can't confirm is useless — * the 2026-07 jury lesson). */ declare function buildJurorPrompt(args: { claims: Array<{ id: string; statement: string; }>; sourceBody: string; reference?: string; }): string; export declare function handleVerifyClaims(input: VerifyClaimsInput, ctx: RunContext): Promise>; export declare const __internal: { normModel: typeof normModel; coerceJurorVerdicts: typeof coerceJurorVerdicts; aggregateClaim: typeof aggregateClaim; buildJurorPrompt: typeof buildJurorPrompt; CONFIRM_VOTES_REQUIRED: number; }; export {}; //# sourceMappingURL=verifyClaims.d.ts.map