[PR #1788] [MERGED] fix(gacha-forge): 1.26.1 held chapters wait for an open event; played-only fallback history #1965

Closed
opened 2026-11-07 16:38:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1788
Author: @SpicyMarinara
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/gacha-forge-1784-1786


📝 Commits (4)

  • f5b21c3 fix(gacha-forge): 1.26.1 held chapters wait for an open event; played-only fallback history (#1786, #1784)
  • 8bbda61 fix(gacha-forge): 1.26.1 review fixes for held chapters and played-only history
  • 1fbee32 Merge remote-tracking branch 'origin/staging' into fix/gacha-forge-1784-1786
  • 33ed8b7 Merge remote-tracking branch 'origin/staging' into fix/gacha-forge-1784-1786

📊 Changes

19 files changed (+583 additions, -94 deletions)

View changed files

📝 .github/workflows/pull-request-checks.yml (+1 -0)
➕ artifacts/gacha-forge-1.26.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 (+5 -0)
📝 packages/gacha-forge/README.md (+6 -0)
📝 packages/gacha-forge/bundle-patches.json (+52 -0)
📝 packages/gacha-forge/client.js (+2 -2)
📝 packages/gacha-forge/docs/seasonal-story-events.md (+1 -1)
📝 packages/gacha-forge/manifest.json (+5 -5)
📝 packages/gacha-forge/server.mjs (+44 -26)
📝 packages/gacha-forge/src/player-choices-server.mjs (+8 -5)
📝 packages/gacha-forge/src/seasonal-events-server.mjs (+22 -12)
📝 tests/gacha-forge-event-preforge.regression.mjs (+147 -1)
➕ tests/gacha-forge-played-history.regression.mjs (+248 -0)

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.

Linked issue

Fixes #1784
Fixes #1786

Why this change

The maintainer asked for the open Gacha Forge bug fixes to be taken care of. Both bugs were found by critics during tonight's investigations.

  • #1784, a knowledge-boundary leak. While story memory is not ready, prompts use the legacy story history. That history read every scene document that existed. So companion chats, proactive messages, and a Character Story's plan and scenes received scenes pre-forge had written ahead but the player had not played, along with a Compress summary of such a chapter or Character Story. Characters could know story that has not happened.
  • #1786, a lock-out. A chapter forged before a story event opened kept pre-forging while the event held it. When it wrote its final big choice, that choice gated the whole world: the event's chain stopped, its scenes were refused with choice-required, and starting the event from Events → Story events failed. The player could not open the held chapter to resolve the choice.

What changed

Package gacha-forge 1.26.1 (8 server ledger edits plus src).

  • #1786 (src/seasonal-events-server.mjs, src/player-choices-server.mjs):
    • A side-effect-free mainHold check makes choiceActive false for a main chapter an open event holds. Its pre-forge then reads off while the event runs, the scene in flight is kept, and its pending choice no longer gates the event's chain or scenes.
    • The event plan's choice guard skips only a main chapter after the event's boundary (heldAfter), the one the open event holds, so a forged-ahead chapter ending on a big choice no longer blocks starting the event. A Character Story's pending choice is not held, so it still stops the event from opening.
    • Once the event is finished, ends or Seasonal events is turned off, Continue on the chapter's map resumes its pre-forge (or opening it after a reload), and its choice holds the main story as before.
    • An opened Character Story also keeps pre-forging during the event in that state (it used to be stuck). Its prompts contain none of the held chapter's text.
  • #1784 (server ledger only):
    • The legacy walk takes the played frontier (forgePlayedFrontier, the same read the current-scene prefix already used). A chapter at or past the frontier keeps only its played scenes.
    • A Compress summary is used only for a chapter before the frontier, and a Character Story's summary only once that story is finished. /compress/merge refuses a Character Story that is not played to its end, as it already refused a chapter.
    • Finished chapters, their summaries and the played scenes of the current chapter are byte-identical. Narration (relative to its own target), fight design and event planning are unchanged too, with one exception: a Compress summary of an unfinished Character Story is no longer used, and its played scenes are read instead, so a narrator no longer learns that story's unplayed scenes either.
  • Release: What's new (1.26.0 pinned), CHANGELOG, README, docs/seasonal-story-events.md, manifest, artifact and catalog. New CI regression: tests/gacha-forge-played-history.regression.mjs.

Package and security impact

  • Affected package IDs: gacha-forge
  • Engine compatibility impact: none.
  • New or changed permissions/entrypoints: none.
  • Restart, storage, update, or uninstall impact: none.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

Agent-side checks:

  • All 74 tests/gacha-forge-*.regression.mjs files pass locally (584 by the runner's count). Prettier, eslint, node --check on both bundles and git diff --check are clean. validate-catalog could not run locally (sparse worktree).
  • gacha-forge-played-history (new, 6 tests) drives the real routes: chat, proactive messages, a Character Story plan and its scenes keep every played scene and none that is unplayed or summarized ahead. It covers a chapter and a Character Story fully written but only partly played, then compressed. 4 of the first 5 fail on 1.26.0, removing either summary guard fails test 5, and test 6 (a merge with an unfinished Character Story is refused) fails without the merge guard.
  • gacha-forge-event-preforge gains the #1786 cases: the chain stops while the event holds the chapter; an already written big choice does not refuse the event's scenes or its start; afterwards the chapter's pre-forge and choice resume; a Character Story's pending choice still refuses the event plan (fails with the first version of the guard).
  • Both fixes were designed before implementation by a workflow with a critic per issue:
    • #1784: the critic found the summary paths the first design missed, fixed here.
    • #1786: the critic found the design sound, added the "start from Events" case and confirmed the race leaves no event text in the held chapter's last scene. Main-chapter behaviour without events is byte-identical (identical.mjs 10/10).

Review:

  • CodeRabbit (local, first commit): 0 findings.
  • An adversarial review workflow (#1786 hold, #1784 history, release; a refuting verifier per finding) confirmed four findings, fixed in the second commit or in this description:
    • a merged Compress digest leaking an unfinished Character Story;
    • the event plan guard skipping a Character Story choice;
    • docs saying the held chapter resumes on open, when it needs Continue in the same session;
    • this description's byte-identical claim.

To verify by hand:

  • Manually verify that with Pre-forge set to Story, forging the next chapter, opening its map and then starting the season's story event from Events → Story events lets every event scene play, and that after the event, Continue on the chapter's map resumes its pre-forge.
  • Manually verify that while Continuity shows memory catching up, a companion chat does not mention scenes pre-forge wrote ahead that you have not played.

🤖 Generated with Claude Code


🔄 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/1788 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/gacha-forge-1784-1786` --- ### 📝 Commits (4) - [`f5b21c3`](https://github.com/Pasta-Devs/Marinara-Agents/commit/f5b21c3e0efeabbdb542eb7d2dbea407ea01134d) fix(gacha-forge): 1.26.1 held chapters wait for an open event; played-only fallback history (#1786, #1784) - [`8bbda61`](https://github.com/Pasta-Devs/Marinara-Agents/commit/8bbda61a772c9240110bb550695d06d171b36659) fix(gacha-forge): 1.26.1 review fixes for held chapters and played-only history - [`1fbee32`](https://github.com/Pasta-Devs/Marinara-Agents/commit/1fbee32c3cbcf87724223a0db09baea334e83e55) Merge remote-tracking branch 'origin/staging' into fix/gacha-forge-1784-1786 - [`33ed8b7`](https://github.com/Pasta-Devs/Marinara-Agents/commit/33ed8b7fa4980c6e909649d9d40db87ef0444e86) Merge remote-tracking branch 'origin/staging' into fix/gacha-forge-1784-1786 ### 📊 Changes **19 files changed** (+583 additions, -94 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/pull-request-checks.yml` (+1 -0) ➕ `artifacts/gacha-forge-1.26.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` (+5 -0) 📝 `packages/gacha-forge/README.md` (+6 -0) 📝 `packages/gacha-forge/bundle-patches.json` (+52 -0) 📝 `packages/gacha-forge/client.js` (+2 -2) 📝 `packages/gacha-forge/docs/seasonal-story-events.md` (+1 -1) 📝 `packages/gacha-forge/manifest.json` (+5 -5) 📝 `packages/gacha-forge/server.mjs` (+44 -26) 📝 `packages/gacha-forge/src/player-choices-server.mjs` (+8 -5) 📝 `packages/gacha-forge/src/seasonal-events-server.mjs` (+22 -12) 📝 `tests/gacha-forge-event-preforge.regression.mjs` (+147 -1) ➕ `tests/gacha-forge-played-history.regression.mjs` (+248 -0) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. ## Linked issue Fixes #1784 Fixes #1786 ## Why this change The maintainer asked for the open Gacha Forge bug fixes to be taken care of. Both bugs were found by critics during tonight's investigations. - **#1784, a knowledge-boundary leak.** While story memory is not ready, prompts use the legacy story history. That history read every scene document that existed. So companion chats, proactive messages, and a Character Story's plan and scenes received scenes pre-forge had written ahead but the player had not played, along with a Compress summary of such a chapter or Character Story. Characters could know story that has not happened. - **#1786, a lock-out.** A chapter forged before a story event opened kept pre-forging while the event held it. When it wrote its final big choice, that choice gated the whole world: the event's chain stopped, its scenes were refused with `choice-required`, and starting the event from Events → Story events failed. The player could not open the held chapter to resolve the choice. ## What changed Package `gacha-forge` 1.26.1 (8 server ledger edits plus src). - **#1786** (`src/seasonal-events-server.mjs`, `src/player-choices-server.mjs`): - A side-effect-free `mainHold` check makes `choiceActive` false for a main chapter an open event holds. Its pre-forge then reads off while the event runs, the scene in flight is kept, and its pending choice no longer gates the event's chain or scenes. - The event plan's choice guard skips only a main chapter after the event's boundary (`heldAfter`), the one the open event holds, so a forged-ahead chapter ending on a big choice no longer blocks starting the event. A Character Story's pending choice is not held, so it still stops the event from opening. - Once the event is finished, ends or Seasonal events is turned off, **Continue** on the chapter's map resumes its pre-forge (or opening it after a reload), and its choice holds the main story as before. - An opened Character Story also keeps pre-forging during the event in that state (it used to be stuck). Its prompts contain none of the held chapter's text. - **#1784** (server ledger only): - The legacy walk takes the played frontier (`forgePlayedFrontier`, the same read the current-scene prefix already used). A chapter at or past the frontier keeps only its played scenes. - A Compress summary is used only for a chapter before the frontier, and a Character Story's summary only once that story is finished. `/compress/merge` refuses a Character Story that is not played to its end, as it already refused a chapter. - Finished chapters, their summaries and the played scenes of the current chapter are byte-identical. Narration (relative to its own target), fight design and event planning are unchanged too, with one exception: a Compress summary of an unfinished Character Story is no longer used, and its played scenes are read instead, so a narrator no longer learns that story's unplayed scenes either. - **Release:** What's new (1.26.0 pinned), CHANGELOG, README, `docs/seasonal-story-events.md`, manifest, artifact and catalog. New CI regression: `tests/gacha-forge-played-history.regression.mjs`. ## Package and security impact - Affected package IDs: `gacha-forge` - Engine compatibility impact: none. - New or changed permissions/entrypoints: none. - Restart, storage, update, or uninstall impact: none. ## Validation - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Agent-side checks: - All 74 `tests/gacha-forge-*.regression.mjs` files pass locally (584 by the runner's count). Prettier, eslint, `node --check` on both bundles and `git diff --check` are clean. `validate-catalog` could not run locally (sparse worktree). - `gacha-forge-played-history` (new, 6 tests) drives the real routes: chat, proactive messages, a Character Story plan and its scenes keep every played scene and none that is unplayed or summarized ahead. It covers a chapter and a Character Story fully written but only partly played, then compressed. 4 of the first 5 fail on 1.26.0, removing either summary guard fails test 5, and test 6 (a merge with an unfinished Character Story is refused) fails without the merge guard. - `gacha-forge-event-preforge` gains the #1786 cases: the chain stops while the event holds the chapter; an already written big choice does not refuse the event's scenes or its start; afterwards the chapter's pre-forge and choice resume; a Character Story's pending choice still refuses the event plan (fails with the first version of the guard). - Both fixes were designed before implementation by a workflow with a critic per issue: - #1784: the critic found the summary paths the first design missed, fixed here. - #1786: the critic found the design sound, added the "start from Events" case and confirmed the race leaves no event text in the held chapter's last scene. Main-chapter behaviour without events is byte-identical (`identical.mjs` 10/10). Review: - CodeRabbit (local, first commit): 0 findings. - An adversarial review workflow (#1786 hold, #1784 history, release; a refuting verifier per finding) confirmed four findings, fixed in the second commit or in this description: - a merged Compress digest leaking an unfinished Character Story; - the event plan guard skipping a Character Story choice; - docs saying the held chapter resumes on open, when it needs Continue in the same session; - this description's byte-identical claim. To verify by hand: - Manually verify that with Pre-forge set to Story, forging the next chapter, opening its map and then starting the season's story event from Events → Story events lets every event scene play, and that after the event, Continue on the chapter's map resumes its pre-forge. - Manually verify that while Continuity shows memory catching up, a companion chat does not mention scenes pre-forge wrote ahead that you have not played. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:38:22 +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-Agents#1965
No description provided.