Implemented module rules as a microservice.
## Summary
- Adds Quarkus to the `rule` module, making it independently deployable as a standalone microservice on port 8081
- Exposes all `RuleSet` methods via a REST API at `/api/rules` (candidate moves, legal moves, check/checkmate/stalemate/draw detection, apply
move)
- Introduces DTOs and a `DtoMapper` for serializing/deserializing chess types (board, moves, game context) as flat JSON strings
- Adds `JacksonConfig` for Scala module registration and an `application.yml` for the rule service
- Includes Dockerfiles for JVM, legacy-jar, native, and native-micro targets
- Full test coverage: 17 `@QuarkusTest` HTTP-level tests + 29 `DtoMapper` unit tests (100% condition coverage)
## Test plan
- [ ] `./compile` — all modules build successfully
- [ ] `./test` — all tests pass (rule module: 107 tests total)
- [ ] `./coverage` — 100% condition coverage in `rule` module
- [ ] Rule service runs standalone: `./gradlew :modules:rule:quarkusDev` starts on port 8081
- [ ] `GET /api/rules/candidate-moves` returns valid moves for initial position
- [ ] `GET /api/rules/is-check` returns `false` for initial position
Co-authored-by: LQ63 <lkhermann@web.de>
Co-authored-by: Janis <janis-e@gmx.de>
Reviewed-on: #36
Co-authored-by: Leon Hermann <lq@blackhole.local>
Co-committed-by: Leon Hermann <lq@blackhole.local>
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>
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>