solti_chain/lib.rs
1//! Conditional composite workload runner for Solti Tasks.
2//!
3//! A chain selects exactly one current step.
4//! Each step can choose one next step after success and one after failure.
5//! [`ChainSpec::validate`] requires every declared step to be reachable from `entry` and rejects cycles.
6//! The model is an outcome-directed acyclic chain rather than a parallel DAG scheduler.
7//!
8//! The chain is carried through [`solti_model::TaskWorkload::Extension`] with [`CHAIN_API_VERSION`] and [`CHAIN_KIND`].
9//! [`ChainRunner`] builds every nested workload through a snapshotted [`solti_runner::RunnerCatalog`] and returns one outer [`taskvisor::TaskRef`].
10//!
11//! Taskvisor therefore applies timeout, restart, backoff, admission, cancellation, status, and history to the whole chain attempt.
12//!
13//! Register leaf runners first, snapshot them into the chain runner, and then register the chain runner.
14//! [`register_chain_runner`] performs the last two operations for the common case.
15
16#![forbid(unsafe_code)]
17#![warn(missing_docs)]
18
19/// Compiles the runnable Rust code blocks in `README.md` as doctests.
20#[cfg(doctest)]
21#[doc = include_str!("../README.md")]
22struct ReadmeDoctests;
23
24mod error;
25pub use error::{ChainError, ChainResult};
26
27mod model;
28pub use model::{
29 CHAIN_API_VERSION, CHAIN_KIND, ChainSpec, ChainStep, FailureMode, FailureTransition,
30 is_chain_workload,
31};
32
33mod output;
34
35mod runner;
36pub use runner::{ChainRunner, register_chain_runner};
37
38#[cfg(feature = "schema")]
39mod schema;