A hub-only game about to start stays listed through a gap in its row (#191) #193

Merged
cmoriarty merged 1 commit from hub-row-gap into main 2026-11-18 10:22:47 -05:00
Owner

Fixes #191.

The fault

On 2026-11-17, two followed friendlies listed only by the hub, Ecuador vs. Bolivia and Uruguay vs. Dominican Republic, left the list at 23:21:49 for a 23:30 kickoff. They came back LIVE at 23:52:07, while ESPN showed both being played.

  • The rows left the page. The section's row count went 87, then 83, then 87 again: the rows left the section's page and came back once the games were live.
  • No hold covered them. #181's hold covers only games already seen live.
  • What it cost. For half an hour around kickoff the games had no listing, no checks and no channel.
  • Nothing was logged. The app logged nothing about the hub's rows, so the gap could only be pieced together from a recorder and ESPN.

The fix

  • The hold (games.py: _near_kickoff, _kept_through_kickoff).
    • When it applies. A hub-only game whose row leaves its page within 15 minutes of its start (KICKOFF_HOLD_BEFORE). It also applies when the row reads finished without saying the game is over, for example a time that has passed with no LIVE badge yet.
    • How the game is listed. With the same id and start: upcoming until its start and live from then on. So it is checked, and its channel can open.
    • When it ends.
      • When its row comes back: as LIVE it is then any live game, held through breaks by #181.
      • Otherwise, 45 minutes past its start (KICKOFF_HOLD_AFTER). So a game called off with no word is gone by then.
      • At once, when a row says the game is over (FT, a score, Postponed…) or a feed reports it final.
    • Rebuilds. The merged list counts the minutes while such a game is kept, as it does for one seen live. That is how it goes live at its start.
  • The log (resolver/hub.py: say_changes).
    • What is logged. Each section read logs its row changes against the read before: each row that appeared, left the page, or shows something else (its time, a LIVE badge, a label).
    • Format. One line each, with the watch id and matchup. The first 12 are named and the rest counted, for a day's rollover.
    • Not a change. A live row's minute.
    • Example. A line reads hub: /: Ecuador vs. Bolivia (70324) left the page, was upcoming 23:30Z.
  • Spec. live-game-list gains two requirements, "A hub-only game about to start stays listed through a gap in its row" and "A section's read says which rows changed", with four scenarios. The upcoming-row requirement names the new exception, and is trimmed to stay under 500 characters.

Checks

  • New tests. All four fail on main's code.
    • test_a_game_whose_row_leaves_just_before_kickoff_stays_listed_until_it_comes_back_live: the 2026-11-17 timeline. The row leaves 9 minutes before kickoff and comes back LIVE 22 minutes after it. The game stays upcoming, then live, and is then held as a game seen live.
    • test_a_game_whose_row_never_comes_back_leaves_45_minutes_after_its_start. It also checks that a row leaving 39 minutes ahead is not held.
    • test_a_row_past_its_start_with_no_live_badge_stays_and_a_called_off_label_ends_it.
    • test_a_sections_read_logs_the_rows_that_appeared_left_or_changed: appeared, left, upcoming to LIVE, no line for a live minute, and the cap of 12.
  • Existing tests. All 73 other hub tests pass unchanged, #181's three among them.
  • The whole lane. make test gave 1,502 passed and 1 skipped, in 34 s at a load average of 2.
  • OpenSpec. openspec validate live-game-list --type spec --strict gives the same 3 long-requirement warnings as on main, and no new ones.

🤖 Generated with Claude Code

Fixes #191. ## The fault On 2026-11-17, two followed friendlies listed only by the hub, Ecuador vs. Bolivia and Uruguay vs. Dominican Republic, left the list at 23:21:49 for a 23:30 kickoff. They came back LIVE at 23:52:07, while ESPN showed both being played. - **The rows left the page.** The section's row count went 87, then 83, then 87 again: the rows left the section's page and came back once the games were live. - **No hold covered them.** #181's hold covers only games already seen live. - **What it cost.** For half an hour around kickoff the games had no listing, no checks and no channel. - **Nothing was logged.** The app logged nothing about the hub's rows, so the gap could only be pieced together from a recorder and ESPN. ## The fix - **The hold** (`games.py`: `_near_kickoff`, `_kept_through_kickoff`). - **When it applies.** A hub-only game whose row leaves its page within 15 minutes of its start (`KICKOFF_HOLD_BEFORE`). It also applies when the row reads finished without saying the game is over, for example a time that has passed with no LIVE badge yet. - **How the game is listed.** With the same id and start: upcoming until its start and live from then on. So it is checked, and its channel can open. - **When it ends.** - When its row comes back: as LIVE it is then any live game, held through breaks by #181. - Otherwise, 45 minutes past its start (`KICKOFF_HOLD_AFTER`). So a game called off with no word is gone by then. - At once, when a row says the game is over (FT, a score, Postponed…) or a feed reports it final. - **Rebuilds.** The merged list counts the minutes while such a game is kept, as it does for one seen live. That is how it goes live at its start. - **The log** (`resolver/hub.py`: `say_changes`). - **What is logged.** Each section read logs its row changes against the read before: each row that appeared, left the page, or shows something else (its time, a LIVE badge, a label). - **Format.** One line each, with the watch id and matchup. The first 12 are named and the rest counted, for a day's rollover. - **Not a change.** A live row's minute. - **Example.** A line reads `hub: /: Ecuador vs. Bolivia (70324) left the page, was upcoming 23:30Z`. - **Spec.** live-game-list gains two requirements, "A hub-only game about to start stays listed through a gap in its row" and "A section's read says which rows changed", with four scenarios. The upcoming-row requirement names the new exception, and is trimmed to stay under 500 characters. ## Checks - **New tests.** All four fail on main's code. - `test_a_game_whose_row_leaves_just_before_kickoff_stays_listed_until_it_comes_back_live`: the 2026-11-17 timeline. The row leaves 9 minutes before kickoff and comes back LIVE 22 minutes after it. The game stays upcoming, then live, and is then held as a game seen live. - `test_a_game_whose_row_never_comes_back_leaves_45_minutes_after_its_start`. It also checks that a row leaving 39 minutes ahead is not held. - `test_a_row_past_its_start_with_no_live_badge_stays_and_a_called_off_label_ends_it`. - `test_a_sections_read_logs_the_rows_that_appeared_left_or_changed`: appeared, left, upcoming to LIVE, no line for a live minute, and the cap of 12. - **Existing tests.** All 73 other hub tests pass unchanged, #181's three among them. - **The whole lane.** `make test` gave 1,502 passed and 1 skipped, in 34 s at a load average of 2. - **OpenSpec.** `openspec validate live-game-list --type spec --strict` gives the same 3 long-requirement warnings as on main, and no new ones. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
On 2026-11-17 two followed friendlies listed only by the hub, Ecuador vs.
Bolivia and Uruguay vs. Dominican Republic, left the list at 23:21:49
for a 23:30 kickoff and came back LIVE at 23:52:07, while ESPN showed
both being played: their rows left the section's page (87 rows, then 83,
then 87 again) and came back once the games were live. #181's hold
covers only games seen live, so for half an hour around kickoff the
games had no listing, no checks and no channel. The app logged nothing
about the hub's rows, so the gap could only be pieced together.

games.py keeps a hub-only game whose row leaves its page, or reads
finished without saying it is over (its time passed with no LIVE badge
yet), within KICKOFF_HOLD_BEFORE (15 min) of its start (_near_kickoff,
_kept_through_kickoff): listed with the same id and start, upcoming
until its start and live from then on, until its row comes back or
KICKOFF_HOLD_AFTER (45 min) past its start. A row saying it is over, or
a feed's final, ends it at once. The merged list counts the minutes
while such a game is kept, as it does for one seen live.

resolver/hub.py logs each section read's row changes against the read
before (say_changes): each row that appeared, left the page, or shows
something else (its time, a LIVE badge, a label), one line each with
its watch id and matchup; the first 12 are named and the rest counted.
A live row's minute is no change.

The live-game-list spec says so, with four 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!193
No description provided.