Skip to main content

Module zone_txn

Module zone_txn 

Source
Expand description

Read-modify-write of small files in one zone, as one transaction across processes (SPEC_MEMORY_FOLLOWS_THE_AGENT_2026_09_24.md §2.1.1).

The global transcript store is one database file that every srv instance on the machine opens. A caller that reads a file, decides, and writes it back (the memory record’s heads.json next to its log.jsonl) must do all of that inside one BEGIN IMMEDIATE transaction, or two processes both read the same state and one’s write is lost. Reads here are sized from the database row, never this process’s cache, which another process’s write leaves stale; the touched files are dropped from the cache after the commit.

Structs§

ZoneTxn
One zone, inside one write transaction. See FileStore::zone_txn.

Functions§

read_in 🔒
A file’s whole content, sized from its row in tx.