[PR #1778] [MERGED] fix(gacha-forge): 1.25.2 fight loading, Formation swaps and memory that keeps going #1963

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

📋 Pull Request Information

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

Base: staging ← Head: fix/gacha-forge-1745-1757-1761


📝 Commits (6)

  • d17a2c7 fix(gacha-forge): 1.25.2 fight loading, Formation swaps and memory on small models
  • 5ca747f Merge branch 'staging' into fix/gacha-forge-1745-1757-1761
  • f0f28ad fix(gacha-forge): 1.25.2 review fixes for fight loading, Formation rows and memory
  • f2216ac Merge remote-tracking branch 'origin/fix/gacha-forge-1745-1757-1761' into fix/gacha-forge-1745-1757-1761
  • 56ecf70 fix(gacha-forge): 1.25.2 memory keeps going after drift, bounded full history (#1777)
  • ea2545e fix(gacha-forge): 1.25.2 seasonal event fights load after a chapter reset

📊 Changes

30 files changed (+1707 additions, -212 deletions)

View changed files

📝 .github/workflows/pull-request-checks.yml (+1 -0)
➕ artifacts/gacha-forge-1.25.2.zip (+0 -0)
📝 catalog/catalog.json (+14 -14)
📝 catalog/notes.json (+6 -6)
📝 catalog/v2/catalog.json (+14 -14)
📝 catalog/v2/notes.json (+6 -6)
📝 catalog/v3/catalog.json (+14 -14)
📝 catalog/v3/notes.json (+6 -6)
📝 packages/gacha-forge/CHANGELOG.md (+8 -0)
📝 packages/gacha-forge/README.md (+16 -2)
📝 packages/gacha-forge/bundle-patches.json (+68 -0)
📝 packages/gacha-forge/client.js (+53 -10)
📝 packages/gacha-forge/docs/formation-combat.md (+2 -2)
📝 packages/gacha-forge/manifest.json (+11 -11)
📝 packages/gacha-forge/server.mjs (+158 -38)
📝 packages/gacha-forge/src/chapter-regeneration-client.mjs (+2 -0)
📝 packages/gacha-forge/src/formation-combat-client.mjs (+1 -0)
📝 packages/gacha-forge/src/formation-combat-en.mjs (+2 -0)
📝 packages/gacha-forge/src/formation-combat-shared.mjs (+44 -6)
📝 packages/gacha-forge/src/story-memory-fit.mjs (+50 -13)

...and 10 more files

📄 Description

Pull request

Important

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

Linked issue

Fixes #1745
Fixes #1757
Fixes #1761
Fixes #1777
Fixes #1785

Follow-up filed: #1784 (the companion-chat fallback history includes pre-forged scenes not played yet; predates this PR).

Why this change

The maintainer asked for three open Gacha Forge issues to be fixed.

  • #1757. Backing out of a fight while /battle, /farm/battle or /tower/battle is still loading, then entering another fight, showed the fight that was left. _loadBattle returned early because _battleLoading was still set, so the new fight sent no request, and the old reply then set _combatNode and prebattle. An abandoned auto-start reply could even start the old fight. A request that never answered blocked every later fight.
  • #1745. A two-unit move in Formation seats its two units one after the other and fires the first unit's enter trigger in between. A revive, Swap, Shuffle or Echo set off in that window could leave four fighters in front, three fighters plus an Echo, or four supports in back. The investigation found that the Swap effect (swap()) has the same flaw as the planned swap (move()), and at revision 3 it causes most of the overflows. The result is 497 of 23,333 stress fights at revision 3. The shipped balance corpus showed none.
  • #1761. When the saved overview is behind or set aside, every uncovered chapter goes in as a required summary. The fitter can only drop recalled details, so on a small model the prompt failed with context-too-large or generation-output-capacity. This also happens with:
    • the 1.25.0 migration rebuild;
    • a switch to a smaller model;
    • a covered source that disappears;
    • historical recall.
  • #1785. In any world where a chapter or Character Story was regenerated, every seasonal story event fight stopped at "Couldn't set up the battle." and Retry repeated it. The fight preview is posted as /battle and mapped to /story-event/battle only after the client adds the story version, and /battle was not a versioned path, so every event route refused it as story-changed. The maintainer hit this in a Formation world.
  • #1777. If a source memory had already summarized later read differently, memory stopped for good at stale/source-changed. Two chapters later every prompt used the legacy full history, which is unbounded (227k tokens at 42 chapters), so most models refused it. The maintainer chose option A: the first-saved record stays canon and memory carries on, and the legacy history is bounded too.

What changed

Package gacha-forge 1.25.2.

  • #1757: one load at a time, by identity (client ledger, 7 edits).
    • _battleLoading now holds the load in flight (an object) instead of true.
    • Entering a fight, leaving one or picking a team retires the old load, so a re-entered fight sends its own request.
    • A reply that is no longer the current load returns without touching _combat*, _autoStarting or the screen, and never starts a battle.
    • Back to Materials or Events frees the farm lock, as Formation's Back already does, so a farm load that never answers cannot block those screens. A dropped reply frees it only when no newer load is running.
    • _enterBattle also calls _loadBattle() after its render, so entering with the screen already drawn still loads; the guard dedupes the normal path.
    • A world switch already resets _battleLoading, which now also retires the old world's load.
  • #1745: Formation rules revision 4 (src/formation-combat-shared.mjs).
    • A planned swap and a Swap effect seat both units, and emit both row events, before either one's enter trigger fires, as the revision-3 Shuffle already seats them. Nothing the mover sets off sees the seat it left as free: a revive returns the unit to the row it fell in when that has room, otherwise to the other row, or fizzles when both are full; a summon finds no free seat.
    • At revision 4 a Shuffle also emits every row event before its enter triggers, and a unit revived in a different row from the one it fell in gets a row event. Before, a unit a Shuffle seated, or one that fell in the Back Row, could be revived in front while the client still drew it in the back.
    • Revisions 2 and 3 are gated off and replay byte-identically. A fight started on 1.25.1 is stamped 3 and is scored by revision 3.
    • Tabs on 1.25.1 get the existing "reload" prompt before their next Formation fight.
  • #1761: summaries yield to the reply only when needed (src/story-memory-fit.mjs, src/story-memory-integration.mjs).
    • context() offers every uncovered chapter summary except the newest to the fitter, oldest first. Character Story and story event summaries always stay.
    • The fitter drops them only after every recalled detail is gone, and only while the reply would otherwise get less than the 8,192-token generation floor.
    • Shipped generation fails in exactly those states. Every prompt that fits today is unchanged, and the newest summary, the previous chapter and the current beats are never dropped.
    • A first approach capped the summaries at a tenth of the context inside recall(). Review showed that it removed canon from prompts that succeed today (for example 39 → 13 chapters at 64k during the 1.25.0 migration), so it was rejected.
  • #1777: first canon stays canon, and the full history is bounded (src/story-memory.mjs, src/story-memory-integration.mjs, src/story-memory-fit.mjs, server ledger, 4 edits).
    • Once a source has a saved record, the record's fingerprint stands for it (keepFirstCanon, in memory only). A drifted source keeps its first record and the overview built over it, and later canon keeps being summarized. A record is never summarized again, so a replay cannot rewrite first play.
    • A source without a record that changes under a paid summary is still never saved. Chapter regeneration already deletes the reset key's record and the overview, so canon replaced on purpose is still replaced.
    • _r can return its blocks and each chapter's turn start (forgeBlocks), and only the memory fallback asks for them. legacy() offers the fitter everything before the previous chapter's turn: older chapters first, then older Character Stories and events, each oldest first. The previous chapter, everything after it, the scene so far and locked decisions always stay; a history that fits is unchanged, and an unknown context window still sends it whole.
    • The fitter finds how many blocks to drop by halving, so a long history costs a few estimates (276 ms at 300 chapters instead of 11 s).
  • #1785: event fights carry the story version (src/chapter-regeneration-client.mjs, src/formation-combat-*.mjs, client ledger).
    • /battle joins forgeChapterVersionPaths. Main-story /battle ignores the field, and tower and farm fights are not mapped, so nothing else changes.
    • The combat error screen names a changed story ("reopen it before trying again"), and shows the server's code beside "Couldn't set up the battle." for any failure it has no words for.
  • Docs and release:
    • README 1.25.2 section and memory paragraph; docs/formation-combat.md move rule and scoring.
    • What's new (1.25.1 pinned), CHANGELOG, manifest, artifact and catalog.
    • New CI regression: tests/gacha-forge-battle-load.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:
    • No storage change. Formation snapshots keep their stamped revision, and new fights are stamped 4.
    • Open tabs on 1.25.1 must reload before their next Formation fight (existing formation-engine-changed path).

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 71 tests/gacha-forge-*.regression.mjs files pass locally (569 tests).

  • Prettier, eslint, node --check on both bundles and git diff --check are clean. The only Prettier warning is in CHANGELOG.md at an older entry, and it is already on staging.

  • validate-catalog could not run locally (sparse worktree without artifacts/).

  • New and changed regressions:

    • gacha-forge-battle-load (new) slices the shipped client and replays 12 enter/leave/re-enter scenarios against a fake server that answers in any order:

      • story → story;
      • farm → tower;
      • a team pick mid-load;
      • farm Again;
      • an abandoned auto-start;
      • an error reply;
      • the farm lock;
      • a pending team save;
      • a request that never answers;
      • no duplicate on redraw;
      • a world switch;
      • a double enter;
      • Back on its own (no late fill, start or voice warm-up).

      12 of 13 fail on 1.25.1. The redraw check passes before and after. Mutants that drop the Back reset or the farm-lock release each fail a test.

    • gacha-forge-formation-combat:

      • a deterministic rules-4 test pins three scenarios: the issue's revive, a Swap effect plus Echo, and a Shuffle mid-move. Each pins the old revision-3 trace for replays and the new revision-4 one.
      • two more pin what the client draws: a unit a Shuffle seats, a trigger kills and a revive brings back; and a unit that fell in the Back Row revived in front. A mutant without the new revive row event fails.
      • the seat helper models the client: cards move only on row events, including the defeat-order pull at the start.
      • The existing fuzz now runs at revisions 3 and 4 and, at 4, checks after every step that no row holds four. Run at revision 3, that check fails at seed 386.
      • The deterministic test fails on 1.25.1.
    • gacha-forge-story-memory-fit and -integration:

      • a request that already fits keeps every byte;
      • one token short drops only the oldest summary;
      • no room still fails without removing the newest summary or required canon;
      • the integration offers chapter summaries oldest first, never an event summary or canon in full, and keeps the newest chapter summary even when an event sorts after it.
  • Before this was written, an investigation workflow ran one investigator per issue, each with a critic:

    • #1745: a 23,333-fight stress fuzz showed 0 overflows at revision 4, both at step boundaries and within steps. A separate 12,000-fight harness agreed. 46,666 live runs and 69,999 server replays were identical at revisions 2 and 3 before and after the change. The rebuilt bundles reproduce byte for byte.
    • #1757: the critic's smaller variant (no new fields) passed every investigator and critic scenario, and the ledger replays and undoes to base.
    • #1761: a context sweep from 24k to 128k compared the final fitted prompts. The fix matched shipped byte for byte wherever shipped succeeds, and replied where shipped failed. The real bundle end to end replied after a 32k model switch and after a changed Character Story.
  • #1777 regressions: drift keeps the first record and memory goes on (a chapter, a Character Story, every chapter re-rendered); a source changed under its own summary is still never saved; a world stalled by an older version recovers on the next run; the package keeps the overview over a drifted Character Story; legacy recovery offers older chapters first and keeps the previous chapter, the scene so far and decisions; a 200-block history drops exactly the oldest blocks it must with at most 12 estimates. The #1777 tests fail on the code before this change.

  • #1777 was investigated before implementation by a workflow with a critic per part. Option A: the critic found no defect, re-ran the harnesses on the rebuilt bundles and probed private chats, order drift, a drift during the overview fold and historical recall. Legacy bound: the critic's byte-identity sweep (4 world shapes × beat and chat × 12k–60k) found every reply that worked before unchanged, and 127 of 152 refused prompts now reply.

  • #1785: a regression in gacha-forge-chapter-regeneration-package runs a real chapter reset, builds the event fight body through forgeChapterRequest and forgeSeasonalRequest, and posts it to the real route: it loads with 0 model calls (it fails on 1.25.1 with story-changed). An investigation workflow reproduced the report against the real staging bundle in Classic and Formation worlds (story-changed on the first load and both Retries, progress stuck at 1/10) and showed the fixed client completing all fights; a critic re-ran it, ruled out other causes, and confirmed main-story, tower and farm fights still load.

Review:

  • CodeRabbit (local): 0 findings.
  • An adversarial review workflow ran one reviewer per fix plus release, with a refuting verifier per finding. Five findings were confirmed and are fixed in the second commit:
    • the docs overstated where a revive lands;
    • a Shuffle could still leave a revived unit drawn in the wrong row;
    • no test pinned Back on its own;
    • the farm lock stayed held after Back;
    • an event summary sorting after the newest chapter summary made that chapter summary droppable.
  • Three were refuted:
    • a shuffle display desync that is identical on revisions 3 and 4 at the reported point (fixed anyway by the row-event order above);
    • a stale /battle/start reply after Back, which predates this PR and is outside #1757;
    • a future-only drift between the fitter's 8192 floor and the server's.

To verify by hand:

  • Manually verify that entering a chapter fight, pressing Back on "Preparing the battle…", and entering a different fight shows the second fight and starts it.
  • Manually verify the same with Materials (farm), then a Tower floor, and that after Back on a loading Materials fight another Materials stage opens at once.
  • Manually verify a Formation fight where a unit with an enter_back revive or summon passive swaps with a support: the swap completes, the revived unit appears in the Back Row, and no row shows four.
  • Manually verify that a tab left open on 1.25.1 is asked to reload before its next Formation fight, and that a fight started before the update still pays out.
  • Manually verify, on a long world with a 32k model while Continuity shows memory catching up, that a scene is written instead of "Couldn't write this scene".
  • Manually verify, in a world where a chapter was regenerated, that a seasonal story event's fight opens its briefing and can be played.
  • Manually verify that a world whose Continuity showed "stale" before the update reaches Ready after the next chapter, and that its earlier chapters are still remembered.

🤖 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/1778 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/gacha-forge-1745-1757-1761` --- ### 📝 Commits (6) - [`d17a2c7`](https://github.com/Pasta-Devs/Marinara-Agents/commit/d17a2c7ea719c67ed44e7cf580b2bfa9d50b34a7) fix(gacha-forge): 1.25.2 fight loading, Formation swaps and memory on small models - [`5ca747f`](https://github.com/Pasta-Devs/Marinara-Agents/commit/5ca747f8cc11a340a21a9134e99d6f800b6cd9f8) Merge branch 'staging' into fix/gacha-forge-1745-1757-1761 - [`f0f28ad`](https://github.com/Pasta-Devs/Marinara-Agents/commit/f0f28ad380e630e6ec44add36469e33e2c63626a) fix(gacha-forge): 1.25.2 review fixes for fight loading, Formation rows and memory - [`f2216ac`](https://github.com/Pasta-Devs/Marinara-Agents/commit/f2216ac344ec38f390a7134889852a286d75fca1) Merge remote-tracking branch 'origin/fix/gacha-forge-1745-1757-1761' into fix/gacha-forge-1745-1757-1761 - [`56ecf70`](https://github.com/Pasta-Devs/Marinara-Agents/commit/56ecf70128cf7008a3884f0236dab53a15f89aa5) fix(gacha-forge): 1.25.2 memory keeps going after drift, bounded full history (#1777) - [`ea2545e`](https://github.com/Pasta-Devs/Marinara-Agents/commit/ea2545ee7fdfcc4cb7f129237350395febe9dda0) fix(gacha-forge): 1.25.2 seasonal event fights load after a chapter reset ### 📊 Changes **30 files changed** (+1707 additions, -212 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/pull-request-checks.yml` (+1 -0) ➕ `artifacts/gacha-forge-1.25.2.zip` (+0 -0) 📝 `catalog/catalog.json` (+14 -14) 📝 `catalog/notes.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+14 -14) 📝 `catalog/v2/notes.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+14 -14) 📝 `catalog/v3/notes.json` (+6 -6) 📝 `packages/gacha-forge/CHANGELOG.md` (+8 -0) 📝 `packages/gacha-forge/README.md` (+16 -2) 📝 `packages/gacha-forge/bundle-patches.json` (+68 -0) 📝 `packages/gacha-forge/client.js` (+53 -10) 📝 `packages/gacha-forge/docs/formation-combat.md` (+2 -2) 📝 `packages/gacha-forge/manifest.json` (+11 -11) 📝 `packages/gacha-forge/server.mjs` (+158 -38) 📝 `packages/gacha-forge/src/chapter-regeneration-client.mjs` (+2 -0) 📝 `packages/gacha-forge/src/formation-combat-client.mjs` (+1 -0) 📝 `packages/gacha-forge/src/formation-combat-en.mjs` (+2 -0) 📝 `packages/gacha-forge/src/formation-combat-shared.mjs` (+44 -6) 📝 `packages/gacha-forge/src/story-memory-fit.mjs` (+50 -13) _...and 10 more files_ </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. ## Linked issue Fixes #1745 Fixes #1757 Fixes #1761 Fixes #1777 Fixes #1785 Follow-up filed: #1784 (the companion-chat fallback history includes pre-forged scenes not played yet; predates this PR). ## Why this change The maintainer asked for three open Gacha Forge issues to be fixed. - **#1757.** Backing out of a fight while `/battle`, `/farm/battle` or `/tower/battle` is still loading, then entering another fight, showed the fight that was left. `_loadBattle` returned early because `_battleLoading` was still set, so the new fight sent no request, and the old reply then set `_combatNode` and `prebattle`. An abandoned auto-start reply could even start the old fight. A request that never answered blocked every later fight. - **#1745.** A two-unit move in Formation seats its two units one after the other and fires the first unit's enter trigger in between. A revive, Swap, Shuffle or Echo set off in that window could leave four fighters in front, three fighters plus an Echo, or four supports in back. The investigation found that the Swap effect (`swap()`) has the same flaw as the planned swap (`move()`), and at revision 3 it causes most of the overflows. The result is 497 of 23,333 stress fights at revision 3. The shipped balance corpus showed none. - **#1761.** When the saved overview is behind or set aside, every uncovered chapter goes in as a required summary. The fitter can only drop recalled details, so on a small model the prompt failed with `context-too-large` or `generation-output-capacity`. This also happens with: - the 1.25.0 migration rebuild; - a switch to a smaller model; - a covered source that disappears; - historical recall. - **#1785.** In any world where a chapter or Character Story was regenerated, every seasonal story event fight stopped at "Couldn't set up the battle." and Retry repeated it. The fight preview is posted as `/battle` and mapped to `/story-event/battle` only after the client adds the story version, and `/battle` was not a versioned path, so every event route refused it as `story-changed`. The maintainer hit this in a Formation world. - **#1777.** If a source memory had already summarized later read differently, memory stopped for good at stale/source-changed. Two chapters later every prompt used the legacy full history, which is unbounded (227k tokens at 42 chapters), so most models refused it. The maintainer chose option A: the first-saved record stays canon and memory carries on, and the legacy history is bounded too. ## What changed Package `gacha-forge` 1.25.2. - **#1757: one load at a time, by identity** (client ledger, 7 edits). - `_battleLoading` now holds the load in flight (an object) instead of `true`. - Entering a fight, leaving one or picking a team retires the old load, so a re-entered fight sends its own request. - A reply that is no longer the current load returns without touching `_combat*`, `_autoStarting` or the screen, and never starts a battle. - Back to Materials or Events frees the farm lock, as Formation's Back already does, so a farm load that never answers cannot block those screens. A dropped reply frees it only when no newer load is running. - `_enterBattle` also calls `_loadBattle()` after its render, so entering with the screen already drawn still loads; the guard dedupes the normal path. - A world switch already resets `_battleLoading`, which now also retires the old world's load. - **#1745: Formation rules revision 4** (`src/formation-combat-shared.mjs`). - A planned swap and a Swap effect seat both units, and emit both `row` events, before either one's enter trigger fires, as the revision-3 Shuffle already seats them. Nothing the mover sets off sees the seat it left as free: a revive returns the unit to the row it fell in when that has room, otherwise to the other row, or fizzles when both are full; a summon finds no free seat. - At revision 4 a Shuffle also emits every `row` event before its enter triggers, and a unit revived in a different row from the one it fell in gets a `row` event. Before, a unit a Shuffle seated, or one that fell in the Back Row, could be revived in front while the client still drew it in the back. - Revisions 2 and 3 are gated off and replay byte-identically. A fight started on 1.25.1 is stamped 3 and is scored by revision 3. - Tabs on 1.25.1 get the existing "reload" prompt before their next Formation fight. - **#1761: summaries yield to the reply only when needed** (`src/story-memory-fit.mjs`, `src/story-memory-integration.mjs`). - `context()` offers every uncovered chapter summary except the newest to the fitter, oldest first. Character Story and story event summaries always stay. - The fitter drops them only after every recalled detail is gone, and only while the reply would otherwise get less than the 8,192-token generation floor. - Shipped generation fails in exactly those states. Every prompt that fits today is unchanged, and the newest summary, the previous chapter and the current beats are never dropped. - A first approach capped the summaries at a tenth of the context inside `recall()`. Review showed that it removed canon from prompts that succeed today (for example 39 → 13 chapters at 64k during the 1.25.0 migration), so it was rejected. - **#1777: first canon stays canon, and the full history is bounded** (`src/story-memory.mjs`, `src/story-memory-integration.mjs`, `src/story-memory-fit.mjs`, server ledger, 4 edits). - Once a source has a saved record, the record's fingerprint stands for it (`keepFirstCanon`, in memory only). A drifted source keeps its first record and the overview built over it, and later canon keeps being summarized. A record is never summarized again, so a replay cannot rewrite first play. - A source without a record that changes under a paid summary is still never saved. Chapter regeneration already deletes the reset key's record and the overview, so canon replaced on purpose is still replaced. - `_r` can return its blocks and each chapter's turn start (`forgeBlocks`), and only the memory fallback asks for them. `legacy()` offers the fitter everything before the previous chapter's turn: older chapters first, then older Character Stories and events, each oldest first. The previous chapter, everything after it, the scene so far and locked decisions always stay; a history that fits is unchanged, and an unknown context window still sends it whole. - The fitter finds how many blocks to drop by halving, so a long history costs a few estimates (276 ms at 300 chapters instead of 11 s). - **#1785: event fights carry the story version** (`src/chapter-regeneration-client.mjs`, `src/formation-combat-*.mjs`, client ledger). - `/battle` joins `forgeChapterVersionPaths`. Main-story `/battle` ignores the field, and tower and farm fights are not mapped, so nothing else changes. - The combat error screen names a changed story ("reopen it before trying again"), and shows the server's code beside "Couldn't set up the battle." for any failure it has no words for. - **Docs and release:** - README 1.25.2 section and memory paragraph; `docs/formation-combat.md` move rule and scoring. - What's new (1.25.1 pinned), CHANGELOG, manifest, artifact and catalog. - New CI regression: `tests/gacha-forge-battle-load.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: - No storage change. Formation snapshots keep their stamped revision, and new fights are stamped 4. - Open tabs on 1.25.1 must reload before their next Formation fight (existing `formation-engine-changed` path). ## 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 71 `tests/gacha-forge-*.regression.mjs` files pass locally (569 tests). - Prettier, eslint, `node --check` on both bundles and `git diff --check` are clean. The only Prettier warning is in `CHANGELOG.md` at an older entry, and it is already on staging. - `validate-catalog` could not run locally (sparse worktree without `artifacts/`). - New and changed regressions: - `gacha-forge-battle-load` (new) slices the shipped client and replays 12 enter/leave/re-enter scenarios against a fake server that answers in any order: - story → story; - farm → tower; - a team pick mid-load; - farm Again; - an abandoned auto-start; - an error reply; - the farm lock; - a pending team save; - a request that never answers; - no duplicate on redraw; - a world switch; - a double enter; - Back on its own (no late fill, start or voice warm-up). 12 of 13 fail on 1.25.1. The redraw check passes before and after. Mutants that drop the Back reset or the farm-lock release each fail a test. - `gacha-forge-formation-combat`: - a deterministic rules-4 test pins three scenarios: the issue's revive, a Swap effect plus Echo, and a Shuffle mid-move. Each pins the old revision-3 trace for replays and the new revision-4 one. - two more pin what the client draws: a unit a Shuffle seats, a trigger kills and a revive brings back; and a unit that fell in the Back Row revived in front. A mutant without the new revive `row` event fails. - the seat helper models the client: cards move only on `row` events, including the defeat-order pull at the start. - The existing fuzz now runs at revisions 3 and 4 and, at 4, checks after every step that no row holds four. Run at revision 3, that check fails at seed 386. - The deterministic test fails on 1.25.1. - `gacha-forge-story-memory-fit` and `-integration`: - a request that already fits keeps every byte; - one token short drops only the oldest summary; - no room still fails without removing the newest summary or required canon; - the integration offers chapter summaries oldest first, never an event summary or canon in full, and keeps the newest chapter summary even when an event sorts after it. - Before this was written, an investigation workflow ran one investigator per issue, each with a critic: - **#1745:** a 23,333-fight stress fuzz showed 0 overflows at revision 4, both at step boundaries and within steps. A separate 12,000-fight harness agreed. 46,666 live runs and 69,999 server replays were identical at revisions 2 and 3 before and after the change. The rebuilt bundles reproduce byte for byte. - **#1757:** the critic's smaller variant (no new fields) passed every investigator and critic scenario, and the ledger replays and undoes to base. - **#1761:** a context sweep from 24k to 128k compared the final fitted prompts. The fix matched shipped byte for byte wherever shipped succeeds, and replied where shipped failed. The real bundle end to end replied after a 32k model switch and after a changed Character Story. - #1777 regressions: drift keeps the first record and memory goes on (a chapter, a Character Story, every chapter re-rendered); a source changed under its own summary is still never saved; a world stalled by an older version recovers on the next run; the package keeps the overview over a drifted Character Story; legacy recovery offers older chapters first and keeps the previous chapter, the scene so far and decisions; a 200-block history drops exactly the oldest blocks it must with at most 12 estimates. The #1777 tests fail on the code before this change. - #1777 was investigated before implementation by a workflow with a critic per part. Option A: the critic found no defect, re-ran the harnesses on the rebuilt bundles and probed private chats, order drift, a drift during the overview fold and historical recall. Legacy bound: the critic's byte-identity sweep (4 world shapes × beat and chat × 12k–60k) found every reply that worked before unchanged, and 127 of 152 refused prompts now reply. - #1785: a regression in `gacha-forge-chapter-regeneration-package` runs a real chapter reset, builds the event fight body through `forgeChapterRequest` and `forgeSeasonalRequest`, and posts it to the real route: it loads with 0 model calls (it fails on 1.25.1 with `story-changed`). An investigation workflow reproduced the report against the real staging bundle in Classic and Formation worlds (story-changed on the first load and both Retries, progress stuck at 1/10) and showed the fixed client completing all fights; a critic re-ran it, ruled out other causes, and confirmed main-story, tower and farm fights still load. Review: - CodeRabbit (local): 0 findings. - An adversarial review workflow ran one reviewer per fix plus release, with a refuting verifier per finding. Five findings were confirmed and are fixed in the second commit: - the docs overstated where a revive lands; - a Shuffle could still leave a revived unit drawn in the wrong row; - no test pinned Back on its own; - the farm lock stayed held after Back; - an event summary sorting after the newest chapter summary made that chapter summary droppable. - Three were refuted: - a shuffle display desync that is identical on revisions 3 and 4 at the reported point (fixed anyway by the row-event order above); - a stale `/battle/start` reply after Back, which predates this PR and is outside #1757; - a future-only drift between the fitter's 8192 floor and the server's. To verify by hand: - Manually verify that entering a chapter fight, pressing Back on "Preparing the battle…", and entering a different fight shows the second fight and starts it. - Manually verify the same with Materials (farm), then a Tower floor, and that after Back on a loading Materials fight another Materials stage opens at once. - Manually verify a Formation fight where a unit with an enter_back revive or summon passive swaps with a support: the swap completes, the revived unit appears in the Back Row, and no row shows four. - Manually verify that a tab left open on 1.25.1 is asked to reload before its next Formation fight, and that a fight started before the update still pays out. - Manually verify, on a long world with a 32k model while Continuity shows memory catching up, that a scene is written instead of "Couldn't write this scene". - Manually verify, in a world where a chapter was regenerated, that a seasonal story event's fight opens its briefing and can be played. - Manually verify that a world whose Continuity showed "stale" before the update reaches Ready after the next chapter, and that its earlier chapters are still remembered. 🤖 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:21 +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#1963
No description provided.