Stage 2: engine package over scrabble-solver #2

Merged
developer merged 2 commits from feature/stage-2-engine into master 2026-06-02 13:12:56 +00:00
Owner

Stage 2 — the backend/internal/engine bridge to scrabble-solver: versioned dictionary registry (keyed by variant+dict_version), a deterministic tile bag with exchange support, a pure rules Game (play/pass/exchange/resign, refill, scoring, end-condition detection with end-game rack adjustment), and dictionary-independent MoveRecords + ReplayBoard (ARCHITECTURE §9.1).

Wiring: go.work replace scrabble-solver => ../scrabble-solver; both Go CI workflows clone the public solver sibling (master HEAD, no token) and set BACKEND_DICT_DIR. Docs updated (ARCHITECTURE §5/§14, TESTING, backend README, PLAN refinements + deferred TODOs). Branch CI green.

Stage 2 — the `backend/internal/engine` bridge to `scrabble-solver`: versioned dictionary registry (keyed by variant+dict_version), a deterministic tile bag with exchange support, a pure rules `Game` (play/pass/exchange/resign, refill, scoring, end-condition detection with end-game rack adjustment), and dictionary-independent `MoveRecord`s + `ReplayBoard` (ARCHITECTURE §9.1). Wiring: `go.work` `replace scrabble-solver => ../scrabble-solver`; both Go CI workflows clone the public solver sibling (master HEAD, no token) and set `BACKEND_DICT_DIR`. Docs updated (ARCHITECTURE §5/§14, TESTING, backend README, PLAN refinements + deferred TODOs). Branch CI green.
developer added 2 commits 2026-06-02 13:12:46 +00:00
Stage 2: engine package over scrabble-solver (registry, bag, Game, replay)
Tests · Go / test (push) Successful in 6s
Tests · Integration / integration (push) Successful in 7s
6d0dd4fb14
backend/internal/engine wraps the sibling scrabble-solver library in-process:

- Registry: versioned DAWG load via dafsa.Load, keyed by (variant, dict_version),
  latest-per-variant; English / Russian / Эрудит handled uniformly.
- Bag: own deterministic, seeded tile bag with Draw + Return (for exchanges),
  since the solver's self-play bag cannot return tiles.
- Game: pure rules engine — deal, play/pass/exchange/resign, refill, per-move
  scoring, turn order, and end-condition detection (empty bag + empty rack, six
  scoreless turns, resignation) with end-game rack adjustment.
- decode/ReplayBoard: dictionary-independent MoveRecords and board replay via
  scrabble.Apply (no internal/encoding), realising ARCHITECTURE §9.1.

Wiring: go.work gains "replace scrabble-solver => ../scrabble-solver"; backend
requires scrabble-solver (placeholder) and github.com/iliadenisov/dafsa directly.
Both Go CI workflows clone the public solver sibling (master HEAD, no token) and
set BACKEND_DICT_DIR.

Docs: ARCHITECTURE §5/§14, TESTING engine layer, backend README, and PLAN
refinements + deferred TODOs (publish/version solver; split engine vs dictionary
generator).
docs: mark Stage 2 done (CI green)
Tests · Go / test (pull_request) Successful in 5s
Tests · Integration / integration (pull_request) Successful in 7s
b422ff1159
developer merged commit f36f3df748 into master 2026-06-02 13:12:56 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#2