/** * LLMArbitrator β€” the focused LLM ε…œεΊ• (fallback) path used by * `CrossPassEdgeMerger` (W2 T7) when structural heuristics cannot * decide whether a cross-pass edge is real. * * Contract: * - `arbitrate(prompt, opts)` is the only public entry point. * - Cache key is `sha256(prompt)`; cache file is `/.json`. * - Cache hit short-circuits: llmRunner.call is NOT invoked. * - A module-level counter (`callsThisInvocation`) caps live LLM calls * per orchestrator invocation. When exhausted, the result is * `{ output: null, callId: 'budget-exhausted', tokens: null }`. * - Live calls are raced against `perCallTimeoutMs`; on timeout, return * `{ output: null, callId: 'timeout', tokens: null }`. * - On any other error, return `{ output: null, callId: 'error', tokens: null }`. * - `resetArbitratorBudget()` zeros the module counter so the orchestrator * can re-arm it for the next invocation. */ import type { LlmRunner } from '../audit/audit-goal-service.js'; export interface ArbitratorOptions { readonly cacheDir: string; readonly maxCallsPerInvocation: number; readonly perCallTimeoutMs: number; readonly llmRunner: LlmRunner; } export interface ArbitrateResult { readonly output: string | null; readonly callId: string; readonly tokens: { input: number; output: number; } | null; } export declare function resetArbitratorBudget(): void; export declare function arbitrate(prompt: string, opts: ArbitratorOptions): Promise;