[PR #5330] [MERGED] fix: address open Mari, preset, Game, and Roleplay issues #6731

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5330
Author: @SpicyMarinara
Created: 8/20/2026
Status: ✅ Merged
Merged: 8/20/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/issue-sweep-5325-5327


📝 Commits (7)

  • 4561521 fix: unblock Mari mutations and align preset toggles
  • 8119693 fix: restore Game turn and journal controls
  • 06eb13e fix: tighten sweep edge cases
  • da435d9 fix: close remaining sweep review gaps
  • 18864dc fix: guard late audio and precise confirmations
  • f8217a3 fix(roleplay): default unknown merged speakers
  • 9946e74 fix: scope vague mutation confirmations

📊 Changes

19 files changed (+512 additions, -78 deletions)

View changed files

📝 CHANGELOG.md (+4 -0)
📝 e2e/core-flows.e2e.ts (+24 -6)
📝 packages/client/src/components/chat/ChatMessage.tsx (+2 -2)
📝 packages/client/src/components/game/GameJournal.tsx (+145 -10)
📝 packages/client/src/components/game/GameNarration.tsx (+12 -7)
📝 packages/client/src/components/game/GameSessionReplay.tsx (+5 -1)
📝 packages/client/src/components/game/GameSurface.tsx (+3 -2)
📝 packages/client/src/components/presets/ChoiceSelectionModal.tsx (+21 -30)
📝 packages/client/src/lib/game-audio.ts (+37 -5)
📝 packages/client/src/localization/locales/en.json (+8 -0)
📝 packages/server/src/routes/game.routes.ts (+30 -0)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+12 -7)
📝 packages/server/src/services/sidecar/scene-analyzer.ts (+11 -3)
📝 packages/server/src/services/sidecar/scene-postprocess.ts (+3 -0)
📝 packages/server/src/services/sidecar/sidecar-inference.service.ts (+1 -0)
📝 packages/shared/src/types/sidecar.ts (+2 -0)
➕ scripts/regressions/game-journal-edit.regression.ts (+58 -0)
📝 scripts/regressions/open-issues.regression.ts (+68 -3)
📝 scripts/regressions/prompt.regression.ts (+66 -2)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #5325
Closes #5326
Closes #5327
Closes #5336

Why this change

  • Professor Mari could loop on a valid mutation request when a smaller model omitted or paraphrased its redundant authorization quote.
  • Single-option preset variables used an undersized one-off toggle in the Android APK.
  • Game rerolls stayed at the prior playback position, generated journal entries could not be corrected, and scene analysis could not request repeated beat-level sound effects.
  • Earlier Game branches needed to restore their anchored inventory and widget state.
  • In merged-narrator Roleplay groups, a tagged NPC without a matching card could borrow another participant's dialogue color.

What changed

  • Fall back to the server-separated direct user message when the model quote is absent or paraphrased, while retaining denial, informational-request, operation, entity, and vague-confirmation checks.
  • Reuse the standard accessible settings switch for single-option preset variables.
  • Key Game narration playback by message and active swipe so a reroll starts at that swipe's beginning.
  • Add one bounded journal-entry update route and an editor for Timeline and Library entries.
  • Let the scene analyzer choose 1–5 total sequential SFX plays on a beat, clamp the value server-side, and preserve it in session replay.
  • Invalidate late procedural-audio callbacks when the reusable Game audio manager is disposed.
  • Keep the existing branch-state fix from #5287; its regression already proves journal entries and generated widgets rewind to the selected story point.
  • Use the configured default dialogue color as the merged narrator fallback while retaining matching card color overrides.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Automated evidence:

  • pnpm check — passed after the final changes.
  • node ./scripts/run-regressions.mjs --filter scripts/regressions/open-issues.regression.ts — passed.
  • node ./scripts/run-regressions.mjs --filter scripts/regressions/game-journal-edit.regression.ts — passed, including missing-entry rejection.
  • node ./scripts/run-regressions.mjs --filter scripts/regressions/chat-branch-lineage.regression.ts — passed, including Game journal/widget branch rewind.
  • Direct Professor Mari authorization proof — vague confirmations were blocked and the concrete named-character request was accepted.
  • Focused Playwright desktop regression for merged narrator speaker colors — passed (1 test, 4.5s).
  • scripts/regressions/prompt.regression.ts — the new Professor Mari positive and negative authorization controls passed; the full file still reports the unrelated pre-existing Beholder prompt-fixture mismatch.

