1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! State snapshots for checkpoint inspection and time travel.
//!
//! A `StateSnapshot` captures the full state of a graph execution at a
//! specific superstep, along with metadata for resumption and debugging.
use State;
use SystemTime;
/// Complete snapshot of graph execution state at a point in time.
///
/// Used for:
/// - Human-in-the-loop: show state to human before they decide to resume
/// - Time travel: inspect or resume from any past checkpoint
/// - Debugging: see what the state looked like at each superstep
///
/// # Example
///
/// ```ignore
/// let snapshot = graph.get_state("thread-1").await?;
/// if let Some(snap) = snapshot {
/// println!("Step {}: next nodes = {:?}", snap.step, snap.next_nodes);
/// }
/// ```
/// NOTE: `#[non_exhaustive]` — will grow with metadata, branch info, etc.