Expand description
Durable workloop records and persistence contract. Durable workloop records and persistence contract (workloop brief Leg 2).
Two record families:
WorkloopRecord— one per registered loop: the declared [WorkloopSpec], the engine’s cadence bookkeeping (window sequence, next window, next check), and per-invariant health accounting. A sleeping loop IS this record plus its event history — no resident process, no scheduler presence (R13.3). The cadence sweeper drives itself offWorkloopStore::due_workloops.InvariantStateRecord— the current-state record of one invariant (R7): a store document of its declared type, type-erased here as aPayloadplus the declared type name. Exactly one CURRENT record per invariant survives indefinitely; prior generations are retention-bounded on the loop’s declared window (R8.1) and live in the same single-key slot so every mutation is one atomic value swap on any backend.
Structs§
- Invariant
Health State - Per-invariant health accounting the engine persists between sweeps.
- Invariant
Record Slot - The single-key slot holding one invariant’s CURRENT record plus its retention-bounded prior generations (oldest first).
- Invariant
State Record - The current-state record of one invariant (R7): a store document of the invariant’s declared type, type-erased as payload bytes + type name.
- Undecodable
Workloop - A workloop row that was present but could not be decoded.
- Workloop
DueProbe - The one field the due sweep filters on, decodable WITHOUT validating the whole record: a thousand sleeping loops must cost the sweeper a comparison each, not a full spec re-validation each (the R13.3 measurement is what caught the difference — ~20µs per full decode versus nanoseconds per comparison).
- Workloop
Listing - Complete workloop listing, including poisoned-row visibility.
- Workloop
Record - One durable workloop registration: the declared spec plus the engine’s cadence and health bookkeeping.
Traits§
- Workloop
Store - Durable workloop persistence contract.