Expand description
dash — a read-only observability snapshot across every wire identity on this machine.
collect() walks the local session store (via crate::session::list_sessions)
and enriches each session with its daemon liveness, relay binding, pinned
peers, and sync recency. It powers wire dash (the terminal pane) and the
Mission Control reporter.
Hard invariants (a naive aggregate over ~270 sessions dies without these):
- Read-only, no spawn, no kill. Never starts or stops a daemon.
- No per-session network I/O. Reads on-disk state only. Relay
/healthzis probed once per distinct relay, and only when explicitly asked (CollectOpts::probe_relays). - Explicit paths, never the session-scoped config helpers.
crate::config::read_trust/read_relay_stateresolve against the current session’s home (WIRE_HOME / session-key context); using them in a cross-session walk would read the same session 270 times. Every read here is rooted at the session’s ownhome_dir.
Structs§
- Collect
Opts - Dash
Report - The whole-machine snapshot — the golden surface
--jsonemits and the Mission Control reporter consumes. - PeerRow
- One pinned peer of a session, read from its
trust.json. - Relay
Health /healthzresult for one distinct relay URL.- Session
Snapshot - A single wire identity on this box + its live-ish state.
Enums§
- Daemon
State - Liveness of a session’s sync daemon, derived from its
daemon.pidfile + the pid-alive checkcrate::session::list_sessionsalready computes.
Constants§
Functions§
- collect
- Snapshot every wire identity on this box. Read-only; never spawns/kills a
daemon; does network I/O only when
opts.probe_relaysis set. - fingerprint_
from_ did - Extract the short fingerprint from a DID (
did:wire:terra-plain-e6511a52→e6511a52). The nickname may contain hyphens, so take the final segment.Nonefor a DID with no usable trailing segment. - last_
sync_ age_ s - Seconds since
<home>/state/wire/last_sync.jsonwas last written. - read_
peers - Read a session’s pinned peers from
<home>/config/wire/trust.json, excluding the session’s own identity (trust.jsonlists self as an agent). Self is matched on DID or handle: a corrupt self-entry missing itsdidmust still not surface the session as its own peer. - read_
relay_ binding - Read
<home>/config/wire/relay.json→(relay_url, slot_id).