strat-gameplay-webapp/backend/app/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
..
__init__.py CLAUDE: Complete Week 4 - State Management & Persistence 2025-10-22 12:01:03 -05:00
ai_opponent.py CLAUDE: Replace black and flake8 with ruff for formatting and linting 2025-11-20 15:33:21 -06:00
cache.py CLAUDE: Implement Phase 3A - X-Check data models and enums 2025-11-01 15:32:09 -05:00
CLAUDE.md CLAUDE: Fix critical game engine issues and refactor CLAUDE.md docs 2025-11-19 16:05:26 -06:00
dice.py CLAUDE: Redesign dice display with team colors and consolidate player cards 2026-01-24 00:16:32 -06:00
exceptions.py CLAUDE: Add rate limiting, pool monitoring, and exception infrastructure 2025-11-28 12:06:10 -06:00
game_engine.py CLAUDE: Fix on_base_code encoding bug + add truth table & invariant tests 2026-02-08 23:33:10 -06:00
play_resolver.py CLAUDE: Add interactive x-check workflow foundation (steps 1-5) 2026-02-07 17:21:19 -06:00
roll_types.py CLAUDE: Redesign dice display with team colors and consolidate player cards 2026-01-24 00:16:32 -06:00
runner_advancement.py CLAUDE: Fix state recovery batter advancement and flyball descriptions 2025-11-21 15:38:29 -06:00
state_manager.py CLAUDE: Fix double play bug after state recovery 2026-02-07 13:55:10 -06:00
substitution_manager.py CLAUDE: Add game state eviction and resource management 2025-11-28 12:07:55 -06:00
substitution_rules.py CLAUDE: Replace black and flake8 with ruff for formatting and linting 2025-11-20 15:33:21 -06:00
validators.py CLAUDE: Replace black and flake8 with ruff for formatting and linting 2025-11-20 15:33:21 -06:00
x_check_advancement_tables.py CLAUDE: Replace black and flake8 with ruff for formatting and linting 2025-11-20 15:33:21 -06:00