pub struct Checkpoint {
pub id: String,
pub thread_id: String,
pub step: usize,
pub state: State,
pub next_nodes: Vec<String>,
pub created_at: DateTime<Utc>,
pub base: Option<String>,
pub header: CheckpointHeader,
pub journal_ref: Option<JournalRef>,
}Expand description
A versioned snapshot of one thread’s state at a super-step boundary.
Fields§
§id: StringUnique checkpoint id (UUID v4; also serves as a fork handle for time travel).
thread_id: StringThe thread (session) this checkpoint belongs to. Threads cannot see each other’s state.
step: usizeZero-based super-step index at whose boundary this snapshot was taken.
state: StateThe full channel state at the boundary.
In a delta checkpoint (Checkpoint::base set — a storage
detail only opting-in backends produce and no read method ever
returns) this holds just the channels whose values changed since the
base, as full per-channel values. Channels are never deleted from a
state, so overlaying the delta onto the materialized base restores
the full state (fold_delta).
next_nodes: Vec<String>The node set scheduled to run in the next super-step. Restored on resume so execution continues exactly where it suspended.
created_at: DateTime<Utc>Wall-clock creation time (UTC).
base: Option<String>The checkpoint this one diffs against (R0.7 wave 4 delta
checkpoints). None is a full snapshot — every checkpoint written
before W4, and every checkpoint a read method returns: folding is
checkpointer-internal, so base is only ever observed inside a
backend’s storage (checkpoint files, database rows). Additive:
absent from the wire when unset, so pre-W4 checkpoints deserialize
unchanged.
header: CheckpointHeaderFlight Recorder provenance (R0.5): checkpoint format version, graph
version/content hash, active policy version, and the run’s logical
clock value at creation. See CheckpointHeader for the semantics.
#[serde(default)] keeps checkpoints written before R0.5 (which have
no header field) deserializable: they load with
CheckpointHeader::default — current format version, unversioned
graph, static policy.
journal_ref: Option<JournalRef>The journal head at this boundary (None pre-R0.5), binding this
state snapshot to the run evidence that produced it.
Implementations§
Source§impl Checkpoint
impl Checkpoint
Sourcepub fn new(
thread_id: impl Into<String>,
step: usize,
state: State,
next_nodes: Vec<String>,
) -> Self
pub fn new( thread_id: impl Into<String>, step: usize, state: State, next_nodes: Vec<String>, ) -> Self
A new checkpoint with a fresh UUID v4 id and current timestamp.
Convenience constructor used by tests and pre-R0.5 call paths: the
header falls back to CheckpointHeader::default and no journal
reference is stamped. The executor mints checkpoints field-by-field
instead, sourcing id/timestamp from the run’s determinism seams and
stamping the real header and journal head.
Trait Implementations§
Source§impl Clone for Checkpoint
impl Clone for Checkpoint
Source§fn clone(&self) -> Checkpoint
fn clone(&self) -> Checkpoint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more