af-workflow 0.4.0

Spec-driven workflow chassis: typed node expressions composed into a branched DAG. Port of agent_core/workflow.
Documentation
//! `af-workflow` — spec-driven workflow chassis.
//!
//! A workflow is typed node expressions composed into a branched DAG. Port of
//! `agent_core/workflow`.
//!
//! - **Spec model** ([`Spec`], [`Branch`], [`Node`], [`Edge`]) — deserializes
//!   existing Python builtin JSON specs unchanged.
//! - **Runtime** — [`Event`] / [`StepResult`] / [`WorkflowContext`] / [`State`]
//!   and the [`StepNode`] trait (one event in, one result out).
//! - **Registry** ([`NodeRegistry`]) — maps node types to factories. Ships the
//!   generic node types via [`NodeRegistry::with_builtins`]; products register
//!   their own business types and side-effect guards.
//! - **Durable host** ([`WorkflowHost`]) — validates and compiles a branch DAG;
//!   claimed work is scheduled only by [`run_due_pass`].

#![deny(missing_docs)]
#![deny(rustdoc::broken_intra_doc_links)]

pub mod builtins;
pub mod contract;
pub mod event;
mod executor;
pub mod graph;
pub mod host;
pub mod ingress;
pub mod metrics;
pub mod node;
pub mod provider;
pub mod recorder;
pub mod registry;
pub mod result;
pub mod spec;
pub mod spec_driver;
pub mod state;
pub mod supervisor;
pub mod template;
pub mod validator;

pub use contract::*;
pub use event::Event;
pub use executor::{CompileError, RunOutcome, Terminal};
pub use graph::{
    primitive_kind, render_graph, render_graph_json, GraphEdge, GraphNode, WorkflowGraph,
};
pub use host::{HostError, WorkflowHost, ROOT_BRANCH};
pub use ingress::{
    ingress_plans, next_cron_at, next_scheduled_at, schedule_decision, BranchIngressPlan,
    ScheduleDecision,
};
pub use metrics::{Readiness, RuntimeMetrics};
pub use node::{StepNode, WorkflowContext};
pub use provider::{ProviderBlock, ProviderGate, ProviderLimits, ProviderPermit, WorkPriority};
pub use recorder::{noop_recorder, NoopRecorder, RunHandle, RunRecorder, RunStatus, StepStatus};
pub use registry::{FieldSpec, FieldType, NodeError, NodeRegistry, NodeSchema, StepFactory};
/// Registrar a product fills in `Product::register_workflow`.
pub type WorkflowRegistrar = NodeRegistry;
pub use result::{PreparedAction, StepResult};
pub use spec::{Branch, Edge, Node, Spec, SpecError};
pub use spec_driver::SpecDriver;
pub use state::{MemoryState, NamespacedState, State};
pub use supervisor::{
    run_due_pass, DriverRegistry, EvaluationOutcome, MemoryWorkQueue, SupervisorError,
    SupervisorSettings, SupervisorStats, Wakeup, WorkDisposition, WorkItem, WorkQueue,
    WorkflowDriver, WorkflowTransitionCommand,
};
pub use template::{resolve_config, TemplateError};
pub use validator::{validate, Violation};