ucm-events
Append-only event store and graph projection for the Unified Context Management (UCM) engine.
ucm-events is the source of truth for every context mutation. Following the
Datomic "database as a value" model, facts are only
ever appended — never updated in place. The graph is always rebuildable by
replaying the event log, which makes the whole system auditable and time-travelable.
What it does
EventStore— an append-only log with id and stream indexing, checkpointing (events_since_checkpoint/advance_checkpoint), time-boundedreplay, andcausation_chaintraversal so you can reconstruct why a fact exists.GraphProjection— deterministic, idempotent fold from&[UcmEvent]to aUcmGraph. Replay the whole log (replay_all) or apply incrementally (apply_event/apply_batch).
Quick example
use ;
// `events` is a Vec<UcmEvent> produced by ucm-ingest adapters.
let mut store = new;
store.append_batch;
// Materialize the current graph by folding the entire log.
let graph = replay_all;
println!;
Where it fits
ucm-ingest adapters emit UcmEvents → ucm-events persists and projects them
into a UcmGraph (defined in ucm-graph-core) → ucm-reason
analyzes the materialized graph. Because state is fully replayable, ucm-observe
can re-run any past analysis and verify it is deterministic.
Research foundations
- Event sourcing — Martin Fowler, Event Sourcing.
- Database as a value — Datomic immutable, append-only architecture.
The in-memory store has the same API surface as a durable backend would; for production, swap the storage for RocksDB with a column family per stream.
License
MIT — see LICENSE.