Stage 13: alphabet on the wire (UI alphabet-agnostic, TODO-4) #14

Merged
developer merged 1 commits from feature/stage-13-alphabet-on-the-wire into master 2026-06-04 15:00:57 +00:00
Owner

Makes the UI alphabet-agnostic: live play exchanges per-variant alphabet indices (rack out; submit-play / evaluate / exchange / word-check in), and the client caches each variant's (index, letter, value) table behind StateRequest.include_alphabet, rendering the rack and blank chooser from it. History / journal / GCG stay decoded concrete characters (ARCHITECTURE §9.1, unchanged). Discharges TODO-4.

Wire (pkg/fbs): new AlphabetEntry + PlayTile; StateView.rack[ubyte] + alphabet; StateRequest.include_alphabet; SubmitPlay/Eval tiles→[PlayTile]; Exchange/CheckWord[ubyte] (committed Go + TS regenerated).

Backend: engine.AlphabetTable + cached per-variant codec + BlankIndex; the server edge maps index↔letter via a new thin game.Service.GameVariant; the domain API and the robot keep one letter-based play path. The gateway forwards indices verbatim (no alphabet table).

UI: lib/alphabet.ts cache; codec.ts index codec; premiums.ts geometry-only; mock fixture table; display normalised to upper case (placement/board/checkword unchanged).

Tests: Go engine.AlphabetTable parity (EN/RU/Эрудит, ё=index 6 / value 0) + a GameVariant inttest; gateway transcode round-trips for the index/alphabet paths; UI codec + alphabet unit tests; premiums test trimmed to geometry. Go build/vet/gofmt/test green; UI check + 95 unit + build (90 KB gzip) + 48 chromium/webkit e2e green.

Makes the UI **alphabet-agnostic**: live play exchanges per-variant **alphabet indices** (rack out; submit-play / evaluate / exchange / word-check in), and the client caches each variant's `(index, letter, value)` table behind `StateRequest.include_alphabet`, rendering the rack and blank chooser from it. History / journal / GCG stay decoded concrete characters (ARCHITECTURE §9.1, unchanged). Discharges TODO-4. **Wire (pkg/fbs):** new `AlphabetEntry` + `PlayTile`; `StateView.rack`→`[ubyte]` + `alphabet`; `StateRequest.include_alphabet`; `SubmitPlay`/`Eval` tiles→`[PlayTile]`; `Exchange`/`CheckWord`→`[ubyte]` (committed Go + TS regenerated). **Backend:** `engine.AlphabetTable` + cached per-variant codec + `BlankIndex`; the server edge maps index↔letter via a new thin `game.Service.GameVariant`; the domain API and the robot keep one letter-based play path. The gateway forwards indices verbatim (no alphabet table). **UI:** `lib/alphabet.ts` cache; `codec.ts` index codec; `premiums.ts` geometry-only; mock fixture table; display normalised to upper case (placement/board/checkword unchanged). **Tests:** Go `engine.AlphabetTable` parity (EN/RU/Эрудит, ё=index 6 / value 0) + a `GameVariant` inttest; gateway transcode round-trips for the index/alphabet paths; UI codec + alphabet unit tests; premiums test trimmed to geometry. Go build/vet/gofmt/test green; UI check + 95 unit + build (90 KB gzip) + 48 chromium/webkit e2e green.
developer added 1 commit 2026-06-04 14:27:18 +00:00
Stage 13: alphabet on the wire (UI alphabet-agnostic, TODO-4)
Tests · Go / test (push) Successful in 10s
Tests · Integration / integration (push) Successful in 12s
Tests · UI / test (push) Successful in 19s
Tests · Go / test (pull_request) Successful in 9s
Tests · Integration / integration (pull_request) Successful in 12s
Tests · UI / test (pull_request) Successful in 19s
90eaf4964b
Live play now exchanges per-variant alphabet indices instead of concrete
letters (rack out; submit-play, evaluate, exchange, word-check in). The client
caches each variant's (index, letter, value) table behind
StateRequest.include_alphabet and renders the rack and blank chooser from it,
dropping the hardcoded value/alphabet tables. History, the durable journal and
GCG stay decoded concrete characters (ARCHITECTURE §9.1, unchanged).

- pkg/fbs: new AlphabetEntry + PlayTile; StateView.rack -> [ubyte] + alphabet;
  StateRequest.include_alphabet; SubmitPlay/Eval tiles -> [PlayTile];
  Exchange tiles + CheckWord word -> [ubyte] (committed Go + TS regenerated).
- engine: AlphabetTable + a cached per-variant codec (LetterForIndex/EncodeRack/
  DecodeTiles/DecodeWord) + BlankIndex sentinel; Go parity test.
- backend server edge maps index<->letter (new thin game.Service.GameVariant);
  game.Service domain methods, engine.Game and the robot keep one letter-based
  play path. The gateway forwards indices verbatim (no alphabet table).
- ui: lib/alphabet.ts in-memory cache; codec encodes/decodes indices; premiums.ts
  is geometry-only; the mock seeds a fixture table; the UI normalises display to
  upper case (codec + cache), leaving placement/board/checkword unchanged.

Parity moved to the Go engine.AlphabetTable test; premiums.ts loses its value
tables. Discharges TODO-4.
owner approved these changes 2026-06-04 14:59:18 +00:00
developer merged commit da6665b967 into master 2026-06-04 15:00:57 +00:00
developer deleted branch feature/stage-13-alphabet-on-the-wire 2026-06-04 15:00:57 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#14