[PR #8260] [MERGED] feat(game): update a game's imported ruleset; keep over-long setup text and the setup's connection #8250

Closed
opened 2026-10-26 04:04:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8260
Author: @kolacheee
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @kolacheee

Base: staging ← Head: claude/game-mode-cloud-nx3wjf


📝 Commits (6)

  • 9f8a461 feat(game): update a game to a newer version of its imported ruleset from the Journal
  • 899ceb3 Merge remote-tracking branch 'origin/staging' into feat/game-ruleset-update
  • 773fc08 fix(game): clip over-long setup blueprint text instead of dropping the blueprint
  • 908e8ae fix(game): the connection a setup runs on becomes the game's own
  • 05391b9 feat(game): the setup wizard names the rules an existing game plays by
  • 3b01b6b fix(game): a clipped setup string never ends in half a surrogate pair

📊 Changes

12 files changed (+447 additions, -86 deletions)

View changed files

📝 packages/client/src/components/game/GameJournal.tsx (+6 -0)
➕ packages/client/src/components/game/GameRulesetUpdate.tsx (+100 -0)
📝 packages/client/src/components/game/GameSetupWizard.tsx (+4 -0)
📝 packages/client/src/components/game/GameSurface.tsx (+1 -0)
📝 packages/client/src/localization/locales/en.json (+7 -0)
📝 packages/server/src/routes/game-rulesets.routes.ts (+17 -0)
📝 packages/server/src/routes/game.routes.ts (+8 -86)
➕ packages/server/src/services/game/game-ruleset-version.service.ts (+55 -0)
➕ packages/server/src/services/game/game-setup-blueprint.ts (+105 -0)
➕ scripts/regressions/game-ruleset-game-version.regression.ts (+102 -0)
➕ scripts/regressions/game-setup-blueprint-clip.regression.ts (+39 -0)
📝 scripts/regressions/world-setting-kits.regression.ts (+3 -0)

📄 Description

Linked issue

Closes #8259

Why this change

  • Before:

    • A game on an imported ruleset plays the exact version it was created on, permanently. After the ruleset is updated, old saves keep the old rules and can't be moved forward.
    • For an existing game, the setup wizard doesn't say which rules the game plays by.
    • When a model writes one campaign-plan string longer than its cap during setup (for example an encounter principle over 160 characters), the whole blueprint is dropped.
    • The connection the setup ran on isn't saved to the game, so the start screen offers whatever connection the chat held before.
  • After:

    • When a newer version of the game's imported ruleset is stored, the Journal and the wizard's World step show both versions and an "Update this game" button. After a confirmation, the game plays by the newer version from then on.
    • The wizard always names the current rules for an existing game.
    • Over-long setup strings are cut at a word and kept.
    • The setup's connection becomes the game's own.

What changed

  • GameRulesetUpdate is shown in the Journal, only when a newer stored version exists, and in the setup wizard for an existing game, always, as a read-only line naming the rules and version. Package rulesets already play their newest installed version, so they never get the update offer.
  • A new POST /api/game-rulesets/game-version endpoint with { chatId, version } moves a game's ruleset pin to that stored version and keeps the game's options. It only moves forward, only to a stored version, and only for a game that has a pin. The move is re-checked inside the metadata queue. Later sessions copy the pin from the previous session's metadata, so the update carries forward. Sheets on an older layout are migrated as they are read.
  • The setup blueprint schema moves to services/game/game-setup-blueprint.ts. Its campaign-plan strings are clipped to their caps: cut at the last word that fits, ending in "…", never splitting a surrogate pair.
  • POST /api/game/setup writes the connection it ran on to the chat when one was chosen explicitly. "random" stays a per-request pick.
  • Seven new English strings under ui.game.rulesetUpdate.*.

Validation

  • Shared build, server and client typecheck, eslint on the changed client files, prettier, and the locale check all pass locally.
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • New game-ruleset-game-version regression:
    • the pin moves forward with its options kept, and the game resolves to the new definition;
    • moving back, moving to the current version, or moving to an unstored version is refused;
    • a non-game chat and a game with no pin are refused;
    • a missing chat returns 404 and a bad body returns 400.
  • New game-setup-blueprint-clip regression: over-long strings are clipped and kept, an emoji straddling the cut is dropped whole, and strings within their caps are unchanged.
  • world-setting-kits now also checks that the setup's connection is saved on the chat.
  • The existing game-ruleset-import, game-ruleset-registry and open-issues regressions pass.
  • The two notices have not been clicked through in a browser yet.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8260 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `claude/game-mode-cloud-nx3wjf` --- ### 📝 Commits (6) - [`9f8a461`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9f8a461b541deed2a476bd58e1c9efee7f226338) feat(game): update a game to a newer version of its imported ruleset from the Journal - [`899ceb3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/899ceb3f00695caaacb511f37aed0fa05cd9a1d3) Merge remote-tracking branch 'origin/staging' into feat/game-ruleset-update - [`773fc08`](https://github.com/Pasta-Devs/Marinara-Engine/commit/773fc082ef4d85fc42097765a44e009b07e377a9) fix(game): clip over-long setup blueprint text instead of dropping the blueprint - [`908e8ae`](https://github.com/Pasta-Devs/Marinara-Engine/commit/908e8ae1f64818aa6fd4a0718ac4c75ed8f347a1) fix(game): the connection a setup runs on becomes the game's own - [`05391b9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/05391b9d4c0eb1fd17bb34da43aaf0cfec219dd5) feat(game): the setup wizard names the rules an existing game plays by - [`3b01b6b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3b01b6b7b126853d890edda56764e1baf93ef650) fix(game): a clipped setup string never ends in half a surrogate pair ### 📊 Changes **12 files changed** (+447 additions, -86 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/game/GameJournal.tsx` (+6 -0) ➕ `packages/client/src/components/game/GameRulesetUpdate.tsx` (+100 -0) 📝 `packages/client/src/components/game/GameSetupWizard.tsx` (+4 -0) 📝 `packages/client/src/components/game/GameSurface.tsx` (+1 -0) 📝 `packages/client/src/localization/locales/en.json` (+7 -0) 📝 `packages/server/src/routes/game-rulesets.routes.ts` (+17 -0) 📝 `packages/server/src/routes/game.routes.ts` (+8 -86) ➕ `packages/server/src/services/game/game-ruleset-version.service.ts` (+55 -0) ➕ `packages/server/src/services/game/game-setup-blueprint.ts` (+105 -0) ➕ `scripts/regressions/game-ruleset-game-version.regression.ts` (+102 -0) ➕ `scripts/regressions/game-setup-blueprint-clip.regression.ts` (+39 -0) 📝 `scripts/regressions/world-setting-kits.regression.ts` (+3 -0) </details> ### 📄 Description ## Linked issue Closes #8259 ## Why this change - Before: - A game on an imported ruleset plays the exact version it was created on, permanently. After the ruleset is updated, old saves keep the old rules and can't be moved forward. - For an existing game, the setup wizard doesn't say which rules the game plays by. - When a model writes one campaign-plan string longer than its cap during setup (for example an encounter principle over 160 characters), the whole blueprint is dropped. - The connection the setup ran on isn't saved to the game, so the start screen offers whatever connection the chat held before. - After: - When a newer version of the game's imported ruleset is stored, the Journal and the wizard's World step show both versions and an "Update this game" button. After a confirmation, the game plays by the newer version from then on. - The wizard always names the current rules for an existing game. - Over-long setup strings are cut at a word and kept. - The setup's connection becomes the game's own. ## What changed - `GameRulesetUpdate` is shown in the Journal, only when a newer stored version exists, and in the setup wizard for an existing game, always, as a read-only line naming the rules and version. Package rulesets already play their newest installed version, so they never get the update offer. - A new `POST /api/game-rulesets/game-version` endpoint with `{ chatId, version }` moves a game's ruleset pin to that stored version and keeps the game's options. It only moves forward, only to a stored version, and only for a game that has a pin. The move is re-checked inside the metadata queue. Later sessions copy the pin from the previous session's metadata, so the update carries forward. Sheets on an older layout are migrated as they are read. - The setup blueprint schema moves to `services/game/game-setup-blueprint.ts`. Its campaign-plan strings are clipped to their caps: cut at the last word that fits, ending in "…", never splitting a surrogate pair. - `POST /api/game/setup` writes the connection it ran on to the chat when one was chosen explicitly. "random" stays a per-request pick. - Seven new English strings under `ui.game.rulesetUpdate.*`. ## Validation - [x] Shared build, server and client typecheck, eslint on the changed client files, prettier, and the locale check all pass locally. - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - New `game-ruleset-game-version` regression: - the pin moves forward with its options kept, and the game resolves to the new definition; - moving back, moving to the current version, or moving to an unstored version is refused; - a non-game chat and a game with no pin are refused; - a missing chat returns 404 and a bad body returns 400. - New `game-setup-blueprint-clip` regression: over-long strings are clipped and kept, an emoji straddling the cut is dropped whole, and strings within their caps are unchanged. - `world-setting-kits` now also checks that the setup's connection is saved on the chat. - The existing `game-ruleset-import`, `game-ruleset-registry` and `open-issues` regressions pass. - The two notices have not been clicked through in a browser yet. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 04:04:06 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8250
No description provided.