[PR #2219] [MERGED] Fix game map location auto-sync #5481

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-2139-map-location-sync


📝 Commits (3)

  • 90c9d6a Fix game map location auto-sync
  • d77495c Record issue 2139 PR proof
  • 8de4104 Move issue 2139 proof to scratch

📊 Changes

6 files changed (+282 additions, -45 deletions)

View changed files

📝 scratch/bugfix-verification.json (+46 -45)
➕ scratch/issue-2139-map-position-repro.ts (+103 -0)
➕ scratch/issue-2139-vitest-after.json (+1 -0)
➕ scratch/issue-2139-vitest.config.ts (+8 -0)
📝 src/engine/modes/game/world/map-position.service.ts (+99 -0)
📝 src/features/modes/game/components/GameSurface.tsx (+25 -0)

📄 Description

Linked issue

Closes #2139

Why this change

  • Game maps on refactor only moved the party marker when the GM emitted an explicit [map_update:] tag. Legacy/main also synced the marker from the structured game-state location field, so ordinary narrated movement could leave the visible map stale.

What changed

  • Restored location-driven game map sync for existing node maps and grid maps.
  • Added metadata-level map selection so a structured location can activate the stored map that contains that location.
  • Added GameSurface wiring to persist location-derived map position changes when gameSnapshot.location changes.
  • Added focused scratch proof coverage for node, grid, multi-map, no-match, and already-synced cases.

Refactor impact

Primary owner:

  • game mode

Impact areas reviewed:

  • src/engine/modes/game/world/map-position.service.ts
  • src/features/modes/game/components/GameSurface.tsx
  • scratch/bugfix-verification.json

Boundary notes:

  • Engine code remains React-free. Feature UI imports the focused game map service that it already used for [map_update:] parsing/application.
  • No raw Tauri, remote-runtime, dependency, schema, auth, storage, prompt-pipeline, or release/version changes.

Pressure points touched:

  • GameSurface: added a location-change effect that syncs and persists map metadata.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Codex reproduced the pre-fix failure with a focused scratch Vitest repro; the structured-location sync export was absent on refactor.
  • After the fix, Codex ran pnpm exec vitest run --config scratch/issue-2139-vitest.config.ts successfully.
  • Codex wrote a JSON proof report with pnpm exec vitest run --config scratch/issue-2139-vitest.config.ts --reporter=json --outputFile=scratch/issue-2139-vitest-after.json.
  • Codex ran pnpm typecheck, pnpm check:architecture, pnpm check, git diff --check, and node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json; all passed.
  • Bunny review passed locally before opening this PR.
  • No human-only verification blocker is known for the core claim.
  • GitHub Rust Capability Layer is currently failing on latest upstream/refactor in untouched src-tauri/src/commands/storage/commands/entities.rs duplicate type aliases (LorebookEntryAtomicRows, LorebookFolderDeleteAtomicRows); local pnpm check passed on this issue branch before that base moved.

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:

  • This restores existing game map behavior and does not add a new user-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

UI evidence

  • N/A. This is a game state/map metadata logic regression; the core claim is proven by focused service coverage plus full pnpm check.

🔄 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/2219 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/4/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-2139-map-location-sync` --- ### 📝 Commits (3) - [`90c9d6a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/90c9d6a9b9221567743683d66ce5f30de2dce63a) Fix game map location auto-sync - [`d77495c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d77495c0b101ac6d218f5fd8cb99eb4eb777ccb2) Record issue 2139 PR proof - [`8de4104`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8de41040ac61d8aa45d5cc9a92c74b0ef466165b) Move issue 2139 proof to scratch ### 📊 Changes **6 files changed** (+282 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `scratch/bugfix-verification.json` (+46 -45) ➕ `scratch/issue-2139-map-position-repro.ts` (+103 -0) ➕ `scratch/issue-2139-vitest-after.json` (+1 -0) ➕ `scratch/issue-2139-vitest.config.ts` (+8 -0) 📝 `src/engine/modes/game/world/map-position.service.ts` (+99 -0) 📝 `src/features/modes/game/components/GameSurface.tsx` (+25 -0) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #2139 ## Why this change - Game maps on `refactor` only moved the party marker when the GM emitted an explicit `[map_update:]` tag. Legacy/main also synced the marker from the structured game-state `location` field, so ordinary narrated movement could leave the visible map stale. ## What changed - Restored location-driven game map sync for existing node maps and grid maps. - Added metadata-level map selection so a structured location can activate the stored map that contains that location. - Added `GameSurface` wiring to persist location-derived map position changes when `gameSnapshot.location` changes. - Added focused scratch proof coverage for node, grid, multi-map, no-match, and already-synced cases. ## Refactor impact Primary owner: - game mode Impact areas reviewed: - `src/engine/modes/game/world/map-position.service.ts` - `src/features/modes/game/components/GameSurface.tsx` - `scratch/bugfix-verification.json` Boundary notes: - Engine code remains React-free. Feature UI imports the focused game map service that it already used for `[map_update:]` parsing/application. - No raw Tauri, remote-runtime, dependency, schema, auth, storage, prompt-pipeline, or release/version changes. Pressure points touched: - `GameSurface`: added a location-change effect that syncs and persists map metadata. ## 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) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Codex reproduced the pre-fix failure with a focused scratch Vitest repro; the structured-location sync export was absent on `refactor`. - After the fix, Codex ran `pnpm exec vitest run --config scratch/issue-2139-vitest.config.ts` successfully. - Codex wrote a JSON proof report with `pnpm exec vitest run --config scratch/issue-2139-vitest.config.ts --reporter=json --outputFile=scratch/issue-2139-vitest-after.json`. - Codex ran `pnpm typecheck`, `pnpm check:architecture`, `pnpm check`, `git diff --check`, and `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json`; all passed. - Bunny review passed locally before opening this PR. - No human-only verification blocker is known for the core claim. - GitHub Rust Capability Layer is currently failing on latest `upstream/refactor` in untouched `src-tauri/src/commands/storage/commands/entities.rs` duplicate type aliases (`LorebookEntryAtomicRows`, `LorebookFolderDeleteAtomicRows`); local `pnpm check` passed on this issue branch before that base moved. ## 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: - This restores existing game map behavior and does not add a new user-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 ## UI evidence - N/A. This is a game state/map metadata logic regression; the core claim is proven by focused service coverage plus full `pnpm check`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:16:43 +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#5481
No description provided.