Skip to main content

constraint_crdt/
lib.rs

1//! # Constraint-CRDT
2//!
3//! CRDT-backed constraint states for distributed fleet consensus.
4//!
5//! ## Core insight
6//!
7//! CRDTs satisfy three algebraic laws (commutative, associative, idempotent).
8//! Constraint satisfaction requires closure under lattice operations.
9//! These are THE SAME algebraic structure — a semilattice.
10//!
11//! ## Modules
12//!
13//! - `merge` — The semilattice join trait (C/A/I laws)
14//! - `state` — Composite CRDT: all sub-CRDTs in one mergeable unit
15//! - `counter` — G-Counter: distributed satisfaction counting
16//! - `pncounter` — PN-Counter: positive/negative counting
17//! - `orset` — OR-Set: add-wins constraint tracking
18//! - `eisenstein` — Lattice positions as LWW registers (lower norm wins)
19//! - `tile` — PLATO tiles as mergeable CRDTs
20//! - `vclock` — Vector clocks for causal ordering
21//! - `delta` — Delta-state CRDTs (send only changes)
22//! - `merkle` — State hashes for efficient sync detection
23//! - `gossip` — Anti-entropy gossip protocol
24//! - `simulation` — Deterministic network simulation
25//! - `plato` — HTTP client for PLATO server (feature-gated)
26
27pub mod merge;
28pub mod state;
29pub mod counter;
30pub mod pncounter;
31pub mod orset;
32pub mod eisenstein;
33pub mod tile;
34pub mod vclock;
35pub mod delta;
36pub mod merkle;
37pub mod gossip;
38pub mod simulation;
39pub mod bloom;
40pub mod geometric;
41pub mod decay;
42pub mod sketch;
43pub mod ttl_crdt;
44#[cfg(feature = "plato")]
45pub mod plato;
46
47pub use bloom::BloomCRDT;
48pub use geometric::{GeometricNode, GossipExperiment as GeometricExperiment};
49pub use decay::{DecayCounter, DecayConstraintState};
50pub use sketch::SketchCRDT;
51pub use ttl_crdt::{TtlCrdtNode, TtlCrdtConstraint, TtlState, TtlType, EmergenceEvent};
52
53pub use merge::Merge;
54pub use state::ConstraintState;
55pub use counter::ConstraintGCounter;
56pub use pncounter::PNCounter;
57pub use orset::ConstraintORSet;
58pub use eisenstein::EisensteinRegister;
59pub use tile::FleetTile;
60pub use vclock::VectorClock;
61pub use delta::{ConstraintDelta, DeltaTracker};
62pub use merkle::StateHash;
63pub use gossip::{GossipNode, GossipMessage, exchange as gossip_exchange};
64pub use simulation::Simulation;
65#[cfg(feature = "plato")]
66pub use plato::PlatoClient;