pub struct MemoryReplaySource { /* private fields */ }Expand description
The serving side of exact replay for memory reads: an ordered cursor
over a journaled run’s recorded RunEventKind::MemoryRead events.
This is crate::replay::ReplaySource specialized to one event kind —
the same matching rule (sequence + request hash), the same loud failure
on any mismatch — kept in this module because a memory read is answered
from the memory seam, not from a model or tool wrapper. Matching is by
sequence + request hash: MemoryReplaySource::serve takes the next
unserved MemoryRead event in seq order and requires the issued
request’s canonical hash to equal the journaled request’s. Anything else
fails with RustyError::Replay — a replay that has drifted from its
evidence must stop, not improvise.
Implementations§
Source§impl MemoryReplaySource
impl MemoryReplaySource
Sourcepub fn new(snapshot: &JournalSnapshot) -> Self
pub fn new(snapshot: &JournalSnapshot) -> Self
A source over the MemoryRead events of snapshot. The snapshot is
assumed already integrity-verified (the caller’s replay session
verifies it); unresolved artifact references simply fail to match.
Sourcepub fn serve(&self, request: &Value) -> Result<ServedEffect>
pub fn serve(&self, request: &Value) -> Result<ServedEffect>
Serve one memory read from the journal: the next unserved
MemoryRead event whose journaled request hash-equals request.
The returned ServedEffect carries the recorded assembly; re-journal
it into the replay run’s journal so the replayed evidence reproduces
the recorded evidence byte-for-byte.
Sourcepub fn is_exhausted(&self) -> bool
pub fn is_exhausted(&self) -> bool
true when every recorded memory read has been served. Verification
treats a non-exhausted source as a replay that stopped short of its
evidence.