/** * GoldenTrace Replay Validator - Pure replay validation for generated L2 rules * * PRI-115: Before L2 registration, generated rule code must pass replay * against GoldenTrace cases. This module provides the pure validation logic. * * TRUST BOUNDARY: * - Pure functions only, zero side effects * - No filesystem, VM, process, or network access * - Sandbox loading is injected via the adapter layer */ import type { GoldenTraceCase, GoldenTraceDecision } from './golden-trace.js'; import type { RuleHostDecision, RuleHostInput, RuleHostResult } from './internalization/rule-host-contracts.js'; import type { RuleHostHelpers } from './internalization/rule-host-helpers.js'; import type { ToolSemanticRegistry } from './internalization/tool-semantic-registry.js'; export interface ReplayValidatorCaseResult { caseId: string; passed: boolean; expectedDecision: GoldenTraceDecision; actualDecision: RuleHostDecision | 'error' | 'non_deterministic'; failureReason?: string; repairHint?: string; proposedParamsMatch?: boolean; proposedParamsDiff?: string[]; applicationModeMatch?: boolean; } export interface ReplayValidatorResult { passed: boolean; totalCases: number; passedCases: number; failedCases: number; perCaseResults: readonly ReplayValidatorCaseResult[]; failureReasons: readonly string[]; repairHints: readonly string[]; } export interface ReplayValidatorConfig { maxRepairAttempts: number; /** * Project directory for path normalization (PRI-439 Phase 3). * When provided, Golden Trace replay produces non-null `normalizedPath` * values that match the production OpenClaw Gate, enabling path-based * rules to be validated in replay. * When not provided, `normalizedPath` falls back to `null` (legacy behavior). */ projectDir?: string; /** * PRI-634-F Phase 2: the ToolSemanticRegistry used by the production gate. * When provided, replay resolves `canonicalKind` from the same registry and * derives identical bash/write extraction hints (replay/production input * parity). Absent → legacy behavior (no canonicalKind, no derived hints). */ toolSemantics?: ToolSemanticRegistry; } export declare const DEFAULT_REPLAY_VALIDATOR_CONFIG: ReplayValidatorConfig; export type ReplayEvaluateFn = (input: RuleHostInput, helpers: RuleHostHelpers) => RuleHostResult; export declare function diffParams(expected: Record, actual: Record): string[]; export declare function replayGoldenTrace(evaluateFn: ReplayEvaluateFn, cases: readonly GoldenTraceCase[], config?: Partial): ReplayValidatorResult; //# sourceMappingURL=golden-trace-replay-validator.d.ts.map