mocra_dag/lib.rs
1//! mocra-dag: a general-purpose distributed DAG execution engine (extracted from the main mocra
2//! crate, with **zero crawler coupling**).
3//!
4//! - [`Dag`] / [`DagChainBuilder`]: graph construction (nodes + dependency edges, topological
5//! validation, cycle detection).
6//! - [`DagScheduler`]: layered concurrent execution, retry policies, and a distributed run guard
7//! protected by fencing.
8//! - Node dispatch is injected through the [`DagNodeDispatcher`] abstraction (with a built-in
9//! [`LocalNodeDispatcher`]; the host can supply its own).
10//! - Runtime dependencies are injected through traits ([`DagStore`] / [`DagEventSink`] /
11//! [`DagFencingStore`]); the host implements them with the embedded cluster KV / distributed
12//! pub-sub, so this crate does not depend back on the host.
13
14// Existing style carried over from the main crate: the emit_sync_state telemetry function takes
15// many arguments (one per state field), and graph has an empty-list guard — the original logic is
16// kept (covered by 54 tests), so these two pedantic lints are waived.
17#![allow(clippy::too_many_arguments, clippy::redundant_guards)]
18
19mod graph;
20mod metrics;
21mod scheduler;
22pub mod store;
23pub mod types;
24
25pub use graph::{Dag, DagChainBuilder, DagNodePtr};
26pub use scheduler::{DagExecutionReport, DagScheduler, DagSchedulerOptions, NodeExecutionResult};
27pub use store::{DagEventSink, DagStore};
28pub use types::{
29 DagError, DagErrorClass, DagErrorCode, DagFencingStore, DagNodeDispatcher,
30 DagNodeExecutionPolicy, DagNodeRecord, DagNodeRetryMode, DagNodeStatus, DagNodeSyncState,
31 DagNodeTrait, DagRunGuard, DagRunGuardAcquireOutcome, DagRunResumeState, DagRunStateStore,
32 LocalNodeDispatcher, NodeExecutionContext, NodePlacement, TaskPayload,
33};