/** Deterministic Critic for the replay path — checks assertions against evidence, no LLM (invariant #4). */ import type { AssertionHandler, Critic } from "../../core/ports.js"; import type { Assertion, AssertionResult, Context, Evidence, Verdict } from "../../core/types.js"; /** A product-defined check for a `{ kind: "custom", name }` assertion — the host decides what success means. */ export type CustomCheck = (params: Record, evidence: Evidence) => boolean | { passed: boolean; detail?: string; } | Promise; export type CustomChecks = Record; /** Evaluate one mechanical assertion. `expect` is not mechanical — returns unsupported (LlmCritic handles it). */ export declare function checkAssertion(assertion: Assertion, evidence: Evidence, benign?: readonly string[], benignConsole?: readonly string[], localePrefixes?: readonly string[]): AssertionResult; /** Built-in mechanical checks — every kind except product `custom` (`expect` yields its LlmCritic hint). */ export declare class MechanicalAssertionHandler implements AssertionHandler { private readonly benign; private readonly benignConsole; private readonly localePrefixes?; constructor(benign?: readonly string[], benignConsole?: readonly string[], localePrefixes?: readonly string[] | undefined); supports(assertion: Assertion): boolean; judge(assertion: Assertion, evidence: Evidence): AssertionResult; } /** Product-defined `{ kind: "custom", name }` checks via a name→check registry. */ export declare class CustomAssertionHandler implements AssertionHandler { private readonly custom; constructor(custom?: CustomChecks); supports(assertion: Assertion): boolean; judge(assertion: Assertion, evidence: Evidence): Promise; } /** Aggregate assertion results into a verdict, failing closed on an empty set — a scenario that * verifies nothing must not look green (#69). Shared by both critics so the semantics can't drift. */ export declare function toVerdict(results: AssertionResult[]): Verdict; /** Route one assertion to the first handler that supports it (mirror of the Execute-stage step dispatch). */ export declare function judgeAssertion(handlers: AssertionHandler[], assertion: Assertion, evidence: Evidence, ctx?: Context): Promise; /** Resolve any assertion — a registered `custom` handler, else the built-in mechanical check. */ export declare function resolveAssertion(assertion: Assertion, evidence: Evidence, custom?: CustomChecks): Promise; export declare class AssertionCritic implements Critic { private readonly handlers; /** * @param custom product-defined checks for `custom` assertions, keyed by name. * @param benign URL substrings whose 4xx/5xx is product noise, not a regression (P7). * @param benignConsole console-text substrings that are product noise (framework/i18n), not errors (#66). * @param localePrefixes locale prefixes `navigated`'s URL match may strip as a fallback (#86); * default is `urlReached`'s conservative built-in list. Keep this consistent with whatever * the same run passed as `RunHarnessOptions.localePrefixes`, or the verdict and the mid-run * `expect` checks can disagree on the same URL. */ constructor(custom?: CustomChecks, benign?: readonly string[], benignConsole?: readonly string[], localePrefixes?: readonly string[]); judge(evidence: Evidence, assertions: Assertion[]): Promise; }