Commit Graph

68 Commits

Author SHA1 Message Date
Janis f1c9df16b6 feat: add initial project structure and documentation files (#24)
Build & Test (NowChessSystems) TeamCity build finished
Reviewed-on: #24
io-0.3.0 rule-0.0.5
2026-04-12 16:39:17 +02:00
TeamCity 9d11d25b99 ci: bump version with Build-35 2026-04-08 07:37:40 +00:00
lq64 7a045d31d7 feat: NCS-31 FastParse FEN (#22)
Build & Test (NowChessSystems) TeamCity build finished
Summary

  - Added fastparse_3:3.0.2 dependency to modules/io
  - Implemented FenParserFastParse as a second alternative FEN parser using FastParse, with the same public API as
  FenParser and FenParserCombinators
  - Parsers are built bottom-up using (using P[Any]) Scala 3 syntax with NoWhitespace.* to prevent implicit whitespace
  skipping; rank sum validation uses Pass/Fail inside .flatMap
  - Added FenParserFastParseTest mirroring FenParserCombinatorsTest to prove behavioural equivalence across all three
  implementations

  Test plan

  - All existing tests pass — FenParser, FenParserCombinators, and all other modules untouched
  - FenParserFastParseTest covers all cases: valid FEN, invalid color, invalid castling, invalid board shapes, en
  passant, rank overflow, round-trip via FenExporter
  - All parser logic branches genuinely covered — known scoverage gap documented in docs/unresolved.md (FastParse inline
   macro generates synthetic proxy methods that scoverage instruments but that never execute at runtime)

Co-authored-by: LQ63 <lkhermann@web.de>
Reviewed-on: #22
Reviewed-by: Janis <janis-e@gmx.de>
Co-authored-by: Leon Hermann <lq@blackhole.local>
Co-committed-by: Leon Hermann <lq@blackhole.local>
rule-0.0.4
2026-04-08 09:32:57 +02:00
TeamCity b518c704fa ci: bump version with Build-34 2026-04-07 19:42:37 +00:00
Janis fe8e3c0539 fix: NCS-32 Queenside Castle doesn't care about pieces in the way (#23)
Build & Test (NowChessSystems) TeamCity build finished
Reviewed-on: #23
Co-authored-by: Janis <janis.e.20@gmx.de>
Co-committed-by: Janis <janis.e.20@gmx.de>
io-0.2.0 ui-0.8.0
2026-04-07 20:32:48 +02:00
TeamCity 1b16adcc72 ci: bump version with Build-33 2026-04-07 18:02:38 +00:00
lq64 b4bc72f7e4 feat: NCS-30 FEN Parser using ParserCombinators (#21)
Build & Test (NowChessSystems) TeamCity build finished
Summary

  - Added scala-parser-combinators_3:2.4.0 dependency to modules/io
  - Implemented FenParserCombinators as an alternative FEN parser using RegexParsers, with the same public API as the
  existing FenParser
  - Parsers are built bottom-up: piece characters → rank tokens → rank → board, composed with explicit field separators
  into a full FEN parser
  - Added FenParserCombinatorsTest mirroring the existing FenParserTest to prove behavioural equivalence

  Test plan

  - All existing tests pass — FenParser and all other modules untouched
  - FenParserCombinatorsTest covers all cases: valid FEN, invalid color, invalid castling, invalid board shapes, en
  passant, round-trip via FenExporter
  - 100% line/branch/method coverage on FenParserCombinators

Co-authored-by: LQ63 <lkhermann@web.de>
Reviewed-on: #21
Reviewed-by: Janis <janis-e@gmx.de>
Co-authored-by: Leon Hermann <lq@blackhole.local>
Co-committed-by: Leon Hermann <lq@blackhole.local>
io-0.1.0 ui-0.7.0
2026-04-07 12:28:43 +02:00
Janis 8959c3a849 refactor: NCS-24 update CLAUDE.md for improved structure and clarity (#20)
Build & Test (NowChessSystems) TeamCity build finished
Reviewed-on: #20
Reviewed-by: Leon Hermann <lq@blackhole.local>
Co-authored-by: Janis <janis-e@gmx.de>
Co-committed-by: Janis <janis-e@gmx.de>
io-0.0.3 core-0.12.0 rule-0.0.3 api-0.4.0
2026-04-07 12:25:33 +02:00
TeamCity 47032378e2 ci: bump version with Build-31 2026-04-07 06:25:56 +00:00
lq64 217f14f899 refactor: NCS-19 Currying (#18)
Build & Test (NowChessSystems) TeamCity build finished
Summary

  - Curried candidateMoves, legalMoves, and applyMove in the RuleSet trait to separate (context) as the world being
  operated on from the computation parameter
  - Updated DefaultRules overrides and all internal call sites
  - Updated all external call sites: GameEngine, PgnParser, PgnExporter, ChessBoardView, and all affected tests

  Test plan

  - All existing tests pass (./gradlew build)
  - No behaviour changes — pure style refactoring, existing test suite is the regression guard

Co-authored-by: LQ63 <lkhermann@web.de>
Reviewed-on: #18
Reviewed-by: Janis <janis-e@gmx.de>
Co-authored-by: Leon Hermann <lq@blackhole.local>
Co-committed-by: Leon Hermann <lq@blackhole.local>
ui-0.6.0 io-0.0.2 rule-0.0.2 core-0.11.0 api-0.3.0
2026-04-06 21:03:17 +02:00
TeamCity 638139602c ci: bump version with Build-30 2026-04-06 07:21:42 +00:00
Janis 8f56a82104 refactor: NCS-22 NCS-23 reworked modules and tests (#17)
Build & Test (NowChessSystems) TeamCity build finished
Reviewed-on: #17
io-0.0.1 rule-0.0.1
2026-04-06 09:07:39 +02:00
TeamCity 51ffd7aac9 ci: bump version with Build-28 2026-04-03 09:09:16 +00:00
Janis 1b9eb471de fix: set PYTHONUTF8 environment variable for coverage scripts (#16)
Build & Test (NowChessSystems) TeamCity build finished
Reviewed-on: #16
Co-authored-by: Janis <janis.e.20@gmx.de>
Co-committed-by: Janis <janis.e.20@gmx.de>
core-0.10.0 ui-0.5.0 api-0.2.0
2026-04-03 11:03:02 +02:00
TeamCity 45013c87a9 ci: bump version with Build-27 2026-04-02 19:15:54 +00:00
Janis 80518719d5 feat: NCS-21 Write Scripts to automate certain tasks (#15)
Build & Test (NowChessSystems) TeamCity build finished
Co-authored-by: shahdlala66 <shahd.lala66@gmail.com>
Reviewed-on: #15
Co-authored-by: Janis <janis.e.20@gmx.de>
Co-committed-by: Janis <janis.e.20@gmx.de>
api-0.1.0 ui-0.4.0 core-0.9.0
2026-04-02 21:11:21 +02:00
TeamCity 2d6ead7e47 ci: bump version with Build-26 2026-04-01 20:53:08 +00:00
Janis 3ff80318b4 feat: NCS-17 Implement basic ScalaFX UI (#14)
Build & Test (NowChessSystems) TeamCity build finished
Co-authored-by: shahdlala66 <shahd.lala66@gmail.com>
Reviewed-on: #14
Co-authored-by: Janis <janis.e.20@gmx.de>
Co-committed-by: Janis <janis.e.20@gmx.de>
api-0.0.8 ui-0.3.0 core-0.8.0
2026-04-01 22:48:30 +02:00
TeamCity 9fb743d135 ci: bump version with Build-25 2026-04-01 08:40:41 +00:00
lq64 412ed986a9 feat: NCS-11 50-move rule (#9)
Build & Test (NowChessSystems) TeamCity build finished
Summary

  - Implements the FIDE 50-move draw rule: a player may claim a draw if no pawn move or capture has occurred in the last
   50 full moves (100 half-moves)
  - Draw is not automatic — the eligible player must claim it via a TUI menu shown at the start of their turn
  - halfMoveClock: Int is threaded through processMove and gameLoop; resets on pawn move, capture, or en passant;
  increments on all other moves

  Changes

  - GameController.scala: extended MoveResult.Moved and MoveResult.MovedInCheck with newHalfMoveClock: Int; added
  MoveResult.DrawClaimed; added halfMoveClock parameter to processMove and gameLoop; TUI menu shown when clock ≥ 100
  - Main.scala: initial gameLoop call passes halfMoveClock = 0
  - GameControllerTest.scala: updated all existing pattern matches; added 10 new tests covering clock reset, clock
  increment, draw claim, and TUI menu behaviour

  Test plan

  - processMove: 'draw' with halfMoveClock = 100 → DrawClaimed
  - processMove: 'draw' with halfMoveClock = 99 → InvalidFormat
  - Pawn move / capture / en passant → clock resets to 0
  - Quiet piece move → clock increments by 1
  - MovedInCheck carries updated clock
  - TUI menu appears when clock ≥ 100; option 1 claims draw, option 2 continues
  - No TUI menu when clock < 100
  - All 197 tests passing

Co-authored-by: LQ63 <lkhermann@web.de>
Reviewed-on: #9
Co-authored-by: Leon Hermann <lq@blackhole.local>
Co-committed-by: Leon Hermann <lq@blackhole.local>
ui-0.2.0 core-0.7.0 api-0.0.7
2026-04-01 10:36:24 +02:00
TeamCity 8bbeead702 ci: bump version with Build-24 2026-04-01 07:17:44 +00:00
Janis e5e20c566e fix: update move validation to check for king safety (#13)
Build & Test (NowChessSystems) TeamCity build finished
Reviewed-on: #13
core-0.6.0 api-0.0.6 ui-0.1.0
2026-04-01 09:07:06 +02:00
Janis 13bfc16cfe feat: NCS-10 Implement Pawn Promotion (#12)
Build & Test (NowChessSystems) TeamCity build finished
Reviewed-on: #12
Reviewed-by: Leon Hermann <lq@blackhole.local>
Co-authored-by: Janis <janis-e@gmx.de>
Co-committed-by: Janis <janis-e@gmx.de>
2026-03-31 22:18:14 +02:00
TeamCity 85cbf95c18 ci: bump version with Build-22 2026-03-31 08:35:28 +00:00
shosho996 1361dfc895 feat: NCS-16 Core Separation via Patterns (#10)
Build & Test (NowChessSystems) TeamCity build finished
Co-authored-by: Janis <janis-e@gmx.de>
Co-authored-by: shahdlala66 <shahd.lala66@gmail.com>
Co-authored-by: Janis <janis.e.20@gmx.de>
Reviewed-on: #10
Reviewed-by: Janis <janis-e@gmx.de>
Co-authored-by: Shahd Lala <shosho996@blackhole.local>
Co-committed-by: Shahd Lala <shosho996@blackhole.local>
core-0.5.0 api-0.0.5
2026-03-31 10:31:02 +02:00
TeamCity 707c4826a4 ci: bump version with Build-21 2026-03-29 15:10:35 +00:00
lq64 919beb3b4b feat: NCS-9 En passant implementation (#8)
Build & Test (NowChessSystems) TeamCity build finished
- Add EnPassantCalculator to derive the en passant target square from GameHistory, detect en passant captures, and
  compute the captured pawn's square
  - Extend MoveValidator.legalTargets to include the en passant diagonal square in pawn legal targets
  - Extend GameController.processMove to remove the captured pawn from the board when an en passant capture is played

  Details

  En passant is derived purely from the last HistoryMove — no new state is introduced. If the last move was a double
  pawn push, the target square is the square the pawn passed through. The board mutation follows the same pattern as
  castling: board.withMove moves the capturing pawn, then board.removed removes the captured pawn from its actual square
   (which differs from the destination square).

  Test Plan

  - EnPassantCalculatorTest — 14 unit tests covering target derivation, captured square calculation, and capture
  detection for both colors
  - MoveValidatorTest — 5 new tests: ep target included/excluded based on history, adjacency filter, both colors, case _
   branch coverage
  - GameControllerTest — 2 integration tests: white and black en passant capture removes pawn from board and returns
  correct captured piece
  - 100% scoverage (line/branch/method) confirmed

Co-authored-by: LQ63 <lkhermann@web.de>
Reviewed-on: #8
Reviewed-by: Janis <janis-e@gmx.de>
Co-authored-by: Leon Hermann <lq@blackhole.local>
Co-committed-by: Leon Hermann <lq@blackhole.local>
api-0.0.4 core-0.4.0
2026-03-29 17:06:50 +02:00
TeamCity ee79dc5b98 ci: bump version with Build-20 2026-03-29 12:06:38 +00:00
Janis f28e69dc18 feat: NCS-6 Implementing FEN & PGN (#7)
Build & Test (NowChessSystems) TeamCity build finished
Reviewed-on: #7
Reviewed-by: Leon Hermann <lq@blackhole.local>
core-0.3.0
2026-03-29 14:02:25 +02:00
TeamCity 5f485fed9b ci: bump version with Build-19 2026-03-28 17:12:54 +00:00
Janis f4c18d22d7 refactor: NCS-8 removed Context and replaced it with History (#6)
Build & Test (NowChessSystems) TeamCity build finished
Reviewed-on: #6
api-0.0.3
2026-03-28 18:08:55 +01:00
TeamCity 4d800e88eb ci: bump version with Build-18 2026-03-28 12:39:59 +00:00
Janis 2df2fdeeb9 feat: add memory structure documentation and update index (#5)
Build & Test (NowChessSystems) TeamCity build finished
Reviewed-on: #5
2026-03-28 13:35:49 +01:00
TeamCity 9190d1e5a0 ci: bump version with v17%
Build & Test (NowChessSystems) TeamCity build finished
2026-03-27 09:25:13 +00:00
Janis d675966436 refactor: replace return/var in castlingTargets with functional style (#4)
Build & Test (NowChessSystems) TeamCity build finished
Reviewed-on: #4
Co-authored-by: Janis <janis.e.20@gmx.de>
Co-committed-by: Janis <janis.e.20@gmx.de>
2026-03-25 08:48:49 +01:00
Janis b4116e9a82 test: add unit tests for API response, board, color, game state, move, piece, and square (#3)
Build & Test (NowChessSystems) TeamCity build finished
Reviewed-on: #3
2026-03-25 08:19:43 +01:00
Janis 11efb1a42d docs: remove outdated JUnitSuiteLike issue from unresolved.md
Build & Test (NowChessSystems) TeamCity build finished
2026-03-24 18:12:53 +01:00
lq64 00d326c1ba feat: implement legal castling (#1)
Build & Test (NowChessSystems) TeamCity build finished
## 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>
2026-03-24 17:55:00 +01:00
Janis d0289e16f4 fix: update unit test documentation to remove JUnitSuiteLike reference
Build & Test (NowChessSystems) TeamCity build finished
2026-03-24 12:25:42 +01:00
Janis 7b1f8b1176 fix: update main class path in build configuration and adjust VCS directory mapping
Build & Test (NowChessSystems) TeamCity build finished
2026-03-24 09:59:13 +01:00
Janis 7662b8ea10 feat: add new trusted keys to verification keyring and metadata
Build & Test (NowChessSystems) TeamCity build failed
2026-03-23 22:46:44 +01:00
Janis aedd787b77 fix: add missing kings to gameLoop capture test board 2026-03-23 22:37:15 +01:00
Janis d67615235b docs: remove resolved test bug entry from unresolved.md
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>
2026-03-23 22:32:59 +01:00
Janis f0481e2561 fix: correct test board positions and captureOutput/withInput interaction
- 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>
2026-03-23 22:32:51 +01:00
Janis 5264a22541 feat: wire check/checkmate/stalemate into processMove and gameLoop
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>
2026-03-23 22:30:09 +01:00
Janis 13ac90a42f test: add failing GameControllerTest cases for check/checkmate/stalemate
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 22:16:53 +01:00
Janis 8b7ec57e5e feat: add MovedInCheck/Checkmate/Stalemate MoveResult variants (stub dispatch)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 21:48:32 +01:00
Janis 94a02ff684 feat: implement GameRules with isInCheck, legalMoves, gameStatus
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 21:42:21 +01:00
Janis 86552b52bd test: add failing GameRulesTest for check/checkmate/stalemate
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 21:34:24 +01:00
Janis 76d4168038 feat: add GameRules stub with PositionStatus enum 2026-03-23 21:29:41 +01:00