v1.2.2

Replay Management

Replay Management runs a saved workflow again and keeps the run, test, comparison, and result records together.

Overview

A Replay is not a retry of the original workflow. AIGP re-resolves the authorized historical source, freezes its configuration and references, then produces a distinct execution with explicit source-to-replay lineage. The historical source is never changed.

Replay reads trajectories, not projections

Replay consumes the ordered Agent Runtime trajectory. Ontology and evidence views are downstream projections: useful for relationships and navigation, but not the source used to inspect action sequence, failures, or recovery. A controlled fidelity test showed that a projection can retain outcome and duration while losing ordering, score and token evidence, retry and recovery sequence, and causal completeness.

The artifact boundary determines which evaluation axes remain defensible. An outcome can remain readable after a reduction, while cost becomes unreliable without token provenance and behavioural or causal conclusions require the missing ordered evidence. In those cases, the platform reports insufficient evidence rather than guessing.

Durable and idempotent

Re-submitting the same replay request returns its existing Replay. Worker retries reuse the same replay, execution job, frozen configuration hash, and replay execution identity.

Lifecycle

Creation validates immutable evidence and freezes a Replay configuration. Submission produces the replay execution; evaluation then creates governance evidence without rerunning that workflow.

AI Governance Platform / governed event stream
replay / historical executionevent order
  1. 01
    freeze source evidence

    The authorized historical source and configuration are resolved once.

  2. 02
    queue replay work

    A durable replay execution job is created with an explicit source link.

  3. 03
    produce replay execution

    The worker creates a distinct execution; it never mutates the source.

  4. 04
    evaluate and compare

    A new scorecard is compared with the compatible historical baseline.

governed outcome

REPLAYED

Lineage sealed · drift calculated · immutable result retained

text
DRAFT → READY → QUEUED → RUNNING → EXECUTION_COMPLETED → EVALUATING → COMPARING → COMPLETED

Failed and cancelled replays retain the evidence that was successfully recorded before the terminal transition. Replays may be archived, but are not deleted through the normal lifecycle.

Controlled replays for Causal Audit

Causal Audit uses the same durable Replay framework, but for a different question. A standard replay asks, “how did a historical workflow compare with its saved evaluation?” A controlled replay asks, “did one approved change to tool evidence materially change this measured outcome?”

Standard ReplayControlled Causal Replay
Reproduces a historical workflow from frozen evidence.Reproduces an eligible source in isolation with one policy-approved evidence change.
Creates a replay evaluation, baseline comparison, drift summary, and result.Returns a bounded outcome artifact to Causal Audit for influence scoring and classification.
Needs a compatible historical evaluation for a meaningful comparison.Needs an explicit safe replay capability, approved intervention policy, and complete causal lineage.

The source remains untouched in both cases. Controlled replays also retain a direct link to the policy version, intervention digest, counterfactual evidence reference, and produced execution. See Causal Audit for the safety rules and worker sequence. Read Controlled Replay Framework for the complete lifecycle and integration contract.

Baseline: the original scorecard

A baseline evaluation is the saved scorecard for the original historical execution. It is the before side of a replay comparison. The evaluation produced for the new replay execution is the after side. AIGP compares those two scorecards to show what changed and to calculate drift.

text
Original historical execution
  → saved evaluation = BASELINE (before)

New replay execution
  → new evaluation = REPLAY EVALUATION (after)

BASELINE + REPLAY EVALUATION
  → metric comparison + drift summary + immutable Replay result

The baseline is not a default model, prompt, or configuration. It is a specific, already-persisted evaluation result belonging to the source execution. Replay Management does not rerun the source to manufacture one, because that would no longer be historical evidence.

AIGP can select the baseline in three ways. The default is LATEST_COMPATIBLE.

StrategyWhat AIGP usesWhen to use it
Latest CompatibleThe most recent compatible source evaluation.Normal operational comparison.
Source PrimaryThe source evaluation explicitly marked as primary.A team has designated one canonical scorecard.
ExplicitThe exact source evaluation ID supplied by the operator.A review requires comparison with a particular historical evaluation.

A baseline is compatible only when it has:

  • the same source execution and tenant scope;
  • the same evaluator type and evaluator version; and
  • at least one metric shared with the replay evaluation.

These checks keep the comparison meaningful. For example, ananswer_relevance score from evaluator version 1 cannot be treated as directly comparable with a similarly named score from a different evaluator version or rubric.

