strat-gameplay-webapp/backend/tests/unit
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
..
api CLAUDE: Add critical test coverage for Phase 1 2025-11-05 12:21:35 -06:00
config CLAUDE: Remove defensive alignment field completely 2025-11-14 13:02:22 -06:00
core CLAUDE: Fix on_base_code encoding bug + add truth table & invariant tests 2026-02-08 23:33:10 -06:00
middleware CLAUDE: Add rate limiting, pool monitoring, and exception infrastructure 2025-11-28 12:06:10 -06:00
models CLAUDE: Add comprehensive unit tests for PendingXCheck model 2026-02-07 17:30:19 -06:00
monitoring CLAUDE: Add rate limiting, pool monitoring, and exception infrastructure 2025-11-28 12:06:10 -06:00
services CLAUDE: Phases 3.5, F1-F5 Complete - Statistics & Frontend Components 2025-11-14 09:52:30 -06:00
terminal_client CLAUDE: Refactor offensive decisions - replace approach with action field 2025-11-14 15:07:54 -06:00
utils CLAUDE: Add critical test coverage for Phase 1 2025-11-05 12:21:35 -06:00
websocket CLAUDE: Redesign dice display with team colors and consolidate player cards 2026-01-24 00:16:32 -06:00
__init__.py CLAUDE: Complete Week 4 - State Management & Persistence 2025-10-22 12:01:03 -05:00