Manual verification notes

  • Manually verify the single-option preset switch in the Android APK.
  • Manually verify Professor Mari can perform an explicitly requested lorebook mutation with GLM/Gemma while informational requests remain blocked.
  • Manually reroll a completed Game turn and confirm playback begins at the player line/first narration segment.
  • Manually edit Timeline and Library journal entries, reload, and confirm the corrections persist.
  • Manually verify a scene-analysis result with sfxLoopCount repeats sequentially and session replay does the same.
  • Manually verify an unknown tagged NPC in a mixed-color merged Roleplay group uses the configured default dialogue color.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] <paths> follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

  • Issue #5326 contains the Android before screenshot. Capture the corrected APK switch and journal editor before merge.
  • The focused browser regression covers the merged-narrator card-color and unknown-NPC fallback paths.

Summary by CodeRabbit

  • New Features
    • Added journal entry editing with title/content updates, save status, and error messages.
    • Added configurable sound-effect repetition, supporting up to five sequential plays.
    • Improved single-option preset switches with clearer toggle behavior.
  • Bug Fixes
    • Improved workspace authorization for natural-language confirmations.
    • Fixed narration resets when switching assistant swipes.
    • Restored branch state more reliably during replay.
    • Corrected merged narrator dialogue colors and sound-effect playback cleanup.

