Journals and offline replay
Locate and verify a Vaern journal, replay a run, and understand what can cause divergence.
Find the journal
A default run writes .vaern/runs/<run-id>/journal.jsonl under the current working directory. Set VAERN_HOME to choose another location. The runs/latest file contains the newest run ID.
Each JSONL record has a SHA-256 digest that depends on the previous record. Records can describe loaded modules, tool calls, network or file effects, console output, and the end of the run.
Verify the chain
vaern journal verify latest- Exit 0 confirms that the hashes match and the journal includes its final run.end record.
- Exit 2 means that the available chain verifies but the run has no closing record. Exit 1 indicates an invalid record.
- Keep the printed final hash separately if you will need to establish that a journal matches the original saved record.
Replay a recorded run
Run the command in the original working directory. Vaern verifies the journal and the hashes of the loaded modules, then re-executes the script with the captured run parameters.
Supported recorded effects receive their recorded outcomes. Tool handlers execute again and their supported runtime effects are replayed. The CLI compares console output and the final exit status against the original run.
vaern replay latestDiagnose a divergence
- Keep the entry file and imported module sources identical to the original run.
- Wall-clock time, environment values and interactions with timers can affect reproducibility.
- Replay can reject truncated recorded responses and runs that started an HTTP listener. Journals can contain input data and console messages, so treat them as application records.