[PR #2229] [MERGED] Fix legacy game narration segment parsing #5491

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-2150-legacy-narration


📝 Commits (2)

  • a3bfc0b Fix legacy game narration segment parsing
  • 02ba776 Refresh PR metadata checks

📊 Changes

3 files changed (+222 additions, -3 deletions)

View changed files

➕ src/features/modes/game/components/GameNarration.test.tsx (+186 -0)
📝 src/features/modes/game/components/GameNarration.tsx (+29 -2)
📝 src/features/modes/game/lib/game-tag-parser.ts (+7 -1)

📄 Description

Linked issue

Closes #2150

Why this change

Old saved game histories can contain Narration: ... and Dialogue [Name] [expr]: "..." lines. The engine edit parser still treated those as standalone segments, but GameNarration display/truncation no longer did, so prefixes leaked into the UI and edit/delete/interrupt segment indices could diverge.

What changed

  • Restored legacy Narration: parsing in GameNarration display so the prefix is stripped and the line remains a standalone narration segment.
  • Restored legacy Dialogue [Name] [expr]: / Dialogue [Name]: parsing for display and interrupt truncation while preserving compact [Name] [expr]: dialogue.
  • Kept segment-timed inventory updates aligned with the same legacy segment boundaries.
  • Added focused regression coverage for rendered narration, interrupt truncation, and inventory segment timing.

Refactor impact

Primary owner:

game mode

Impact areas reviewed:

  • src/features/modes/game/components/GameNarration.tsx
  • src/features/modes/game/lib/game-tag-parser.ts
  • src/engine/modes/game/state/segment-edits.ts for existing legacy edit parser behavior

Boundary notes:

  • Feature/UI parser fix only; no engine, shared API, Rust, storage, schema, prompt pipeline, dependency, or release metadata changes.
  • Engine edit parsing already recognizes the legacy forms, so this PR restores feature-side agreement rather than changing engine behavior.

Pressure points touched:

  • GameNarration segment display and interrupt truncation
  • Segment-timed inventory parser used by game runtime UI timing

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 ran:

  • Before-fix focused Vitest harness in a temporary upstream/refactor worktree: failed with legacy narration/dialogue collapsed into fallback narration and truncation segment 0 including the following legacy dialogue line.
  • pnpm exec vitest run src/features/modes/game/components/GameNarration.test.tsx --reporter verbose: passed, 3 tests.
  • pnpm typecheck: passed.
  • pnpm check:unused: passed.
  • pnpm check: passed.
  • node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch/issue-2150-bugfix-verification.json: passed locally.
  • Bunny review: pass before opening draft.

Manual/UI note: no reviewer-visible before/after screenshot from an actual old saved Tauri game chat is attached yet; the core parser claim is covered by the component-level regression test and full local checks. External CI, Bunny, and CodeRabbit are clean; this is kept draft for any desired human visual check.

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:

  • Compatibility bugfix for legacy saved game narration formats; no new user-discoverable 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

No uploaded screenshot evidence yet. The draft relies on focused component regression proof for rendered text and interrupt truncation, plus local and GitHub baseline 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/2229 **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-2150-legacy-narration` --- ### 📝 Commits (2) - [`a3bfc0b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a3bfc0bbb295e34b407f779bdb7a6d961d419868) Fix legacy game narration segment parsing - [`02ba776`](https://github.com/Pasta-Devs/Marinara-Engine/commit/02ba776d3209813992c3974e668c9d1d90ca6b52) Refresh PR metadata checks ### 📊 Changes **3 files changed** (+222 additions, -3 deletions) <details> <summary>View changed files</summary> ➕ `src/features/modes/game/components/GameNarration.test.tsx` (+186 -0) 📝 `src/features/modes/game/components/GameNarration.tsx` (+29 -2) 📝 `src/features/modes/game/lib/game-tag-parser.ts` (+7 -1) </details> ### 📄 Description ## Linked issue Closes #2150 ## Why this change Old saved game histories can contain `Narration: ...` and `Dialogue [Name] [expr]: "..."` lines. The engine edit parser still treated those as standalone segments, but GameNarration display/truncation no longer did, so prefixes leaked into the UI and edit/delete/interrupt segment indices could diverge. ## What changed - Restored legacy `Narration:` parsing in GameNarration display so the prefix is stripped and the line remains a standalone narration segment. - Restored legacy `Dialogue [Name] [expr]:` / `Dialogue [Name]:` parsing for display and interrupt truncation while preserving compact `[Name] [expr]:` dialogue. - Kept segment-timed inventory updates aligned with the same legacy segment boundaries. - Added focused regression coverage for rendered narration, interrupt truncation, and inventory segment timing. ## Refactor impact Primary owner: game mode Impact areas reviewed: - `src/features/modes/game/components/GameNarration.tsx` - `src/features/modes/game/lib/game-tag-parser.ts` - `src/engine/modes/game/state/segment-edits.ts` for existing legacy edit parser behavior Boundary notes: - Feature/UI parser fix only; no engine, shared API, Rust, storage, schema, prompt pipeline, dependency, or release metadata changes. - Engine edit parsing already recognizes the legacy forms, so this PR restores feature-side agreement rather than changing engine behavior. Pressure points touched: - `GameNarration` segment display and interrupt truncation - Segment-timed inventory parser used by game runtime UI timing ## 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 ran: - Before-fix focused Vitest harness in a temporary `upstream/refactor` worktree: failed with legacy narration/dialogue collapsed into fallback narration and truncation segment 0 including the following legacy dialogue line. - `pnpm exec vitest run src/features/modes/game/components/GameNarration.test.tsx --reporter verbose`: passed, 3 tests. - `pnpm typecheck`: passed. - `pnpm check:unused`: passed. - `pnpm check`: passed. - `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch/issue-2150-bugfix-verification.json`: passed locally. - Bunny review: pass before opening draft. Manual/UI note: no reviewer-visible before/after screenshot from an actual old saved Tauri game chat is attached yet; the core parser claim is covered by the component-level regression test and full local checks. External CI, Bunny, and CodeRabbit are clean; this is kept draft for any desired human visual check. ## 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: - Compatibility bugfix for legacy saved game narration formats; no new user-discoverable 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 No uploaded screenshot evidence yet. The draft relies on focused component regression proof for rendered text and interrupt truncation, plus local and GitHub baseline 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:47 +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#5491
No description provided.