Skip to content

Inspect run history and replay it offline

History is the ordered record of facts Weave accepted for a run: it started, an action completed, a signal arrived, a timer elapsed. Replay feeds those facts back through the same pure runtime kernel to check that they tell a consistent story. Replay sends no messages, executes no actions, and does not resume the run. To start a new execution instead, see run retry.

Who it is for. Operators investigating a run, and developers who audit or debug executions. What you need. Studio or the CLI connected to a platform (connect the CLI), the run's id (from its start response, or a trigger or provider receipt), and run.read in that environment (the viewer role). For offline replay, also the exact compiled artifact the run used. Allow 10 minutes.

Offline consistency verification separated from operations that change execution

Follow the top row left to right for read-only replay and its result. A consistent report describes the retained evidence of a finished run; it does not independently prove delivery or past authorization. The lower row is a separate, authorized decision that changes execution. Open diagram at full size

Read a run's history

In Studio, open Runs, select a run, and read its Timeline: the first page of its accepted facts (up to 100) as plain sentences, such as "Run started". View raw event shows a fact as it was recorded. The run's Now line explains why it waits, for example "Waiting for a signal at STEP", where STEP is the step's ID. A run blocked by an incident shows "This run stopped at STEP." instead.

From the CLI, run the commands with a saved platform and workspace from weave auth setup (see how remote commands choose a platform). Saved platforms are new in 0.1.0a7; with an alpha6 or earlier CLI, these commands use explicit mode.

# Read the first page of accepted facts for one run.
weave runs history RUN_ID --limit 100 --output json

Expected: an event page with run_id, scope, high_water_sequence, events, and next_cursor. When next_cursor is not null, pass it unchanged with --cursor to read the next page. Do not compute sequence offsets yourself.

Check that the history is consistent

Choose where the check runs.

On the platform. The server replays the run with the artifact it pinned. It replays the same bounded evidence as an export (at most 1,000 facts, or fewer with --limit):

# Ask the platform to replay the run's recorded facts with its pinned artifact.
weave runs replay RUN_ID --output json

Expected: a replay report (described below). It needs only run.read.

Offline, on your computer. Use this when you want an independent check with an artifact you keep:

  1. Export the run's evidence:

    # Export up to 1,000 accepted facts with source references and completeness metadata.
    weave runs export RUN_ID --output json > history.json
    

    Expected: a JSON document with version: weave/history-v1, events, artifact_digest, and omissions. The export never includes the artifact itself.

  2. Get the exact artifact the run used. Use the compiled-artifact.json you kept when you compiled and published that version, or read the published version. Its VERSION_ID is activation.request.version_id in weave runs read RUN_ID --output json:

    # Save the compiled artifact of the published version the run is pinned to.
    weave definitions export VERSION_ID --collection workflows --output json \
      | python3 -c 'import json,sys; json.dump(json.load(sys.stdin)["artifact"], sys.stdout)' \
      > pinned-artifact.json
    

    Then compare the artifact's digest with the export's artifact_digest; they must be equal. A current source file with the same name is not a substitute.

  3. Replay locally:

    # Replay the exported facts with the pinned artifact; no network, database, or executor is used.
    weave run replay --artifact pinned-artifact.json --events history.json
    

    Expected: a replay report and exit code 0 when it is consistent, 1 when it is incomplete or inconsistent. A nonzero exit is a verdict about the evidence, not a sign that the live run failed.

Release tooling should keep each published artifact with its release evidence, so offline replay is always possible.

Read the replay report

The report has status, diagnostics (each with code and sequence), last_verified_sequence, final_state, omissions, and authorization_verified, which is always false.

Status Meaning What to do next
consistent A fully evidenced, finished stream whose transitions agree Nothing; this proves internal consistency, not external delivery or past authorization
incomplete The run is still open, the export was bounded, or evidence is missing or withheld Check whether the run is still running or the export hit its limit; keep the verified prefix
inconsistent The artifact, the event stream, or a transition does not match Confirm you used the exact artifact and stream, then read the first diagnostic; never edit history to make it agree

