cml/lib.rs
1//! `cml` — CML, the single-algorithm canonical append log over the [`spine`].
2//!
3//! CML (Canonical Merkle Log) is the **single-algorithm** append-only engine
4//! layered over the structural Merkle Spine. It owns one algorithm's frontier
5//! carry (the base-k reduction [`schedule`]), the member-root fold, the
6//! append-only [`consistency::ConsistencyProof`], inclusion
7//! and leaf proof generation, and the structural snapshot facet — the frontier
8//! peaks a [`spine::Seal`] freezes.
9//!
10//! It is **epoch-free and multi-algorithm-free** (D7): the engine reads one
11//! algorithm's view ([`AlgView`]) over a borrowed [`NodeReader`] substrate and
12//! never owns the store, so the `polydigest` combinator can drive **N** views over
13//! **one** shared data substrate without duplicating leaf data (D14). The
14//! activation timeline, the null-run-extents, the binding root, and coupling are
15//! the combinator's facet, not CML's.
16//!
17//! The structural commitment a CML seal produces is the general [`spine::Seal`]
18//! (re-exported here); the epoch facet over it is `polydigest::BoundSnapshot`.
19
20pub mod consistency;
21pub mod engine;
22pub mod mountain;
23pub mod schedule;
24
25pub mod error;
26
27// The append-only proof surface: CML's consistency proof plus the spine's
28// inclusion/leaf surface re-exported through `cml::proof::*`.
29pub mod proof {
30 pub use crate::consistency::{
31 ConsistencyProof, InclusionProof, ProofStep, constant_time_eq,
32 reconstruct_consistency_roots, reconstruct_inclusion_root, verify_consistency,
33 verify_inclusion, verify_inclusion_path_structure,
34 };
35}
36
37pub use consistency::{ConsistencyProof, reconstruct_consistency_roots, verify_consistency};
38pub use engine::{
39 AlgView, LogKind, NodeReader, carry, compute_root, consistency_proof, frontier_peaks,
40 get_node_hash, inclusion_proof, leaf_proof, peak_at, reconstruct_subtree_root,
41 reconstruct_view, root_for_at, validate_epochs,
42};
43pub use error::{Error, Result};
44pub use schedule::reduction_count;
45// The spine surface a CML consumer needs directly.
46pub use spine::{Hasher, Subtree, evaluate, frontier_for_size, nary_mr, null_digest};
47// The structural snapshot facet a CML seal freezes is the general spine Seal;
48// re-exported so a CML consumer reaches it through `cml::*`.
49pub use spine::{RunExtent, Seal};