feat(1-3): Core Improvements - Phases 1-3 Complete#3
Open
nikhilachale wants to merge 2 commits into
Open
Conversation
- Fix castling rules: prevent castling out of, through, or into check - Add bishop color logic to insufficient material detection - Add move-legality validation in socket server - Add promotion piece choice support (Q/R/B/N) in Game.ts - Add promotion piece parameter to socket make_move handler - Add promotion UI in game page with modal selector All Phase 1 tasks completed. Castling now properly checks for king safety, insufficient material draw detection handles same-color bishops, and players can select promotion pieces when pawns reach the final rank. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Phase 2 - Multiplayer Stability: - Validate player identity in socket handlers (white/black only, prevent spoofing) - Add room cleanup lifecycle with 5-minute timeout for inactive rooms - Add reconnect retry logic with exponential backoff (2s to 30s, 10 max attempts) - Update chessStore with rejoining state and actions - Replace blocking alerts with non-blocking error message banner Phase 3 - AI Quality: - Fix opening-depth behavior to honor requested search depth - Reduce cloning overhead in MoveEvaluator (removed per-piece game clones) - Add AI sanity checks in tests (deterministic behavior, legal moves only) Tests: - Game.test.ts: Castling edge cases, insufficient material, promotion - MoveEvaluator.test.ts: Consistency, checkmate avoidance, legal moves, deterministic scoring - index.test.ts: Socket message handling with mocked WebSocket All Phase 2 and Phase 3 tasks completed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive implementation of Phases 1-3 from issue #1 covering core correctness, multiplayer stability, and AI quality improvements.
Changes Made
Phase 1: Core Correctness
Phase 2: Multiplayer Stability
Phase 3: AI Quality
Tests Added
Success Criteria Met
Closes #1