Expand description
Journal records and the ledger they build (§12, §12c).
The ledger is the live state the journal establishes. A checkpoint is the serialized ledger, so replaying (checkpoint + tail) and replaying the full history produce equal ledgers by construction.
validate runs before a record is written (write-ahead) and again on
replay. It enforces I6, I15 and the recovery interlock at the journal
itself, so no caller can journal a step that breaks them.
Verified with Verus (docs/verification.md): validate accepts a record
only when rules hold, and apply preserves inv (I6 among the live
transactions, unique ids, leases naming their transaction). Bookkeeping no
invariant reads (the terminal archive, overrides, incidents, tokens) is
done by small unverified helpers that cannot reach the verified fields.
Structs§
- Entry
- IdMap
- A map from transaction id, stored as a vector sorted by id; vstd
specifies
BTreeMaponly for keys with an ordering spec, whichTxnIdlacks. Serialized as the JSON object theBTreeMapwas. - Interlock
Entry - An unresolved RecoveryFailed (§12c). While any exists, autonomous mutation is blocked.
- Ledger
- LiveTxn
- OpRecord
- Reconciliation
- What a restarted owner found and did (§12 daemon restart reconciliation).
- Terminal
Txn - What remains of a terminal transaction: enough to refuse stale epochs and
to show the outcome. Bounded to the most recent
TERMINAL_KEEP.
Enums§
- HoldBy
- Who applied a hold: systemd’s
OnFailure=(seen by the daemon) or the daemon itself, for a stop outside Planarian that is not attributed. - Ledger
Error - Record
Constants§
Functions§
- archive 🔒
- compatible_
exec 🔒 - find 🔒
- flying_
exec 🔒 - is_
autonomous 🔒 - lift_
override 🔒 - note_
why 🔒 - op_eq 🔒
- push_
tag 🔒 - put 🔒
- Insert or replace, keeping the entries sorted by id.
- record_
incident 🔒 - recovery_
eq 🔒 - set_
override 🔒 - stale 🔒
- tag_
string 🔒 - use_
token 🔒