A game waiting for its first check takes turns with a live game checked again (#185) #187

Merged
cmoriarty merged 1 commit from checks-take-turns into main 2026-11-17 02:05:48 -05:00
Owner

Fixes #185.

The fault

On 2026-11-17, Tahiti vs. Cook Islands was live and followed, and its sportsurge match page listed no streams. The checker reads one game at a time, and a round takes the live games' checks before the upcoming ones' (prewarm._plan_round).

  • Tahiti took every round. It was checked every 71 s for an hour: 55 solver reads of a page that never changed.
  • Malaysia went unchecked. Malaysia vs. Yemen, followed and inside the lead from 05:30, had no check until it went live at 06:01. Had its page listed streams before kickoff, it would not have been Ready at kickoff.

The fix

  • A game with no check yet gets a turn. A round can give its live check to a game checked before while a game inside the lead has had no check yet. The next round now owes its first check to that game, earliest kickoff first, ahead of the live games. This is prewarm._first_owed, the same kind of turn as #115's.
    • A live game's first check still comes first.
    • With no game waiting, the turn lapses and the live game keeps the slot.
    • The Admin page's Now table plays the turn forward like any other.
  • An empty match page waits. A sportsurge match page with no streams now answers "not listed" (NotListed), as a watchsports game page with none already does.
    • Background reads of the game wait for the hub's refresh, 5 minutes, and the answer is logged once (#72).
    • A viewer's tune and Check now still read it at once.
  • Specs. stream-supervision gains the requirement "A game inside the lead takes turns with a live game checked again", and its round order names the turn. stream-resolution gains "A Sportsurge match page with no streams answers not listed".

Checks

  • New tests. Each one failed on main's code:
    • test_a_game_waiting_for_its_first_check_takes_turns_with_a_live_game_checked_again: a live game whose checks keep failing, and two followed games inside the lead. The rounds read live, live, Malaysia, live, Singapore, live. On main it was live every round.
    • test_a_live_game_checked_again_keeps_the_slot_once_every_game_has_had_a_check: no turn is owed once every game has had its check.
    • test_the_now_table_shows_the_waiting_games_first_check_next.
    • test_the_match_page_listing_no_streams_answers_not_listed, tightened from ResolutionError.
  • The whole lane. make test gave 1,496 passed and 1 skipped, in 33 s at a load average of 2.
  • OpenSpec. openspec validate stream-supervision --type spec --strict and openspec validate stream-resolution --type spec --strict give the same 24 and 5 long-requirement warnings as on main, and no new ones.

🤖 Generated with Claude Code

Fixes #185. ## The fault On 2026-11-17, Tahiti vs. Cook Islands was live and followed, and its sportsurge match page listed no streams. The checker reads one game at a time, and a round takes the live games' checks before the upcoming ones' (`prewarm._plan_round`). - **Tahiti took every round.** It was checked every 71 s for an hour: 55 solver reads of a page that never changed. - **Malaysia went unchecked.** Malaysia vs. Yemen, followed and inside the lead from 05:30, had no check until it went live at 06:01. Had its page listed streams before kickoff, it would not have been Ready at kickoff. ## The fix - **A game with no check yet gets a turn.** A round can give its live check to a game checked before while a game inside the lead has had no check yet. The next round now owes its first check to that game, earliest kickoff first, ahead of the live games. This is `prewarm._first_owed`, the same kind of turn as #115's. - A live game's first check still comes first. - With no game waiting, the turn lapses and the live game keeps the slot. - The Admin page's Now table plays the turn forward like any other. - **An empty match page waits.** A sportsurge match page with no streams now answers "not listed" (`NotListed`), as a watchsports game page with none already does. - Background reads of the game wait for the hub's refresh, 5 minutes, and the answer is logged once (#72). - A viewer's tune and Check now still read it at once. - **Specs.** stream-supervision gains the requirement "A game inside the lead takes turns with a live game checked again", and its round order names the turn. stream-resolution gains "A Sportsurge match page with no streams answers not listed". ## Checks - **New tests.** Each one failed on main's code: - `test_a_game_waiting_for_its_first_check_takes_turns_with_a_live_game_checked_again`: a live game whose checks keep failing, and two followed games inside the lead. The rounds read live, live, Malaysia, live, Singapore, live. On main it was live every round. - `test_a_live_game_checked_again_keeps_the_slot_once_every_game_has_had_a_check`: no turn is owed once every game has had its check. - `test_the_now_table_shows_the_waiting_games_first_check_next`. - `test_the_match_page_listing_no_streams_answers_not_listed`, tightened from `ResolutionError`. - **The whole lane.** `make test` gave 1,496 passed and 1 skipped, in 33 s at a load average of 2. - **OpenSpec.** `openspec validate stream-supervision --type spec --strict` and `openspec validate stream-resolution --type spec --strict` give the same 24 and 5 long-requirement warnings as on main, and no new ones. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
On 2026-11-17 Tahiti vs. Cook Islands was live and followed, and its
sportsurge match page listed no streams. With one read at a time and the
live games' checks ahead of the upcoming ones, it was checked every
round for an hour (55 solver reads of the same page), and Malaysia vs.
Yemen, followed and inside the lead from 05:30, had no check until it
went live at 06:01.

A round whose live check went to a game checked before, while a game
inside the lead had no check yet, now owes the next round's first check
to that game (prewarm._first_owed, like #115's turn). A live game's
first check still comes first, and with no game waiting the turn lapses.

A sportsurge match page with no streams answers not listed, as a
watchsports game page with none already does: background reads of the
game wait for the hub's refresh (5 minutes), and the answer is logged
once (#72). A viewer's tune and Check now still read it at once.

The stream-supervision and stream-resolution specs say so, each with
scenarios and their tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
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!187
No description provided.