Settings, steadier recoveries and the version on every page #113

Merged
cmoriarty merged 1 commit from feature/settings-and-recoveries into develop 2026-11-08 03:43:31 -05:00
Owner

OpenSpec change: settings-and-recoveries. Milestone 38, "Settings, steadier recoveries and 1.2.0". This builds #100, #101 and #102. Each issue stays open for its check on the live page. After this merges, 1.2.0 is released through release/1.2.0 and tagged v1.2.0, as 1.1.0 was.

Why

  • Background channels can only be tuned by a redeploy (#100). CHANNEL_BACKGROUND_LIMIT was the only control. At about 3 Mbit/s each, five can cost 15 Mbit/s with nobody watching.
  • Recoveries go wrong in two ways (#101). On UTEP vs. Hawai'i, a recovery took a copy of the stream that had just failed. Then a Choppy source was re-read every 45 s or so, each re-read interrupting the search for a different stream.
  • Nothing on screen says which version runs (#102).

What changes

  • Settings (#100).
    • New settings.py keeps settings.json beside watchlist.json.
    • The Admin top bar gains a flame: background channels running against the count (e.g. 2/5) and their cost in Mbit/s. Its popover holds an on/off switch, a 1–10 stepper, a meter, the kept-warm teams, and the help behind an info icon.
    • Each Watchlist entry gets a keep-warm flame. With any entry kept warm, only its games get a background channel. They still count toward the limit, so a kept-warm list is a filter, not a priority. With none kept warm, every followed game qualifies, as before.
    • CHANNEL_BACKGROUND_LIMIT is now only the starting value.
    • Changes apply at the next 15 s round. Off closes the unwatched background channels, and a watched one plays on.
    • Changes are logged as a new settings event kind.
  • Steadier recoveries (#101).
    • A recovery now chooses between the ready standby and the ready second standby (resolution.recovery_pick). A different stream goes before a copy of the failed one. Between copies, it takes one whose playlist is on another host.
    • Each standby's stream mark is logged when it is verified. The standby order is logged with its marks whenever it changes.
    • A Choppy stream's re-read waits for a slot instead of interrupting the game's own background search (spare_game on the read gate).
    • Landing back on the same slow stream wakes the standby search at once. It also marks the run and the event with the pace, and the Playing card shows a slow-source mark.
    • Tests reproduce UTEP's layout (kept A, a copy B standing first, a different stream C second), played, played in the background, and unwatched. The order check was already right in all three. The copy came from the recovery's first step taking the first ready standby unchecked, which is now fixed.
  • Version (#102).
    • GET /api/version answers the package version, plus the commit and build time baked in by publish-image.yml, through the Dockerfile's APP_COMMIT and APP_BUILT_AT.
    • A shared Brand header shows v1.2.0 left of the logo on Games, Watchlist and Admin, with the commit and build time on hover.
    • A test keeps pyproject.toml, package.json and the lock file in step.

New routes:

  • GET /api/settings
  • PUT /api/settings/background
  • PUT /api/watchlist/keep-warm
  • GET /api/version

/api/watchlist answers keep_warm, and the Admin view gains status.background.

Tests (run locally; ci.yml is manual for now)

  • make test: 1125 passed, 1 skipped (18 s)
  • npm --prefix frontend test: 236 passed (18 files)
  • make e2e: passed (click-to-play, failure, recording, replay, channel)

🤖 Generated with Claude Code

OpenSpec change: `settings-and-recoveries`. Milestone 38, "Settings, steadier recoveries and 1.2.0". This builds #100, #101 and #102. Each issue stays open for its check on the live page. After this merges, 1.2.0 is released through `release/1.2.0` and tagged `v1.2.0`, as 1.1.0 was. ## Why - **Background channels can only be tuned by a redeploy (#100).** `CHANNEL_BACKGROUND_LIMIT` was the only control. At about 3 Mbit/s each, five can cost 15 Mbit/s with nobody watching. - **Recoveries go wrong in two ways (#101).** On UTEP vs. Hawai'i, a recovery took a copy of the stream that had just failed. Then a Choppy source was re-read every 45 s or so, each re-read interrupting the search for a different stream. - **Nothing on screen says which version runs (#102).** ## What changes - **Settings (#100).** - New `settings.py` keeps `settings.json` beside `watchlist.json`. - The Admin top bar gains a flame: background channels running against the count (e.g. 2/5) and their cost in Mbit/s. Its popover holds an on/off switch, a 1–10 stepper, a meter, the kept-warm teams, and the help behind an info icon. - Each Watchlist entry gets a keep-warm flame. With any entry kept warm, only its games get a background channel. They still count toward the limit, so a kept-warm list is a filter, not a priority. With none kept warm, every followed game qualifies, as before. - `CHANNEL_BACKGROUND_LIMIT` is now only the starting value. - Changes apply at the next 15 s round. Off closes the unwatched background channels, and a watched one plays on. - Changes are logged as a new `settings` event kind. - **Steadier recoveries (#101).** - A recovery now chooses between the ready standby and the ready second standby (`resolution.recovery_pick`). A different stream goes before a copy of the failed one. Between copies, it takes one whose playlist is on another host. - Each standby's stream mark is logged when it is verified. The standby order is logged with its marks whenever it changes. - A Choppy stream's re-read waits for a slot instead of interrupting the game's own background search (`spare_game` on the read gate). - Landing back on the same slow stream wakes the standby search at once. It also marks the run and the event with the pace, and the Playing card shows a slow-source mark. - Tests reproduce UTEP's layout (kept A, a copy B standing first, a different stream C second), played, played in the background, and unwatched. The order check was already right in all three. The copy came from the recovery's first step taking the first ready standby unchecked, which is now fixed. - **Version (#102).** - `GET /api/version` answers the package version, plus the commit and build time baked in by `publish-image.yml`, through the `Dockerfile`'s `APP_COMMIT` and `APP_BUILT_AT`. - A shared `Brand` header shows `v1.2.0` left of the logo on Games, Watchlist and Admin, with the commit and build time on hover. - A test keeps `pyproject.toml`, `package.json` and the lock file in step. New routes: - `GET /api/settings` - `PUT /api/settings/background` - `PUT /api/watchlist/keep-warm` - `GET /api/version` `/api/watchlist` answers `keep_warm`, and the Admin view gains `status.background`. ## Tests (run locally; ci.yml is manual for now) - `make test`: 1125 passed, 1 skipped (18 s) - `npm --prefix frontend test`: 236 passed (18 files) - `make e2e`: passed (click-to-play, failure, recording, replay, channel) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
From the first nights of milestones 36-38. Background channels could
only be tuned by a redeploy (#100); a recovery took a copy of the
stream that had just failed, and a slow source's re-reads starved the
search for a different one (#101); nothing on screen said which
version ran (#102).

- Settings (#100): settings.py keeps settings.json beside
  watchlist.json. The Admin top bar shows the background channels
  running against the count and their cost in Mbit/s; its popover
  switches them and sets the count (1-10). Each Watchlist entry has a
  keep-warm flame: with any kept warm, only their games get a
  background channel (a filter that counts toward the limit).
  CHANNEL_BACKGROUND_LIMIT is the starting value. Changes are a new
  "settings" event kind. Routes: GET /api/settings,
  PUT /api/settings/background, PUT /api/watchlist/keep-warm.
- Steadier recoveries (#101): resolution.recovery_pick chooses
  between the ready standbys, a different stream before a copy of the
  failed one and, between copies, one on another playlist host. Each
  standby's mark is logged when verified, and the standby order with
  its marks whenever it changes. A Choppy stream's re-read no longer
  interrupts the game's own background read (spare_game on the gate);
  landing on the same stream again wakes the standby search and marks
  the run and the event as a slow source, which the Playing card
  shows. The UTEP layout reproduced in tests orders correctly: the
  copy came from the recovery's first step, now fixed.
- The version (#102): GET /api/version answers the package's
  version with the commit and build time that publish-image.yml bakes
  in (APP_COMMIT, APP_BUILT_AT); a shared Brand header shows it left
  of the logo on Games, Watchlist and Admin. A test keeps the
  manifests in step; 1.2.0 comes on release/1.2.0.

OpenSpec change settings-and-recoveries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cmoriarty merged commit 654a9a77ab into develop 2026-11-08 03:43:31 -05:00
Sign in to join this conversation.
No reviewers
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/sports-breaker!113
No description provided.