paper-dynasty-database/tests
Cal Corum 6a176af7da feat: Refractor Phase 2 integration — wire boost into evaluate-game
When a card reaches a new Refractor tier during game evaluation, the
system now creates a boosted variant card with modified ratings. This
connects the Phase 2 Foundation pure functions (PR #176) to the live
evaluate-game endpoint.

Key changes:
- evaluate_card() gains dry_run parameter so apply_tier_boost() is the
  sole writer of current_tier, ensuring atomicity with variant creation
- apply_tier_boost() orchestrates the full boost flow: source card
  lookup, boost application, variant card + ratings creation, audit
  record, and atomic state mutations inside db.atomic()
- evaluate_game() calls evaluate_card(dry_run=True) then loops through
  intermediate tiers on tier-up, with error isolation per player
- Display stat helpers compute fresh avg/obp/slg for variant cards
- REFRACTOR_BOOST_ENABLED env var provides a kill switch
- 51 new tests: unit tests for display stats, integration tests for
  orchestration, HTTP endpoint tests for multi-tier jumps, pitcher
  path, kill switch, atomicity, idempotency, and cross-player isolation
- Clarified all "79-sum" references to note the 108-total card invariant

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 13:04:52 -05:00
..
__init__.py feat: evolution track seed data and tests (WP-03) (#68) 2026-03-12 17:35:12 -05:00
conftest.py feat: add Refractor Phase 2 foundation — boost functions, schema, tests 2026-03-29 13:39:03 -05:00
test_formula_engine.py test: add Tier 1 and Tier 2 refractor system test cases 2026-03-24 09:02:30 -05:00
test_postgame_refractor.py feat: Refractor Phase 2 integration — wire boost into evaluate-game 2026-03-30 13:04:52 -05:00
test_refractor_boost_integration.py feat: Refractor Phase 2 integration — wire boost into evaluate-game 2026-03-30 13:04:52 -05:00
test_refractor_boost.py feat: Refractor Phase 2 integration — wire boost into evaluate-game 2026-03-30 13:04:52 -05:00
test_refractor_evaluator.py feat: Refractor Phase 2 integration — wire boost into evaluate-game 2026-03-30 13:04:52 -05:00
test_refractor_init.py test: add Tier 1 and Tier 2 refractor system test cases 2026-03-24 09:02:30 -05:00
test_refractor_models.py refactor: rename evolution system to refractor 2026-03-23 13:31:55 -05:00
test_refractor_seed.py test: add Tier 1 and Tier 2 refractor system test cases 2026-03-24 09:02:30 -05:00
test_refractor_state_api.py feat: add evaluated_only filter to GET /api/v2/refractor/cards (#174) 2026-03-25 17:32:59 -05:00
test_refractor_track_api.py test: add Tier 3 refractor test cases (T3-1, T3-6, T3-7, T3-8) 2026-03-24 21:38:25 -05:00
test_season_stats_model.py refactor: deduplicate pitcher formula and test constants 2026-03-17 09:49:33 -05:00
test_season_stats_update.py fix: stale docstring + add decision-only pitcher test 2026-03-19 10:31:16 -05:00