[PR #1823] [MERGED] Fix game checkpoints and scene asset safeguards #5294

Closed
opened 2026-10-22 04:14:59 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1823
Author: @cha1latte
Created: 6/1/2026
Status: ✅ Merged
Merged: 6/1/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-1792-game-checkpoints-assets


📝 Commits (6)

  • 158e50b Fix game checkpoints and scene asset safeguards
  • e557c0f Fix game safeguard lint issues
  • 249ce28 Harden game illustration asset generation
  • c617d2f Refresh PR checks for discovery metadata
  • 443bf12 Harden game checkpoint persistence
  • 1af908e Expose automatic checkpoint warnings

📊 Changes

4 files changed (+413 additions, -58 deletions)

View changed files

📝 src/engine/modes/game/scene/game-scene-analysis.service.test.ts (+28 -0)
📝 src/engine/modes/game/scene/game-scene-analysis.service.ts (+14 -19)
📝 src/features/modes/game/api/game-api.ts (+339 -36)
📝 src/features/modes/game/components/GameSurface.tsx (+32 -3)

📄 Description

Linked issue

Closes #1792

Why this change

  • Game mode refactor paths lost legacy side effects around automatic checkpoints, scene-analysis failure fallback, generated scene illustration safeguards, and game session gallery grouping.

What changed

  • Restored automatic checkpoint creation for session start, session end, combat start, and combat end.
  • Restored game groupId persistence for first and follow-up game session chats so gallery/history can scope across sessions.
  • Let scene-analysis provider failures reject so the existing UI onError path can apply inline GM tags.
  • Added scene illustration safeguards: session-aware cooldown metadata, character/persona/NPC reference image payloads, chat gallery preservation, and fallback to the current reusable background if generated background creation fails.

Refactor impact

Primary owner:

Game mode

Impact areas reviewed:

  • Game mode API and GameSurface scene-analysis context
  • React-free game scene-analysis service
  • Chat/gallery storage metadata shapes used by game sessions
  • Image-generation request payloads and gallery row preservation

Boundary notes:

  • Feature code continues to use shared API wrappers (storageApi, imageGenerationApi, spriteApi, gameAssetsApi) rather than raw Tauri calls.
  • Engine scene-analysis remains React-free and only changes provider-failure error propagation.
  • No dependency, schema, auth, release, prompt-pipeline, import/export, or Rust command changes.

Pressure points touched:

  • GameSurface scene-analysis context and illustration cooldown gating
  • Game mode API session/combat transition side effects
  • Scene-analysis service failure handling

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • pnpm check passes locally before PR push/handoff, including the unused-code check
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Browser screenshot/recording evidence added when UI/browser state is the claim
  • Remote runtime smoke checked when relevant

Manual verification notes

Codex machine verification:

  • pnpm exec vitest run src/engine/modes/game/scene/game-scene-analysis.service.test.ts src/features/modes/game/api/game-api.test.ts passed after first failing before the production fix.
  • pnpm typecheck passed.
  • pnpm check passed after rebasing onto current upstream/refactor.
  • node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json passed.
  • Bunny review pass completed on the current rebased diff.

Manual/browser verification:

  • Not run. This PR changes game API/storage/provider payload logic; the core claim is covered by the targeted command harness and full repo gate.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Bugfix restoring existing Game mode parity; no new discoverable feature.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

No docs or release metadata changes were needed for this bugfix.

UI evidence

N/A. No visible UI layout/browser state changed; proof is the command harness and full repo validation above.


🔄 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/1823 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/1/2026 **Status:** ✅ Merged **Merged:** 6/1/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-1792-game-checkpoints-assets` --- ### 📝 Commits (6) - [`158e50b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/158e50bc4167cfd1003c2b613676e710c4c44212) Fix game checkpoints and scene asset safeguards - [`e557c0f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e557c0f5d1dd631adaa45f4a9ff85fcf52786b5e) Fix game safeguard lint issues - [`249ce28`](https://github.com/Pasta-Devs/Marinara-Engine/commit/249ce286db6488855b089cd204cc1bc383963725) Harden game illustration asset generation - [`c617d2f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c617d2f35dcd4fbd1c4b07d98fb09fc001b17fc1) Refresh PR checks for discovery metadata - [`443bf12`](https://github.com/Pasta-Devs/Marinara-Engine/commit/443bf120c707e39cf913936d1fd5770ad5a3bab1) Harden game checkpoint persistence - [`1af908e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1af908e98f65f6273c5bb6711fecb4ca6a5356f9) Expose automatic checkpoint warnings ### 📊 Changes **4 files changed** (+413 additions, -58 deletions) <details> <summary>View changed files</summary> 📝 `src/engine/modes/game/scene/game-scene-analysis.service.test.ts` (+28 -0) 📝 `src/engine/modes/game/scene/game-scene-analysis.service.ts` (+14 -19) 📝 `src/features/modes/game/api/game-api.ts` (+339 -36) 📝 `src/features/modes/game/components/GameSurface.tsx` (+32 -3) </details> ### 📄 Description ## Linked issue Closes #1792 ## Why this change - Game mode refactor paths lost legacy side effects around automatic checkpoints, scene-analysis failure fallback, generated scene illustration safeguards, and game session gallery grouping. ## What changed - Restored automatic checkpoint creation for session start, session end, combat start, and combat end. - Restored game `groupId` persistence for first and follow-up game session chats so gallery/history can scope across sessions. - Let scene-analysis provider failures reject so the existing UI `onError` path can apply inline GM tags. - Added scene illustration safeguards: session-aware cooldown metadata, character/persona/NPC reference image payloads, chat gallery preservation, and fallback to the current reusable background if generated background creation fails. ## Refactor impact Primary owner: Game mode Impact areas reviewed: - Game mode API and GameSurface scene-analysis context - React-free game scene-analysis service - Chat/gallery storage metadata shapes used by game sessions - Image-generation request payloads and gallery row preservation Boundary notes: - Feature code continues to use shared API wrappers (`storageApi`, `imageGenerationApi`, `spriteApi`, `gameAssetsApi`) rather than raw Tauri calls. - Engine scene-analysis remains React-free and only changes provider-failure error propagation. - No dependency, schema, auth, release, prompt-pipeline, import/export, or Rust command changes. Pressure points touched: - `GameSurface` scene-analysis context and illustration cooldown gating - Game mode API session/combat transition side effects - Scene-analysis service failure handling ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> <!-- Do not submit *.test.ts or *.test.tsx files as PR proof; cite existing checks, command output, app/browser/Tauri verification, or manual notes instead. --> - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] `pnpm check` passes locally before PR push/handoff, including the unused-code check - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [ ] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Browser screenshot/recording evidence added when UI/browser state is the claim - [ ] Remote runtime smoke checked when relevant ### Manual verification notes Codex machine verification: - `pnpm exec vitest run src/engine/modes/game/scene/game-scene-analysis.service.test.ts src/features/modes/game/api/game-api.test.ts` passed after first failing before the production fix. - `pnpm typecheck` passed. - `pnpm check` passed after rebasing onto current `upstream/refactor`. - `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json` passed. - Bunny review pass completed on the current rebased diff. Manual/browser verification: - Not run. This PR changes game API/storage/provider payload logic; the core claim is covered by the targeted command harness and full repo gate. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Bugfix restoring existing Game mode parity; no new discoverable feature. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims No docs or release metadata changes were needed for this bugfix. ## UI evidence N/A. No visible UI layout/browser state changed; proof is the command harness and full repo validation above. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:14:59 +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#5294
No description provided.