strat-gameplay-webapp/backend/tests/unit/core
Cal Corum 2a70df74bf CLAUDE: Fix on_base_code encoding bug + add truth table & invariant tests
Fix critical encoding mismatch where calculate_on_base_code() returned
bit-field encoding (3=R1+R2, 4=R3) but runner_advancement.py charts
expected sequential encoding (3=R3, 4=R1+R2). Values 3 and 4 were
swapped, causing wrong groundball results for R1+R2 and R3-only scenarios.

Add comprehensive test coverage:
- 1184 invariant tests (structural correctness across all outcomes × base codes)
- 49 hit truth table tests (SINGLE_1/2, DOUBLE_2/3, TRIPLE, HOMERUN)
- 33 walk truth table tests (WALK, HBP with stat flag verification)
- 42 simple out truth table tests (STRIKEOUT, LINEOUT, POPOUT, WP, PB)
- 88 groundball truth table tests (GB_A/B/C × infield back/in/corners_in × locations)

Total: 2401 unit tests passing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 23:33:10 -06:00
..
truth_tables CLAUDE: Fix on_base_code encoding bug + add truth table & invariant tests 2026-02-08 23:33:10 -06:00
__init__.py CLAUDE: Complete Week 4 - State Management & Persistence 2025-10-22 12:01:03 -05:00
test_dice.py CLAUDE: Fix all unit test failures and implement 100% test requirement 2025-11-04 19:35:21 -06:00
test_exceptions.py CLAUDE: Add exception tests and enhance stop-services script 2025-11-28 12:10:59 -06:00
test_flyball_advancement.py CLAUDE: Fix state recovery batter advancement and flyball descriptions 2025-11-21 15:38:29 -06:00
test_game_eviction.py CLAUDE: Add game state eviction and resource management 2025-11-28 12:07:55 -06:00
test_play_resolver_invariants.py CLAUDE: Fix on_base_code encoding bug + add truth table & invariant tests 2026-02-08 23:33:10 -06:00
test_play_resolver.py CLAUDE: Add game state eviction and resource management 2025-11-28 12:07:55 -06:00
test_recovery_double_play_fix.py CLAUDE: Fix double play bug after state recovery 2026-02-07 13:55:10 -06:00
test_roll_types.py CLAUDE: Complete Week 6 - granular PlayOutcome integration and metadata support 2025-10-29 20:29:06 -05:00
test_runner_advancement.py CLAUDE: Replace black and flake8 with ruff for formatting and linting 2025-11-20 15:33:21 -06:00
test_state_manager.py CLAUDE: Add game state eviction and resource management 2025-11-28 12:07:55 -06:00
test_substitution_rules.py CLAUDE: Phase 3F - Substitution System Testing Complete 2025-11-04 22:34:17 -06:00
test_validators.py CLAUDE: Fix squeeze_bunt validation - remove bases loaded restriction 2025-11-14 15:09:03 -06:00
test_x_check_advancement_tables.py CLAUDE: Fix all unit test failures and implement 100% test requirement 2025-11-04 19:35:21 -06:00