Skip to main content

Module store

Module store 

Source
Expand description

The single-writer SQLite store: RunLog append path, same-transaction checkpoint materialization, and the content-addressed evidence area.

§Durability & consistency rules (07 §3.3, verbatim discipline)

  1. actionIntent WAL: Store::write_action_intent appends in its own transaction; under journal_mode=WAL + synchronous=FULL a returned commit is the fsync — callers MUST call it (and see it return) before provider.execute dispatch.
  2. Same-transaction materialization: Store::append_event updates the checkpoint row in the same transaction as the run_log insert; a read checkpoint is always consistent with an exact log_seq.
  3. file-before-row-before-log: Store::put_evidence writes and fsyncs the evidence bytes before inserting the evidence row; the RunLog event referencing the evidence is appended by the caller afterwards. A crash leaves at most an orphan file (GC-able), never a log that references missing evidence.
  4. Append-only: there is no API that UPDATEs or DELETEs run_log rows — the guarantee is structural, not procedural.

§Single writer

Store owns its rusqlite::Connection (which is !Sync); exactly one Store instance must perform writes for a given store directory. WAL mode lets concurrently opened read-only inspectors (e.g. pointlock inspect) read without blocking the writer.

Structs§

EvidenceMeta
One resolved evidence entry (Store::evidence_meta).
EvidencePut
Result of Store::put_evidence.
IntentDispatch
The dispatch identity of an actionIntent (2026-07-18 incorporation, item ②): 1-based chain position plus the bound attempt’s channel and native action name, verbatim.
NewRun
Parameters of Store::begin_run. The runStarted event is not written here — the caller appends it (07 §3.1: the log is the truth; begin_run only creates the run row the fold takes as RunMeta).
RunListEntry
One row of Store::list_runs — the run-index projection source.
Store
The single-writer store handle (see the module docs for the durability rules and the single-writer discipline).