paper-dynasty-database/app/services
Cal Corum 4a1251a734 feat: add Refractor Phase 2 foundation — boost functions, schema, tests
Pure functions for computing boosted card ratings when a player
reaches a new Refractor tier. Batter boost applies fixed +0.5 to
four offensive columns per tier; pitcher boost uses a 1.5 TB-budget
priority algorithm. Both preserve the 108-sum invariant.

- Create refractor_boost.py with apply_batter_boost, apply_pitcher_boost,
  and compute_variant_hash (Decimal arithmetic, zero-floor truncation)
- Add RefractorBoostAudit model, Card.variant, BattingCard/PitchingCard
  image_url, RefractorCardState.variant fields to db_engine.py
- Add migration SQL for refractor_card_state.variant column and
  refractor_boost_audit table (JSONB, UNIQUE constraint, transactional)
- 26 unit tests covering 108-sum invariant, deltas, truncation, TB
  accounting, determinism, x-check protection, and variant hash behavior

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 13:39:03 -05:00
..
__init__.py feat: formula engine for evolution value computation (WP-09) 2026-03-12 19:34:40 -05:00
formula_engine.py refactor: rename evolution system to refractor 2026-03-23 13:31:55 -05:00
refractor_boost.py feat: add Refractor Phase 2 foundation — boost functions, schema, tests 2026-03-29 13:39:03 -05:00
refractor_evaluator.py refactor: rename evolution system to refractor 2026-03-23 13:31:55 -05:00
refractor_init.py fix: complete remaining evolution→refractor renames from review 2026-03-23 14:17:03 -05:00
season_stats.py fix: add pitcher_id null guard in _get_player_pairs 2026-03-23 12:50:16 -05:00