last_verified_sequence and final_state describe only what replay could verify. Sequence gaps and unavailable operands stop at the verified prefix. These make a report inconsistent: the wrong artifact, lock, or source identity; duplicate accepted receipt identities; invalid event envelopes; invalid signal arbitration; or a transition that differs from the recorded one. A run suspended by a legitimate kernel incident remains an inspectable, verified prefix.

Calls in a history

A run that calls another workflow records a call_completed event when the call's child run ends, with node_id (the call's instance key), generation, child_run_id, status, and output (the child's output, or a code and message). Its evidence names the call row the outcome came from (call_receipt), and the event that issued the call lists the row in issued_calls. Replaying the caller needs only its own history and artifact: the child's events stay in the child's history, which replays on its own. A call outcome that does not match its call evidence makes the report inconsistent (WV-REPLAY-CALL or WV-REPLAY-CALL-ISSUANCE); missing call evidence makes it incomplete (WV-REPLAY-CALL-PROVENANCE).

AI agent runs in a history

An AI agent records its work at its own instance keys, here for a step support:

Key What it records
support The agent itself: its deadline, its output or failure, and its own incidents
support#2 Turn 2: the turn task and its answer
support#2.1 The first tool call of turn 2: a task, a call of a workflow, or a human task, by the tool's kind
support#2.1.review The review of that call, a human task

Inside a loop the agent's key carries the iteration first, as in support[3]#2.1. A call the platform refused never ran and records no events of its own; the model's next turn input carries the refusal.

Replay checks these facts like any others, and also:

  • A turn's answer must fit the turn's pinned output schema, a call's result the output schema of the tool the agent recorded for that call, and a review's answer the review form (approve or reject, with an optional comment). An output that doesn't fit makes the report inconsistent with WV-REPLAY-EVENT.
  • Each turn task's evidence records input_digest, the SHA-256 digest of the canonical JSON of the input the model was given. Replay rebuilds every turn input from the recorded facts, with the rules version the artifact pins, and compares digests. A transcript rebuilt differently makes the report inconsistent with WV-REPLAY-AGENT-INPUT; evidence without the digest makes it incomplete with the same code.
  • A review's human_completed event carries the input_digest of the call input the review showed, which an approval runs, and exports keep it.

Replay never calls a model or a tool: the recorded answers are the evidence. An export classifies a call's output by every tool the call may have run, narrowed by the action or workflow its evidence names, so a value a tool marks secret stays out.

An agent with conversation memory records a memory_loaded event at its own key before its first turn. Its data has node_id, key_hash, the conversation's version, expired, test (a test run, which loads nothing), messages (the exchanges it loaded, as the model read them) and, for a stored conversation that couldn't be read, code: "AGENT.MEMORY_UNREADABLE". History and exports keep the messages: they were scrubbed and redacted when they were remembered, and reading a run's history needs the same run.read as reading the conversation. An export of a run therefore carries the exchanges that run loaded.

Replay never reads a conversation, so a run replays the same after its conversation was changed, expired or deleted. The event that started the agent names the load it asked for in its evidence, and the memory_loaded event's evidence holds a receipt: the load, the version, expiry and test flag, and a digest of the messages. A receipt that doesn't match the load or the event's data makes the report inconsistent with WV-REPLAY-MEMORY; a missing receipt or load makes it incomplete with WV-REPLAY-MEMORY-PROVENANCE.

Handled step failures in a history

A step whose On error setting handles a failure records a step_failed event with node_id (the instance key), generation, code, outcome, attempts, and, when known, child_run_id, deadline, wait_id, and effect (inside a transaction). Exports keep only these codes, outcomes, and counts, never worker or provider text. The step change that follows has status: failed and the error object; an error path's join records the step's final change with the path's output. Replay checks each event against its source: the task receipt and recovery timing for a task that failed after its retries or that nobody claimed before its deadline, the deadline and its order for a signal or human task that timed out, and the refused call row for a call that could not start. Confirm it had no effect (accept_reconciled_failure) replays only for a task incident of a step with a setting, and incident_resolved keeps its attempts. On a transaction in doubt the same kind is It didn't happen: it records the incident's code and no attempts, and replay checks it through the kernel like the transaction's other resolutions.

Transactions in a history

A run with a workflow transaction records its phases at their own keys: the confirm, cancel and undo of a step hold run at hold#confirm, hold#cancel and hold#undo, with task and call evidence like any step, and a transaction's own deadlines fire at move#hold, move#settle (and move#settle.1, … when a person retries a settle timeout) and move#decide. A step's final failure is a step_failed event (see handled step failures) whose effect is none only when the worker's release proved nothing was applied; exports keep it and the effect of task_failed, recovery_scheduled and call_completed, the run_id a transaction's run starts with, and skip_undo of a cancel. A resolution of a transaction in doubt records the incident's code, so its output (the step's output, or a reconciliation record whose blockOutput is classified by the block's output schema) is exported safely. Replay checks the resolution through the kernel and compares transitions byte for byte: a tampered effect replays inconsistent.

A run that grew too large to undo its transactions records its hold (incident_opened at @transactions) with evidence that omits the expected transition for its size (and the run's source reference, as every evidence row does), so replay verifies everything before it and stops there as incomplete (WV-REPLAY-EXPECTATION), as it stops at an oversized stop.

Routes, pagination, and limits

All routes are under /api/v1/tenants/{tenant}/projects/{project}/environments/{environment}/runs/{id} and need current run.read:

Route CLI Returns
GET .../history?limit=1..100&cursor=… weave runs history One EventPage; default limit 100
GET .../export?limit=1..1000 weave runs export One HistoryExport; default limit 1,000
GET .../replay?limit=1..1000 weave runs replay One ReplayReport from the server's pinned artifact, over the same bounded evidence as the export; default limit 1,000

Stable pages. A history cursor binds the full scope, the run, the last sequence, and the high-water sequence of the first page, so facts appended later do not enter that traversal. Every page reloads your current run.read; knowing a cursor grants nothing.

Late completions. An export also lists up to 100 ignored late completion receipts in a separate, ordered auxiliary_receipts section. The run lock and auxiliary_high_water define that snapshot, and auxiliary_complete: false says it was truncated; it has no pagination. Ignored receipts never enter the accepted sequence.

Source references. An export names the original scoped version, source hash, source format, source map, and the IR node paths. Republishing the same executable with new formatting does not change that reference. Missing or ambiguous source provenance makes the export explicitly incomplete. Filenames in a source map are labels: the service never opens them and never includes source text or an artifact.

Size limits. Inspection limits do not cap how long a run may live.

  • Pure replay accepts at most 10,000 events and 64 MiB of artifact plus events. It checks each transition's size before hashing a reconstruction larger than 64 MiB and returns an incomplete verified prefix.
  • Export streams rows and bounds the whole output, including maps, auxiliary receipts, and replay state, to 64 MiB, measured field by field. An oversized final state is withheld with a resource_limit omission, an incomplete status, and the last verified sequence kept.
  • These are input and output bounds, not limits on kernel CPU or process memory; runtime state and transitions have their own budgets.

replay(artifact, tuple(events)) in Python calls the same public kernel transition as production and never regenerates outcomes. The strict event-page, history-export, recorded-evidence, and replay-report schemas are written by weave schema export --directory DIR. The older weave run history and weave run export commands still work with --environment-url (or WEAVE_ENVIRONMENT_URL) and WEAVE_ACCESS_TOKEN.

What the evidence contains

New facts carry optional weave/recorded-v1 evidence in an append-only, scoped sidecar, committed in the same transaction as the fact:

  • The start fact keeps the safe initial input. Every fact binds the run, the scope, the executable and dependency identity, and the exact source reference.
  • Newly issued task and wait UUIDs map to kernel command nodes and to pinned action, release, and deadline facts. Receipts bind the generation and the selected wait, and bounded signal metadata records how signals were arbitrated.
  • Facts and issued commands name each run of a step by its instance key, which is the step ID outside loops. Replay finds the step from the step ID part of a canonical key; any other spelling makes the history inconsistent. An export's node_paths stays keyed by node ID, so map an event's node_id to its path through the node ID part of the key (node_of).
  • A loop's history shows spawn_branch and accept_output commands with the element position in index, its iterations' events under keys such as send[2], and each yield as a wait_elapsed event for its yield key (notify~1). Replay checks these like any other fact, so the exported history of a run with loops replays as consistent.
  • The expected transition is the SHA-256 of a canonical classified-v1 safe projection of the kernel state, identified as sha256-rfc8785-v1; no duplicate snapshot is stored.
  • Lease tokens, output fingerprints, and free-form operator reasons or evidence strings are never exported. Typed omissions distinguish a withheld value from a genuine null.

The secret classification policy still governs values and artifacts, including its limit on unmarked business data.

Task timing. Task receipts can carry timing evidence:

  • live_admission records the single database checked_at time of the final locked lease check and that attempt's effective_deadline. The issued task keeps its original deadline; claiming may shorten the effective deadline to the overall run deadline. Replay requires admission strictly before the effective deadline and checks that neither issued bound was extended. A fact's own timestamp is not its admission time.
  • recovery_decision records when recovery decided. A scheduled retry must be at or after that time and strictly before the effective deadline; a recovery incident may be recorded after the deadline. Recovery retires its generation: only the next generation can supply an outcome, never before the recorded retry time. A manual safe retry also allows only its successor.
  • Missing timing in older sidecars makes replay incomplete; contradictory timing or lifecycle facts make it inconsistent.

What replay cannot prove. Existing facts are never rewritten. Missing initial input, identity, or issuance provenance stays incomplete; this version does not fill it from snapshots. A policy-blocked run shows only safe metadata and explicit omissions. A sidecar's presence does not prove completeness. Recorded facts establish internal consistency, not independent proof of historical leases or identity-provider authorization, which is why authorization_verified is always false.

Oversized finished runs. A terminal control on an oversized run can keep its full transition in PostgreSQL while omitting the optional expected-transition digest with reason resource_limit. Replay then stays incomplete: a committed cancellation or timeout does not by itself prove a fully replayable stream, and earlier facts are never rewritten to fill the gap.

Next steps

Troubleshooting

What you see Why What to do
inconsistent with an artifact or lock diagnostic You replayed with a different artifact Use the artifact whose digest equals the export's artifact_digest
incomplete for a run that is still running Open runs are never fully evidenced Replay again after the run finishes
inconsistent with WV-REPLAY-AGENT-INPUT An AI agent's turn input, rebuilt from the recorded facts, differs from the input its task recorded Confirm the export is unchanged; the diagnostic's sequence is the fact that issued the turn. Never edit history to make it agree; see AI agent runs in a history
incomplete with WV-REPLAY-BOUNDED-PREFIX The run has more accepted facts than the export or replay limit (at most 1,000); the platform replay has the same bound Keep the verified prefix: it covers the facts up to last_verified_sequence
incomplete with WV-REPLAY-LIMIT The export reached its 64 MiB size budget, or one fact was too large to include Keep the verified prefix; the withheld facts are not part of the check
WV-REPLAY-INPUT: bounded artifact and recorded events required A file is not valid JSON, is too large, or has more than 10,000 events Check both files and their sizes
HTTP 403 WV-FORBIDDEN You lack run.read in that environment Ask for the viewer role there; operator alone does not include it
HTTP 404 WV-NOT-FOUND The run belongs to another environment than the selected workspace Check the Workspace: line of weave auth status, or pass --environment
auxiliary_complete: false More than 100 late completions were ignored Expected; ignored receipts never change the run