Skip to main content

Crate hearth_store

Crate hearth_store 

Source
Expand description

hearth-store — the NEDB spine.

Every residency transition is a bi-temporal, causally-linked, tamper-evident event in an embedded NEDB database. This is not a log bolted onto the side of the supervisor: it IS the supervisor’s state.

Three properties no other serving stack has, inherited for free:

  • state_as_of(model, seq) — what was resident then, not now.
  • why(model) — a causal chain from the current state back through every transition that produced it, not a guess from grep.
  • verify() — cryptographic proof the history wasn’t rewritten.

Layout: one versioned document per model in the residency collection (id = model name). Each transition is a new version of that document, with caused_by linking to the event that produced it — a load links to the pull that fetched the bytes, a loss links to the load it undid. NEDB’s version chain gives history; its DAG gives causality; its Merkle head gives tamper-evidence.

Structs§

Event
One event read back out of the spine.
EventRef
A recorded event: the node hash (for causal linking) and its seq (for AS OF reads). Everything a caller needs to chain the next event.
Spine
The spine itself: an embedded NEDB database.

Enums§

Transition
What kind of transition is being recorded.