registry_backend
registry_backend
¶
A StateBackend backed by the daemon registry DB (#111).
Lets offline readers (CLI commands when the conductor is down) get the current
job state from the authoritative daemon DB (~/.marianne/daemon-state.db)
instead of the stale, possibly-lossy per-workspace state files. The daemon DB is
the source of truth; this adapter exposes it through the standard
StateBackend interface so existing offline-read callers (which expect a
(CheckpointState, StateBackend) pair) work unchanged.
Lives in daemon/ (not state/) because it bridges state.StateBackend
onto daemon.JobRegistry — state/ must not import daemon/.
Attributes¶
Classes¶
RegistryStateBackend
¶
Bases: StateBackend
Expose the daemon registry's checkpoint store as a StateBackend.
Wraps an already-open JobRegistry; close() closes it, matching the
"caller closes the returned backend" contract of the offline-read helpers.
Source code in src/marianne/daemon/registry_backend.py
RegistryFirstReadBackend
¶
Bases: StateBackend
Read job state from the authoritative daemon DB — conductor-ONLY (#50).
For read-only consumers (the MCP server, the dashboard's offline
fallback). #111 gave this class a per-workspace fallback; #50 removed
it per the composer's ruling ("workspaces are for work to occur only,
not for state tracking") — load() reads the daemon registry and
NOTHING else. The registry is opened transiently per load (no
long-lived handle to leak). A job absent from the registry does not
exist as far as state is concerned.
The workspace constructor parameter is retained for call-signature
stability but no longer consulted. Write/list operations raise — these
consumers only ever read, and state writes belong to the conductor.