haematite 0.7.0

Content-addressed, branchable, actor-native storage engine
Documentation
//! Directory-entry fencing (FENCE-CHAIN r8 R1a): the one fsync primitive every
//! owned directory entry passes through, plus the `cfg(test)` pending-mutation
//! journal the crash battery drives.
//!
//! Production surface is a single function, [`sync_dir_entry`]. Everything else in
//! this module — the journal, the FAILPOINT/LOSSY/OBSERVER hooks, the CUT — is
//! `cfg(test)` machinery and compiles out of release builds entirely. The whole
//! module is native-only (it is never part of the wasm rung's compilation), so the
//! instrumentation is inert on wasm by construction and that rung stays
//! byte-unchanged.

pub mod sync;

#[cfg(test)]
pub mod journal;

#[cfg(test)]
#[path = "wall_tests.rs"]
mod wall_tests;

#[cfg(test)]
#[path = "wall_meta_tests.rs"]
mod wall_meta_tests;

#[cfg(test)]
#[path = "pin_tests.rs"]
mod pin_tests;

#[cfg(test)]
#[path = "retry_tests.rs"]
mod retry_tests;

// The self-re-exec OS-kill crash harness (PinCase/run_pin). `pub(crate)` so
// the vacuum sweep's crash matrix (`db::vacuum::sweep_crash_tests`) drives the
// SAME protocol rather than standing up a second OS-kill coordinator — the
// ruling-3 lineage constraint honoured at the code level where the journal
// visibility boundary (crash_harness.rs header) does not force duplication.
#[cfg(test)]
#[path = "crash_harness.rs"]
pub mod crash_harness;

#[cfg(test)]
#[path = "crash_pin_tests.rs"]
mod crash_pin_tests;

pub use sync::sync_dir_entry;

/// The D0 external-anchor remedy (FENCE-CHAIN r8 D0/D1, R4e).
///
/// Every fence chain terminates somewhere: the engine fences every directory
/// entry it OWNS, but the durability of the directory ABOVE each owned root is an
/// explicit operator precondition. A subsystem asked to create a root whose parent
/// does not exist refuses with `NotFound` PRESERVED and this exact remedy text
/// appended, rather than deep-`create_dir_all`-ing an ancestry it cannot vouch is
/// durably linked.
pub const D0_ANCHOR_REMEDY: &str = "create the parent directory and ensure it is durably linked (fsync it, or use \
     an existing long-lived location)";