No compatible baseline

A replayable source execution and a replay-ready source are not quite the same thing. The execution must have frozen replay evidence and a compatible saved evaluation before a replay can be compared. If AIGP reports no compatible source evaluation, first evaluate the original source with the intended evaluator and metric schema. Then create a new Replay (or select that evaluation explicitly). Retrying the failed replay job cannot invent the missing historical scorecard.

Lineage - What Happened

Lineage is the durable chain of references that answers, “what produced this result?” It is not a visual guess or an ontology dependency. AIGP records these references on the Replay as work progresses, and Studio renders the graph directly from them even when an ontology projection is delayed or unavailable.

text
Source execution
  └─ REPLAY_OF → Replay request
                     ├─ SUBMITTED_AS → Replay execution job
                     ├─ PRODUCED → New replay execution
                     ├─ EVALUATED_BY → Replay evaluation job
                     ├─ COMPARED_WITH → Source baseline evaluation
                     └─ PRODUCED → Comparison, drift, and immutable result

In the Lineage tab, select any node to inspect its identity and metadata. The graph distinguishes the original source from the produced execution, and the baseline evaluation from the replay evaluation. This matters when reviewing a failure: an execution job, an evaluation job, a comparison, and a final result are related evidence, not interchangeable statuses.

You can move nodes to inspect a complex graph and select Reset to restore the generated layout. These positions are a local viewing preference only; they do not modify lineage or any persisted evidence.

Drift Metrics - What Changed

Drift is the structured answer to “how did the replay evaluation differ from the baseline?” It is a comparison signal for review, not by itself a release approval or a root-cause explanation.

FieldMeaning
Metric countEvery metric present in either evaluation—the shared, new, and removed evaluation surface.
Changed metricsShared metric names whose numeric score differs between baseline and replay.
New / removed metricsMetrics only present in the replay / only present in the baseline. These show that the evaluation surface changed.
Overall score deltaThe unweighted average of replay score − baseline score across shared metrics. It is not a weighted business score.
Improved / regressedDirectional classifications when the evaluation records whether higher or lower is better. Without that metadata, AIGP does not infer a direction.

The built-in governance-drift-v1 analyzer assigns severity from the largest absolute changed-metric delta and structural changes to the metric set: NONE when nothing changed, LOW below 0.10, MEDIUM at 0.10 or above—or when a metric is new or removed—and HIGH at 0.20 or above. The result also retains the effective drift-threshold policy as governance context for review.

Read drift as a review signal

A positive delta is not automatically “good”: lower latency, cost, or safety-risk scores may be preferable. Read the metric direction, changed metric names, evaluation surface, and configured governance policy before acting on a severity label.

Worker Execution

The shared worker runtime claims one leased job at a time and dispatchesREPLAY_EXECUTION, REPLAY_EVALUATION, EVALUATION, and EXPERIMENT jobs. It commits each durable boundary before acknowledging the job, which allows safe recovery after an interruption.

On successful replay execution, the worker idempotently submits the separate replay-evaluation job. Cancellation reaches queued and running handlers at safe boundaries. API and worker processes can run together or separately, provided they share the same durable stores.

API & Studio

Source selection uses GET /api/v1/replay-executions/search, which returns a small, cursor-paginated execution projection. The Replay API exposes creation, listing, submission, evaluation, cancellation, archival, and immutable result retrieval under /api/v1/replays.

Studio provides /replays, /replays/new, and /replays/[replayId]. The detail view renders persisted lineage and evidence references; it does not reconstruct workflows, select baselines, or calculate drift in the browser.

Run Locally

bash
# Terminal 1: API (demo data is seeded in local/dev mode)
uv run uvicorn ai_governance.api.app:app --reload

# Terminal 2: durable worker
uv run python -m ai_governance.workers.replay_worker_runtime

# Optional end-to-end smoke test
sh scripts/replay/run-smoke.sh

Docker Compose starts ai-governance-replay-worker separately and shares the ai-governance_sqlite_data volume with the API. For local demo data, 27 replayable historical sources include compatible primary mock evaluations, and the Replay inventory includes completed and active lifecycle examples.

Execution Search Projection

Replay source discovery is an eventually consistent search projection, not the authority for replay creation. It should be backed by a projected execution index and searched with bounded filters and opaque keyset cursors. AIGP always re-resolves the complete source execution before validating or creating a Replay, so a browser selection cannot bypass authorization or frozen-evidence checks.