Skip to content

RAL-202: the roster shows live sessions first and folds stale ones away - #291

Merged
Castor-o7 merged 2 commits into
mainfrom
ral-202-roster-order
Nov 17, 2026
Merged

Castor-o7 merged 2 commits into
mainfrom
ral-202-roster-order

Conversation

@Castor-o7

@Castor-o7 Castor-o7 commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

RAL-202: the 7300 roster shows live sessions first and folds stale ones away.

Why: Josh, via the lamplighter and the watchman: the roster was "full of stale sessions, and the data is higgledy-piggledy". Read live, 7 of Marshal's roster rows are hook-only leftovers, and the table sorted every row by project.

The rule (shims::stale) is one function, used by the viewer, stalls, wake and brief. A row is stale when:

  • the daemon records it as bound to no connection, or its declared pid is 0, and
  • the daemon holds no wait for it. A row with a current wait has a hook waiting on it, so it's live.

The stale reason names the fact and its label: "bound to no connection [recorded]" or "its pid is 0 [declared]".

Viewer:

  • Live sessions come first, the most recently active first.
  • Stale rows fold under one "N stale sessions" line, closed until clicked. The section stays open across the 30-second redraws, keyed by data-key so a changed count doesn't close it. Each row says why it's stale.
  • No never-bound row says "connected N ago". A stale row shows its reason instead, and a live but unbound row (one holding a wait) reads "on the roster since N ago".
  • "since unknown" becomes "last active N ago" when the roster has last_activity_at, and "since: not reported by its roster" when it has no time. It still never says "for" an age taken from the last tool (RAL-124).
  • A stale row's "busy" never shows under "Now".

stalls / wake / brief: stale rows are dropped before teams are matched, so a leftover is never taken for a team's live session. Their reports give stale_sessions; rally stalls live gives stale_sessions: 7.

Tests:

  • fmt and clippy -D warnings are clean, and the full cargo test passes with browser tests (RALLY_TEST_CHROME): 580 lib tests and 54 web tests.
  • New: unit tests of the stale rule (live, unbound, pid 0, waiting, a shim row with neither block), and a headless Chrome test of the order, the folded section, the stale reasons, no "connected" on stale rows, and none in "Now".
  • Updated: the RAL-116 and RAL-124 browser tests, to the new "on the roster since" and "last active" wording.

Second commit, the watchman's follow-up to RAL-199 part 2: marshal::recipient matches a nickname only against live sessions: bound to a shim's connection, or holding a wait the daemon has now. When only a stale row holds the name, it says so. send_at watches the wake watchers, so a waiting hook-only session can still be reached. The digest's live list for marshal::route leaves out stale rows. So a ghost never ends a route early or makes a live nickname ambiguous. Unit tests cover a ghost sharing a live name, a ghost-only name, and a hook-only waiter. The ignored e2e still passes (3 of 3).

🤖 Generated with Claude Code

Castor-o7 and others added 2 commits November 17, 2026 15:15
The 7300 roster was full of hook-only leftovers (7 of the live roster's
rows), shown in project order and mixed in with live sessions.

- shims::stale: a row is stale when the daemon records it as bound to no
  connection, or its declared pid is 0, and the daemon holds no wait for
  it. The reason says which fact, with its label.
- The viewer puts live sessions first, most recently active first. Stale
  rows fold under one "N stale sessions" line, closed until clicked (kept
  open across redraws by data-key). Each one says why it's stale, and
  none says "connected N ago". A live row that was never bound reads "on
  the roster since". A stale "busy" never shows under "Now".
- "since unknown" becomes "last active N ago" where the roster has a time
  and "since: not reported by its roster" where it doesn't. It never
  reads "for" an age taken from the last tool (RAL-124 holds).
- stalls, wake and brief drop stale rows before matching teams, and
  their reports count them as stale_sessions.
- Unit tests of the rule, a headless Chrome test of the panel, and the
  RAL-116 and RAL-124 browser tests updated to the new wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The watchman's follow-up to part 2. A hook-only ghost carrying the
designated name ended the digest's route early at a dead session, and a
ghost sharing a live team's nickname made that team "ambiguous".

- marshal::recipient matches a nickname only against live sessions:
  bound to a shim's connection, or holding a wait the daemon has now.
  When only a stale row holds the name, it says so. An exact session id
  is still taken as given.
- send_at also watches the wake watchers, so a hook-only session that is
  waiting can still be reached.
- The digest's live list for marshal::route leaves out shims::stale rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Castor-o7
Castor-o7 force-pushed the ral-202-roster-order branch from 186d6be to a868ae1 Compare November 17, 2026 20:21
@Castor-o7
Castor-o7 merged commit be66d32 into main Nov 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant