pub struct AppTruth { /* private fields */ }Expand description
The process’s current-truth recorder: every lifecycle transition and announced fact since boot, retained for the life of the process (no cap — see the module docs for the bound this deliberately is NOT).
Implementations§
Source§impl AppTruth
impl AppTruth
Sourcepub fn empty() -> Arc<Self>
pub fn empty() -> Arc<Self>
An empty truth with no attached recorder thread. Used internally by
Self::spawn and, publicly, by fixtures/tests that construct a
crate::server::ShellConfig/crate::server::ShellServer without
a live component registry to record from (pure HTTP-serving tests).
Sourcepub fn spawn(
registry: &ComponentRegistry,
expected: HashSet<ComponentId>,
) -> Result<(Arc<Self>, JoinHandle<()>), HostError>
pub fn spawn( registry: &ComponentRegistry, expected: HashSet<ComponentId>, ) -> Result<(Arc<Self>, JoinHandle<()>), HostError>
Spawns the dedicated recorder thread on its OWN lifecycle
subscription, taken here — BEFORE component install, the same
convention the console logger and the announcer both follow — so the
boot transitions (Registered → Starting → Running) are never missed.
Recording runs independent of whether [frame].channel/the announcer
exists: this is host-local truth served over plain HTTP, not a bus
publish.
The recorder thread’s exit condition mirrors the console logger’s
exactly: it exits once it has observed the Removed transition of
every component in expected (published by ordered shutdown), or on
stream closure.
§Errors
Returns a typed failure for a poisoned subscribe or a thread spawn refusal.
Sourcepub fn record_fact(&self, body: Value)
pub fn record_fact(&self, body: Value)
Records one accepted application fact. Called by
crate::announcer::Announcer::announce_fact the moment a fact is
accepted — before the pump goes live.
Sourcepub fn snapshot(&self) -> AppTruthSnapshot
pub fn snapshot(&self) -> AppTruthSnapshot
Assembles the current snapshot: every transition and fact recorded so far, in order, plus each component’s latest observed state.