Expand description
The durable state model (RFC 0025 §3, §5–§7): entity kinds, the
manifest, the write-ahead inbox, timers, the checkpoint policy and the
restore protocol — one façade (Durable) over a crate::store::Store
that the runtime (RFC 0026) is the single writer of.
Every entity is a versioned Envelope under <prefix>/<instance>/<kind>/<id>;
Durable::put allocates the next seq per key and treats a CAS conflict
on a key it already owns as fatal (a second writer). The manifest indexes
the live entities so a store without list can still be restored; it is
flushed debounced (store.checkpoint.debounce_ms) and at drain.
Modules§
- ulid
- A dependency-free ULID (Universally Unique Lexicographically Sortable
Identifier): 48-bit ms timestamp + 80 random bits, Crockford base32, 26
chars, monotonic within one process for the same millisecond. Used for
inbox events, runs, artifacts, audit records — sortable by time in the
store’s
listand stable across restarts.
Structs§
- Durable
- The durability façade: the single writer’s view of the store.
- Entity
Ref - One live entity in the manifest index.
- Inbox
Event - A write-ahead inbox event (RFC 0025 §5).
- Manifest
- The instance manifest (RFC 0025 §3.3
manifest). - Policy
- The checkpoint policy knobs (
store.checkpoint,store.durability,store.on_error). - Restored
- What a restore found (RFC 0025 §6).
- Timer
Record - A durable timer (RFC 0025 §3.3
timer): an absolute deadline + who owns it.
Enums§
- Inbox
Status - Kind
- The entity kinds (RFC 0025 §3.3).
Functions§
- config_
digest - The digest of the settings that shaped the durable state (RFC 0033 §3.3): section name → SHA-256 hex of that section’s canonical JSON.
- fresh_
requested - Whether
--freshwas given. - kill_
point - A test kill point (RFC test strategy §2): with
AGENTD_TEST_KILL_AT=<name>set (debug /internal-mocksbuilds only), the process SIGKILLs itself here — the chaos suite’s way of dying between two durable writes. - record_
config_ digest - Record the digest of the configuration this process runs under, for
Durable::restoreto compare against the manifest’s (RFC 0033 §3.3). First call wins — the configuration is loaded once, before any side effect. - request_
fresh --freshwas given: the nextDurableopened in this process starts a new generation instead of resuming (RFC 0033 §3.2).