feat(game): void unreplayable games as a draw instead of erroring
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 13s
CI / ui (pull_request) Successful in 46s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m13s

A committed move that becomes illegal under a tightened rule (the single-word
connectivity fix) makes engine replay fail, which left such games unopenable —
an empty screen and an 'illegal play' error. Now the first open closes the game
gracefully as a draw (engine.EndAborted -> end_reason 'aborted', no winner),
preserves the journal, and surfaces an impersonal organizer note at the end of
the move history and in the GCG export.

- engine: EndAborted + Abort() (draw, no rack adjustment; winner -1).
- service: replay aborts on ErrIllegalPlay; liveGame persists the void once
  (lazy, on open); GameState re-reads for the settled view.
- store: VoidGame finishes the game and stamps a draw without a journal row.
- migration 00002: allow end_reason 'aborted'.
- ui: organizer note under the history grid; i18n en/ru.
- docs: ARCHITECTURE 6/9.1, FUNCTIONAL(+ru), PRERELEASE MW3.
This commit is contained in:
Ilia Denisov
2026-06-14 16:57:27 +02:00
parent ff87a3bf62
commit 222eaf730f
15 changed files with 299 additions and 2 deletions
+12
View File
@@ -917,6 +917,9 @@
{/each}
</div>
</div>
{#if view.game.endReason === 'aborted'}
<p class="horganizer">{t('game.abortedNote')}</p>
{/if}
</div>
{/if}
@@ -1174,6 +1177,15 @@
.hsc {
font-variant-numeric: tabular-nums;
}
/* The impersonal organizer note closing an aborted (un-replayable) game, under the grid. */
.horganizer {
margin: 0;
padding: 8px var(--pad);
color: var(--text-muted);
font-size: 0.85rem;
font-style: italic;
text-align: center;
}
.boardwrap {
padding: 6px;
transition: transform 0.3s ease;
+1
View File
@@ -81,6 +81,7 @@ export const en = {
'game.won': 'You won',
'game.lost': 'You lost',
'game.tied': 'Draw',
'game.abortedNote': 'This game could not be continued by the organizer and was ended in a draw.',
'game.checkWordPrompt': 'Enter a word',
'game.wordLegal': '“{word}” is valid',
'game.wordIllegal': '“{word}” is not valid',
+1
View File
@@ -82,6 +82,7 @@ export const ru: Record<MessageKey, string> = {
'game.won': 'Вы выиграли',
'game.lost': 'Вы проиграли',
'game.tied': 'Ничья',
'game.abortedNote': 'Партия не может быть продолжена по вине организатора и завершена ничьёй.',
'game.checkWordPrompt': 'Введите слово',
'game.wordLegal': '«{word}» допустимо',
'game.wordIllegal': '«{word}» недопустимо',