pub struct JournalSnapshot {
pub run_id: String,
pub thread_id: String,
pub events: Vec<RunEvent>,
pub artifacts: BTreeMap<String, Value>,
pub artifact_refs: BTreeMap<String, ArtifactRef>,
pub head_hash: String,
}Expand description
The serde-complete export form of a Journal: run identity, the full
event sequence, the artifact payloads referenced by events, and the head
hash binding them. Round-trips through JSON unchanged; load with
Journal::from_snapshot to re-verify the head.
Fields§
§run_id: StringThe recorded run’s id.
thread_id: StringThe thread the run belongs to.
events: Vec<RunEvent>Every recorded event, in sequence order.
artifacts: BTreeMap<String, Value>Content-addressed payloads referenced by events (SHA-256 hex → value).
artifact_refs: BTreeMap<String, ArtifactRef>Payloads whose bytes live in an external ArtifactStore instead
of embedded in artifacts (R0.7 wave 4; see
Journal::snapshot_externalized). Additive: absent from the wire
when empty, so pre-W4 snapshots — and replay fixtures, which embed
by design — keep their exact shape. Load with
Journal::from_snapshot_with_store.
head_hash: StringThe chained head hash over events.
Implementations§
Source§impl JournalSnapshot
impl JournalSnapshot
Sourcepub fn find_effect_receipt(
&self,
idempotency_key: &str,
) -> Option<EffectReceipt>
pub fn find_effect_receipt( &self, idempotency_key: &str, ) -> Option<EffectReceipt>
The effect-receipt replay lookup (R0.6 Durable Work): the journaled
EffectReceipt for idempotency_key, when one exists.
This is the queue-dispatched analogue of the seq-ordered serving cursor exact replay uses for model and tool calls: a task’s effect lands outside the run’s super-step order, so receipts are matched by the idempotency key the effect ran under, not by sequence. A re-driven run (or a replayed activity) asks “did this key already land?” and serves the receipt instead of re-sending the effect.
Malformed receipt payloads (a hand-edited journal) are skipped rather
than fatal — integrity failures of the snapshot itself are caught by
Journal::from_snapshot’s hash check at load time.
Sourcepub fn find_effect_receipt_by_effect_id(
&self,
effect_id: &EffectId,
) -> Option<EffectReceipt>
pub fn find_effect_receipt_by_effect_id( &self, effect_id: &EffectId, ) -> Option<EffectReceipt>
The effect-kernel receipt lookup (R0.7): the journaled
EffectReceipt for a deterministic effect id, when one exists.
Where JournalSnapshot::find_effect_receipt answers “did this key
already land?”, this answers the recovery question the typed kernel
asks: “did this exact effect — this kind, this input, this key, in
this run scope — already commit?” (see
crate::effects::derive_effect_id). Receipts journaled before the
kernel (no effect_id on the wire) simply never match here and keep
being served by the key lookup — the two lookups coexist, the id
lookup strictly sharper.