1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! Runtime library for code generated from Event Tree Definition Language
//! (ETDL) documents — the reliability-aware, event-driven DSL based on
//! [IEC 62502](https://github.com/usamassem/etdl-specification) event tree and
//! [IEC 61025](https://github.com/usamassem/etdl-specification) fault tree analysis.
//!
//! Generated handlers use these components to record branches and failures
//! against build-time-resolved probabilities, enforce declared retry policies,
//! detect SLA anomalies, and inject chaos in controlled environments.
//!
//! # Components
//!
//! - [`BranchMonitor`] — records taken branches and failures per node with their
//! declared probabilities
//! - [`RetryPolicy`] / [`BackoffStrategy`] — async retry with exponential or fixed
//! backoff and a total time budget
//! - [`SlaTracker`] — rolling-window anomaly detection
//! (`ETDL_SLA_WINDOW`, `ETDL_SLA_THRESHOLD`)
//! - [`ChaosController`] — seeded, node-scoped failure injection, guarded off in
//! production via `ETDL_ENV`
//! - [`inject_traceparent`] — W3C trace context propagation
//!
//! # Example
//!
//! ```
//! use etdl_core::{BranchMonitor, BackoffStrategy, RetryPolicy};
//! use std::time::Duration;
//!
//! let mut monitor = BranchMonitor::new("InventoryCheckBarrier");
//! monitor.record_branch("SUCCESS", 0.95);
//!
//! let retry = RetryPolicy {
//! max_attempts: 3,
//! backoff_ms: 250,
//! strategy: BackoffStrategy::Exponential,
//! };
//! ```
pub use ChaosController;
pub use BranchMonitor;
pub use ;
pub use ;
pub use SlaTracker;
pub use ;
/// Re-export so generated code can call `etdl_core::serde_json::to_value(...)`
/// without the consuming crate declaring `serde_json` directly.
pub use serde_json;