Skip to main content

Module replay

Module replay 

Source
Expand description

Session record + replay (DESIGN.md §15 v0.2+).

Two halves:

  • SessionRecorder is a Hook that captures every lifecycle event to a JSONL file. Wire it via AgentLoop::with_hook and you get a complete trace of what the agent did.
  • read_session + replay_as_mock reconstruct a deterministic MockModel from a recorded log so you can replay the run offline, verify changes, or debug failures without rerunning against a real LLM.

Structs§

LiveProgressHook
Hook that prints a verbose progress trace to stderr in real time.
SessionRecorder
Hook that serialises every relevant lifecycle event into a JSONL file.
SessionStats
Stats from a single session — handy summary for the harness trace CLI.

Enums§

SessionEvent
One event in the recorded session. Owned (no borrows) so it round-trips through serde without lifetime gymnastics.

Functions§

format_event_short
Tiny helper used by the CLI: convert a single event to a single line of pretty-printed text (does NOT include the timestamp prefix).
format_event_verbose
Multi-line, content-rich version of format_event_short.
read_session
Read a recorded JSONL session log back into memory.
replay_as_mock
Build a harness_models::MockModel that returns each recorded PostModel output in order. Pair with a fresh AgentLoop to replay the run.
replay_as_mock_via_events
Backwards-compatible alias.