Skip to content

feat(common): sports_game_over -- the reconciled game-over check (sports family 5) - #770

Merged
ChuckBuilds merged 2 commits into
mainfrom
claude/family5-game-over-core
Oct 5, 2026
Merged

ChuckBuilds merged 2 commits into
mainfrom
claude/family5-game-over-core

Conversation

@ChuckBuilds

Copy link
Copy Markdown
Owner

Step 5 of the "reconcile, then promote" procedure (docs/SPORTS_UNIFICATION.md) for family 5, the pilot. ledmatrix-plugins #625 made all nine scoreboards' SportsLive._is_game_really_over byte-identical. This copies that body into a new hardware-free module. Nothing in core uses it until the plugins require the release that ships it.

New module: src/common/sports_game_over.py

SportsGameOverMixin provides:

  • _is_game_really_over(game), under its existing name.
  • One per-sport seam, FINAL_PERIOD: Optional[int] = None, the period from which a clock at 0:00 ends the game. None means the clock never ends a game, and only ESPN's final does. The plugins set hockey 3; basketball, football and lacrosse 4; afl, nrl, soccer, baseball and ufc None.
  • The owner's decisions, from fix(web): two api_v3 paths called names that no longer exist #625:
    • Equal scores at 0:00 at the end of regulation are not over; the game stays live through the overtime break.
    • Only a non-empty string clock counts.
    • ufc ends only on ESPN's final.
  • The host contract is in the docstring. SportsLiveSharedMixin._detect_stale_games calls the method, and the test pins the base order with the new mixin.

Docs

  • SPORTS_UNIFICATION.md: removes CLOCK_COUNTS_DOWN from the seam tables, the "why seams" text and step 2. It was described there but never existed in code, and the owner chose one seam. The FINAL_PERIOD row now says the default is None. It also records the family 5 decisions and status.
  • Also updated: the CHANGELOG (Unreleased, New modules), src/common/README.md, and sports_shared.py's list of methods that stay per plugin.

Verification

  • test/test_sports_game_over.py: 98 tests, mutation-checked. They cover the period, clock and status matrix, ties, unreadable scores, and ufc's recorded payload shapes.
  • test/test_sports_game_over_parity.py: 20 tests. With LEDMATRIX_PLUGINS pointed at plugins main (with fix(web): two api_v3 paths called names that no longer exist #625), the body matches every plugin copy and each plugin's FINAL_PERIOD matches the decided value.
  • Together with test_common_is_hardware_free: 124 pass.
  • Full suite: no new failing test IDs against a fresh origin/main run on the same machine.
  • Types: check_types is clean for the new module. The one Windows-local error is the existing fetch_service.py unused ignore, which is on main too.

After merge: the plugins repo's check_min_core_version.py table needs src.common.sports_game_over: None, or every plugins PR's safety job fails. That branch is ready to land right after this one.

🤖 Generated with Claude Code

ChuckBuilds and others added 2 commits October 5, 2026 09:21
…rts family 5)

New hardware-free module src/common/sports_game_over.py with
SportsGameOverMixin._is_game_really_over, the scoreboards' SportsLive check
that drops a game ESPN still lists as live, copied from ledmatrix-plugins
claude/family5-reconcile once the nine copies (five bodies) became one.

Over on a final period text; from period FINAL_PERIOD on, also on a 0:00
clock string unless the score is level (a tie at the end of regulation goes
to overtime; a game that ends tied ends on its final status). FINAL_PERIOD
is the one per-sport seam, a class attribute defaulting to None (the clock
never ends a game); the scoreboards declare 3 (hockey), 4 (basketball,
football, lacrosse) or None (afl, nrl, soccer, baseball, ufc).

- test/test_sports_game_over.py: the plugins' pinned matrix folded to the
  three FINAL_PERIOD values, edge shapes, the tie guard, ufc's recorded
  ESPN MMA states, an override deferring through super() (baseball), the
  base order with SportsLiveSharedMixin._detect_stale_games, host contract.
- test/test_sports_game_over_parity.py: with LEDMATRIX_PLUGINS, compares the
  body with every plugin copy (drift-report normalisation plus decorators)
  and each plugin's FINAL_PERIOD with the owner's decision.
- mypy ratchet, src/common/README.md, CHANGELOG (Unreleased, New modules).
- docs/SPORTS_UNIFICATION.md: family 5 status and decisions; the seam
  tables now match the code (FINAL_PERIOD defaults to None; the
  CLOCK_COUNTS_DOWN seam never existed and is gone from the doc).

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

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4b112dc4-18e4-49b0-83f0-3b840884087d
📥 Commits

Reviewing files that changed from the base of the PR and between bb475a7 and be5e1ec.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • docs/SPORTS_UNIFICATION.md
  • mypy-clean.txt
  • src/common/README.md
  • src/common/sports_game_over.py
  • src/common/sports_shared.py
  • test/test_sports_game_over.py
  • test/test_sports_game_over_parity.py
  • 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 11 complexity

Metric Results
Complexity 11

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 merged commit b638b91 into main Oct 5, 2026
15 checks passed
@ChuckBuilds
ChuckBuilds deleted the claude/family5-game-over-core branch October 5, 2026 13:36
@ChuckBuilds ChuckBuilds mentioned this pull request Oct 5, 2026
2 of 3 tasks
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