Skip to content

fix(sports): offer the idle back-off only the kickoffs each board would show - #628

Merged
ChuckBuilds merged 1 commit into
mainfrom
claude/sports-kickoff-filter-all
Oct 5, 2026
Merged

ChuckBuilds merged 1 commit into
mainfrom
claude/sports-kickoff-filter-all

Conversation

@ChuckBuilds

@ChuckBuilds ChuckBuilds commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

What

Football 3.18.7 (#622) stopped a favourites-only board from waking for other teams' kickoffs. Before that, the live loop offered every game on the scoreboard to core's idle back-off. Each kickoff holds the poll at the live cadence for 15 minutes, so on a busy slate the board fetched the whole scoreboard about every 30 s for games it then filtered out.

This PR applies the same rule to every other scoreboard that offers kickoffs. Each one now offers only the games its own live filter would show, and excluded teams are honoured the same way. Since core #772 (in 3.8.1) every offered kickoff gets its own grace, so offering only the games a board shows matters more than it did.

plugin version filter used for the offer
afl 1.37.0 -> 1.37.1 _classify_live_game(home_abbr, away_abbr)
baseball 1.59.0 -> 1.59.1 new _classify_live_game() (was an inline chain in update())
basketball 1.44.0 -> 1.44.1 _classify_live_game(..., is_tournament=...): tournament games still offered in tournament mode
hockey 1.44.0 -> 1.44.1 _is_live_game_included()
lacrosse 1.37.0 -> 1.37.1 new _classify_live_game() (was inline)
nrl 1.36.0 -> 1.36.1 _classify_live_game(home_id, away_id): team IDs, since NRL abbreviations collide
soccer 2.41.0 -> 2.41.1 _classify_live_game(home_abbr, away_abbr)
ufc 1.20.0 -> 1.20.1 new _classify_live_game() (was inline; ufc has no excluded list)
  • odds-ticker offers no kickoffs, so it is untouched. football already has the rule.
  • Baseball, lacrosse and ufc used to filter inline inside update(). That chain moved into a _classify_live_game() that both the live list and the kickoff offer call, so there is one rule per plugin. The behaviour is identical; only the LIVE_PRIORITY_DEBUG reason string is simpler.
  • The favourite-matching behaviour pinned by test_favourite_matching.py (test(scoreboards): pin every plugin's favourite matching before family 6 reconciles it #634) is unchanged: all 204 rows pass.
  • Boards that show every live game are unchanged.
  • Each plugin has a new versions[] entry and a CHANGELOG entry. update_registry.py has been run and --check passes.

Proof

All results below are against plugins main 19fc4a2 and core main e745ae80 (3.8.1 + #774).

Unit tests. Each plugin has a new test_kickoff_offer_follows_the_live_filter.py. It runs a real SportsLive.update() over a canned payload and records what gets offered. It checks that:

  • a favourites-only board offers only the favourite's game;
  • an excluded team's game is never offered;
  • show-all, favourites-only-off and no-favourites boards offer every game;
  • the call is still getattr-guarded.

basketball adds checks for tournament mode. For nrl, the favourite and the other game share abbreviations, so matching on abbreviations instead of IDs fails.

Mutation check:

Mutant Result
main's sports.py fails in all 8 plugins
soccer offers nothing on show-all fails
basketball drops is_tournament fails
nrl matches abbreviations fails
baseball loses the exclude check fails
ufc loses the no-favourites fallback fails

Replay. This reuses football's frozen-time fake-ESPN harness, generalised, on recorded payloads served gzipped. Each run covers 18 h (09:00-03:00 ET). Counts are scoreboard requests.

run main this PR
MLB Fri 2026-09-25, favourite LAD (one 22:15 game) 927 req / 19.6 MB wire / 273 MB dec 620 / 13.1 / 183
MLB same day, favourites NYY + LAD 1,361 / 28.7 / 400 1,293 / 27.4 / 381
MLB same day, show all live 1,683 / 35.0 / 489 1,683 / 35.0 / 489 (same games shown)
NHL Sat 2026-10-03 (preseason), favourite LA (one 22:00 game) 645 / 12.7 / 192 513 / 10.1 / 155

The favourites' games were seen live within one poll of going live in every run.

Guards.

  • check_version_bump.py --base origin/main with all 8 ids passes.
  • Every other check_* passes, including drift.
  • All 50 scripts/test_*.py, including test_favourite_matching.py, pass against a fresh core main.

Plugin tests. run_plugin_tests.py for each touched plugin, branch vs main, with PYTHONIOENCODING=utf-8 on Windows:

  • Every plugin has +1 pass, which is the new test.
  • The failures are the same on both. The only one is baseball's test_baseball_activity.py (KeyError 'plays' on a real-feed fixture).

Previously stacked on #620, which has now merged; this PR has been rebuilt on main.

Related core PR: ChuckBuilds/LEDMatrix#772 (merged).

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3cebebbd-ffb8-491d-869e-5fb58c2a4943
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 128 complexity

Metric Results
Complexity 128

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@ChuckBuilds
ChuckBuilds force-pushed the claude/espn-canonical-scoreboard-keys branch 2 times, most recently from c7c0124 to 405814b Compare October 5, 2026 14:26
@ChuckBuilds
ChuckBuilds force-pushed the claude/sports-kickoff-filter-all branch from 3302f44 to f2492d6 Compare October 5, 2026 14:35
@ChuckBuilds
ChuckBuilds force-pushed the claude/espn-canonical-scoreboard-keys branch from 405814b to b148ccf Compare October 5, 2026 15:16
Base automatically changed from claude/espn-canonical-scoreboard-keys to main October 5, 2026 15:22
…ld show

Football 3.18.7 (#622) stopped a favourites-only board from waking for other
teams' kickoffs: the live loop offered every game on the scoreboard to core's
idle back-off, and each kickoff holds the poll at the live cadence for 15
minutes, so the board fetched the whole scoreboard about every 30 s on a busy
slate for games it then filtered out. The same rule now applies in the other
eight scoreboards that offer kickoffs: afl, baseball, basketball, hockey,
lacrosse, nrl, soccer and ufc. Each uses its own live filter
(_classify_live_game; hockey's _is_live_game_included; basketball keeps
tournament games in tournament mode; nrl matches team IDs). Baseball,
lacrosse and ufc filtered inline in update(), so that chain moves into a
_classify_live_game() both sites call. Boards showing every live game are
unchanged. odds-ticker offers no kickoffs and is untouched.

Replays under frozen time (fake gzipped ESPN): baseball, Fri 2026-09-25,
favourite LAD: 927 -> 620 scoreboard requests, 19.6 -> 13.1 MB wire; hockey,
Sat 2026-10-03, favourite LA: 645 -> 513, 12.7 -> 10.1 MB. Show-all
boards make the same requests and show the same games.

Versions (next patch above main): afl 1.37.1, baseball 1.59.1, basketball
1.44.1, hockey 1.44.1, lacrosse 1.37.1, nrl 1.36.1, soccer 2.41.1, ufc 1.20.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ChuckBuilds
ChuckBuilds force-pushed the claude/sports-kickoff-filter-all branch from f2492d6 to 7a26ac3 Compare October 5, 2026 15:26
@ChuckBuilds ChuckBuilds changed the title fix(sports): offer the idle back-off only the kickoffs each board would show (stacked on #620) fix(sports): offer the idle back-off only the kickoffs each board would show Oct 5, 2026
@ChuckBuilds
ChuckBuilds marked this pull request as ready for review October 5, 2026 15:32
@ChuckBuilds
ChuckBuilds merged commit dd04093 into main Oct 5, 2026
5 checks passed
@ChuckBuilds
ChuckBuilds deleted the claude/sports-kickoff-filter-all branch October 5, 2026 15:32
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