[PR #1682] fix(gacha-forge): repair chats, artwork, help and character prompts #1672

Open
opened 2026-10-26 04:02:39 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1682
Author: @SpicyMarinara
Created: 10/25/2026
Status: 🔄 Open

Base: staging ← Head: fix/gacha-portrait-animation-recovery


📝 Commits (10+)

  • e682913 chore(gacha-forge): start portrait and banner recovery fixes
  • 74e14d8 fix(gacha-forge): recover portrait and banner media states
  • 17cc19b Merge staging Noodle delivery into Gacha media repair
  • 5df88ce fix(gacha-forge): retain character chats and authored story canon
  • fc45b0c Merge branch 'staging' into fix/gacha-portrait-animation-recovery
  • afac636 fix(gacha-forge): retain successful messages until canonical reads settle
  • a26ece0 Merge remote staging update into Gacha recovery candidate
  • 22df8ff test(gacha-forge): verify visible context bounds in the active settings view
  • a490776 fix(gacha-forge): preserve sent-message order during canonical adoption
  • 9c07fb6 build(gacha-forge): publish the ordered-chat recovery archive

📊 Changes

29 files changed (+3369 additions, -241 deletions)

View changed files

➕ artifacts/gacha-forge-1.16.1.zip (+0 -0)
📝 catalog/catalog.json (+8 -8)
📝 catalog/notes.json (+6 -6)
📝 catalog/v2/catalog.json (+8 -8)
📝 catalog/v2/notes.json (+6 -6)
📝 catalog/v3/catalog.json (+8 -8)
📝 catalog/v3/notes.json (+6 -6)
📝 packages/gacha-forge/CHANGELOG.md (+9 -0)
📝 packages/gacha-forge/README.md (+10 -2)
📝 packages/gacha-forge/bundle-patches.json (+139 -0)
📝 packages/gacha-forge/client.js (+280 -50)
📝 packages/gacha-forge/manifest.json (+5 -5)
📝 packages/gacha-forge/server.mjs (+231 -43)
📝 packages/gacha-forge/src/animation-client.mjs (+58 -38)
📝 packages/gacha-forge/src/animation-en.mjs (+1 -0)
📝 packages/gacha-forge/src/animation-server.mjs (+82 -30)
📝 packages/gacha-forge/src/browser-presentation.mjs (+22 -9)
➕ packages/gacha-forge/src/character-card-context.mjs (+90 -0)
➕ packages/gacha-forge/src/chat-continuity-client.mjs (+194 -0)
➕ packages/gacha-forge/src/chat-continuity-server.mjs (+45 -0)

...and 9 more files

📄 Description

Linked issue

Closes #1680
Closes #1681
Closes #1684
Closes #1686
Closes #1689
Refs #1685
Refs Pasta-Devs/Marinara-Engine#8287

Owner: @SpicyMarinara (Codex).

Why this change

Character messages persisted the player's first message, then threw ReferenceError: de is not defined before calling the reply provider. The UI could hide that persisted message after an error or a failed canonical reload. Loaded story portraits also retained an SVG silhouette, failed banner playback offered no recovery, and mobile Writing help became oversized while tap state was lost on rerender.

What changed

  • Fix first-send memory lookup using the persisted current message. Keep sent messages and verified replies visible until canonical adoption, preserve player/reply order during replacement, reconcile failed requests without automatic resend, and prevent concurrent duplicate sends or extra Vigor charges. Earlier and archived messages remain scrollable in the same chat after Close and remember; memory summaries retain their existing active-conversation boundary. Use the neutral fallback “They did not answer.”
  • Hide the actual SVG fallback when portrait artwork loads while preserving speaker identity, stale-event guards and missing/error fallbacks.
  • Offer explicit banner Retry with a provider-credit notice after decoder, promise-only playback, and stale-poster failures. Preserve previous saved media until replacement succeeds; immutable replacement URLs and atomic metadata prevent stale bytes. Autoplay permission denial keeps manual playback of the cached clip. No automatic paid retry loop. After the ready marker commits, retire only superseded clips that no marker references; preserve identical/shared media and keep old clips on replacement or cleanup failure.
  • Restore compact help circles and show their actual text on tap, retaining the open field across binding and DOM rerenders.
  • Send full linked-card Description, Personality, Backstory and Appearance for initial forging, main chapters, story beats and Character Stories. Exclude card Scenario, Dialogue/Greetings, Example Dialogue and tags from initial and subsequent card references. The Gacha world scenario remains separate. Read current linked cards without rewriting saved units; log the final fitted provider prompt in debug mode. Avoid serialization only when the public logger explicitly reports debug disabled; retain ordinary debug and explicit overrides.
  • Rebuild Gacha Forge 1.16.1, its reversible source ledger, manifest, ZIP and all catalog lanes. Preserve Noodle 1.5.10 and Long-Term Memory 1.4.93 from current staging.

Context issue #1685 remains open. Its reported blank landscape card was not reproduced, including after keyboard dismissal, saved scroll, a high-context warning, synthetic notch insets and portrait/landscape rotation. This PR adds focused visibility and persistence proof, with no speculative Context styling change.

Package and security impact

  • Affected package: gacha-forge 1.16.1; API version, Engine compatibility, permissions and entrypoints unchanged.
  • No destructive storage migration. Existing worlds, chapters, units, equipment and chat records are retained. Existing generated story scenes are not rewritten.
  • Provider tests use local controlled HTTP responses and synthetic media, with no paid generation.

Validation

Completed locally (source-head boundaries stated below):

  • npm run format:check; npm run lint -- --concurrency 1: passed, 0 errors and 812 existing warnings. Final two-file browser-fixture delta also passes ESLint/Prettier.
  • All 30 tests/gacha-forge*.regression.mjs Node suites passed during source consolidation, plus the actual Chromium/WebKit portrait DOM regression. After the final client ordering repair, the affected chat suite passed all 20 cases and the nine affected installed-browser cases passed again. The prior 12 card-context cases cover the unchanged four-field paths. After the logging guard, all three logging-contract cases and the actual fitted main/bond provider/log equality probe passed again on the final server payload; existing animation/audio/security guards passed.
  • Catalog lanes, package locales, full catalog validation and release-notes regression passed. Official builder rerun reproduced all 302 compared files byte for byte, including all 247 declared payloads and the 8,156,616-byte archive (8eb7c74a6a531f408b9f3d0396f8f2570bead486ab8d1736205ac1bda235718e).
  • Installed-package browser proof passed the 12 portrait/banner/chat/help cases plus six Context/keyboard/viewport cases on desktop Chromium, mobile Chromium and mobile WebKit. Light/Dark host and Bloom/Aurora package styles covered. Retained initial failure traces: a duplicate settings-selector fixture failed unchanged replay, then passed after scoping the fixture to the active settings view; an earlier reveal-timing case passed unchanged replay.
  • Real Engine manager proof: 1.16.0 → 1.16.1 update, restart, offline activation, uninstall and offline restart passed across five fresh processes. Seven saved world/chapter/unit/equipment documents remained unchanged. Review-hash mismatch and tampered archive were rejected without replacing the old installation.
  • Actual shipped SDK routes and local HTTP provider verified the same main connection, one first-message reply, one charge, explicit recovery of previously failed persisted messages, and retained history. Final fitted main/bond prompts and debug logs exactly matched the controlled provider payload. Final server SHA256: c3edbfcd36c50440edb56e47d3af762bfa1c9f08b117efb03cad3ff1b3b6c28b.
  • Local CodeRabbit: first full review found one reproduced fixture-cleanup leak, fixed; second full review found one valid missing viewport assertion, fixed. Final fixture-only delta review: no findings. A separately reproduced sent-message ordering defect was fixed by canonical replacement in place; its final runtime delta review completed with no findings. The final generated-output commits are covered by separate byte-rebuild and lifecycle verification. Hosted review then identified one real superseded-media leak and an optional serialization improvement; both are repaired, with focused regressions and scoped local reviews reporting no findings. A final failure-path check also reproduced and repaired the uncommitted-new-clip leak if its ready marker fails; distinct unreferenced new bytes are retired, while prior, identical and shared media remain protected. That isolated source delta also passed local review without findings. New hosted review is pending.

Manual verification notes

  • Manually verify portrait transitions, compact help tap text and banner Retry on a physical iPhone.
  • Manually verify first send, Close and remember, and scrolling earlier messages with a real configured provider.
  • Recheck #1685 on the affected phone after updating; its native landscape blank-card behavior remains unproven.
  • Inspect the rebuilt package update and restart in Download Agents.

Browser emulation, controlled viewport geometry and fake providers do not establish physical-device behavior, paid-provider output quality or correction of already generated prose. The broader browser proof used compiled Engine ad331de19e4eabbdad847c2b7f9a1d9ae8a9bbe2 (the delivered shadow-editor keyboard fix). The latest six-case banner replay (capture head189e, with the unchanged client payload) and the final8e manager lifecycle/provider logging proof use the stable compiled Engine candidate 334c052d19040daaea8ee5e09f5498cb584abefa; candidate validation is separate from its staging merge.

Documentation impact

Updated Gacha Forge README and its package changelog for recovery, chat retention, compact help and four-field card grounding.

UI evidence

Six inspected installed-package screenshots: compact help text, explicit banner Retry, distinctive synthetic loaded portrait without the fallback, ordered first reply, same-window archived history, and the controlled unreproduced Context case. The comment identifies exact capture heads and physical-device/provider limitations.


🔄 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-Agents/pull/1682 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/25/2026 **Status:** 🔄 Open **Base:** `staging` ← **Head:** `fix/gacha-portrait-animation-recovery` --- ### 📝 Commits (10+) - [`e682913`](https://github.com/Pasta-Devs/Marinara-Agents/commit/e682913277e5f91dc8fdc02c5380991a86ba24c5) chore(gacha-forge): start portrait and banner recovery fixes - [`74e14d8`](https://github.com/Pasta-Devs/Marinara-Agents/commit/74e14d88a31cc07d7e265f52fcb464b3502c5d05) fix(gacha-forge): recover portrait and banner media states - [`17cc19b`](https://github.com/Pasta-Devs/Marinara-Agents/commit/17cc19bb74dbf5eeb4d0a44f3624504e08811654) Merge staging Noodle delivery into Gacha media repair - [`5df88ce`](https://github.com/Pasta-Devs/Marinara-Agents/commit/5df88cedc2664318a3203ae0d302670375e208da) fix(gacha-forge): retain character chats and authored story canon - [`fc45b0c`](https://github.com/Pasta-Devs/Marinara-Agents/commit/fc45b0cf93300868f514a10c3ade8a42d67cae7f) Merge branch 'staging' into fix/gacha-portrait-animation-recovery - [`afac636`](https://github.com/Pasta-Devs/Marinara-Agents/commit/afac63652d00424b08417809cdd097ae3ce08356) fix(gacha-forge): retain successful messages until canonical reads settle - [`a26ece0`](https://github.com/Pasta-Devs/Marinara-Agents/commit/a26ece0fd94bee499f16a68dcbd8e493ad4420f2) Merge remote staging update into Gacha recovery candidate - [`22df8ff`](https://github.com/Pasta-Devs/Marinara-Agents/commit/22df8ff175e29fddd4bfff35c3534171812c3bf7) test(gacha-forge): verify visible context bounds in the active settings view - [`a490776`](https://github.com/Pasta-Devs/Marinara-Agents/commit/a4907767d3efb35f90ffcf899d7fdb2081f7a012) fix(gacha-forge): preserve sent-message order during canonical adoption - [`9c07fb6`](https://github.com/Pasta-Devs/Marinara-Agents/commit/9c07fb607a44f4f72cd9d023cdf5dcce6d8233d2) build(gacha-forge): publish the ordered-chat recovery archive ### 📊 Changes **29 files changed** (+3369 additions, -241 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/gacha-forge-1.16.1.zip` (+0 -0) 📝 `catalog/catalog.json` (+8 -8) 📝 `catalog/notes.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+8 -8) 📝 `catalog/v2/notes.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+8 -8) 📝 `catalog/v3/notes.json` (+6 -6) 📝 `packages/gacha-forge/CHANGELOG.md` (+9 -0) 📝 `packages/gacha-forge/README.md` (+10 -2) 📝 `packages/gacha-forge/bundle-patches.json` (+139 -0) 📝 `packages/gacha-forge/client.js` (+280 -50) 📝 `packages/gacha-forge/manifest.json` (+5 -5) 📝 `packages/gacha-forge/server.mjs` (+231 -43) 📝 `packages/gacha-forge/src/animation-client.mjs` (+58 -38) 📝 `packages/gacha-forge/src/animation-en.mjs` (+1 -0) 📝 `packages/gacha-forge/src/animation-server.mjs` (+82 -30) 📝 `packages/gacha-forge/src/browser-presentation.mjs` (+22 -9) ➕ `packages/gacha-forge/src/character-card-context.mjs` (+90 -0) ➕ `packages/gacha-forge/src/chat-continuity-client.mjs` (+194 -0) ➕ `packages/gacha-forge/src/chat-continuity-server.mjs` (+45 -0) _...and 9 more files_ </details> ### 📄 Description ## Linked issue Closes #1680 Closes #1681 Closes #1684 Closes #1686 Closes #1689 Refs #1685 Refs Pasta-Devs/Marinara-Engine#8287 Owner: @SpicyMarinara (Codex). ## Why this change Character messages persisted the player's first message, then threw `ReferenceError: de is not defined` before calling the reply provider. The UI could hide that persisted message after an error or a failed canonical reload. Loaded story portraits also retained an SVG silhouette, failed banner playback offered no recovery, and mobile Writing help became oversized while tap state was lost on rerender. ## What changed - Fix first-send memory lookup using the persisted current message. Keep sent messages and verified replies visible until canonical adoption, preserve player/reply order during replacement, reconcile failed requests without automatic resend, and prevent concurrent duplicate sends or extra Vigor charges. Earlier and archived messages remain scrollable in the same chat after Close and remember; memory summaries retain their existing active-conversation boundary. Use the neutral fallback “They did not answer.” - Hide the actual SVG fallback when portrait artwork loads while preserving speaker identity, stale-event guards and missing/error fallbacks. - Offer explicit banner Retry with a provider-credit notice after decoder, promise-only playback, and stale-poster failures. Preserve previous saved media until replacement succeeds; immutable replacement URLs and atomic metadata prevent stale bytes. Autoplay permission denial keeps manual playback of the cached clip. No automatic paid retry loop. After the ready marker commits, retire only superseded clips that no marker references; preserve identical/shared media and keep old clips on replacement or cleanup failure. - Restore compact help circles and show their actual text on tap, retaining the open field across binding and DOM rerenders. - Send full linked-card Description, Personality, Backstory and Appearance for initial forging, main chapters, story beats and Character Stories. Exclude card Scenario, Dialogue/Greetings, Example Dialogue and tags from initial and subsequent card references. The Gacha world scenario remains separate. Read current linked cards without rewriting saved units; log the final fitted provider prompt in debug mode. Avoid serialization only when the public logger explicitly reports debug disabled; retain ordinary debug and explicit overrides. - Rebuild Gacha Forge 1.16.1, its reversible source ledger, manifest, ZIP and all catalog lanes. Preserve Noodle 1.5.10 and Long-Term Memory 1.4.93 from current staging. **Context issue #1685 remains open.** Its reported blank landscape card was not reproduced, including after keyboard dismissal, saved scroll, a high-context warning, synthetic notch insets and portrait/landscape rotation. This PR adds focused visibility and persistence proof, with no speculative Context styling change. ## Package and security impact - Affected package: `gacha-forge` 1.16.1; API version, Engine compatibility, permissions and entrypoints unchanged. - No destructive storage migration. Existing worlds, chapters, units, equipment and chat records are retained. Existing generated story scenes are not rewritten. - Provider tests use local controlled HTTP responses and synthetic media, with no paid generation. ## Validation Completed locally (source-head boundaries stated below): - `npm run format:check`; `npm run lint -- --concurrency 1`: passed, 0 errors and 812 existing warnings. Final two-file browser-fixture delta also passes ESLint/Prettier. - All 30 `tests/gacha-forge*.regression.mjs` Node suites passed during source consolidation, plus the actual Chromium/WebKit portrait DOM regression. After the final client ordering repair, the affected chat suite passed all 20 cases and the nine affected installed-browser cases passed again. The prior 12 card-context cases cover the unchanged four-field paths. After the logging guard, all three logging-contract cases and the actual fitted main/bond provider/log equality probe passed again on the final server payload; existing animation/audio/security guards passed. - Catalog lanes, package locales, full catalog validation and release-notes regression passed. Official builder rerun reproduced all 302 compared files byte for byte, including all 247 declared payloads and the 8,156,616-byte archive (`8eb7c74a6a531f408b9f3d0396f8f2570bead486ab8d1736205ac1bda235718e`). - Installed-package browser proof passed the 12 portrait/banner/chat/help cases plus six Context/keyboard/viewport cases on desktop Chromium, mobile Chromium and mobile WebKit. Light/Dark host and Bloom/Aurora package styles covered. Retained initial failure traces: a duplicate settings-selector fixture failed unchanged replay, then passed after scoping the fixture to the active settings view; an earlier reveal-timing case passed unchanged replay. - Real Engine manager proof: 1.16.0 → 1.16.1 update, restart, offline activation, uninstall and offline restart passed across five fresh processes. Seven saved world/chapter/unit/equipment documents remained unchanged. Review-hash mismatch and tampered archive were rejected without replacing the old installation. - Actual shipped SDK routes and local HTTP provider verified the same main connection, one first-message reply, one charge, explicit recovery of previously failed persisted messages, and retained history. Final fitted main/bond prompts and debug logs exactly matched the controlled provider payload. Final server SHA256: `c3edbfcd36c50440edb56e47d3af762bfa1c9f08b117efb03cad3ff1b3b6c28b`. - Local CodeRabbit: first full review found one reproduced fixture-cleanup leak, fixed; second full review found one valid missing viewport assertion, fixed. Final fixture-only delta review: no findings. A separately reproduced sent-message ordering defect was fixed by canonical replacement in place; its final runtime delta review completed with no findings. The final generated-output commits are covered by separate byte-rebuild and lifecycle verification. Hosted review then identified one real superseded-media leak and an optional serialization improvement; both are repaired, with focused regressions and scoped local reviews reporting no findings. A final failure-path check also reproduced and repaired the uncommitted-new-clip leak if its ready marker fails; distinct unreferenced new bytes are retired, while prior, identical and shared media remain protected. That isolated source delta also passed local review without findings. New hosted review is pending. ### Manual verification notes - [ ] Manually verify portrait transitions, compact help tap text and banner Retry on a physical iPhone. - [ ] Manually verify first send, Close and remember, and scrolling earlier messages with a real configured provider. - [ ] Recheck #1685 on the affected phone after updating; its native landscape blank-card behavior remains unproven. - [ ] Inspect the rebuilt package update and restart in Download Agents. Browser emulation, controlled viewport geometry and fake providers do not establish physical-device behavior, paid-provider output quality or correction of already generated prose. The broader browser proof used compiled Engine `ad331de19e4eabbdad847c2b7f9a1d9ae8a9bbe2` (the delivered shadow-editor keyboard fix). The latest six-case banner replay (capture head189e, with the unchanged client payload) and the final8e manager lifecycle/provider logging proof use the stable compiled Engine candidate `334c052d19040daaea8ee5e09f5498cb584abefa`; candidate validation is separate from its staging merge. ## Documentation impact Updated Gacha Forge README and its package changelog for recovery, chat retention, compact help and four-field card grounding. ## UI evidence [Six inspected installed-package screenshots](https://github.com/Pasta-Devs/Marinara-Agents/pull/1682#issuecomment-6399412605): compact help text, explicit banner Retry, distinctive synthetic loaded portrait without the fallback, ordered first reply, same-window archived history, and the controlled unreproduced Context case. The comment identifies exact capture heads and physical-device/provider limitations. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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-Agents#1672
No description provided.