/** * Semantic-method rule evaluator (LLM-as-judge). * * Implements atr-method-v1.1.md §6.4 evaluation semantics. The judge * itself is passed in via dependency injection — the reference engine * does NOT bundle a vendor SDK. Operators wire in OpenAI, Anthropic, * or a local model at deployment time. * * Capability: atr/method/semantic (per atr-method-v1.1.md §9). * * Fallback behavior per spec §6.4: * - If judge is unavailable AND rule.semantic.fallback_method === 'pattern', * the engine falls back to pattern evaluation on the same input. * - If fallback_method === 'none' or absent, the engine returns a * graceful_error (matched: false, error: ). */ import type { ATRRule, ATRSemanticJudge } from "./types.js"; export interface SemanticEvaluationResult { matched: boolean; /** Judge response confidence (0.0-1.0) if judge was called */ confidence?: number; /** Judge response category if returned */ category?: string; /** Judge response evidence if returned */ evidence?: string; /** Why the rule did not evaluate via judge (cache hit / fallback / error) */ reason?: string; /** Set when judge unavailable AND fallback_method !== 'pattern' */ error?: string; } interface JudgeCache { get(key: string): { confidence: number; category: string; evidence?: string; } | undefined; set(key: string, value: { confidence: number; category: string; evidence?: string; expires_at: number; }): void; } export interface SemanticEvaluatorOptions { /** Caller-supplied judge function. If absent, fallback path is taken. */ judge?: ATRSemanticJudge; /** Caller-supplied cache. Defaults to an in-process Map cache. */ cache?: JudgeCache; /** Max input chars sent to the judge (default 20000). Bounds token cost. */ maxInputChars?: number; } export declare function evaluateSemanticRule(rule: ATRRule, input: string, options?: SemanticEvaluatorOptions): Promise; export {}; //# sourceMappingURL=semantic-evaluator.d.ts.map