Skip to content

docs: update README for sports-plugins branch - #8

Merged
ChuckBuilds merged 2 commits into
mainfrom
sports-plugins
Oct 11, 2025
Merged

docs: update README for sports-plugins branch#8
ChuckBuilds merged 2 commits into
mainfrom
sports-plugins

Conversation

@ChuckBuilds

Copy link
Copy Markdown
Owner
  • Added Plugin Releases section highlighting Phase 2 sports plugins
  • Listed hockey-scoreboard as first sports plugin
  • Updated stats: 9 total plugins across 7 categories
  • Added sports-plugins branch information
  • Teased upcoming sports plugins (football, basketball, baseball, soccer)

- Added Plugin Releases section highlighting Phase 2 sports plugins
- Listed hockey-scoreboard as first sports plugin
- Updated stats: 9 total plugins across 7 categories
- Added sports-plugins branch information
- Teased upcoming sports plugins (football, basketball, baseball, soccer)
@ChuckBuilds
ChuckBuilds merged commit cf5fdb5 into main Oct 11, 2025
ChuckBuilds pushed a commit that referenced this pull request Aug 27, 2026
None of this was written down anywhere a user would look. The settings existed
only as schema descriptions in the web UI, plus code comments and commit
messages -- and the behaviour is not guessable, which is exactly why it kept
being misread.

The section leads with the thing that trips people up: upcoming_games_to_show
is not "how many cards you see", it is the size of a POOL that the panel
cycles, keeping its place between visits. Making it bigger lengthens the lap,
so any one game appears LESS often -- the opposite of what people reach for it
to do.

Then the three modes as a table, because which one you are in depends on two
settings at once, and the useful one (favourites first, then others) is the
combination that until now did nothing.

Facts in it are measured rather than described: ~950 upcoming college games of
which ~250 involve a ranked team; 18 distinct matchups over three hours of
rotation while the pool stays at 6 cards. Every default quoted was checked
against the schema.

The AP_TOP_n warning is in both this section and the Dynamic Team Resolution
section that introduces those patterns, because that is where someone meets
them: expanding a group into the favourites list makes your own teams compete
with it, and on a real schedule UGA's next game was favourite-game #5 and
Auburn's #8, so neither appeared with a limit of 3.

