Skip to main content

entrenar/integrity/lineage/
mod.rs

1//! Lamport Timestamps and Causal Lineage (ENT-014)
2//!
3//! Provides logical clocks for tracking causal ordering of events
4//! across distributed training runs without requiring synchronized wall clocks.
5//!
6//! # Example
7//!
8//! ```
9//! use entrenar::integrity::{LamportTimestamp, LineageEventType, CausalLineage};
10//!
11//! let mut ts1 = LamportTimestamp::new("node-1");
12//! let mut ts2 = LamportTimestamp::new("node-2");
13//!
14//! // Local events increment counter
15//! ts1.increment();
16//! ts1.increment();
17//!
18//! // Receiving a message merges timestamps
19//! ts2.merge(&ts1);
20//!
21//! // Check causal ordering
22//! assert!(ts1.happens_before(&ts2));
23//! ```
24
25mod causal;
26mod event;
27mod timestamp;
28
29#[cfg(test)]
30mod tests;
31
32// Re-export all public types
33pub use causal::CausalLineage;
34pub use event::{LineageEvent, LineageEventType};
35pub use timestamp::LamportTimestamp;