Skip to content

Connection states

Reference for the connection state table (openspec change connection-state-symbols: operator-clients, Connection Operations). Both operator clients show a connection's state as one column, a symbol per state, and take the symbols, tones and sort order from this table. Neither keeps a copy of it.

Python (virtufin.domain_devkit.connections) TypeScript (@virtufin/domain-devkit)
connection_states() -> tuple[ConnectionState, ...] CONNECTION_STATES: readonly ConnectionStateEntry[]
connection_state(raw: str \| None) -> ConnectionState connectionState(raw): ConnectionStateEntry
normalize(raw) normalizeConnectionState(raw)
TONES, TONE_OK … TONE_MUTED CONNECTION_TONES, ConnectionTone
connection_state_vectors() CONNECTION_STATE_VECTORS

Both are pure. The TypeScript one is browser-safe. The table is connections/connection-states.v1.json, and the vectors (connections/lookup.v1.json) run in both languages' tests.

The table

Sorted by rank, the most severe first.

Rank State Glyph (TUI) Icon (web app, lucide) Tone Meaning
1 failed ✖ circle-x danger could not load or start
2 disconnected ○ unplug danger socket closed, not retrying
3 degraded ◐ plug-zap warn open, some items not subscribed
4 connecting ◌ loader (spins) warn connecting or logging in
5 reconnecting ↻ refresh-cw (spins) warn socket dropped, retrying
6 waiting … hourglass muted worker loading or running, no feed report yet
7 unknown ? circle-question-mark muted a state this client does not know
8 connected ● plug ok socket open, subscribed
9 stopped ■ circle-stop muted stopped by intent
10 releasing ⏏ log-out muted releasing itself, deleting its worker

The glyphs are single-width characters, never emoji, whose terminal width varies.

Lookup

A connection's raw state is the feed's own status, else its last lifecycle status report, else its worker's status. The lookup trims it, reads it in lower case with _ as -, and then maps it:

  • running and loading (the worker's status before the feed reports) to waiting;
  • load-failed (LOAD_FAILED) and the lifecycle reports failed and lease-lost to failed;
  • a table state to itself;
  • anything else (UNKNOWN, an empty state) to unknown. The client still shows the raw state as its name.

Publishing changed elsewhere

No event carries a feed's publish topic: a client learns it from the feed's status answer. When another client turns publishing on or off, the feed's metrics show it first. publishingOutdated(publishTopic, previous, current) (Python publishing_outdated) says whether the last two metrics events contradict the answer:

  • the answer names no topic (""), and published grew;
  • the answer names a topic, and unpublished (frames held back) grew.

Without an answer yet (null / None) or before two metrics events it is never outdated. A counter left out counts 0. When it is outdated, the client asks the feed's status once more. The vectors in connections/publishing.v1.json (PUBLISHING_VECTORS, publishing_vectors()) run in both languages' tests.