/**
 * Content-addressed judge-verdict caching.
 *
 * LAW: cache JUDGE VERDICTS only — judging the same artifact with the same
 * judge+rubric is pure. NEVER cache agent rollouts. (A router that cached
 * identical fanout prompts silently destroyed best-of-N diversity; rollout
 * caching reintroduces that failure class. Judging has no diversity to
 * destroy — same artifact + same rubric ⇒ same verdict is the desired
 * property, not a bug.)
 *
 * The cache key is a sha-256 over the canonical JSON of everything that can
 * change a verdict: the artifact content, the scenario id, the judge name,
 * the full dimension list (key + description — the description IS the rubric
 * text shown to the judge), and a caller-supplied `judgeVersion`.
 * `judgeVersion` is REQUIRED: a judge whose prompt/model/ensemble changes
 * without a version bump would otherwise silently serve stale verdicts.
 *
 * Strict canonicalization (`canonicalJson`) throws on undefined / function /
 * symbol / non-finite numbers — an artifact that cannot be unambiguously
 * serialized cannot be content-addressed, and coercing it would let two
 * different artifacts collide on one key.
 */
import type { JudgeConfig, JudgeScore, Scenario } from './campaign/types';
/**
 * Stable JSON stringify: object keys sorted recursively, so two semantically
 * equal values produce byte-identical output regardless of key insertion
 * order. Throws on undefined / function / symbol / NaN / ±Infinity / bigint /
 * Map / Set — anything JSON.stringify would coerce or drop silently.
 *
 * Distinct from `pre-registration.ts`'s `canonicalize`/`hashJson`, which are
 * permissive (coercion allowed) and async (web-crypto). Use THIS pair when a
 * hash collision or silent coercion would corrupt a cache key or attestation.
 */
export declare function canonicalJson(value: unknown): string;
/** Hex sha-256 over `canonicalJson(value)`. The content address used by the
 *  verdict cache and report attestation. */
export declare function contentHash(value: unknown): string;
/** Pluggable verdict store. Sync or async on both legs — `cachedJudge`
 *  awaits the results either way. */
export interface VerdictCacheStore {
    get(key: string): Promise<JudgeScore | undefined> | JudgeScore | undefined;
    set(key: string, score: JudgeScore): Promise<void> | void;
}
/** Process-local Map-backed store. */
export declare function inMemoryVerdictCache(): VerdictCacheStore;
/**
 * JSONL-file-backed store: the full file is loaded into an in-memory index at
 * construction; every `set` appends one line synchronously (durable before
 * the verdict is returned). A corrupt or malformed line throws at load with
 * file:line — a skipped line would silently re-judge (cost) or, worse, mask
 * a half-written file that needs operator attention.
 */
export declare function fileVerdictCache(path: string): VerdictCacheStore;
export interface VerdictCacheStats {
    hits: number;
    misses: number;
}
export interface CachedJudgeOptions {
    /** REQUIRED — part of the cache key. Bump on any change to the judge's
     *  prompt, model, ensemble, or scoring logic; silent judge upgrades must
     *  never serve stale verdicts. */
    judgeVersion: string;
}
/** The wrapped judge: same `JudgeConfig` seam, plus hit/miss observability. */
export type CachedJudge<TArtifact, TScenario extends Scenario = Scenario> = JudgeConfig<TArtifact, TScenario> & {
    stats(): VerdictCacheStats;
};
/**
 * Wrap a `JudgeConfig` so repeat judgments of the same artifact are served
 * from the store instead of re-invoking `score()`. The wrapper is generic
 * over the judge's own type parameters and preserves `appliesTo` — it is a
 * drop-in replacement anywhere a `JudgeConfig` is accepted.
 *
 * A judge that throws is NOT cached: the error propagates and the next
 * attempt re-judges (caching a failure would pin a transient outage forever).
 */
export declare function cachedJudge<TArtifact, TScenario extends Scenario = Scenario>(judge: JudgeConfig<TArtifact, TScenario>, store: VerdictCacheStore, options: CachedJudgeOptions): CachedJudge<TArtifact, TScenario>;
//# sourceMappingURL=verdict-cache.d.ts.map