Expand description
Juncture checkpoint persistence
This crate provides checkpoint persistence for Juncture state machine executions. It enables time-travel debugging, crash recovery, and human-in-the-loop workflows.
§Overview
Checkpoint persistence captures the complete state of graph execution at specific points, allowing execution to be paused, resumed, or rolled back to any previous state.
§Core Components
juncture_core::checkpoint::CheckpointSaver: Trait defining checkpoint storage operationsMemorySaver: In-memory implementation for development/testingjuncture_core::checkpoint::Checkpoint: Complete execution state snapshotjuncture_core::checkpoint::CheckpointMetadata: Execution context and provenance
§Example
ⓘ
use juncture_checkpoint::MemorySaver;
use juncture_core::{RunnableConfig, checkpoint::CheckpointSaver};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let saver = MemorySaver::new();
let config = RunnableConfig::default().with_thread_id("my-thread");
// Save a checkpoint
let checkpoint = /* create checkpoint */;
let metadata = /* create metadata */;
let updated_config = saver.put(&config, checkpoint, metadata).await?;
// Retrieve latest checkpoint
let tuple = saver.get_tuple(&updated_config).await?.unwrap();
Ok(())
}Re-exports§
pub use cache::BaseCache;pub use cache::MemoryCache;pub use error::CheckpointError;pub use memory::MemorySaver;pub use serde::CheckpointSerializer;pub use serde::JsonPlusSerializer;pub use serde::JsonSerializer;pub use serde::MsgpackSerializer;pub use serde::SerializationFormat;pub use serde::SerializerKind;pub use serde::deserialize_auto;pub use serde::detect_format;pub use types::*;
Modules§
- cache
- Caching layer for checkpoint storage
- error
- Checkpoint error types
- memory
- In-memory checkpoint storage
- serde
- Checkpoint serialization
- types
- Checkpoint data structures
Traits§
- Checkpoint
Saver - Checkpoint persistence interface