Shorter version in the other eight READMEs, without the college-specific
detail, and noting that the quality and division filters are inert for leagues
with no poll and no divisions.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STMbQE4YctTacQXfbYqKuW
ChuckBuilds added a commit that referenced this pull request Sep 2, 2026
…neages (#353)

* feat(sports): only fill the other slots with games worth watching

Selection was purely chronological, so rotating harder just served more
filler. On a real board's college schedule, 923 non-favourite upcoming games:
235 involve a nationally ranked team and the rest are matchups the viewer has
never heard of. Two settings now decide what fills the slots left over after
favourites, and neither ever touches favourites themselves -- follow a
smaller-division school and its games always show.

other_games_min_quality (default "ranked") uses the rankings table the plugin
already fetches for the rank badge, so it costs no extra requests. That gating
had to move: rankings were only fetched when show_ranking was on, which left
the filter with an empty table and would have emptied the board.

other_games_divisions (default ["fbs"]) needs ESPN's own group rosters -- two
requests a day, cached. conferenceId cannot do this job: cross-division games
put an FBS conference on an FCS slate, so the id sets overlap and Merrimack at
Delaware classifies as FBS. The group rosters are disjoint (148 FBS ids, 130
FCS). Every participant must be in a checked division, so leaving FCS
unchecked also removes a ranked side hosting an FCS school -- which is the
actual complaint.

Every check fails OPEN. A rankings table that did not load, or divisions that
did not resolve, allows the game: a board showing filler is poor, a board
showing nothing is broken.

Three real defects found while testing this, all in the already-pushed commits
of this PR:

- SportsRecent is a SIBLING of SportsUpcoming, not a subclass, so its call to
  _favorites_first hit a method it did not have. AttributeError, swallowed by
  update()'s own try/except, recent games silently blank. The shared helpers
  now live on SportsCore and a test drives the real SportsRecent class rather
  than only Upcoming, which is what hid it.
- nrl matches favourites by ESPN team id on purpose -- its abbreviations are
  not unique, "NEW" is both Newcastle Knights and New Zealand Warriors -- and
  the ported abbreviation-based matcher shadowed that on the upcoming path,
  where it would favourite the wrong club. Removed; nrl keeps its own.
- The custom-league editor is an array-table, and array-table.js stringifies a
  list into "a,b" before submitting, so an array-typed property inside a row
  can never validate. The checkbox group is out of custom_leagues; the enum
  string stays.

Class-level defaults for everything the selection path reads, because that
read happens inside update()'s try/except: a missing attribute does not raise
anywhere visible, it just blanks the board.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STMbQE4YctTacQXfbYqKuW

* fix(sports): make the new settings actually take effect

Two defects found while re-checking the logic with the season a week out.
Both are the same shape: nothing raises, nothing logs, the feature is just
quietly not there.

1. None of the five new settings reached the code. Managers do not read the
   plugin config -- _adapt_config_for_manager translates it, and that
   translation is an explicit whitelist. Every one of the new keys was
   declared in the schema, rendered in the web UI, read by sports.py, and
   dropped in between. A user could set them, save, and nothing would change;
   the code kept its own defaults. All nine plugins, and the lineages disagree
   about where the values live: game_limits, filtering, or the league root,
   with hockey and lacrosse going through resolve_value instead. Each now
   reads from the same place its own schema declares them.

   test_settings_reach_the_manager.py guards it, using values that are NOT the
   defaults -- a fixture built from defaults passes against a translation that
   drops the key entirely.

2. Making "ranked" the default quality made every league fetch rankings, and
   only college leagues have them: NFL's endpoint 404s. _fetch_team_rankings
   only short-circuits on a NON-empty cache, so a failed fetch leaves it empty
   and the next update tries again -- roughly 2,900 dead requests a day per
   non-college league at a 30s interval. Gated on the league actually having a
   poll.

Verified against the live API rather than assumed: the division lookup fetches
148 FBS and 130 FCS team ids, caches them, serves a second instance without
touching the network, and is skipped entirely for NFL. college-football's
rankings endpoint returns 25; nfl's returns 404.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STMbQE4YctTacQXfbYqKuW

* fix(sports): fetch each ranking poll once, not once per group

AP_TOP_5, AP_TOP_10 and AP_TOP_25 all resolve from the same poll and differ
only in how far down it they slice -- and the value cached was the whole list.
The key, though, named the pattern, so configuring two groups fetched the
identical payload twice, stored it twice and expired it twice for no
difference in the result. Seen on a real board:
dynamic_teams_ncaa_fb_AP_TOP_10.json and dynamic_teams_ncaa_fb_AP_TOP_25.json
side by side, both holding the same 25 teams.

Keyed by sport instead. Five plugins carry a resolver with patterns; two key
spellings between them. afl, nrl and soccer ship a stub with no patterns at
all, so there is nothing to key.

The test asserts one fetch PER SPORT rather than one overall: hockey and
lacrosse declare groups across several sports, and those really are separate
polls. It also skips the shared-cache assertion for lineages that pair a
class-level dict with a per-instance freshness stamp, where a new instance
refetches by construction -- pre-existing, and not what this change governs.

Reverting the key in any of the five fails three checks.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STMbQE4YctTacQXfbYqKuW

* fix(sports): fetch college rankings from the endpoint that has them

Driving the real NCAAFBUpcomingManager end to end -- which nothing had done --
showed the selection working and "rankings loaded: 0". The quality filter was
failing open on every board.

fetch_standings tried /standings first and fell back to /rankings only on a
404. College football answers /standings with HTTP 200 and no "rankings" key,
so the fallback never fired. Verified against the live API today:

    football/college-football/standings  200, no "rankings" key
    football/college-football/rankings   200, 3 ranking blocks
    football/nfl/standings               200
    football/nfl/rankings                404

Nothing ever failed. _fetch_team_rankings parsed a body with no rankings in
it and cached an empty table, so the AP rank badge never appeared however
show_ranking was set -- that part predates this PR -- and the new "ranked"
filter passed every game, because an empty table fails open.

The endpoint is now chosen by league rather than discovered by error code,
and a 200 without the key counts as a miss. After the fix the same end-to-end
run loads 25 rankings and fills the other slots with SJSU@USC (#14),
UTEP@OU (#10) and MIA@STAN (#7) instead of the next three unranked games.

Also verified end to end, both directions: NFL recent returns 2 TB games plus
2 others, newest first, and fetches 0 rankings -- no poll exists, and none is
requested.

Note on the baseball copy: the first attempt replaced from fetch_standings to
the next top-level class, which in that file swallowed fetch_game_summary,
fetch_player_details and _parse_player_details. Its own test_player_card
caught it. Redone bounded to the method, and targeted at ESPNDataSource
specifically -- the abstract declaration above it has the same signature.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STMbQE4YctTacQXfbYqKuW

* test(football): drive the real manager classes, not just the base ones

The SportsRecent defect survived every test because they all drove
SportsUpcoming directly. This drives what the plugin actually instantiates --
live, recent and upcoming, for both leagues -- and asserts each carries every
selection helper and setting.

Favourite detection is checked in BOTH directions. Asserting only that a
favourite returns True passes against a matcher that returns True for
everything, which would sweep the whole league into the favourites bucket and
quietly empty the other-games slots.

Reverting the helpers to SportsUpcoming reproduces the original failure
verbatim: 'NFLRecentManager' object has no attribute '_is_favorite_game'.

Verified alongside, by driving the real managers end to end against live ESPN
data rather than fixtures:

- NCAA upcoming: 3 favourites (UGA, AUB) plus 3 ranked others -- SJSU@USC
  (#14), UTEP@OU (#10), MIA@STAN (#7)
- NFL recent: 2 TB games plus 2 others, newest first, 0 rankings requested
- both live managers update cleanly and resolve favourites
- the config the web UI writes from schema defaults validates, a user-edited
  one validates, and a string where an array belongs is rejected

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STMbQE4YctTacQXfbYqKuW

* docs(sports): explain how favourite selection actually works

None of this was written down anywhere a user would look. The settings existed
only as schema descriptions in the web UI, plus code comments and commit
messages -- and the behaviour is not guessable, which is exactly why it kept
being misread.

The section leads with the thing that trips people up: upcoming_games_to_show
is not "how many cards you see", it is the size of a POOL that the panel
cycles, keeping its place between visits. Making it bigger lengthens the lap,
so any one game appears LESS often -- the opposite of what people reach for it
to do.

Then the three modes as a table, because which one you are in depends on two
settings at once, and the useful one (favourites first, then others) is the
combination that until now did nothing.

Facts in it are measured rather than described: ~950 upcoming college games of
which ~250 involve a ranked team; 18 distinct matchups over three hours of
rotation while the pool stays at 6 cards. Every default quoted was checked
against the schema.

The AP_TOP_n warning is in both this section and the Dynamic Team Resolution
section that introduces those patterns, because that is where someone meets
them: expanding a group into the favourites list makes your own teams compete
with it, and on a real schedule UGA's next game was favourite-game #5 and
Auburn's #8, so neither appeared with a limit of 3.

Shorter version in the other eight READMEs, without the college-specific
detail, and noting that the quality and division filters are inert for leagues
with no poll and no divisions.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STMbQE4YctTacQXfbYqKuW

* fix(sports): expire the division lookup instead of holding it forever

The in-memory copy had no clock. _load_division_team_ids returned early on
any non-None value, so the first result a process produced was the only one
it ever used, and a board that happened to be offline for that first lookup
ran with division filtering disabled until someone restarted the service --
on a display that stays up for weeks, indefinitely. A roster that changed
between seasons was never picked up either.

The copy now expires like the stored one: a day for a resolved lookup, ten
minutes for one that came back empty, so a blip costs minutes rather than a
day without retrying per frame.

Also lower-cases the league before the "college" test -- the guard that
decides whether to make the two requests at all was case-sensitive on a value
the config supplies.

The probe sets the freshness stamp alongside the pre-loaded ids: a populated
cache with a zero stamp now reads as stale and goes back to the network,
which is not what a test pre-loading divisions means.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RRtqXDCnvnY6EQwhT5CV9

* chore(sports): publish the follow-up work as new plugin versions

Nine minor bumps, one per sports plugin. The 1.32.0-generation entry that
1.32.0 already shipped under is restored to the text it was released with --
it had been edited in place while this work was still on the same branch, and
it now described settings that version does not have.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RRtqXDCnvnY6EQwhT5CV9

* fix(sports): act on the review -- divisions, empty favourites, dead tests

Six of CodeRabbit's thirteen comments were real. Three are behaviour, three
are the tests and docs that let the behaviour hide.

1. FBS/FCS is a college FOOTBALL taxonomy, and the lookup ran for any league
   whose name contains "college". Checked against the live API, groups 80 and
   81 exist for that one league:

       football/college-football     200, 148 FBS + 130 FCS team ids
       baseball/college-baseball     500
       lacrosse/mens-college-lacrosse 500
       basketball/mens-college-basketball  200, 0 items
       basketball/womens-college-basketball 200, 0 items
       hockey/mens-college-hockey    200, 0 items

   An empty roster fails open, so the setting filtered nothing on those
   leagues; it only cost two requests a day and two warnings in the log. The
   group ids are now keyed by league, and the schema and READMEs say plainly
   that the division filter is college football alone rather than implying
   every college league has divisions to pick from.

2. With no favourite teams configured, selection took the next N games
   chronologically and never called _passes_other_filters. Every game in that
   branch is a non-favourite game, so both settings were inert for exactly the
   boards that have nothing else narrowing the list -- ask for ranked games
   only, get the next three kickoffs. Both branches now go through
   _filtered_or_all, which fails open as a whole: a filter matching nothing
   would blank the mode, and there is no favourite left to carry it.

3. afl and nrl declare these keys twice, at the config root and inside
   game_limits, and the web UI renders both. afl's translation read the root,
   nrl's read game_limits, so each plugin had a set of controls that accepted
   input and dropped it. Both now read either, game_limits first, matching how
   nrl already resolved the two older limits.

4. The division-filter assertion was vacuous in all nine test copies. The
   fixture put home ids in the division sets and away ids nowhere, so every
   away side classified as "other", the filter dropped the whole slate, and
   all() over the empty result passed -- it would have passed just as well
   against a filter that rejected everything. The sets now cover both sides,
   one game straddles deliberately (and is the FIRST game, or selection never
   reaches it), and the count is asserted. Ablating _game_divisions to the home
   side only now fails two checks; before, it failed none.

5. test_settings_reach_the_manager now asserts that every location a plugin's
   own schema offers actually reaches the manager -- root, game_limits or
   filtering, whichever that schema declares -- rather than one fixture that
   fills in all three and passes whichever the adapter happens to read.
   Reverting the afl fallback fails five of its checks.

6. E731: the two assigned lambdas in the ranking-fetch tests are functions.

Skipped, with reasons:

- "Read broadcast data from `broadcasts`, not `broadcast`." The scoreboard
  payload carries both, and `broadcast` is the string this code wants:
  college-football "NBC", nfl "NFL Net", college-baseball "ESPN",
  mens-college-lacrosse "ESPN", ufc "Paramount+". Where it is empty
  (soccer/eng.1, nhl) `broadcasts` is an empty list too, so reading the other
  key changes nothing.
- "Namespace the persistent cache keys by plugin." They are already keyed by
  sport and by league, and the copies of the resolver store the same shape, so
  a shared entry is the same data fetched once instead of twice.
- "Load deferred plugin modules under unique module names." Each test script
  runs in its own process and puts only its own plugin directory on sys.path,
  so there is no other plugin's module to collide with.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RRtqXDCnvnY6EQwhT5CV9

* fix(sports): make the filters fail open as a set, not just per check

Three gaps found reading the selection logic back, all the same shape: a
filter doing exactly what it was asked leaves the board with less than the
user expected, and nothing says why.

1. `_passes_other_filters` fails open per check -- a ranking table that could
   not be fetched allows every game -- but the SET of filters had no such
   guard on the favourites path. Favourites idle inside the schedule window
   plus a quality bar nothing clears meant an empty list, which is a blank
   mode rather than a short one. `_filtered_or_all` already made that
   whole-list fallback for a board with no favourites; the favourites path now
   makes the same one. `other_..._games_to_show` of 0 is an explicit
   "favourites only" and is still honoured, blank or not.

2. "broadcast" was the one check that could not fail open, because the
   scoreboard payload always carries the key -- it is simply empty in leagues
   ESPN publishes no listings for. Measured today:

       college-football "NBC"    nfl "NFL Net"     college-baseball "ESPN"
       mens-college-lacrosse "ESPN"    mma/ufc "Paramount+"
       soccer/eng.1 ""           hockey/nhl ""

   So picking it on a hockey or soccer board removed every non-favourite game.
   Coverage is now read off the slate rather than a hardcoded league list: no
   game carrying a broadcaster means the data is absent, not that nothing is
   on television, and the check allows everything.

3. The ranking table is keyed by the abbreviation the RANKINGS endpoint
   returns and matched against the SCOREBOARD's. Nothing guarantees the two
   agree, and if they stop agreeing the filter silently removes every
   non-favourite game -- the same silence that let "rankings loaded: 0" run on
   real boards until someone went looking. A loaded poll matching no game on
   the schedule now warns, throttled to once an hour, and names the
   abbreviations it holds so the mismatch is visible rather than inferred.

Ablating any one of the three fails its own check and no others.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RRtqXDCnvnY6EQwhT5CV9

* feat(sports): one side in a checked division is enough, and guard the schema

The division filter required EVERY participant to be in a checked division, so
the default ["fbs"] read as "FBS versus FBS only". Measured against the real
Week 2 slate, that silently removed five of the twenty ranked matchups --
Missouri, Utah, Tennessee, Texas Tech and BYU, each hosting an FCS school.
Those are games about a team the viewer checked the box for.

One side is now enough. FBS vs FCS is in; FCS vs FCS is still out unless `fcs`
is checked, which is what the setting is actually for. On the same slate, with
the same rotation, coverage of ranked matchups goes 15/20 -> 20/20, and the
longest gap between two showings of one game moves 40 -> 69 minutes because the
pool is five games larger. Favourites remain exempt from every filter, so a
favourite's own FCS tune-up game was showing before this change and still is.

The quality filter keeps this from becoming a flood: with the default "ranked",
an unranked FBS side hosting an FCS school is rejected on quality anyway, so
what the looser rule admits is specifically the ranked matchup.

Also, from an audit of all 31 selection blocks across the nine schemas:

- The five settings are declared in every block, each with a default, matching
  types, and identical ranges (0-20 counts, 0-86400 seconds, the two enums).
  The `other_*` counts default to their own block's limit, so an upgrade keeps
  the games the board was already showing.
- scripts/check_selection_settings.py now enforces that, structurally: it finds
  every properties-dict that declares a game limit, so a league added later is
  covered without editing the checker. Its self-test asserts the repo passes
  AND that five separate kinds of gap are caught, because a guard that cannot
  fail is indistinguishable from one that passes.
- soccer's custom_leagues block is the one place a setting is legitimately
  absent. array-table.js coerceValue() has no array branch: it submits "fbs"
  where the schema wants ["fbs"], and jsonschema then rejects the entire save,
  not just that field. Adding it there broke three cases in
  test_custom_league_config.py, which is how the constraint was found. The
  checker knows about row editors and does not demand arrays inside one.
- The reads are hardened. These land in update()'s own try/except, so a string
  where an integer belongs surfaced as a mode that rendered nothing rather than
  as an error. Counts and the interval clamp to their declared range,
  other_games_min_quality is case-normalised, and a bare "fbs" becomes one
  division rather than list("fbs") == ['f','b','s'] -- three names matching
  nothing, which rejected every non-favourite game.

Ablating the division rule back fails two checks; ablating any of the schema
guarantees fails the guard's self-test.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RRtqXDCnvnY6EQwhT5CV9

* fix(sports): rotate on the display path, and make three settings reachable

Two findings from auditing the configuration surface, and they compound: the
rotation interval was a setting that could not take effect, gated behind an
interval that could not be changed.

1. `_other_games_window` only ever ran from update(), which returns early until
   `upcoming_update_interval` has passed -- an hour. So
   `other_rotation_interval_seconds: 240` did not produce fifteen slices an
   hour; it produced one jump of fifteen windows, once an hour. On a real board
   that reads as the same two matchups for six hours, which is exactly what
   ledpi's journal showed: 89 visits to ncaa_fb_upcoming, UNC@TCU and SJSU@USC
   every single time.

   Which games exist, and which are worth a slot, is a fetch concern. WHICH of
   them is on screen is a display concern. The composition is now split out of
   _favorites_first, and the two display paths re-cut the slice when the
   interval passes -- one list slice and a sort of a few games, no network.
   Same lesson `_advance_live_game_if_due` already carries a comment about, for
   the same reason: gating a display decision on the fetch quantises it to the
   refresh rate.

   The card on screen keeps its place if it survived the cut, so rotating
   changes what comes next rather than interrupting what someone is reading.

2. Five settings sports.py reads were unreachable: no schema declaration, no
   translation, permanently at their built-in defaults. Three are worth
   exposing and now are -- recent_update_interval, upcoming_update_interval and
   stale_game_timeout. The odds intervals are left internal: odds are already
   fetched per selected game, so the knob would be a second lever on the same
   behaviour.

   The shape of the gap differed per plugin, which is why one audit found all
   of it: afl, nrl and soccer DECLARED the two intervals and dropped them in
   translation -- controls the form rendered and the board ignored, the same
   bug this PR opened with. baseball, basketball, football and ufc had neither.
   hockey and lacrosse were already complete, under `update_intervals.recent`
   and `.upcoming`; only the staleness guard was missing there.

   `update_interval_seconds` stays undeclared deliberately: all three managers
   overwrite it with their own per-mode interval, so a control for it would do
   nothing in the place a user would expect it to.

The propagation test now covers all eight settings rather than the five
selection ones, and asserts each still arrives from every location its own
schema offers. Removing any single adapter entry fails two of its checks.

Also updates the empty-mode stand-in in three plugins, which builds a bare
object carrying only what display() touches -- it binds the two real rotation
methods rather than stubbing them, so a regression that made them raise is
caught rather than hidden.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RRtqXDCnvnY6EQwhT5CV9

* feat(football): default college football to five games, no favorite team

`favorite_teams` was already empty by default; the counts were 1. With no
favorites configured every card is a non-favorite card, so a fresh college
install showed exactly one game and repeated it until the schedule moved on --
which is the state ledpi was in this morning, two games shown 89 times each
over six hours.

Five in each of the four counts. The `other_*` pair mirrors its own limit, as
in every other block, so adding a favorite team later adds to what is there
rather than replacing it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RRtqXDCnvnY6EQwhT5CV9

* feat(sports): order the other-games pool by the matchup, not the clock

The quality filter declares the poll to be the thing worth showing, and then
selection ignored the number entirely. #1 against #2 and #25 against an
unranked side were interchangeable: both passed the gate, and whichever kicked
off sooner took the slot. Rank was fetched, cached, and used for nothing but
the badge painted on the card -- the only sort touching it in the whole file
was `sorted(rankings)[:8]`, for a log line.

The non-favourite pool is now ordered by the better of the two sides' poll
positions before the window slices it, with kickoff as the tie-break. The
rotation still walks the entire pool, so coverage and the measured gaps are
unchanged; it walks DOWN the ladder instead of along the clock. What changes is
which games lead: the first window after a restart or an update holds the best
game available rather than the earliest, and a board is far more often freshly
started than three hours into a lap.

Favourites keep kickoff order. Ordering your own teams by rank would put a
week-8 fixture ahead of Saturday's, and for your own team the next game is the
point -- a test pins that.

A league with no poll keeps the chronological order it had, because there is
nothing to sort on: `_by_importance` returns the list untouched when the
rankings table is empty, which is also what happens on a failed fetch.

Reverting the ordering fails the check that the first window holds the best
game; the fixture puts the top-ranked matchup last chronologically so the two
orderings cannot agree by accident.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RRtqXDCnvnY6EQwhT5CV9

* fix(sports): one game per team in the ordered pool

Shipping the rank ordering to a real board showed what the chronological order
had been hiding: the upcoming pool is not a week of fixtures. For college
football it is the whole season -- ledpi logged "Found 947 total upcoming games
in data" -- so ordering by rank alone stacked all twelve of the #1 team's games
above the #2 team's first one. The board went straight to KENT@OSU, ILL@OSU,
then OSU@IOWA, MD@OSU: Ohio State's season, in order, before any other matchup.

The pool now keeps one game per team, the soonest, and orders those by rank. It
reads as "what each team has next, best matchup first", which is what an
upcoming board means, and it is inherently near-term without a horizon setting
to tune: a team's next game is by definition its closest one.

Deduping happens on a soonest-first pass rather than on the rank-ordered one.
Taking the first entry per team out of rank order would keep whichever game
sorted first by rank, and for a game between two ranked sides that is not
necessarily the one being played next.

The ablation reproduces the board's symptom exactly -- top0, top1, top2, top3
-- so the test fails for the reason it was written.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RRtqXDCnvnY6EQwhT5CV9

* fix(sports): share the favourite slots between your teams

The other-games pool refuses to spend its slots on one team; favourites were
still doing exactly that. `favorites[:limit]` takes the soonest N, and the
upcoming list is a season, so a team that plays either side of another's bye
takes both slots. Walked across a real 901-game season with UGA and AUB at a
limit of 2: nine days showed Auburn twice and Georgia not at all.

Round-robin instead -- each favourite team's next game before any team's
second. Depth survives where there is room: one favourite with three slots
still gets its next three games, because a team's second game only comes up
once every team has had a first. A game between two favourites is picked once
and counts for both.

Which side of a game belongs to which favourite turned out to be a per-lineage
question. NRL matches on ESPN team ids because its abbreviations are not unique
-- "NEW" is both Newcastle and New Zealand -- while the other eight match on
abbreviation. The first version assumed abbreviations and silently grouped
nothing there: every queue empty, every favourite slot empty, and the nine
plugins would have disagreed about what the setting does. It now asks for the
lineage's own matcher.

The fixture gives each team both spellings, as the existing one does, so a
single test covers both styles -- and the ablation fails on the id-matching
lineage too, which is what proves that path is really exercised.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RRtqXDCnvnY6EQwhT5CV9

* test(harness): name the check that failed, not the last line logged

Nine plugins failed in CI with the same reason -- "ignoring unusable
other_upcoming_games_to_show='not a number', using 3" -- which is a log line
from a test that PASSES, emitted on stderr near the end of the script. The
runner reported the last line of stdout+stderr, and for any script that warns
on stderr that is the warning, whether the run passed or failed. The reason
was therefore identical for every failure and named nothing.

It now reports the checks that actually failed, up to three, and falls back to
the exit code plus the last few lines when a script died without naming one --
a traceback, or an exit from somewhere unexpected. That case has to stay
visible: it is the one where there is no check name to report and the tail is
all the evidence there is.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RRtqXDCnvnY6EQwhT5CV9

* fix(sports): a fresh boot must not swallow the first coverage warning

CI failed all nine plugins on "the mismatch is reported" and no machine here
could reproduce it. The reason is uptime: monotonic() counts from an arbitrary
origin, a few hundred seconds on a runner that just booted, and the throttle
compared it against a stamp of 0. So "never logged" read as "logged at the
epoch", and the first warning was suppressed for the first hour of uptime --
precisely when a misconfigured board is being watched. This machine has days of
uptime, so monotonic() dwarfs the hour and it always passed.

Zero now means never logged, as it already does for the rotation clock a few
methods up. The test drives it at 120 seconds of uptime rather than trusting
the host's, so the case is pinned on any machine.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RRtqXDCnvnY6EQwhT5CV9

* feat(hockey): sunset the bundled scroll fallback, floor at 3.2.0 (#346)

B6, piloted on one plugin. B5 moved this scoreboard onto the core's
src.common.sports_scroll behind a guarded import, keeping the frozen
pre-adoption implementation as scroll_display_legacy.py so it still ran on a
core that predated the module. That copy is now deleted and the import is
plain.

The guard goes with the copy, deliberately. Keeping try/except with nothing
behind it would name the missing scroll_display_legacy rather than the core
module that is actually absent -- and that name is the whole user-visible
contract here, because PluginManager catches the ModuleNotFoundError and parks
the plugin in ERROR with one log line. Get it wrong and the user is told the
wrong thing about why their scoreboard vanished.

Hockey first, alone, because B5 shipped four of eight plugins with scroll mode
broken at once and every gate was green at the time. It is also the only
adoption besides baseball exercised on real hardware.

The floor rises to 3.2.0 -- the release that ships the module, not a later one:
a floor describes what the plugin needs. compatible_versions moves to >=3.2.0
with it, since compatibility.check evaluates the range before the floor and
leaving >=2.0.0 beside a 3.2.0 floor would be self-contradictory even though it
changes no verdict.

Behaviour is unchanged. The frozen copy and the live path were method-for-method
identical for every content method, all 16 safety-harness renders pass across
eight panel sizes, and the class-level separator-icon constants -- the exact
thing B5 lost -- are byte-identical after the de-indent. 703 lines removed.

test_core_fallback.py -> test_core_scroll.py, rewritten rather than deleted:
its machinery has already caught two shipped bugs, and both were load-time
bugs the harness cannot see because the core base catches exceptions out of
prepare_scroll_content. It now asserts the sunset instead of the fallback --
the import is top-level and unguarded, no copy exists or is imported, the base
is the core class by identity, an old core fails naming exactly
src.common.sports_scroll, and the manifest floors at 3.2.0 or above.

That last one is load-bearing: nothing else in either repo checks the floor's
VALUE. The harness runs against core main, which has the module whatever the
manifest says; check_manifest_version_fields checks the field's spelling, not
its number; the registry carries no floor at all. A sunset shipping with a
2.0.0 floor would be green everywhere while the store handed it to a 3.1.0
core.

The cross-path attribute diff that caught afl's unset _game_renderer has no
second path left to diff against, so it is replaced by a static self-attribute
audit: attributes a method reads that nothing in the class assigns and the
built object does not carry. Same defect class, one path.

check_scroll_adoption.py gains sunset_violations and a SUNSET_PLUGINS set.
offending_classes is left byte-identical so its eleven pinned cases keep
meaning what they mean. The existing check asks whether the fallback was
INLINED and structurally cannot ask whether it still EXISTS -- it opens
scroll_display.py and nothing else -- so a resurrected file or a returned guard
would both pass. The set is listed rather than inferred: a plugin that never
adopted legitimately has neither guard nor copy, so adding an id is the
deliberate act of stating the sunset holds, in the same PR as the deletion.

The self-test's most important new case is the negative one: an unrelated
try/except must not read as the guard returning. This file already has two
(ScrollHelper, the Pillow resample constant) and basketball has three, so a
check that fired on any try/except would have failed all eight on day one.

Also fixes the runner prefix: these scripts printed "FAIL name:", which
run_plugin_tests.py does not match (it greps [FAIL] or FAILED), so CI reported
the stream tail instead of naming the failing check. Now "[FAIL] name:".

Verified both regressions are caught, by both the test and the gate: restoring
the guard fails test_the_core_import_is_unguarded and trips the gate;
restoring the copy fails test_the_bundled_copy_is_gone and trips it too.
hockey 20/20; fleet 222 passed, 2 skipped, 1 failed -- unchanged, that failure
being football's pre-existing test_favorite_live_boost.py, which reproduces on
a clean origin/main.


Claude-Session: https://claude.ai/code/session_014RRtqXDCnvnY6EQwhT5CV9

Co-authored-by: Claude <noreply@anthropic.com>

* fix(hockey-scoreboard): keep this PR to selection, not the scroll sunset

The merged branch carried two feature versions. 1.21.0 is the selection
work this PR is for; 1.22.0 is the B6 scroll-fallback sunset, which has
its own PR (sunset/hockey-scroll-fallback) and raises the core floor to
3.2.0. Shipping them together would have floored every user at 3.2.0 to
get a selection fix, and advertised a sunset in the manifest while the
bundled copy was still present.

Hockey drops to 1.21.0 at >=2.0.0; scroll_display.py,
scroll_display_legacy.py and test_core_fallback.py return to main's
copies; the sunset-only test_core_scroll.py and the SUNSET_PLUGINS
edition of check_scroll_adoption.py go back to main's versions too.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* style(scoreboards): drop the redundant `or {}` in the ranked-quality check

`(getattr(self, "_team_rankings_cache", None) or {}) and not ...` is
truth-identical to `getattr(...) and not ...` in all three cases -- None,
an empty dict, and a populated one -- since `{}` is falsy either way.
Codacy flagged it once per lineage, which is the whole of its "8 new
issues" on this PR.

Football expresses the same guard as `self._rankings_loaded()`; the
siblings have no such helper, so this keeps the inline form rather than
porting a method to eight copies for a one-line simplification.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
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