Expand description
On-disk JSON persistence + boot reconciliation for workstream records (DOC-48 §3).
Why: the daemon must survive restarts without losing track of which
workstreams it owns, or silently changing which one is active
(§3.2: “A daemon restart never silently changes which workstream is
active”). A single flat JSON file with an atomic temp+rename write gives
crash-safe persistence without a database dependency — mirroring
trusty_mpm::session_manager::store::SessionStore’s proven pattern
(fingerprint-gated reload, atomic write, structured errors), adapted to
this spec’s flat-array-plus-pointer shape (§3.1) instead of a keyed map.
What: StoreError (structured failure surface), ReconcileOutcome
(what boot reconciliation did), and WorkstreamStore — load/save,
create/get/list, the low-level set_active persistence primitive (NOT
the future workstream.activate RPC verb — see its docs), and
WorkstreamStore::reconcile_on_boot (§3.3: non-destructive, restores
the active pointer or clears it if the target vanished).
Test: store_tests.
Structs§
- Reconcile
Outcome - What a boot-time reconciliation pass (§3.3) observed and did.
- Workstream
Store - Async, file-backed store for
Workstreamrecords (DOC-48 §3).
Enums§
- Bind
Error - Typed failure surface for
WorkstreamStore::bind_session(issue #3298). - Store
Error - Errors that can arise from store I/O or serialization.
Constants§
- STORE_
VERSION - The
versionfield stamped into every store file (§3.1).