[PR #2217] [MERGED] Fix game JSONish parser wiring #5480

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-2138-game-jsonish-parser


📝 Commits (3)

  • 664f0c5 Fix game JSONish parser wiring
  • 9a3f008 Merge remote-tracking branch 'origin/refactor' into fix/issue-2138-game-jsonish-parser
  • 2564987 Fix storage atomic row clippy alias

📊 Changes

2 files changed (+11 additions, -17 deletions)

View changed files

📝 src-tauri/src/commands/storage/commands/entities.rs (+9 -2)
📝 src/features/modes/game/api/game-api.ts (+2 -15)

📄 Description

Linked issue

Closes #2138

Why this change

  • Game-mode model JSON and JSON-repair apply paths were still using a weak local object parser, so recoverable JSONish output that legacy/main accepts could fail into the repair modal and then fail again when applied.

What changed

  • Routed the game API's object parser helper through the existing parseGameJsonish implementation while keeping the object-only guard.
  • Left the existing generated-JSON and repair-apply call sites in place so both paths now share the tolerant parser.

Refactor impact

Primary owner:

  • game mode

Impact areas reviewed:

  • Game-mode LLM JSON generation paths: setup, map, session conclusion, session lorebook, campaign progression, party cards.
  • Game JSON repair apply path.

Boundary notes:

  • Feature API code now imports the existing engine shared JSONish parser. Engine code still does not import feature/runtime code.
  • No storage, schema, remote runtime, provider transport, or dependency changes.

Pressure points touched:

  • src/features/modes/game/api/game-api.ts

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

  • Reproduced before fix with a scratch Vitest harness: recoverable JSONish repair input threw Repaired JSON is not a JSON object.
  • Verified after fix with the same scratch harness: raw newline plus trailing comma, line comment, fenced JSONish with trailing junk, and double-stringified valid object all passed the parser gate; array JSON still failed the object-only negative control.
  • Ran pnpm typecheck locally: passed.
  • Ran pnpm check:architecture locally: passed.
  • Ran full pnpm check locally: passed.
  • Ran cargo clippy --manifest-path src-tauri/Cargo.toml --workspace --all-targets -- -D warnings locally after the CI fix: passed.
  • Local Bunny review found no code/proof findings for the diff. The optional local proof-gate helper referenced by workflow notes was unavailable at C:/Users/celia/.codex/tools/marinara-proof-gate.mjs, so this remains a draft pending normal review gates.

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 only; no new discoverable user-facing feature or workflow.

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 - no visible UI change. This is game-mode JSON parsing behavior verified with a scratch logic harness and full local checks.


🔄 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/2217 **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-2138-game-jsonish-parser` --- ### 📝 Commits (3) - [`664f0c5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/664f0c51367d0b0936174ed4ad3db56942b72405) Fix game JSONish parser wiring - [`9a3f008`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9a3f00862c15929a41c2cfd060182d3d32ffbe93) Merge remote-tracking branch 'origin/refactor' into fix/issue-2138-game-jsonish-parser - [`2564987`](https://github.com/Pasta-Devs/Marinara-Engine/commit/25649875e2c8f25678dc0d74f10f11c30e48b040) Fix storage atomic row clippy alias ### 📊 Changes **2 files changed** (+11 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/commands/entities.rs` (+9 -2) 📝 `src/features/modes/game/api/game-api.ts` (+2 -15) </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 #2138 ## Why this change - Game-mode model JSON and JSON-repair apply paths were still using a weak local object parser, so recoverable JSONish output that legacy/main accepts could fail into the repair modal and then fail again when applied. ## What changed - Routed the game API's object parser helper through the existing `parseGameJsonish` implementation while keeping the object-only guard. - Left the existing generated-JSON and repair-apply call sites in place so both paths now share the tolerant parser. ## Refactor impact Primary owner: - game mode Impact areas reviewed: - Game-mode LLM JSON generation paths: setup, map, session conclusion, session lorebook, campaign progression, party cards. - Game JSON repair apply path. Boundary notes: - Feature API code now imports the existing engine shared JSONish parser. Engine code still does not import feature/runtime code. - No storage, schema, remote runtime, provider transport, or dependency changes. Pressure points touched: - `src/features/modes/game/api/game-api.ts` ## 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 - Reproduced before fix with a scratch Vitest harness: recoverable JSONish repair input threw `Repaired JSON is not a JSON object.` - Verified after fix with the same scratch harness: raw newline plus trailing comma, line comment, fenced JSONish with trailing junk, and double-stringified valid object all passed the parser gate; array JSON still failed the object-only negative control. - Ran `pnpm typecheck` locally: passed. - Ran `pnpm check:architecture` locally: passed. - Ran full `pnpm check` locally: passed. - Ran `cargo clippy --manifest-path src-tauri/Cargo.toml --workspace --all-targets -- -D warnings` locally after the CI fix: passed. - Local Bunny review found no code/proof findings for the diff. The optional local proof-gate helper referenced by workflow notes was unavailable at `C:/Users/celia/.codex/tools/marinara-proof-gate.mjs`, so this remains a draft pending normal review gates. ## 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 only; no new discoverable user-facing feature or workflow. ## 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 - no visible UI change. This is game-mode JSON parsing behavior verified with a scratch logic harness and full local checks. --- <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:41 +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#5480
No description provided.