Skip to main content

Module dash

Module dash 

Source
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 /healthz is 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_state resolve 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 own home_dir.

Structs§

CollectOpts
DashReport
The whole-machine snapshot — the golden surface --json emits and the Mission Control reporter consumes.
PeerRow
One pinned peer of a session, read from its trust.json.
RelayHealth
/healthz result for one distinct relay URL.
SessionSnapshot
A single wire identity on this box + its live-ish state.

Enums§

DaemonState
Liveness of a session’s sync daemon, derived from its daemon.pid file + the pid-alive check crate::session::list_sessions already computes.

Constants§

SCHEMA

Functions§

collect
Snapshot every wire identity on this box. Read-only; never spawns/kills a daemon; does network I/O only when opts.probe_relays is set.
fingerprint_from_did
Extract the short fingerprint from a DID (did:wire:terra-plain-e6511a52e6511a52). The nickname may contain hyphens, so take the final segment. None for a DID with no usable trailing segment.
last_sync_age_s
Seconds since <home>/state/wire/last_sync.json was last written.
read_peers
Read a session’s pinned peers from <home>/config/wire/trust.json, excluding the session’s own identity (trust.json lists self as an agent). Self is matched on DID or handle: a corrupt self-entry missing its did must still not surface the session as its own peer.
read_relay_binding
Read <home>/config/wire/relay.json(relay_url, slot_id).