[PR #1510] [MERGED] [codex] Restore Knip-unused game map wiring #5114

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1510
Author: @Xelvanis
Created: 5/29/2026
Status: ✅ Merged
Merged: 5/29/2026
Merged by: @Xelvanis

Base: refactor ← Head: chore/knip-unused-files-1496


📝 Commits (3)

  • a1c47c8 Restore Knip-unused game map wiring
  • d0b745b Fix map generation failure paths
  • 6891047 Address map generation review findings

📊 Changes

26 files changed (+1453 additions, -181 deletions)

View changed files

📝 .graphifyignore (+4 -0)
📝 graphify-out/GRAPH_REPORT.md (+13 -12)
➖ graphify-out/cache/ast/235e4b36b99ae6475e66f35cd38ccbe9fa9f4c9f23745ac97fcd7af23045933e.json (+0 -1)
➖ graphify-out/cache/ast/33b87b4dca658a4db96a3a63f0590514c8ccd710f04a52422e00d319c4f3da2b.json (+0 -1)
➖ graphify-out/cache/ast/486fbdb5c76a3eeb33693a84bb409e57058728e3e75ec67dba5495118044c56d.json (+0 -1)
➖ graphify-out/cache/ast/50374e6b518a5f2afd0aaa938be92ecdaf50f027ebcaaa94a3be5259b836d4f4.json (+0 -1)
➖ graphify-out/cache/ast/56fafe8dd3d6273f651df0dd6410ea80a62de620df559ebf1effc97bef05b5db.json (+0 -1)
➖ graphify-out/cache/ast/7c6829134afa5a54eecc434a6a6f1de1aa1f8d920b0fa6d1d775ceaa47096751.json (+0 -1)
➖ graphify-out/cache/ast/8677def538bbabf9f92fea962480dfc1f2415d127edfefb795bca00a914f21f6.json (+0 -1)
➖ graphify-out/cache/ast/8d5fe73dd066b3faca070346c78c5c1843ab38f9c7be2b494731b252847ba680.json (+0 -1)
➖ graphify-out/cache/ast/96be833580a9a0dd19508e2ae8b8a8fdac7e27df235279518d702712c4c50d1c.json (+0 -1)
➖ graphify-out/cache/ast/c34dfb3c558cfbc7690c89418ae6faca7b6d7d10bb169b69ea9a4f120d559bec.json (+0 -1)
➕ graphify-out/cache/ast/d774b5fb8fab0732b6b7086e299a0af98c58a2c2e123d03f01958054b101881e.json (+1 -0)
➖ graphify-out/cache/ast/f3b660f1242da4201169cca9e0f5a0febf9ca9052f4d2305972dc7a226e41d58.json (+0 -1)
📝 graphify-out/cache/stat-index.json (+1 -1)
📝 graphify-out/graph.json (+820 -112)
📝 graphify-out/manifest.json (+18 -18)
📝 graphify.scope.json (+4 -0)
📝 src/features/modes/game/api/game-api.test.ts (+239 -1)
📝 src/features/modes/game/api/game-api.ts (+278 -4)

...and 6 more files

📄 Description

Linked issue

Closes #1496

Why this change

  • Restores/rewires several Knip-reported game/roleplay files that were intended to be add-back triage, not deletion.
  • Keeps generated map creation, visible tracker wrappers, and Graphify scope aligned with current refactor architecture.
  • Fixes the failure paths found during the Bunny pass before publication.

What changed

  • Restored buildMapGenerationPrompt into gameApi.generateMap, including model JSON normalization, active map persistence, JSON repair handling, and targeted tests.
  • Routed game and roleplay tracker calls through their mode-owned tracker API wrappers.
  • Guarded async map generation UI/store updates so stale completions do not overwrite the active chat's map state.
  • Tightened Graphify scope for local generated Android files and refreshed Graphify output.

Refactor impact

Primary owner:

  • Game mode / roleplay mode feature APIs and UI, with game-mode engine prompt helper usage.

Impact areas reviewed:

  • Game map generation/persistence, GameSurface map controls, game/roleplay tracker wrappers, Graphify scope, Knip unused-file output.

Boundary notes:

  • Engine prompt helper stays React-free under src/engine/modes/game/world; feature code consumes it through the game API facade.
  • No raw Tauri or remote-runtime route changes.
  • Game and roleplay remain separate mode owners through mode-specific tracker wrappers.

Pressure points touched:

  • GameSurface, game map API/hook, roleplay HUD tracker clearing, Graphify generated output.

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

  • Automated validation run by Codex:
    • pnpm exec vitest run src/features/modes/game/api/game-api.test.ts
    • pnpm typecheck
    • pnpm lint:eslint
    • pnpm check:architecture
    • pnpm build (passed with the existing Vite chunk-size warning)
    • pnpm exec knip --reporter compact --no-exit-code --no-config-hints (still reports 13 unused files)
    • graphify update .
    • pnpm check:graphify-scope
    • git diff --check origin/refactor...HEAD -- . ':(exclude)graphify-out/**'
  • No browser or native Tauri manual QA was performed.

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

  • Not captured; changes are API/flow wiring with targeted automated coverage.

Summary by CodeRabbit

Release Notes

  • New Features

    • Game map generation now supports automatic repair when generation encounters issues.
    • New methods for accessing visible game state and clearing manual roleplay state.
  • Bug Fixes

    • Map generation button now properly disables while processing.
    • Map state updates correctly scoped to active sessions only.
    • Improved error handling in map generation flow.
  • Chores

    • Updated build configuration to ignore additional Android-generated artifacts.

Review Change Stack


🔄 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/1510 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/29/2026 **Status:** ✅ Merged **Merged:** 5/29/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `chore/knip-unused-files-1496` --- ### 📝 Commits (3) - [`a1c47c8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a1c47c8acb6e98cece540b8d1ee0a8ed52730a80) Restore Knip-unused game map wiring - [`d0b745b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d0b745b7c5d3b394555a06b4c8c6e105ce5df1b0) Fix map generation failure paths - [`6891047`](https://github.com/Pasta-Devs/Marinara-Engine/commit/68910475f56520ac432756ea9d9df02d58d13e87) Address map generation review findings ### 📊 Changes **26 files changed** (+1453 additions, -181 deletions) <details> <summary>View changed files</summary> 📝 `.graphifyignore` (+4 -0) 📝 `graphify-out/GRAPH_REPORT.md` (+13 -12) ➖ `graphify-out/cache/ast/235e4b36b99ae6475e66f35cd38ccbe9fa9f4c9f23745ac97fcd7af23045933e.json` (+0 -1) ➖ `graphify-out/cache/ast/33b87b4dca658a4db96a3a63f0590514c8ccd710f04a52422e00d319c4f3da2b.json` (+0 -1) ➖ `graphify-out/cache/ast/486fbdb5c76a3eeb33693a84bb409e57058728e3e75ec67dba5495118044c56d.json` (+0 -1) ➖ `graphify-out/cache/ast/50374e6b518a5f2afd0aaa938be92ecdaf50f027ebcaaa94a3be5259b836d4f4.json` (+0 -1) ➖ `graphify-out/cache/ast/56fafe8dd3d6273f651df0dd6410ea80a62de620df559ebf1effc97bef05b5db.json` (+0 -1) ➖ `graphify-out/cache/ast/7c6829134afa5a54eecc434a6a6f1de1aa1f8d920b0fa6d1d775ceaa47096751.json` (+0 -1) ➖ `graphify-out/cache/ast/8677def538bbabf9f92fea962480dfc1f2415d127edfefb795bca00a914f21f6.json` (+0 -1) ➖ `graphify-out/cache/ast/8d5fe73dd066b3faca070346c78c5c1843ab38f9c7be2b494731b252847ba680.json` (+0 -1) ➖ `graphify-out/cache/ast/96be833580a9a0dd19508e2ae8b8a8fdac7e27df235279518d702712c4c50d1c.json` (+0 -1) ➖ `graphify-out/cache/ast/c34dfb3c558cfbc7690c89418ae6faca7b6d7d10bb169b69ea9a4f120d559bec.json` (+0 -1) ➕ `graphify-out/cache/ast/d774b5fb8fab0732b6b7086e299a0af98c58a2c2e123d03f01958054b101881e.json` (+1 -0) ➖ `graphify-out/cache/ast/f3b660f1242da4201169cca9e0f5a0febf9ca9052f4d2305972dc7a226e41d58.json` (+0 -1) 📝 `graphify-out/cache/stat-index.json` (+1 -1) 📝 `graphify-out/graph.json` (+820 -112) 📝 `graphify-out/manifest.json` (+18 -18) 📝 `graphify.scope.json` (+4 -0) 📝 `src/features/modes/game/api/game-api.test.ts` (+239 -1) 📝 `src/features/modes/game/api/game-api.ts` (+278 -4) _...and 6 more files_ </details> ### 📄 Description ## Linked issue Closes #1496 ## Why this change - Restores/rewires several Knip-reported game/roleplay files that were intended to be add-back triage, not deletion. - Keeps generated map creation, visible tracker wrappers, and Graphify scope aligned with current refactor architecture. - Fixes the failure paths found during the Bunny pass before publication. ## What changed - Restored `buildMapGenerationPrompt` into `gameApi.generateMap`, including model JSON normalization, active map persistence, JSON repair handling, and targeted tests. - Routed game and roleplay tracker calls through their mode-owned tracker API wrappers. - Guarded async map generation UI/store updates so stale completions do not overwrite the active chat's map state. - Tightened Graphify scope for local generated Android files and refreshed Graphify output. ## Refactor impact Primary owner: - Game mode / roleplay mode feature APIs and UI, with game-mode engine prompt helper usage. Impact areas reviewed: - Game map generation/persistence, GameSurface map controls, game/roleplay tracker wrappers, Graphify scope, Knip unused-file output. Boundary notes: - Engine prompt helper stays React-free under `src/engine/modes/game/world`; feature code consumes it through the game API facade. - No raw Tauri or remote-runtime route changes. - Game and roleplay remain separate mode owners through mode-specific tracker wrappers. Pressure points touched: - GameSurface, game map API/hook, roleplay HUD tracker clearing, Graphify generated output. ## 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 - Automated validation run by Codex: - `pnpm exec vitest run src/features/modes/game/api/game-api.test.ts` - `pnpm typecheck` - `pnpm lint:eslint` - `pnpm check:architecture` - `pnpm build` (passed with the existing Vite chunk-size warning) - `pnpm exec knip --reporter compact --no-exit-code --no-config-hints` (still reports 13 unused files) - `graphify update .` - `pnpm check:graphify-scope` - `git diff --check origin/refactor...HEAD -- . ':(exclude)graphify-out/**'` - No browser or native Tauri manual QA was performed. ## 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 - Not captured; changes are API/flow wiring with targeted automated coverage. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Game map generation now supports automatic repair when generation encounters issues. * New methods for accessing visible game state and clearing manual roleplay state. * **Bug Fixes** * Map generation button now properly disables while processing. * Map state updates correctly scoped to active sessions only. * Improved error handling in map generation flow. * **Chores** * Updated build configuration to ignore additional Android-generated artifacts. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1510?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <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:24 +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#5114
No description provided.