Skip to content

Live windows: follow /v1/live/ws instead of polling every 10 s - #7

Merged
transfix merged 1 commit into
mainfrom
live
Oct 31, 2026
Merged

transfix merged 1 commit into
mainfrom
live

Conversation

@transfix

Copy link
Copy Markdown
Contributor

The Builders, Builds and Activity windows no longer refresh every 10 s. While a window is open it follows the registry's /v1/live/ws feed, natively and in the browser build, using the new ws-* verbs in transfix/libcvc#923 (roadmap L6).

Per window:

window topic on a message
Builders builders the snapshot replaces the list; a builder changes its row in place, or adds one; builder_removed reloads
Builds builds a job on the page changes in place; a new job on the first page, or one leaving the status filter, reloads the page
Activity activity reloads
  • Status line: it ends in · live, or · polling while the feed is down.
  • Feed down: the window polls about every 10 s and tries the feed again. A reconnect reloads once, since it may have missed something.
  • Polling only: a host without ws-* (has?), --live off, or a close with 4004 (no live updates) or 4001.
  • Closing a window closes its socket.
  • The shared pump lives in net.ari (live-pump, live-stop, live-idle). The pure parts are in lib.ari (live-url, hello-text, live-final, live-note), with unit tests.

Fix found on the way: cvcpkg.org's builders have capability keys like glibc2.35, and state-set-tree refuses them as node names. So the Builders window on main fails against the real registry (the fixture data predates those keys). Builders are now cut to the fields the window shows (builder-row), and the fixture's first builder carries dotted capability keys.

Fixture: fixture_registry.py serves /v1/live/ws, a small stdlib WebSocket server that speaks HTTP/1.1 for the upgrade. /_live?msg= publishes a message, and also applies it to what the REST endpoints serve. /_live?close=CODE closes every feed and /_live?off=1 turns the feed off. The site CSP names the ws:// origin. The tracked __pycache__/*.pyc is removed and ignored.

Tests:

  • fleet_test adds 7 tests: all three windows go live, a builder changes in place with no new /v1/builders request, a new builder is added, a job changes in place with no new /v1/builds request, a new job reloads, an event reloads, and a 4004 close leaves the windows polling.
  • The tmux test checks that View > Builders goes live.
  • The browser test adds a step: View > Builders shows 14 of 20 online · live.
  • Window snapshots pass --live off, so the frame doesn't depend on when the feed connects.
  • Local run with ari built from master plus the CI PR list plus #923: all layers pass (1, 2a–c, 3a, 3b, 3d). Against cvcpkg.org, the native Builders and Activity windows go live.
  • The wasm build is CI's: the WebSocket backend compiles with em++ locally, but the full page is untested here.

The Builders, Builds and Activity windows now keep a WebSocket to the
registry's live feed while they're open (libcvc's ws-* verbs, natively and
in the browser). A builder or a job on the page changes in place as the
server reports it; a new job on the first page, a job leaving the filter,
an activity event or a resync reloads with one REST request. Each window's
status line ends in "· live", or "· polling" while the feed is down; then it
polls about every 10 s and tries the feed again. Without the verbs, with
--live off, or after close 4004/4001, it only polls.

Builders now keep only the fields the window shows: cvcpkg.org's builder
capabilities have keys like "glibc2.35", which can't name state nodes, so
storing whole builders failed against the real registry. The fixture's
first builder carries such keys now.

The fixture registry serves /v1/live/ws (a small stdlib WebSocket server)
and /_live to publish, close or turn off the feed. fleet_test checks
in-place updates without new /v1 requests, reloads, and the 4004 fallback;
the tmux and browser tests check that View > Builders goes live. CI adds
transfix/libcvc#923.
@transfix
transfix merged commit 9b6721d into main Oct 31, 2026
6 checks passed
@transfix
transfix deleted the live branch October 31, 2026 00:33
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