minerva 0.2.0

Causal ordering for distributed systems
docs.rs failed to build minerva-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: minerva-0.1.0

Minerva

Minerva is a no_std-first Rust library for causal ordering in distributed systems.

  • kairos provides a lock-free Hybrid Logical Clock. Each 128-bit stamp packs physical time, logical time, a caller-defined kairotic tag, and station identity.
  • metis provides causal delivery, exact dot sets, stability tracking, causal stores, sequence CRDTs, and recorded membership.
  • chronos provides OS-backed time sources with the optional std feature.

Minerva separates mechanism from policy. The crate validates structure, preserves causal invariants, returns typed refusals, and offers explicit resource bounds. Callers own trust, retry, conflict resolution, reclamation, and membership policy.

The crate uses only safe Rust and has #![forbid(unsafe_code)]. Property tests, fuzz targets, Kani models, Creusot proofs, Miri runs, and mutation tests cover the applicable invariants. See What is proven for the exact scope and limits.

Example

Two replicas write one sequence and converge:

use minerva::kairos::{Clock, TickCounter};
use minerva::metis::{Anchor, Composer, DotSet, Locus, Rhapsody};

let clock = Clock::with_default_config(TickCounter::new(), 1).unwrap();
let mut ada = Composer::<Rhapsody>::new(1);
let mut bea = Composer::<Rhapsody>::new(2);

// Ada writes one element. The write mints a dot: the element's identity.
let rank = clock.now(0u16);
let (_dot, _delta) = ada.compose(|assigned| {
    let mut rhapsody = Rhapsody::new();
    assert!(rhapsody.weave(assigned, Locus { anchor: Anchor::Origin, rank }));
    (rhapsody, DotSet::new())
});

// Bea absorbs what Ada owes her. Both replicas read the same order.
let owed = ada.owed_to(bea.state().context());
let _ = bea.absorb(1, &owed);
assert_eq!(ada.state().store().order(), bea.state().store().order());

Day one extends this example to a full replicated document with concurrent edits, removal, and witnessed garbage collection.

Status

The public API is not stable. Version 2 membership frames remain dormant until a joint registry decision activates them. Version 1 wire bytes remain unchanged. See CHANGELOG.md for release notes and migration rows.

Features

Feature Effect
rand (default) Adds entropy to contention backoff. Pulls in std; disable default features for bare targets.
std Enables the chronos OS time sources.
instrumentation Exposes bounded structural measurements.
timing Adds wall-time measurements and enables instrumentation and std.

The core requires alloc. For bare targets use minerva = { version = "0.2", default-features = false }.

Documentation

API documentation: docs.rs/minerva.

Start with Day one and the consumer guide. The documentation guide maps the architecture, PRDs, module notes, and glossary.

License

Minerva is available under the Apache License 2.0 or the MIT License.