tree: 3ed18880b295f0bbbf70dafeb0b8de991bf4b014 [search]
  1. migrations/
  2. src/
  3. tests/
  4. build.rs
  5. Cargo.toml
  6. README.md
  7. README.zh-CN.md
platform/event-log/README.md

maka-event-log

简体中文

maka-event-log owns durable State Root storage: the exclusive OS process lock (RootOwner), the SQLite database (RootStore), two-phase Host operation journals, and immutable checkpoint publication. Higher-level Agent facts and projections register migrations on top of RootStore from maka-agent-state.

Key modules

  • root.rs & root_store.rs — Acquire the exclusive State Root lock and coordinate graceful shutdown with admitted in-flight operations.
  • connection.rs & writeback.rs — Run a single serialized SQLite writer FIFO alongside concurrent snapshot reader threads, publishing scoped invalidation signals only after commits succeed.
  • root_store/data.rs — Root- and Session-scoped SQL statements that let native services commit domain state atomically alongside a Host operation receipt.
  • applications.rs — Persistence for deployment sources, caller intent records, and provider operation receipts (Outcome + physical Cleanup).
  • checkpoints/ — Content-addressed workspace & history checkpoint publication, CAS Head updates, and crash-safe restore settlement.
  • schema.rs & migration.rs — Base Root schema and composed domain migration verification.

Checkpoint repositories

checkpoints::repository decouples immutable blob storage from logical Session bindings and CAS Head commits:

  • Default local authority (RootStore::open) — Stores checkpoint Heads in the Root SQLite database and promotes verified staging files directly via zero-copy local links after fsync.
  • External repository authority (RootStore::open_with_checkpoint_storage) — Accepts a pluggable Storage pair. FileRepository::open provides a multi-process local-filesystem reference adapter arbitrated by its own SQLite database outside worker Roots.

Exact checkout (Storage::checkout_exact) verifies all object digests and workspace closure against the persisted logical Session binding before returning the current Head, without granting execution authority.

Testing

cargo nextest run -p maka-event-log