Deterministic replay
Replay
Supply the original YAML separately. Replay validates the scenario with the current safety policy, imports at most 2 MiB of strict JSON from a regular file, checks the report schema and planner versions, and compares the regenerated plan with saved metadata. The comparison covers normalized schedule inputs (worker count, batch waits, order, seed, delay mode, and jitter bound), and each derived sequence, event ID, batch, and delay. The current YAML supplies every byte of request configuration. Replay cannot authenticate unrelated scenario content or identify changes to bodies, credentials, targets, timeouts, or assertions that leave scheduling unchanged.
Reports are unauthenticated and serve as schedule checks. The importer checks timing ranks, batch spread, and whether the recorded peak is consistent with the observations. When timestamps tie, multiple event orders are possible. Client timing, network order, and resulting service state may vary between runs even when the schedule is identical.
JSON reports and replay
On Unix, --report atomically publishes a new report and refuses to overwrite an existing file. Choose a private existing directory with a physical path and trusted parents. On macOS, /tmp is a symlink to /private/tmp; --report rejects path components containing symlinks. Resolve the temporary directory with pwd -P as shown below.
Start a fresh race-fixed demo on port 8083 before the initial run and restart it before replay to reset state.
report_dir=$(mktemp -d "${TMPDIR:-/tmp}/faultline-reports.XXXXXXXX")
report_dir=$(cd "$report_dir" && pwd -P)
./faultline run examples/seeded-delays.yaml --format json --report "$report_dir/run.json"
./faultline replay examples/seeded-delays.yaml --from "$report_dir/run.json"
./faultline ui --report "$report_dir/run.json"
On Windows, atomic --report publication is unavailable. Capture --format json stdout as UTF-8 without a byte order mark to a fresh file in a private directory. Shell redirection has its own overwrite behavior. The replayed schedule is reproducible. Server behavior, network arrival order, and observed timing can vary.