[PR #6193] [MERGED] fix: address assigned setup, translation, shutdown, and inventory issues #7084

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6193
Author: @SpicyMarinara
Created: 9/14/2026
Status: ✅ Merged
Merged: 9/14/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/assigned-sweep-6181-6192


📝 Commits (10+)

  • 3293f64 docs: record assigned issue sweep scope
  • 19bcb60 fix: preserve Game setup and background chat state in assigned sweep
  • dbd6a78 fix: preserve unsupported capability records across registry writes
  • ba7bdeb docs: note lossless installed package compatibility handling
  • c800002 test: check metadata save ordering without source distance limit
  • 7a0231d test: allow the complete wizard round trip within its scenario budget
  • 91e9c58 test: wait for VN messages before injecting translation state
  • 95082c0 fix: address sweep review findings and regression readiness
  • 3aa237b fix: recover setup loading and probe closed terminals portably
  • 8055d86 fix: restore installed legacy Experiences from setup imports

📊 Changes

41 files changed (+2351 additions, -443 deletions)

View changed files

📝 CHANGELOG.md (+6 -0)
📝 CONTRIBUTING.md (+2 -0)
📝 docs/development/optional-agent-packages.md (+48 -0)
📝 e2e/chat-sweep.e2e.ts (+259 -0)
📝 e2e/core-flows.e2e.ts (+2 -0)
➕ e2e/game-experience-setup.e2e.ts (+354 -0)
➕ e2e/inventory-tracker-details.e2e.ts (+133 -0)
📝 e2e/roleplay-vn.e2e.ts (+1 -0)
📝 packages/client/src/components/chat/ChatArea.tsx (+3 -40)
📝 packages/client/src/components/game/GameSetupSummary.tsx (+3 -1)
📝 packages/client/src/components/game/GameSetupWizard.tsx (+221 -27)
📝 packages/client/src/components/game/GameSurface.tsx (+7 -13)
➕ packages/client/src/components/game/LegacyExperienceSetupDialog.tsx (+181 -0)
📝 packages/client/src/components/game/NewGameExperienceChooser.tsx (+85 -221)
📝 packages/client/src/features/tracker-panel/components/sections/InventoryTrackerPanel.tsx (+75 -42)
📝 packages/client/src/hooks/use-generate.ts (+15 -31)
📝 packages/client/src/hooks/use-lorebooks.ts (+10 -1)
📝 packages/client/src/hooks/use-translate.ts (+88 -25)
📝 packages/client/src/lib/custom-agent-result-examples.ts (+1 -1)
➕ packages/client/src/lib/game-experience-setup.ts (+22 -0)

...and 21 more files

📄 Description

Linked issue

Closes #6181
Closes #6182
Closes #6183
Closes #6187
Closes #6192

Companion package work: Pasta-Devs/Marinara-Agents#852 (merged by @kolacheee at 8924a8c8; its tree exactly matches the reviewed artifacts). Translated documentation: #6194 (merged to docs-i18n; #6189 closed). This Engine PR supplies the API 1.18 support required by that package update.

Why this change

Experiences currently replace Game setup and hide Party and the other normal choices. Automatic translation can lose the originating chat's settings after navigation. Terminal hangup can leave confirmed saves unwritten and the storage writer lease behind. Inventory items cannot retain their descriptions or storage locations.

What changed

  • Keep all seven Game setup steps for Experiences declaring the optional API 1.18 setup block. Reuse the existing chooser, seed controls, normal setup payload and extracted legacy dialog. Existing-game setup preserves its saved Experience; only new games can choose one. Setup imports also restore installed legacy Experience selections into their existing dialogs, without importing arbitrary package state. Widget requirements remain editable and separate spatial-map preparation is suppressed for inline Experiences.
  • Add up to 100 explicit lore-entry picks using the existing library queries and lore processor. Picks include unattached enabled books, respect chat exclusions/disabled entries and ordinary token budgets, and supplement ordinary global/attached lore. Setup files carry the Experience and numeric seed; imports discard arbitrary package config and resolve the installed manifest's constants.
  • Capture translation settings after pending metadata saves and reuse the manual translation/persistence path. The originating chat retains its provider, language, prompt and saved result across navigation/cache eviction; an in-flight request is not duplicated on remount.
  • Route POSIX SIGHUP through normal shutdown. Guard Pino's direct stdout and the two known development pretty-stdout transports only when the terminal has failed, so exit-time flushing cannot hang. File/custom-transport errors and Windows signal handling stay under their existing paths.
  • Preserve optional inventory description/location through normalization, incremental updates, field locks, quantity-one edits and committed narrator context. Reuse the tracker InlineEdit controls and localization. The package prompt is updated in the companion PR.
  • Read installed package records independently, retaining unsupported raw records during later writes. Malformed registry containers still fail safely. This improves hosts containing this patch; it cannot retrofit compatibility into already-released older Engines.

For Experience games the GM now receives the player's actual goals and genre instead of empty goals and the package's former fixed pixel-art genre. The companion Pixelforge package retains its sealed world, legacy readers and startup readiness gate.

Validation

Completed local evidence:

  • pnpm check passes again after the review fixes (formatting, localization, lint/types, production client/server builds). The lifecycle regression verifies lossless writes, malformed-container refusal and downgrade prevention.

  • Wizard: 6/6 browser cases across desktop Chromium, mobile Chromium and mobile WebKit. Covers all seven steps, legacy dialog keyboard focus/trapping/back navigation, numeric seed errors/randomize, setup import and deselection, failed entry loading with in-place retry preserving selected IDs, existing-game omission, widget requirement/override, map suppression, eligible lore picks and payloads.

  • Translation: failing-before reproduction, then 9/9 final browser cases across the same projects and Conversation/Roleplay/Game. Covers navigation, cache eviction, a bounded held-save interval, malformed language fallbacks and originating provider settings; the earlier 12-case run also covered Game manual/hidden/delayed controls.

  • Inventory: failing-before normalization/context proofs; prompt and actual generation/retry route regressions pass. Six browser cases cover light/dark themes, details, quantity-one edits, locks and reload. Committed context is checked in XML, Markdown and unwrapped formats.

  • Real /game/setup regression: explicit unattached probability-zero lore is included alongside ordinary lore; disabled/excluded and over-budget controls stay absent. Classic-wizard /game/create stamping and seed-only setup-file round trip pass.

  • Real macOS pseudo-terminal reproduction: before, closing the terminal lost a confirmed pending save; the development pretty transport also reproduced exit 1 and a retained lease. All six production/development idle, direct-SIGHUP and busy cases now exit 0, persist the save, release the lease and record a clean heartbeat. Duplicate SIGINT and healthy/custom/file logging-error controls pass. The final probe uses one NUL byte; a controlled zero-write no-op reproduces the old portability failure and passes with the nonempty probe.

  • Final commit 0558bb92c: all eight required checks pass (including container, repository validation, code scanning and CodeRabbit), Windows launcher CI passes, and the complete hosted Node sweep passes 268/268. CodeRabbit completed the final two-file review with no actionable comments. The final Keeper entry-picker negative control fails before and passes after; all six wizard browser cases and pnpm check pass locally. The earlier complete hosted browser matrix on 3aa237b84 passed 922 cases with 245 intentional skips; the final optional full browser rerun is still running at merge, with no failures reported.

  • Actual rebuilt Inventory 1.2.0 and Pixelforge 0.16.8 ZIPs pass the real Engine catalog/install/read/uninstall path with disposable data and bounded fixture HTTPS responses. Archive corruption and installed-client tampering are rejected; a fresh process rereads persisted packages. Pixelforge remains absent from published catalogs.

  • 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

Manual verification notes

Manually verify package update from an existing installation, a real-provider Pixelforge world with selected lore and Party, an existing saved world, and inventory details grounded in actual story output. Physical iPhone/Android behavior and real-provider translation quality were not certified by the automated browser fixtures. All six Linux production/development PTY cases also pass on final commit 0558bb92c with persisted saves, released leases and clean exits; Windows launcher CI passes. Checklist boxes remain human to-dos per AGENTS.md.

Docs and release impact

CHANGELOG documents all product changes. The optional-package reference documents API 1.18, and CONTRIBUTING names the Python standard-library prerequisite for the real PTY regression. No Engine app-version bump. All ten translated packs are handled in #6194, including the earlier API 1.17 delta from #6189.

UI evidence

Inspected browser screenshots (download the HTML to view): wizard before/after selection, mobile seed and lore picker, inventory details in both themes. Synthetic fixtures only; no user chats or credentials.


🔄 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/6193 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/14/2026 **Status:** ✅ Merged **Merged:** 9/14/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/assigned-sweep-6181-6192` --- ### 📝 Commits (10+) - [`3293f64`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3293f64e5a2cf2d1255638889f39a7a7f10fd6b8) docs: record assigned issue sweep scope - [`19bcb60`](https://github.com/Pasta-Devs/Marinara-Engine/commit/19bcb60e4a5776448b5e6bc056b86e3e7d35b7af) fix: preserve Game setup and background chat state in assigned sweep - [`dbd6a78`](https://github.com/Pasta-Devs/Marinara-Engine/commit/dbd6a78d1854546df30fd9d34967f671566d4e6a) fix: preserve unsupported capability records across registry writes - [`ba7bdeb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ba7bdebe48511094ff36f994f1117c77344bfba2) docs: note lossless installed package compatibility handling - [`c800002`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c8000028701c87d39b26dc1b381060a5d0103b7f) test: check metadata save ordering without source distance limit - [`7a0231d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7a0231d2102ecec111a7399b89599ad4ea6366c4) test: allow the complete wizard round trip within its scenario budget - [`91e9c58`](https://github.com/Pasta-Devs/Marinara-Engine/commit/91e9c5811e30357a0aa9744267d8dc2467ddfc8e) test: wait for VN messages before injecting translation state - [`95082c0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/95082c0deb8cac32ab490371cf8ce6a214c49c44) fix: address sweep review findings and regression readiness - [`3aa237b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3aa237b8498bf3bd93a130915de2685142d7bbb4) fix: recover setup loading and probe closed terminals portably - [`8055d86`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8055d86695135b32551aa5dc561da866459f76e3) fix: restore installed legacy Experiences from setup imports ### 📊 Changes **41 files changed** (+2351 additions, -443 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+6 -0) 📝 `CONTRIBUTING.md` (+2 -0) 📝 `docs/development/optional-agent-packages.md` (+48 -0) 📝 `e2e/chat-sweep.e2e.ts` (+259 -0) 📝 `e2e/core-flows.e2e.ts` (+2 -0) ➕ `e2e/game-experience-setup.e2e.ts` (+354 -0) ➕ `e2e/inventory-tracker-details.e2e.ts` (+133 -0) 📝 `e2e/roleplay-vn.e2e.ts` (+1 -0) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+3 -40) 📝 `packages/client/src/components/game/GameSetupSummary.tsx` (+3 -1) 📝 `packages/client/src/components/game/GameSetupWizard.tsx` (+221 -27) 📝 `packages/client/src/components/game/GameSurface.tsx` (+7 -13) ➕ `packages/client/src/components/game/LegacyExperienceSetupDialog.tsx` (+181 -0) 📝 `packages/client/src/components/game/NewGameExperienceChooser.tsx` (+85 -221) 📝 `packages/client/src/features/tracker-panel/components/sections/InventoryTrackerPanel.tsx` (+75 -42) 📝 `packages/client/src/hooks/use-generate.ts` (+15 -31) 📝 `packages/client/src/hooks/use-lorebooks.ts` (+10 -1) 📝 `packages/client/src/hooks/use-translate.ts` (+88 -25) 📝 `packages/client/src/lib/custom-agent-result-examples.ts` (+1 -1) ➕ `packages/client/src/lib/game-experience-setup.ts` (+22 -0) _...and 21 more files_ </details> ### 📄 Description ## Linked issue Closes #6181 Closes #6182 Closes #6183 Closes #6187 Closes #6192 Companion package work: Pasta-Devs/Marinara-Agents#852 (merged by @kolacheee at `8924a8c8`; its tree exactly matches the reviewed artifacts). Translated documentation: #6194 (merged to `docs-i18n`; #6189 closed). This Engine PR supplies the API 1.18 support required by that package update. ## Why this change Experiences currently replace Game setup and hide Party and the other normal choices. Automatic translation can lose the originating chat's settings after navigation. Terminal hangup can leave confirmed saves unwritten and the storage writer lease behind. Inventory items cannot retain their descriptions or storage locations. ## What changed - Keep all seven Game setup steps for Experiences declaring the optional API 1.18 setup block. Reuse the existing chooser, seed controls, normal setup payload and extracted legacy dialog. Existing-game setup preserves its saved Experience; only new games can choose one. Setup imports also restore installed legacy Experience selections into their existing dialogs, without importing arbitrary package state. Widget requirements remain editable and separate spatial-map preparation is suppressed for inline Experiences. - Add up to 100 explicit lore-entry picks using the existing library queries and lore processor. Picks include unattached enabled books, respect chat exclusions/disabled entries and ordinary token budgets, and supplement ordinary global/attached lore. Setup files carry the Experience and numeric seed; imports discard arbitrary package config and resolve the installed manifest's constants. - Capture translation settings after pending metadata saves and reuse the manual translation/persistence path. The originating chat retains its provider, language, prompt and saved result across navigation/cache eviction; an in-flight request is not duplicated on remount. - Route POSIX SIGHUP through normal shutdown. Guard Pino's direct stdout and the two known development pretty-stdout transports only when the terminal has failed, so exit-time flushing cannot hang. File/custom-transport errors and Windows signal handling stay under their existing paths. - Preserve optional inventory description/location through normalization, incremental updates, field locks, quantity-one edits and committed narrator context. Reuse the tracker InlineEdit controls and localization. The package prompt is updated in the companion PR. - Read installed package records independently, retaining unsupported raw records during later writes. Malformed registry containers still fail safely. This improves hosts containing this patch; it cannot retrofit compatibility into already-released older Engines. For Experience games the GM now receives the player's actual goals and genre instead of empty goals and the package's former fixed pixel-art genre. The companion Pixelforge package retains its sealed world, legacy readers and startup readiness gate. ## Validation Completed local evidence: - `pnpm check` passes again after the review fixes (formatting, localization, lint/types, production client/server builds). The lifecycle regression verifies lossless writes, malformed-container refusal and downgrade prevention. - Wizard: 6/6 browser cases across desktop Chromium, mobile Chromium and mobile WebKit. Covers all seven steps, legacy dialog keyboard focus/trapping/back navigation, numeric seed errors/randomize, setup import and deselection, failed entry loading with in-place retry preserving selected IDs, existing-game omission, widget requirement/override, map suppression, eligible lore picks and payloads. - Translation: failing-before reproduction, then 9/9 final browser cases across the same projects and Conversation/Roleplay/Game. Covers navigation, cache eviction, a bounded held-save interval, malformed language fallbacks and originating provider settings; the earlier 12-case run also covered Game manual/hidden/delayed controls. - Inventory: failing-before normalization/context proofs; prompt and actual generation/retry route regressions pass. Six browser cases cover light/dark themes, details, quantity-one edits, locks and reload. Committed context is checked in XML, Markdown and unwrapped formats. - Real `/game/setup` regression: explicit unattached probability-zero lore is included alongside ordinary lore; disabled/excluded and over-budget controls stay absent. Classic-wizard `/game/create` stamping and seed-only setup-file round trip pass. - Real macOS pseudo-terminal reproduction: before, closing the terminal lost a confirmed pending save; the development pretty transport also reproduced exit 1 and a retained lease. All six production/development idle, direct-SIGHUP and busy cases now exit 0, persist the save, release the lease and record a clean heartbeat. Duplicate SIGINT and healthy/custom/file logging-error controls pass. The final probe uses one NUL byte; a controlled zero-write no-op reproduces the old portability failure and passes with the nonempty probe. - Final commit `0558bb92c`: all eight required checks pass (including container, repository validation, code scanning and CodeRabbit), Windows launcher CI passes, and the complete hosted Node sweep passes 268/268. CodeRabbit completed the final two-file review with no actionable comments. The final Keeper entry-picker negative control fails before and passes after; all six wizard browser cases and `pnpm check` pass locally. The earlier complete hosted browser matrix on `3aa237b84` passed 922 cases with 245 intentional skips; the final optional full browser rerun is still running at merge, with no failures reported. - Actual rebuilt Inventory 1.2.0 and Pixelforge 0.16.8 ZIPs pass the real Engine catalog/install/read/uninstall path with disposable data and bounded fixture HTTPS responses. Archive corruption and installed-client tampering are rejected; a fresh process rereads persisted packages. Pixelforge remains absent from published catalogs. - [ ] `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` ### Manual verification notes Manually verify package update from an existing installation, a real-provider Pixelforge world with selected lore and Party, an existing saved world, and inventory details grounded in actual story output. Physical iPhone/Android behavior and real-provider translation quality were not certified by the automated browser fixtures. All six Linux production/development PTY cases also pass on final commit `0558bb92c` with persisted saves, released leases and clean exits; Windows launcher CI passes. Checklist boxes remain human to-dos per AGENTS.md. ## Docs and release impact CHANGELOG documents all product changes. The optional-package reference documents API 1.18, and CONTRIBUTING names the Python standard-library prerequisite for the real PTY regression. No Engine app-version bump. All ten translated packs are handled in #6194, including the earlier API 1.17 delta from #6189. ## UI evidence [Inspected browser screenshots (download the HTML to view)](https://gist.github.com/SpicyMarinara/491c89753ce723e46a8be5a88921aa11): wizard before/after selection, mobile seed and lore picker, inventory details in both themes. Synthetic fixtures only; no user chats or credentials. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:16:23 +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#7084
No description provided.