fix(engine): EvaluatePlay honors the single-word rule #48

Merged
developer merged 1 commits from feature/single-word-evaluate-fix into development 2026-06-12 09:23:45 +00:00
Owner

The move preview (EvaluatePlay) validated under standard rules, so under the single-word rule it rejected a play whose only flaw was incidental invalid perpendicular cross-words — even though SubmitPlay accepts it. The UI gates submission on the preview, so the move (e.g. КРАН bridging an existing Р on the test contour, game 019eba8a-…) could not be made.

Fix: pass g.playOpts() via ValidatePlayOpts, mirroring Play, so preview legality/score match submission.

Robots: unaffected — they search via GenerateMovesOpts and submit via Play (both opts-aware) and never call EvaluatePlay; a regression test asserts this.

Verified locally: gofmt/vet/build clean, full backend unit + integration suites green.

The move preview (`EvaluatePlay`) validated under standard rules, so under the single-word rule it rejected a play whose only flaw was incidental invalid perpendicular cross-words — even though `SubmitPlay` accepts it. The UI gates submission on the preview, so the move (e.g. КРАН bridging an existing Р on the test contour, game `019eba8a-…`) could not be made. **Fix:** pass `g.playOpts()` via `ValidatePlayOpts`, mirroring `Play`, so preview legality/score match submission. **Robots:** unaffected — they search via `GenerateMovesOpts` and submit via `Play` (both opts-aware) and never call `EvaluatePlay`; a regression test asserts this. Verified locally: gofmt/vet/build clean, full backend unit + integration suites green.
developer added 1 commit 2026-06-12 09:14:39 +00:00
fix(engine): EvaluatePlay honors the single-word rule
CI / changes (pull_request) Successful in 1s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 14s
CI / ui (pull_request) Has been skipped
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m5s
5fa51d04d9
The move preview (EvaluatePlay) validated under standard rules — it called
ValidatePlay without the game's play options — so under the single-word
rule it rejected a play whose only flaw was incidental invalid perpendicular
cross-words, even though SubmitPlay accepts it. The UI gates the submit
button on the preview, so such a play (e.g. КРАН bridging an existing Р on
the test contour) could not be made.

Pass g.playOpts() via ValidatePlayOpts, mirroring Play, so the preview's
legality and score match submission. Robots are unaffected — they search
via GenerateMovesOpts and submit via Play, both already opts-aware — and a
regression test asserts that too.
owner approved these changes 2026-06-12 09:20:05 +00:00
developer merged commit 641ac88b2d into development 2026-06-12 09:23:45 +00:00
developer deleted branch feature/single-word-evaluate-fix 2026-06-12 09:23:45 +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#48