feat: on-device move preview (local eval) with network fallback #154

Merged
developer merged 1 commits from feature/local-eval into development 2026-07-01 21:02:09 +00:00
Owner

On-device move preview: score/validate a tentative move locally instead of a per-arrangement network round trip. The dawg reader + validate/score/direction slice of scrabble-solver are ported to TS (ui/src/lib/dict), pinned byte-for-byte to the Go engine by the conformance CI job. Server stays authoritative (submit_play re-validates); network evaluate is the fallback.

The dictionary loads on game open (low priority, aborted at a 5s cap or on leaving the game), cached in IndexedDB (self-healing on a rejected blob), reused across sessions; a warm-up overlay covers a cold load. A bad-connection breaker + in-flight-preview cancellation keep it graceful on slow links. Telemetry (adoption counters) is a follow-up PR.

On-device move preview: score/validate a tentative move locally instead of a per-arrangement network round trip. The dawg reader + validate/score/direction slice of scrabble-solver are ported to TS (ui/src/lib/dict), pinned byte-for-byte to the Go engine by the `conformance` CI job. Server stays authoritative (submit_play re-validates); network evaluate is the fallback. The dictionary loads on game open (low priority, aborted at a 5s cap or on leaving the game), cached in IndexedDB (self-healing on a rejected blob), reused across sessions; a warm-up overlay covers a cold load. A bad-connection breaker + in-flight-preview cancellation keep it graceful on slow links. Telemetry (adoption counters) is a follow-up PR.
owner approved these changes 2026-07-01 20:54:39 +00:00
Dismissed
developer added 1 commit 2026-07-01 20:58:55 +00:00
feat: on-device move preview (local eval) with network fallback
CI / changes (pull_request) Successful in 3s
CI / unit (pull_request) Successful in 10s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 58s
CI / conformance (pull_request) Successful in 9s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m17s
5689f7f6a3
Score and validate a tentative move on-device instead of a per-arrangement network
round trip. The dawg reader and the validate/score/direction slice of the
scrabble-solver engine are ported to TypeScript (ui/src/lib/dict), pinned
byte-for-byte to the Go engine by a `conformance` CI job (full-dictionary reader
parity plus a battery of plays across every variant and both cross-word rules,
including the inferred orientation). The server stays authoritative — submit_play
re-validates — so the local result is an advisory accelerator only.

- backend: Registry.DictBytes + an authed GET /api/v1/user/dict/{variant}/{version}
  (immutable) streaming the pinned per-game dawg; caddy routes /dict to the gateway.
- gateway: a session-gated /dict edge route proxying it; fetchDict on the transport.
- client: the dictionary loads on game open (low priority so it never starves the
  game on a slow link; aborted at a 5s cap or when leaving the game), is cached in
  IndexedDB (best-effort, self-healing on a rejected blob) and reused across
  sessions; a warm-up overlay covers a cold load, then the network preview is the
  fallback; a bad-connection breaker stops warming after repeated misses; the move
  preview cancels its in-flight request when the tiles change.
- parity generators backend/cmd/{dictgen,validategen} + gated Vitest suites, run in
  CI against the release dictionaries. A hidden debug readout lists the cached
  dictionaries + breaker state, and its reset clears the cache.
- docs: ARCHITECTURE §5, TESTING, UI_DESIGN, FUNCTIONAL (+ru).
developer force-pushed feature/local-eval from 38644f2a59 to 5689f7f6a3 2026-07-01 20:58:55 +00:00 Compare
developer dismissed owner's review 2026-07-01 20:58:56 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

developer changed title from feat(ui): on-device move preview (local eval) with network fallback to feat: on-device move preview (local eval) with network fallback 2026-07-01 20:59:27 +00:00
owner approved these changes 2026-07-01 21:00:04 +00:00
developer merged commit 5f87b3fa43 into development 2026-07-01 21:02:09 +00:00
developer deleted branch feature/local-eval 2026-07-01 21:02:09 +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#154