> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openagents.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Replay and Artifacts

> Session logging, REPLAY.jsonl, and verified patch bundles.

## Overview

Autopilot sessions emit structured artifacts that make runs replayable,
verifiable, and auditable. The current implementation emits a `ReplayBundle`
while the target format is `REPLAY.jsonl`.

## What Gets Emitted

The canonical "Verified Patch Bundle" is composed of three artifacts:

* **PR\_SUMMARY.md** — human-readable patch summary
* **RECEIPT.json** — cryptographic audit trail
* **REPLAY.jsonl** — structured event stream for replay/debugging

These are stored under `${OPENAGENTS_HOME}/sessions/{session_id}/`.

## Replay Format (Target)

`REPLAY.jsonl` is a canonical JSONL stream of events such as:

* SessionStart / SessionEnd
* PlanStart
* ToolCall / ToolResult
* Verification

Each event is serialized deterministically for hashing and audit.

## Current vs Target

* **Current**: `ReplayBundle` in `crates/autopilot-core/src/replay.rs`
* **Target**: `REPLAY.jsonl v1` per `crates/dsrs/docs/REPLAY.md`

If docs conflict with code, code wins.

## Why It Matters

Replay and receipts enable:

* Debugging and audit
* Counterfactual analysis and shadow mode
* Training data generation for DSPy optimizers

## Related Specs

* `crates/dsrs/docs/REPLAY.md`
* `crates/dsrs/docs/ARTIFACTS.md`
