feat(game): race exit warnings in the turn report (#12) #82

Merged
developer merged 1 commits from feature/game-race-exit-warnings into development 2026-05-31 09:12:34 +00:00
Owner

What

Implements the inactivity-removal warnings the rules promise
(game/rules.txt, "Выход из игры") but the engine never surfaced.

  • Personal warning: a race within 5 turns of being auto-removed
    for inactivity sees its own turns-remaining countdown in every report.
  • Public notice: every race within 3 turns of removal is listed
    for all participants.

Race.TTL at report time equals turns-until-removal (reports are
generated before the end-of-turn decrement; extinct races are wiped at
turn start). Voluntary quit and idle timeout share the TTL countdown and
are intentionally not distinguished (agreed scope).

Changes

  • model (pkg/model/report): Report.PersonalExitWarning +
    RacesLeavingSoon []RaceExitNotice.
  • fbs (pkg/schema/fbs/report.fbs + regenerated Go/TS):
    RaceExitNotice table, Report.personal_exit_warning /
    races_leaving_soon.
  • transcoder: encode/decode both fields (roundtrip-tested).
  • engine (game/internal/controller/report.go): ReportExitWarnings
    — personal TTL 1..5; public list of other non-extinct races TTL 1..3,
    recipient excluded.
  • ui: danger-styled personal banner + "races leaving soon" section
    (hidden when empty), wired into the report view, EN/RU i18n.
  • docs: rules.txt report-section list, docs/FUNCTIONAL.md §6.4 +
    docs/FUNCTIONAL_ru.md mirror.

Tests

  • Go: go build / go vet / gofmt clean; TestReportExitWarnings
    (engine) + transcoder roundtrip pass.
  • UI: pnpm check 0 errors; pnpm test 888 pass (new component test for
    the banner + section); Playwright report-sections spec extended.

Notes

The FlatBuffers TS regeneration was scoped to the report schema only.
The locally-installed flatc (23.5.26) differs from the version that
produced the committed bindings — it drops a vestigial eslint-disable
header and, more importantly, changes nullable-scalar defaults
(addFieldInt64(.., null)BigInt(0)), which would silently alter the
wire defaults of unrelated tables (local-fleet / local-group /
other-group). A full make fbs-ts therefore churns 130+ unrelated
generated files; those were reverted, and the eslint header was kept on
the touched report files to match the existing convention. A deliberate
toolchain-version bump can regenerate the whole tree later as its own
task.

## What Implements the inactivity-removal warnings the rules promise (`game/rules.txt`, "Выход из игры") but the engine never surfaced. - **Personal warning**: a race within **5 turns** of being auto-removed for inactivity sees its own turns-remaining countdown in every report. - **Public notice**: every race within **3 turns** of removal is listed for all participants. `Race.TTL` at report time equals turns-until-removal (reports are generated before the end-of-turn decrement; extinct races are wiped at turn start). Voluntary quit and idle timeout share the TTL countdown and are intentionally **not** distinguished (agreed scope). ## Changes - **model** (`pkg/model/report`): `Report.PersonalExitWarning` + `RacesLeavingSoon []RaceExitNotice`. - **fbs** (`pkg/schema/fbs/report.fbs` + regenerated Go/TS): `RaceExitNotice` table, `Report.personal_exit_warning` / `races_leaving_soon`. - **transcoder**: encode/decode both fields (roundtrip-tested). - **engine** (`game/internal/controller/report.go`): `ReportExitWarnings` — personal TTL 1..5; public list of other non-extinct races TTL 1..3, recipient excluded. - **ui**: danger-styled personal banner + "races leaving soon" section (hidden when empty), wired into the report view, EN/RU i18n. - **docs**: `rules.txt` report-section list, `docs/FUNCTIONAL.md` §6.4 + `docs/FUNCTIONAL_ru.md` mirror. ## Tests - Go: `go build` / `go vet` / `gofmt` clean; `TestReportExitWarnings` (engine) + transcoder roundtrip pass. - UI: `pnpm check` 0 errors; `pnpm test` 888 pass (new component test for the banner + section); Playwright report-sections spec extended. ## Notes The FlatBuffers TS regeneration was scoped to the `report` schema only. The locally-installed flatc (23.5.26) differs from the version that produced the committed bindings — it drops a vestigial eslint-disable header and, more importantly, changes nullable-scalar defaults (`addFieldInt64(.., null)` → `BigInt(0)`), which would silently alter the wire defaults of unrelated tables (local-fleet / local-group / other-group). A full `make fbs-ts` therefore churns 130+ unrelated generated files; those were reverted, and the eslint header was kept on the touched report files to match the existing convention. A deliberate toolchain-version bump can regenerate the whole tree later as its own task.
developer added 1 commit 2026-05-31 08:36:30 +00:00
feat(game): race exit warnings in the turn report (#12)
Tests · Go / test (push) Successful in 2m29s
Tests · UI / test (push) Waiting to run
Tests · Go / test (pull_request) Successful in 2m17s
Tests · Integration / integration (pull_request) Successful in 1m53s
Tests · UI / test (pull_request) Successful in 3m37s
9e9977d5f1
Surface the inactivity-removal countdown the rules promise but the
engine never reported. A race within five turns of being auto-removed
for inactivity gets a personal warning in its own report; every race
within three turns is listed publicly to all participants.

- model: Report.PersonalExitWarning + RacesLeavingSoon ([]RaceExitNotice)
- fbs: RaceExitNotice table + Report.personal_exit_warning /
  races_leaving_soon (regenerated Go + TS bindings)
- transcoder: encode/decode both fields
- engine: ReportExitWarnings fills the recipient's TTL (1..5) and lists
  other non-extinct races with TTL 1..3, excluding the recipient itself
- ui: danger-styled personal banner + "races leaving soon" section
  (hidden when empty), wired into the report view, EN/RU i18n
- docs: rules.txt report-section list, FUNCTIONAL.md 6.4 + RU mirror

Voluntary quit and idle timeout share the TTL countdown and are not
distinguished, per the agreed scope.
owner approved these changes 2026-05-31 09:11:15 +00:00
developer merged commit afb8c1225c into development 2026-05-31 09:12:34 +00:00
developer deleted branch feature/game-race-exit-warnings 2026-05-31 09:12:34 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/galaxy-game#82