weavegraph 0.7.0

Graph-driven, concurrent agent workflow framework with versioned state, deterministic barrier merges, and rich diagnostics.
Documentation
//! Session state types for workflow execution.
use crate::schedulers::{Scheduler, SchedulerState};
use crate::state::VersionedState;
use crate::types::NodeKind;

/// Persistent state for a single workflow execution session.
///
/// Carries everything needed to resume execution from a checkpoint:
/// versioned channel state, current step, the active node frontier, and
/// scheduler bookkeeping.
#[derive(Debug, Clone)]
pub struct SessionState {
    /// Versioned channel state (messages, extras).
    pub state: VersionedState,
    /// Step counter at which this snapshot was taken.
    pub step: u64,
    /// Nodes scheduled for the next execution round.
    pub frontier: Vec<NodeKind>,
    /// Scheduler instance managing concurrency limits.
    pub scheduler: Scheduler,
    /// Mutable bookkeeping owned by the scheduler between steps.
    pub scheduler_state: SchedulerState,
}

/// Whether a session was started fresh or resumed from a checkpoint.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SessionInit {
    /// No prior checkpoint exists; execution starts from step 0.
    Fresh,
    /// A checkpoint was found and loaded at this step.
    Resumed {
        /// Step number recorded in the loaded checkpoint.
        checkpoint_step: u64,
    },
}

/// Channel version snapshot used to detect state changes between steps.
#[derive(Debug, Clone)]
pub struct StateVersions {
    /// Current version of the messages channel.
    pub messages_version: u32,
    /// Current version of the extras channel.
    pub extra_version: u32,
}