Changes:
- Removed default parameter from HistoryMove case class to eliminate synthetic accessor
- Replaced HistoryMove default parameter with explicit None parameter in GameHistory.addMove
- Added comprehensive tests for all CastleSide.withCastle combinations:
- White Kingside, White Queenside
- Black Kingside, Black Queenside
All 14 tests pass. Coverage: 100% statements, 100% branches (0 gaps).
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Changes:
- Renamed Move to HistoryMove to clarify it records moves in game history (distinct from api.move.Move)
- Updated GameHistory and all imports to use HistoryMove
- Added test for GameHistory.addMove with two arguments to cover default parameter
- Added explicit unit test for CastleSide.withCastle Queenside castling (coverage gap)
All tests pass (11/11); build successful.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
## Summary
- Introduces `GameContext` wrapper (board + castling rights) threading through the entire engine pipeline
- Extends `MoveValidator` with `castlingTargets`, context-aware `legalTargets`/`isLegal` overloads, and helpers (`isCastle`, `castleSide`)
- Updates `GameRules.legalMoves` and `gameStatus` to use `GameContext`, preventing false stalemate when castling is the only legal move
- Adds castle detection and atomic execution (`withCastle`) to `GameController.processMove`, plus full rights revocation via source- and
destination-square tables
## Test Plan
- [ ] 142 tests passing, 100% statement and branch coverage on `modules/core`
- [ ] White/Black kingside (e1g1/e8g8) and queenside (e1c1/e8c8) castling moves execute correctly
- [ ] All six legality conditions enforced (rights flags, home squares, empty transit, king not in check, transit/landing squares not attacked)
- [ ] Rights revoked on king moves, own rook moves, castle moves, and enemy rook captures
- [ ] False stalemate correctly prevented when castling is the only escape
Co-authored-by: LQ63 <lkhermann@web.de>
Co-authored-by: Janis <janis.e.20@gmx.de>
Reviewed-on: #1
Reviewed-by: Janis <janis-e@gmx.de>
Co-authored-by: Leon Hermann <lq@blackhole.local>
Co-committed-by: Leon Hermann <lq@blackhole.local>
The three GameControllerTest bugs described in the entry have been fixed
by the test-writer agent; the file contained no other entries.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add BlackKing/WhiteKing to capture board in 'legal capture returns Moved'
so the position is not treated as stalemate after the capture.
- Move WhiteKing from A3 to C3 in three MovedInCheck tests so it no
longer blocks the rook's path along file A.
- Remove Console.withOut(System.out) from withInput so it no longer
overrides the ByteArrayOutputStream installed by captureOutput.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace stub branches with GameRules.gameStatus dispatch in processMove
and fill in MovedInCheck/Checkmate/Stalemate cases in gameLoop.
Document 6 pre-existing test bugs in docs/unresolved.md.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>