Implemented complete X-Check resolution system in PlayResolver with defense range and error table lookups. Changes: - Added X_CHECK case to resolve_outcome() method - Implemented _resolve_x_check() main resolution method - Added _adjust_range_for_defensive_position() for playing in logic - Added _lookup_defense_table() for defense range table lookups - Added _apply_hash_conversion() for G2#/G3# to SI2 conversion - Added _lookup_error_chart() for error determination - Added _determine_final_x_check_outcome() for final outcome mapping - Added XCheckResult to PlayResult dataclass - Integrated all Phase 3B tables (defense, error, holding runners) Features: - Full defense table lookup (infield, outfield, catcher) - Error chart lookup with priority ordering (RP > E3 > E2 > E1 > NO) - Range adjustment for playing in (+1, max 5) - Hash conversion based on playing in OR holding runner - Error overrides outs to ERROR outcome - Rare play handling - Detailed X-Check audit trail in XCheckResult Placeholders (to be completed in later phases): - Defender retrieval from lineup (currently uses placeholder ratings) - SPD test implementation (currently defaults to G3) - Batter handedness from player model - Runner advancement tables (Phase 3D) Testing: - All 9 PlayResolver tests passing - All 36 X-Check table tests passing - All 51 runner advancement tests passing - 325/327 total tests passing (2 pre-existing failures unrelated) - play_resolver.py compiles successfully Phase 3C Status: 100% COMPLETE ✅ Ready for Phase 3D (Runner Advancement Tables) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| api | ||
| config | ||
| core | ||
| data | ||
| database | ||
| models | ||
| utils | ||
| websocket | ||
| __init__.py | ||
| config.py | ||
| main.py | ||