/** * Contradiction adjudication — decide whether a claimed contradiction is real. * * The contradict tool previously recorded a CONTRADICTION signal on the * agent's say-so without ever checking whether the observation actually * conflicts with the stored belief. This module closes that loop: * * 1. NLI first — if a cross-encoder NLI provider is configured, classify the * (belief, evidence) pair in both directions and map the result onto the * cortex verdict vocabulary. Cheap, local, calibrated for exactly this task. * 2. LLM fallback — structured-JSON adjudication via a versioned prompt. * Verdicts from low-tier models (per config.model_provenance.confidence_tiers) * are capped: a 'genuine' verdict below 0.8 confidence is downgraded to * 'tension' so a weak local model cannot silently erode belief confidence. * 3. No provider / all failed — 'tension' with method 'none': the claim is * recorded as unverified rather than trusted or dropped. * * Verdict vocabulary (superset of nliToCortexVerdict): * - genuine: both cannot be true of the same time — evidence negates the belief * - supersedes: temporal succession — the belief was true and the world has * since changed; revise the belief (believe with valid_from) rather than * distrust it. Only the LLM path can produce this — NLI has no time axis, * and typically labels succession as contradiction. * - tension: partial/scope conflict, or unverifiable claim worth tracking * - complementary: evidence supports or refines the belief * - unrelated: no meaningful logical relationship */ import type { NLIProvider } from '../core/nli.js'; import type { LLMProvider } from '../core/llm.js'; import type { ConfidenceTier } from '../core/types.js'; export type ContradictionVerdict = 'genuine' | 'supersedes' | 'tension' | 'complementary' | 'unrelated'; /** * Max confidence penalty applied to a memory on a fully-confident genuine * verdict. Shared by the contradict tool and observe-time conflict detection. */ export declare const MAX_CONFIDENCE_PENALTY = 0.15; export interface AdjudicationResult { verdict: ContradictionVerdict; /** Adjudicator confidence in the verdict, 0-1. 0 when method is 'none'. */ confidence: number; /** Which mechanism produced the verdict. */ method: 'nli' | 'llm' | 'none'; /** Brief explanation (LLM path) or score summary (NLI path). */ reasoning?: string; /** Set when a low-tier LLM's 'genuine' verdict was downgraded to 'tension'. */ tier_capped?: boolean; } export interface AdjudicateOptions { /** The new evidence (observation content). */ claim: string; /** The stored belief or memory definition being disputed. */ target: string; /** NLI cross-encoder provider — preferred when available. */ nli?: NLIProvider; /** LLM fallback adjudicator. */ llm?: LLMProvider; /** Capability tier of the LLM adjudicator (default 'medium'). */ llmTier?: ConfidenceTier; } /** * Adjudicate a claimed contradiction between new evidence and a stored belief. * Never throws — provider failures degrade to the unverified 'none' result. */ export declare function adjudicateContradiction(options: AdjudicateOptions): Promise; //# sourceMappingURL=adjudicate.d.ts.map