[GH-ISSUE #1792] [Issue]: Game mode refactor lost auto checkpoints and scene asset safeguards #875

Closed
opened 2026-10-21 05:22:43 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Xelvanis on GitHub (Jun 1, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1792

Originally assigned to: @cha1latte on GitHub.

Summary

Static comparison against the legacy game mode found several likely-unintentional regressions in the refactor game surface:

  • Auto checkpoints no longer fire at session start, session end, or combat transitions.
  • Scene-analysis failures return an empty successful result, so the UI does not run inline tag fallback.
  • Rare scene illustration generation no longer enforces the legacy cooldown, does not save generated illustrations into chat gallery, and does not send character reference images to the image provider.
  • Game session records appear to miss groupId, while gallery session scoping still queries by groupId.

Expected behavior

Game mode should preserve these legacy outcomes unless intentionally removed:

  • Starting a session, concluding a session, entering combat, and leaving combat should create automatic checkpoints alongside manual checkpoints.
  • Scene-analysis/provider failures should surface as errors so Game mode can fall back to inline GM tags.
  • Rare scene illustration generation should be gated by session-aware cooldown metadata, preserve generated illustration records in chat gallery, use available character references for character consistency, and fall back to an existing background when reusable background generation fails.
  • All chats in a game should share a game grouping identifier used by cross-session UI such as gallery/history.

Actual behavior

Static evidence from the refactor path shows:

  • src/features/modes/game/components/GameCheckpoints.tsx:60 only creates manual checkpoints.
  • src/features/modes/game/api/game-api.ts:2041 implements manual checkpoint creation, but no matching auto-create calls were found in start-session, conclude-session, or combat transition paths.
  • src/engine/modes/game/scene/game-scene-analysis.service.ts:262 catches scene-analysis failures and returns defaultGameSceneAnalysis(), which reaches the UI success path instead of onError fallback.
  • src/features/modes/game/api/game-api.ts:2378 calls imageGenerationApi.generate with prompt/size only, with no referenceImages payload for scene illustrations.
  • src/features/modes/game/api/game-api.ts:2398 uploads generated illustrations as game assets, but no chat gallery row creation was found.
  • src/features/catalog/gallery/hooks/use-gallery.ts:70 scopes game galleries by groupId, while refactor game create/start-session paths appear to set metadata.gameId but not groupId.

Legacy evidence:

  • packages/server/src/routes/game.routes.ts:3739 created session-start checkpoints.
  • packages/server/src/routes/game.routes.ts:3947 created session-end checkpoints.
  • packages/server/src/routes/game.routes.ts:5097 created combat transition checkpoints.
  • packages/client/src/hooks/use-scene-analysis.ts:68 threw on failed /game/scene-wrap, letting the UI fallback run.
  • packages/server/src/routes/game.routes.ts:257, :7023, and :7105 enforced illustration cooldown metadata.
  • packages/server/src/routes/game.routes.ts:452 and :7089 saved generated illustrations to chat gallery.
  • packages/server/src/routes/game.routes.ts:3006 and :3603 wrote groupId: gameId on game/session chats.

Steps to reproduce

  1. Create or inspect a game session in the refactor build.
  2. Start a new game session, conclude a session, enter combat, and leave combat.
  3. Open the checkpoint panel and inspect game-checkpoints rows.
  4. Force scene analysis to fail, for example with an invalid scene connection, and check whether inline tags still apply.
  5. Generate a rare scene illustration and inspect whether a gallery row, cooldown metadata, and character reference image payload are produced.
  6. Open gallery across multiple game sessions and check whether other session images appear through the game scope.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor inspected at 6cc9d086
  • Run mode: Not run; static refactor vs legacy code comparison
  • OS + version: Not relevant
  • Node + pnpm versions: Not run
  • Rust version, if relevant: Not run
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: Scene analysis and image generation paths, provider not run

Logs, screenshots, or video

No runtime logs or screenshots. Static evidence is listed above with relative file paths and line anchors.

Regression notes

These behaviors existed in the legacy game implementation and appear absent or weakened in the refactor code paths. No current-code evidence found that the removals were intentional product decisions.

Additional context

Suggested repair order:

  1. Restore auto checkpoints at session start/end and combat enter/exit, using current tracker snapshot storage semantics.
  2. Make scene-analysis failures reach the existing UI fallback path instead of returning empty success.
  3. Restore image safeguards: illustration cooldown, gallery preservation, reference image payloads, and background fallback.
  4. Add or repair game groupId persistence, or update gallery scoping to use metadata.gameId consistently.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Xelvanis on GitHub (Jun 1, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1792 Originally assigned to: @cha1latte on GitHub. ## Summary Static comparison against the legacy game mode found several likely-unintentional regressions in the refactor game surface: - Auto checkpoints no longer fire at session start, session end, or combat transitions. - Scene-analysis failures return an empty successful result, so the UI does not run inline tag fallback. - Rare scene illustration generation no longer enforces the legacy cooldown, does not save generated illustrations into chat gallery, and does not send character reference images to the image provider. - Game session records appear to miss `groupId`, while gallery session scoping still queries by `groupId`. ## Expected behavior Game mode should preserve these legacy outcomes unless intentionally removed: - Starting a session, concluding a session, entering combat, and leaving combat should create automatic checkpoints alongside manual checkpoints. - Scene-analysis/provider failures should surface as errors so Game mode can fall back to inline GM tags. - Rare scene illustration generation should be gated by session-aware cooldown metadata, preserve generated illustration records in chat gallery, use available character references for character consistency, and fall back to an existing background when reusable background generation fails. - All chats in a game should share a game grouping identifier used by cross-session UI such as gallery/history. ## Actual behavior Static evidence from the refactor path shows: - `src/features/modes/game/components/GameCheckpoints.tsx:60` only creates manual checkpoints. - `src/features/modes/game/api/game-api.ts:2041` implements manual checkpoint creation, but no matching auto-create calls were found in start-session, conclude-session, or combat transition paths. - `src/engine/modes/game/scene/game-scene-analysis.service.ts:262` catches scene-analysis failures and returns `defaultGameSceneAnalysis()`, which reaches the UI success path instead of `onError` fallback. - `src/features/modes/game/api/game-api.ts:2378` calls `imageGenerationApi.generate` with prompt/size only, with no `referenceImages` payload for scene illustrations. - `src/features/modes/game/api/game-api.ts:2398` uploads generated illustrations as game assets, but no chat gallery row creation was found. - `src/features/catalog/gallery/hooks/use-gallery.ts:70` scopes game galleries by `groupId`, while refactor game create/start-session paths appear to set `metadata.gameId` but not `groupId`. Legacy evidence: - `packages/server/src/routes/game.routes.ts:3739` created session-start checkpoints. - `packages/server/src/routes/game.routes.ts:3947` created session-end checkpoints. - `packages/server/src/routes/game.routes.ts:5097` created combat transition checkpoints. - `packages/client/src/hooks/use-scene-analysis.ts:68` threw on failed `/game/scene-wrap`, letting the UI fallback run. - `packages/server/src/routes/game.routes.ts:257`, `:7023`, and `:7105` enforced illustration cooldown metadata. - `packages/server/src/routes/game.routes.ts:452` and `:7089` saved generated illustrations to chat gallery. - `packages/server/src/routes/game.routes.ts:3006` and `:3603` wrote `groupId: gameId` on game/session chats. ## Steps to reproduce 1. Create or inspect a game session in the refactor build. 2. Start a new game session, conclude a session, enter combat, and leave combat. 3. Open the checkpoint panel and inspect `game-checkpoints` rows. 4. Force scene analysis to fail, for example with an invalid scene connection, and check whether inline tags still apply. 5. Generate a rare scene illustration and inspect whether a gallery row, cooldown metadata, and character reference image payload are produced. 6. Open gallery across multiple game sessions and check whether other session images appear through the game scope. ## Impact area - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [x] Game mode - [ ] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [x] React-free engine behavior, contracts, agents, or capability ports - [x] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: refactor inspected at `6cc9d086` - Run mode: Not run; static refactor vs legacy code comparison - OS + version: Not relevant - Node + pnpm versions: Not run - Rust version, if relevant: Not run - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: Scene analysis and image generation paths, provider not run ## Logs, screenshots, or video No runtime logs or screenshots. Static evidence is listed above with relative file paths and line anchors. ## Regression notes These behaviors existed in the legacy game implementation and appear absent or weakened in the refactor code paths. No current-code evidence found that the removals were intentional product decisions. ## Additional context Suggested repair order: 1. Restore auto checkpoints at session start/end and combat enter/exit, using current tracker snapshot storage semantics. 2. Make scene-analysis failures reach the existing UI fallback path instead of returning empty success. 3. Restore image safeguards: illustration cooldown, gallery preservation, reference image payloads, and background fallback. 4. Add or repair game `groupId` persistence, or update gallery scoping to use `metadata.gameId` consistently. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:22:43 +07:00
Author
Owner

@cha1latte commented on GitHub (Jun 1, 2026):

Fixed in #1823

<!-- gh-comment-id:4594880536 --> @cha1latte commented on GitHub (Jun 1, 2026): Fixed in #1823
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#875
No description provided.