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
//! # mdcs-compaction
//!
//! Compaction and stability subsystem for the MDCS (Merkle-Delta CRDT Store).
//!
//! This crate provides:
//! - Snapshotting: Serialize full CRDT state at stable frontiers
//! - DAG pruning: Remove nodes older than the last snapshot
//! - Stability monitoring: Track delivered and stable frontiers
//! - Version vectors: Compact representation of causal context
//!
//! ## Architecture
//!
//! The compaction subsystem ensures bounded metadata growth by:
//! 1. Tracking which updates have been durably replicated (stability)
//! 2. Creating periodic snapshots at stable points
//! 3. Pruning DAG history before the snapshot root
//! 4. Preventing resurrection of deleted items
//!
//! ## Example
//!
//! ```rust,ignore
//! use mdcs_compaction::{StabilityMonitor, SnapshotManager, PruningPolicy};
//!
//! // Create a stability monitor
//! let mut monitor = StabilityMonitor::new("replica_1");
//!
//! // Track frontier updates from peers
//! monitor.update_peer_frontier("replica_2", frontier_2);
//! monitor.update_peer_frontier("replica_3", frontier_3);
//!
//! // Check if a node is stable (delivered to all tracked peers)
//! if monitor.is_stable(&node_cid) {
//! // Safe to compact
//! }
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;