mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[PR #1778] [MERGED] fix(gacha-forge): 1.25.2 fight loading, Formation swaps and memory that keeps going #1963
Labels
No labels
agent: chess
agent: conversation-calls
agent: eightball
agent: haptic
agent: hierarchical-maps
agent: hierarchical-maps
agent: illustrator
agent: poker
agent: rock-paper-scissors
agent: tic-tac-toe
agent: uno
artifacts
bug
bugfix
build
catalog
ci
client
dependencies
docs
documentation
enhancement
feature
fixed-in-staging
in-pr
normal-scope
packages
pull-request
qol
regression
roadmap
scope-risk
server
soup
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Agents#1963
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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)
d17a2c7fix(gacha-forge): 1.25.2 fight loading, Formation swaps and memory on small models5ca747fMerge branch 'staging' into fix/gacha-forge-1745-1757-1761f0f28adfix(gacha-forge): 1.25.2 review fixes for fight loading, Formation rows and memoryf2216acMerge remote-tracking branch 'origin/fix/gacha-forge-1745-1757-1761' into fix/gacha-forge-1745-1757-176156ecf70fix(gacha-forge): 1.25.2 memory keeps going after drift, bounded full history (#1777)ea2545efix(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
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.
/battle,/farm/battleor/tower/battleis still loading, then entering another fight, showed the fight that was left._loadBattlereturned early because_battleLoadingwas still set, so the new fight sent no request, and the old reply then set_combatNodeandprebattle. An abandoned auto-start reply could even start the old fight. A request that never answered blocked every later fight.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.context-too-largeorgeneration-output-capacity. This also happens with:/battleand mapped to/story-event/battleonly after the client adds the story version, and/battlewas not a versioned path, so every event route refused it asstory-changed. The maintainer hit this in a Formation world.What changed
Package
gacha-forge1.25.2._battleLoadingnow holds the load in flight (an object) instead oftrue._combat*,_autoStartingor the screen, and never starts a battle._enterBattlealso calls_loadBattle()after its render, so entering with the screen already drawn still loads; the guard dedupes the normal path._battleLoading, which now also retires the old world's load.src/formation-combat-shared.mjs).rowevents, 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.rowevent before its enter triggers, and a unit revived in a different row from the one it fell in gets arowevent. 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.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.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.src/story-memory.mjs,src/story-memory-integration.mjs,src/story-memory-fit.mjs, server ledger, 4 edits).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._rcan 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.src/chapter-regeneration-client.mjs,src/formation-combat-*.mjs, client ledger)./battlejoinsforgeChapterVersionPaths. Main-story/battleignores the field, and tower and farm fights are not mapped, so nothing else changes.docs/formation-combat.mdmove rule and scoring.tests/gacha-forge-battle-load.regression.mjs.Package and security impact
gacha-forgeformation-engine-changedpath).Validation
node scripts/validate-catalog.mjspasses locallygit diff --checkpasses locallyCONTRIBUTING.mdManual verification notes
Agent-side checks:
All 71
tests/gacha-forge-*.regression.mjsfiles pass locally (569 tests).Prettier, eslint,
node --checkon both bundles andgit diff --checkare clean. The only Prettier warning is inCHANGELOG.mdat an older entry, and it is already on staging.validate-catalogcould not run locally (sparse worktree withoutartifacts/).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: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:rowevent fails.rowevents, including the defeat-order pull at the start.gacha-forge-story-memory-fitand-integration:Before this was written, an investigation workflow ran one investigator per issue, each with a critic:
#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-packageruns a real chapter reset, builds the event fight body throughforgeChapterRequestandforgeSeasonalRequest, and posts it to the real route: it loads with 0 model calls (it fails on 1.25.1 withstory-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:
/battle/startreply after Back, which predates this PR and is outside #1757;To verify by hand:
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.