Repository navigation
feat(common): sports_game_over -- the reconciled game-over check (sports family 5) - #770
Merged
Merged
Conversation
…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>
Contributor
|
Warning Review limit reachedYou'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. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (8)
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. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 11 |
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.
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_overbyte-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.pySportsGameOverMixinprovides:_is_game_really_over(game), under its existing name.FINAL_PERIOD: Optional[int] = None, the period from which a clock at 0:00 ends the game.Nonemeans 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 ufcNone.SportsLiveSharedMixin._detect_stale_gamescalls the method, and the test pins the base order with the new mixin.Docs
SPORTS_UNIFICATION.md: removesCLOCK_COUNTS_DOWNfrom 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. TheFINAL_PERIODrow now says the default isNone. It also records the family 5 decisions and status.src/common/README.md, andsports_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. WithLEDMATRIX_PLUGINSpointed 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'sFINAL_PERIODmatches the decided value.test_common_is_hardware_free: 124 pass.check_typesis clean for the new module. The one Windows-local error is the existingfetch_service.pyunused ignore, which is on main too.After merge: the plugins repo's
check_min_core_version.pytable needssrc.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