Skip to main content
[PARTIAL]. Real semantic re-evaluation, for one execution at a time, not reachable from POST /replay or any other route. See Replay for the full disambiguation from the unrelated POST /replay route.

Purpose

Re-runs PolicyEngine.evaluate() against a trust record’s recorded signals and compares the outcome to what was originally decided, this is genuine semantic verification, not a signature or hash recheck.

Install

npm install @parmana/replay

Key exports

ExportStability
ReplayEngine[PARTIAL]. .replay(input: ReplayInput): ReplayResult. Real PolicyEngine re-evaluation, scoped to trustRecord.executions[0], one execution, not the whole record.
ReplayBuilder[AVAILABLE]. .build(): ReplayEngine
ReplayVerifier[AVAILABLE]. .verify(original, replayed): boolean, deep-equality via JSON.stringify comparison
ReplayPipeline, ReplayExecutor, ReplayPlan[AVAILABLE]. Build and run a multi-step replay plan from recorded execution IDs
ReplayContextPer-replay context
ReplayErrorThrown on an invalid or incomplete trust record

ReplayResult shape

interface ReplayResult {
  recordedDecision: Decision;
  replayedDecision: Decision;
  matches: boolean;        // recordedDecision.outcome === replayedDecision.outcome
  replayedAt: string;
}

Minimal example

import { ReplayEngine } from "@parmana/replay";

const engine = new ReplayEngine();
const result = engine.replay({ trustRecord, transaction, policy });
// result.matches === true if the recorded and re-evaluated outcomes agree
Full runnable version: examples/tutorials/06-replay/run.ts.
Not reachable from the server. Confirmed by grep: nothing in packages/api or packages/runtime imports @parmana/replay. POST /replay is an unrelated route, a signature recheck via ExecutionTrustApplication.replay(), see Endpoints. Don’t assume calling the HTTP route exercises this package.

Next

Replay

The full disambiguation between this package and the unrelated HTTP route.

Policies and the decision

The PolicyEngine this package re-invokes.