fix: guard T4 rarity upgrade from live-series pipeline collision (#57) #63

Merged
cal merged 2 commits from issue/57-bug-t4-rarity-upgrade-collision-with-live-series-c into main 2026-04-08 12:26:00 +00:00

2 Commits

Author SHA1 Message Date
cal
dee0349e54 Merge branch 'main' into issue/57-bug-t4-rarity-upgrade-collision-with-live-series-c 2026-04-08 12:25:52 +00:00
Cal Corum
aaa2eaa252 fix: guard against T4 rarity upgrade collision in live-series pipeline (#57)
Closes #57

- Add RARITY_LADDER and rarity_is_downgrade() to rarity_thresholds.py
- Add get_fully_evolved_players() to db_calls.py — queries a to-be-created
  database endpoint; returns empty set safely if endpoint is unavailable
- In batters/creation.py post_player_updates(): pre-flight check identifies
  players where OPS rarity would downgrade, then guards the rarity write to
  skip any downgrade for fully-evolved (T4) cards
- Same guard added to pitchers/creation.py post_player_updates()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 06:08:59 -05:00