🔄 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/5330 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/20/2026 **Status:** ✅ Merged **Merged:** 8/20/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/issue-sweep-5325-5327` --- ### 📝 Commits (7) - [`4561521`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4561521a10197665ab38b5a017c1f16b7e3bb122) fix: unblock Mari mutations and align preset toggles - [`8119693`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8119693fc7ed7d937e1de7b02eab5bed21aefae5) fix: restore Game turn and journal controls - [`06eb13e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/06eb13e6b69146a39534d5b79abf17fa68873d17) fix: tighten sweep edge cases - [`da435d9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/da435d97c1a41b2c2e651b02a3643595dc96a085) fix: close remaining sweep review gaps - [`18864dc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/18864dcc2f3aa98b6c941f5fd908f28320c03b10) fix: guard late audio and precise confirmations - [`f8217a3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f8217a3c4d48423f2dd792396e09fb56c63a7e0b) fix(roleplay): default unknown merged speakers - [`9946e74`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9946e7401fe66951052518df4b9964e1490b9014) fix: scope vague mutation confirmations ### 📊 Changes **19 files changed** (+512 additions, -78 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+4 -0) 📝 `e2e/core-flows.e2e.ts` (+24 -6) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+2 -2) 📝 `packages/client/src/components/game/GameJournal.tsx` (+145 -10) 📝 `packages/client/src/components/game/GameNarration.tsx` (+12 -7) 📝 `packages/client/src/components/game/GameSessionReplay.tsx` (+5 -1) 📝 `packages/client/src/components/game/GameSurface.tsx` (+3 -2) 📝 `packages/client/src/components/presets/ChoiceSelectionModal.tsx` (+21 -30) 📝 `packages/client/src/lib/game-audio.ts` (+37 -5) 📝 `packages/client/src/localization/locales/en.json` (+8 -0) 📝 `packages/server/src/routes/game.routes.ts` (+30 -0) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+12 -7) 📝 `packages/server/src/services/sidecar/scene-analyzer.ts` (+11 -3) 📝 `packages/server/src/services/sidecar/scene-postprocess.ts` (+3 -0) 📝 `packages/server/src/services/sidecar/sidecar-inference.service.ts` (+1 -0) 📝 `packages/shared/src/types/sidecar.ts` (+2 -0) ➕ `scripts/regressions/game-journal-edit.regression.ts` (+58 -0) 📝 `scripts/regressions/open-issues.regression.ts` (+68 -3) 📝 `scripts/regressions/prompt.regression.ts` (+66 -2) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #5325 Closes #5326 Closes #5327 Closes #5336 ## Why this change - Professor Mari could loop on a valid mutation request when a smaller model omitted or paraphrased its redundant authorization quote. - Single-option preset variables used an undersized one-off toggle in the Android APK. - Game rerolls stayed at the prior playback position, generated journal entries could not be corrected, and scene analysis could not request repeated beat-level sound effects. - Earlier Game branches needed to restore their anchored inventory and widget state. - In merged-narrator Roleplay groups, a tagged NPC without a matching card could borrow another participant's dialogue color. ## What changed - Fall back to the server-separated direct user message when the model quote is absent or paraphrased, while retaining denial, informational-request, operation, entity, and vague-confirmation checks. - Reuse the standard accessible settings switch for single-option preset variables. - Key Game narration playback by message and active swipe so a reroll starts at that swipe's beginning. - Add one bounded journal-entry update route and an editor for Timeline and Library entries. - Let the scene analyzer choose 1–5 total sequential SFX plays on a beat, clamp the value server-side, and preserve it in session replay. - Invalidate late procedural-audio callbacks when the reusable Game audio manager is disposed. - Keep the existing branch-state fix from #5287; its regression already proves journal entries and generated widgets rewind to the selected story point. - Use the configured default dialogue color as the merged narrator fallback while retaining matching card color overrides. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Automated evidence: - `pnpm check` — passed after the final changes. - `node ./scripts/run-regressions.mjs --filter scripts/regressions/open-issues.regression.ts` — passed. - `node ./scripts/run-regressions.mjs --filter scripts/regressions/game-journal-edit.regression.ts` — passed, including missing-entry rejection. - `node ./scripts/run-regressions.mjs --filter scripts/regressions/chat-branch-lineage.regression.ts` — passed, including Game journal/widget branch rewind. - Direct Professor Mari authorization proof — vague confirmations were blocked and the concrete named-character request was accepted. - Focused Playwright desktop regression for merged narrator speaker colors — passed (1 test, 4.5s). - `scripts/regressions/prompt.regression.ts` — the new Professor Mari positive and negative authorization controls passed; the full file still reports the unrelated pre-existing Beholder prompt-fixture mismatch. ### Manual verification notes - Manually verify the single-option preset switch in the Android APK. - Manually verify Professor Mari can perform an explicitly requested lorebook mutation with GLM/Gemma while informational requests remain blocked. - Manually reroll a completed Game turn and confirm playback begins at the player line/first narration segment. - Manually edit Timeline and Library journal entries, reload, and confirm the corrections persist. - Manually verify a scene-analysis result with `sfxLoopCount` repeats sequentially and session replay does the same. - Manually verify an unknown tagged NPC in a mixed-color merged Roleplay group uses the configured default dialogue color. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n] <paths>` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) - Issue #5326 contains the Android before screenshot. Capture the corrected APK switch and journal editor before merge. - The focused browser regression covers the merged-narrator card-color and unknown-NPC fallback paths. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added journal entry editing with title/content updates, save status, and error messages. * Added configurable sound-effect repetition, supporting up to five sequential plays. * Improved single-option preset switches with clearer toggle behavior. * **Bug Fixes** * Improved workspace authorization for natural-language confirmations. * Fixed narration resets when switching assistant swipes. * Restored branch state more reliably during replay. * Corrected merged narrator dialogue colors and sound-effect playback cleanup. <!-- 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-23 04:13:09 +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#6731
No description provided.