FerroReplay
Replay loop
A minimal deterministic event-processing loop.
The replay loop is intentionally simple: read the next event, advance the deterministic clock, apply the event, and persist any emitted result. FerroReplay supplies the clock machinery; your application owns the event type and dispatch semantics.
use ferro_replay::{Clock, VirtualClock};
struct Event {
timestamp_ns: i64,
payload: Vec<u8>,
}
let clock = VirtualClock::new(0);
for event in load_session("session.frj")? {
let event: Event = event?;
clock.advance_to(event.timestamp_ns).await;
let outputs = engine.apply(event.payload, clock.now_ns())?;
for output in outputs {
writer.append(output)?;
}
}
# Ok::<(), Box<dyn std::error::Error>>(())This illustrates the explicit event-order and clock boundaries needed for replay. Reproducing a Crucible run also requires retained inputs, configuration, code identity, and broker or operator observations used by that run.