[PR #1470] [MERGED] Fix game setup ready transition #5104

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1470
Author: @cha1latte
Created: 5/28/2026
Status: ✅ Merged
Merged: 5/28/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/refactor-issue-1467-generate-world


📝 Commits (3)

  • d84e807 Fix game setup ready transition
  • f02cf3c Merge remote-tracking branch 'upstream/refactor' into fix/refactor-issue-1467-generate-world
  • ddb80b9 Fix refactor clippy warnings

📊 Changes

10 files changed (+245 additions, -158 deletions)

View changed files

📝 graphify-out/GRAPH_REPORT.md (+17 -17)
➕ graphify-out/cache/ast/ea3368abcdad03c563713cf64eb00f5c19e442459c082b9fd18cc1811659594f.json (+1 -0)
📝 graphify-out/cache/stat-index.json (+1 -1)
📝 graphify-out/graph.json (+152 -122)
📝 graphify-out/manifest.json (+13 -8)
➕ pr-evidence/issue-1467/after.png (+0 -0)
📝 src-tauri/src/state.rs (+5 -6)
📝 src/features/modes/game/api/game-api.test.ts (+43 -0)
📝 src/features/modes/game/api/game-api.ts (+3 -2)
📝 src/features/modes/game/hooks/use-game.ts (+10 -2)

📄 Description

Linked issue

Closes #1467

Why this change

  • Generate World setup success persisted the chat as ready, but the mutation contract did not return the updated session chat. The UI then depended on a later invalidation/refetch to observe gameSessionStatus: "ready", which left a stale cache/active-chat path able to keep the setup modal visible after generation.

What changed

  • gameApi.setupGame now returns the updated ready sessionChat from the metadata patch.
  • Game setup success now publishes that returned chat into the chat detail cache and active chat store before invalidating.
  • New-game creation also seeds the chat detail cache/active chat store from its returned setup chat for the same state-owner contract.
  • Added a focused setupGame API contract test.
  • Refreshed Graphify output after the code change.

Refactor impact

Primary owner:

  • Game mode

Impact areas reviewed:

  • Game setup mutation flow
  • gameApi.setupGame
  • applyGameJsonRepair(game_setup) caller path
  • Chat detail cache and active chat store synchronization
  • Graphify generated map output

Boundary notes:

  • Change stays inside game feature API/hooks and feature test coverage.
  • Engine imports remain type/service imports only; no React or runtime adapter imports were added to engine code.
  • No raw Tauri, Rust command, remote runtime, schema, dependency, or prompt-pipeline changes.

Pressure points touched:

  • GameSurface setup visibility depends on the setup-active store flag plus chat readiness state; this PR updates the mutation contract feeding that state.
  • useGameSetup
  • gameApi.setupGame

Validation

  • pnpm check passes locally
  • 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
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

  • node scratch\issue-1467-game-setup-repro.mjs --expect-fixed passed with the setup modal hidden and the Start Game screen visible.
  • pnpm test -- src/features/modes/game/api/game-api.test.ts passed.
  • pnpm typecheck passed.
  • pnpm check:architecture passed.
  • pnpm check:docs passed.
  • graphify update . passed.
  • pnpm check passed.
  • pnpm build passed.
  • node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json passed.
  • Limitation: the browser/Tauri mock happy path did not reproduce the stuck modal before the fix; the issue was diagnosed as a state-contract/cache synchronization race, then proven through the updated API contract and fixed-state UI harness.

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

UI evidence

After-state proof:

Game setup reaches Start Game


🔄 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/1470 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/28/2026 **Status:** ✅ Merged **Merged:** 5/28/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/refactor-issue-1467-generate-world` --- ### 📝 Commits (3) - [`d84e807`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d84e807ded20146c3b57a074ce8e3e1cbd37e646) Fix game setup ready transition - [`f02cf3c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f02cf3ca9c17ab618dbacce7e87fb0be41d2e06c) Merge remote-tracking branch 'upstream/refactor' into fix/refactor-issue-1467-generate-world - [`ddb80b9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ddb80b9e0b4c74b45ec82ddf9a44f782a636c754) Fix refactor clippy warnings ### 📊 Changes **10 files changed** (+245 additions, -158 deletions) <details> <summary>View changed files</summary> 📝 `graphify-out/GRAPH_REPORT.md` (+17 -17) ➕ `graphify-out/cache/ast/ea3368abcdad03c563713cf64eb00f5c19e442459c082b9fd18cc1811659594f.json` (+1 -0) 📝 `graphify-out/cache/stat-index.json` (+1 -1) 📝 `graphify-out/graph.json` (+152 -122) 📝 `graphify-out/manifest.json` (+13 -8) ➕ `pr-evidence/issue-1467/after.png` (+0 -0) 📝 `src-tauri/src/state.rs` (+5 -6) 📝 `src/features/modes/game/api/game-api.test.ts` (+43 -0) 📝 `src/features/modes/game/api/game-api.ts` (+3 -2) 📝 `src/features/modes/game/hooks/use-game.ts` (+10 -2) </details> ### 📄 Description ## Linked issue Closes #1467 ## Why this change - Generate World setup success persisted the chat as ready, but the mutation contract did not return the updated session chat. The UI then depended on a later invalidation/refetch to observe `gameSessionStatus: "ready"`, which left a stale cache/active-chat path able to keep the setup modal visible after generation. ## What changed - `gameApi.setupGame` now returns the updated ready `sessionChat` from the metadata patch. - Game setup success now publishes that returned chat into the chat detail cache and active chat store before invalidating. - New-game creation also seeds the chat detail cache/active chat store from its returned setup chat for the same state-owner contract. - Added a focused `setupGame` API contract test. - Refreshed Graphify output after the code change. ## Refactor impact Primary owner: - Game mode Impact areas reviewed: - Game setup mutation flow - `gameApi.setupGame` - `applyGameJsonRepair(game_setup)` caller path - Chat detail cache and active chat store synchronization - Graphify generated map output Boundary notes: - Change stays inside game feature API/hooks and feature test coverage. - Engine imports remain type/service imports only; no React or runtime adapter imports were added to engine code. - No raw Tauri, Rust command, remote runtime, schema, dependency, or prompt-pipeline changes. Pressure points touched: - `GameSurface` setup visibility depends on the setup-active store flag plus chat readiness state; this PR updates the mutation contract feeding that state. - `useGameSetup` - `gameApi.setupGame` ## Validation - [ ] `pnpm check` passes locally - [ ] `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 - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes - `node scratch\issue-1467-game-setup-repro.mjs --expect-fixed` passed with the setup modal hidden and the Start Game screen visible. - `pnpm test -- src/features/modes/game/api/game-api.test.ts` passed. - `pnpm typecheck` passed. - `pnpm check:architecture` passed. - `pnpm check:docs` passed. - `graphify update .` passed. - `pnpm check` passed. - `pnpm build` passed. - `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json` passed. - Limitation: the browser/Tauri mock happy path did not reproduce the stuck modal before the fix; the issue was diagnosed as a state-contract/cache synchronization race, then proven through the updated API contract and fixed-state UI harness. ## 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 ## UI evidence After-state proof: ![Game setup reaches Start Game](pr-evidence/issue-1467/after.png) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:13:16 +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#5104
No description provided.