[PR #1205] [MERGED] fix(gacha-forge): 1.8.12 — a Character Story merges with the chapters around it, or with other Character Stories #1344

Closed
opened 2026-10-21 05:09:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1205
Author: @SonaGat3
Created: 10/2/2026
Status: ✅ Merged
Merged: 10/2/2026
Merged by: @SonaGat3

Base: staging ← Head: feature/gacha-forge-1.8.12


📝 Commits (1)

  • aa0cece fix(gacha-forge): 1.8.12 — a Character Story merges with the chapters around it, or with other Character Stories

📊 Changes

12 files changed (+338 additions, -314 deletions)

View changed files

➕ artifacts/gacha-forge-1.8.12.zip (+0 -0)
📝 catalog/catalog.json (+8 -8)
📝 catalog/notes.json (+6 -0)
📝 catalog/v2/catalog.json (+8 -8)
📝 catalog/v2/notes.json (+6 -0)
📝 catalog/v3/catalog.json (+8 -8)
📝 catalog/v3/notes.json (+6 -0)
📝 packages/gacha-forge/CHANGELOG.md (+4 -0)
📝 packages/gacha-forge/README.md (+2 -0)
📝 packages/gacha-forge/client.js (+187 -187)
📝 packages/gacha-forge/manifest.json (+5 -5)
📝 packages/gacha-forge/server.mjs (+98 -98)

📄 Description

Linked issue

Closes #1204

Why this change

staging carries Gacha Forge 1.8.11. A player asked how to compress Character Stories further: chapters can be merged together, Character Stories never past their own compression. Merging was built over contiguous entries; Character Stories came later, got their own compression and were left out of the merge — the client even had a comment deciding it the other way ("A bond chapter is never folded"). So every Character Story's summary stays in the context for good, and a merge of chapters 3 to 6 still sends each story played in that stretch on its own.

What changed

  • One builder for the Continuity rows (continuityRows), in the order the story happened: each Character Story after the chapter it followed, and several after the same chapter in the order they were opened. A part stamps opened once, when it is opened; parts opened before this change have none and keep the previous order, ahead of stamped ones. The panel draws these rows and the merge validates against these rows, so the two cannot disagree about what is next to what.
  • The merge takes the ticked rows by key (POST /compress/merge { runId, rows }), rebuilds the rows and takes the run that starts at the first key. It refuses anything that is not the same contiguous run today (stale), a row not compressed (named), a chapter not played to the end (not-finished: a fight still owed is written later from the story so far, and a story merged into that chapter would be out of it), and a second merge in the same world while one runs (busy).
  • Anchor and bonds. A merge is anchored on the first chapter it holds, else on the first story's key; bonds lists every story it swallowed, those already inside merged rows included, so a merge of merges keeps them. A stories-only merge carries no chapter range. Write, then delete — and the safety does not rest on the delete.
  • A swallowed story never comes back. absorbedBonds is built before any walk (a story can be swallowed by a merge anchored after the place it is read) and asked first by every reader: the context does not send it again — neither its summary nor its raw beats, which is what a story without a summary falls back to — /compress does not compress it again, and the panel does not draw it apart. A merged entry's heading names what it holds ("Chapter 4, including Mei's bond chapter").
  • The merged text names each story. The prompt labels each piece ("Chapters 3-5", "Mei's Story Part I (a Character Story, played after chapter 4)") and asks that each story be named once, with its part, so a later part of it reads the merge as what came before. The server checks it: each story's name must appear as a whole word (accents and case aside, particles and single letters not counted, another script as it is). If one is missing the merge is refused, the screen says which story was left out, and nothing changes.
  • The panel. A compressed Character Story takes a tick like a chapter; the selection is by position, not by chapter number; a story not compressed between two picks stops the selection and is named; a merged row names what it holds; and a refused merge says why — before, the panel reloaded in silence.

Generated outputs

packages/gacha-forge/client.js, server.mjs, manifest.json, the artifact zip, the catalog family and the release-notes sidecars were re-derived by node scripts/build-gacha-forge-package.mjs from the committed payload bytes. Nothing was hand-edited; re-running the builder after the commit leaves the tree clean.

Package and security impact

  • capabilityApi, the engine range, permissions, contribution slots, assets, builtAgainst and restartRequired are unchanged. The only manifest field that moved is version, verified by diffing against the staging manifest with the hash lines filtered out.
  • Routes: 121 → 121. None added, none removed. POST /compress/merge changes its body from { from, to } to { rows }; the only caller is the package's own client, shipped in the same payload.
  • No new model calls. The merge is the same call as before, with labelled inputs; a merged text that leaves a story out is retried once through the existing corrective turn, then refused.
  • New stored values: bonds on a merged summary (the keys of the stories it swallowed) and opened on each Character Story part when it is opened. Both are absent on older data, which reads as before.
  • Payload: client.js 1,436,506 → 1,438,795 bytes, server.mjs 498,958 → 502,921, artifact 7,835,622 → 7,841,874. All art is byte-identical: 244 of 247 payload files are unchanged (only client.js, server.mjs and manifest.json move).

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

⚠️ Why the fourth box is unticked. 1.8.12 is not published, so it cannot be installed through the Engine's download path. The same bytes were installed by sideload into a staging Engine, and the catalog zip matches that install file by file.

Manual verification notes

  • Branch hygiene. Branched from the current origin/staging; git ls-files --eol | grep -c w/crlf → 0; git diff --check "origin/staging...HEAD" clean; the build is reproducible.
  • The catalog zip matches the sideloaded install, file by file: 247 of 248 entries are byte-identical; only manifest.json differs, which every installer rewrites.
  • Repo checks run locally, in the workflow's own order — the script is generated from pull-request-checks.yml at origin/staging, so its 25 steps cannot go stale: 24 of 25 green. ⚠️ npm run test:security fails on Windows for a reason unrelated to this change (catalog-path-safety.regression.mjs expects a POSIX path and gets D:\tmp\package\assets\icon.png); its log never names gacha-forge, and it failed identically on a clean staging checkout for every earlier Gacha Forge PR.
  • Package's own suite: eleven probes plus a 132-script bench, plus the phone probe — all green (727 s).
  • Every new check was verified failing against the previous code. Rows in play order (a story opened earlier comes first even when its unit is listed later); a chapter and the story after it merge, anchored on the chapter; the story's own summary is gone and the panel stops drawing it; /compress refuses it; the context sends it once, inside the merge, with neither its old summary nor its raw beats; a merged text that leaves a story out is refused, says which, and deletes nothing; a merge of a merge keeps the stories it held; two stories merge alone, anchored on the first; a story and the chapter after it merge on the chapter, and the context does not send the story at its own place; a chapter with a fight still owed is refused; two merges at once answer busy; a stale selection is stale; the name check by whole word (Spanish particles, a Japanese name, accents). Client: ticks on story rows, selection by position in both directions, a gap named, the rows posted in order, refusals said, a lost anchor and stale restart the pick. Five existing merge checks were moved to the new request shape and pass unchanged; one that asserted the opposite rule ("a bond chapter offers no tick") was inverted.
  • Reviewed before and after building by separate read-only reviewers, against the package's crossing checklist. Their findings are in this change: a swallowed story falling back to its raw beats, the absorbed set needed before the walk, the summary reader dropping bonds, the merge prompt erasing whose story each part was, a name check that found "Ana" inside "semana", silent refusals, and a selection that could get stuck.
  • A mockup of the panel with ticks on Character Stories, on a real world's rows, was approved before building.

Documentation impact

  • Updated this README catalog and package guidance
  • No documentation changes needed
  • Updated linked Marinara Engine documentation

packages/gacha-forge/README.md gains the 1.8.12 paragraph; packages/gacha-forge/CHANGELOG.md gains 1.8.12. The repository README is unchanged.

UI evidence (if applicable)

Summary by CodeRabbit

  • New Features
    • Gacha Forge 1.8.12 lets you merge compressed Character Stories with adjacent chapters or other Character Stories in Settings > Continuity. Each compressed story counts as a continuity tick, and merged entries retain the names of the included stories.
    • Merged stories won’t be sent again separately. Only chapters played to the end can be merged; if a merge isn’t available, you’ll see why.

🔄 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/1205 **Author:** [@SonaGat3](https://github.com/SonaGat3) **Created:** 10/2/2026 **Status:** ✅ Merged **Merged:** 10/2/2026 **Merged by:** [@SonaGat3](https://github.com/SonaGat3) **Base:** `staging` ← **Head:** `feature/gacha-forge-1.8.12` --- ### 📝 Commits (1) - [`aa0cece`](https://github.com/Pasta-Devs/Marinara-Agents/commit/aa0cece0fea33552d32e1ba55d6ac451d9ebc4fc) fix(gacha-forge): 1.8.12 — a Character Story merges with the chapters around it, or with other Character Stories ### 📊 Changes **12 files changed** (+338 additions, -314 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/gacha-forge-1.8.12.zip` (+0 -0) 📝 `catalog/catalog.json` (+8 -8) 📝 `catalog/notes.json` (+6 -0) 📝 `catalog/v2/catalog.json` (+8 -8) 📝 `catalog/v2/notes.json` (+6 -0) 📝 `catalog/v3/catalog.json` (+8 -8) 📝 `catalog/v3/notes.json` (+6 -0) 📝 `packages/gacha-forge/CHANGELOG.md` (+4 -0) 📝 `packages/gacha-forge/README.md` (+2 -0) 📝 `packages/gacha-forge/client.js` (+187 -187) 📝 `packages/gacha-forge/manifest.json` (+5 -5) 📝 `packages/gacha-forge/server.mjs` (+98 -98) </details> ### 📄 Description ## Linked issue Closes #1204 ## Why this change `staging` carries Gacha Forge **1.8.11**. A player asked how to compress Character Stories further: chapters can be merged together, Character Stories never past their own compression. Merging was built over contiguous entries; Character Stories came later, got their own compression and were left out of the merge — the client even had a comment deciding it the other way ("A bond chapter is never folded"). So every Character Story's summary stays in the context for good, and a merge of chapters 3 to 6 still sends each story played in that stretch on its own. ## What changed - **One builder for the Continuity rows** (`continuityRows`), in the order the story happened: each Character Story after the chapter it followed, and several after the same chapter in the order they were opened. A part stamps `opened` once, when it is opened; parts opened before this change have none and keep the previous order, ahead of stamped ones. The panel draws these rows and the merge validates against these rows, so the two cannot disagree about what is next to what. - **The merge takes the ticked rows by key** (`POST /compress/merge { runId, rows }`), rebuilds the rows and takes the run that starts at the first key. It refuses anything that is not the same contiguous run today (`stale`), a row not compressed (named), a chapter not played to the end (`not-finished`: a fight still owed is written later from the story so far, and a story merged into that chapter would be out of it), and a second merge in the same world while one runs (`busy`). - **Anchor and `bonds`.** A merge is anchored on the first chapter it holds, else on the first story's key; `bonds` lists every story it swallowed, those already inside merged rows included, so a merge of merges keeps them. A stories-only merge carries no chapter range. Write, then delete — and the safety does not rest on the delete. - **A swallowed story never comes back.** `absorbedBonds` is built before any walk (a story can be swallowed by a merge anchored after the place it is read) and asked first by every reader: the context does not send it again — neither its summary nor its raw beats, which is what a story without a summary falls back to — `/compress` does not compress it again, and the panel does not draw it apart. A merged entry's heading names what it holds ("Chapter 4, including Mei's bond chapter"). - **The merged text names each story.** The prompt labels each piece ("Chapters 3-5", "Mei's Story Part I (a Character Story, played after chapter 4)") and asks that each story be named once, with its part, so a later part of it reads the merge as what came before. The server checks it: each story's name must appear as a whole word (accents and case aside, particles and single letters not counted, another script as it is). If one is missing the merge is refused, the screen says which story was left out, and nothing changes. - **The panel.** A compressed Character Story takes a tick like a chapter; the selection is by position, not by chapter number; a story not compressed between two picks stops the selection and is named; a merged row names what it holds; and a refused merge says why — before, the panel reloaded in silence. ### Generated outputs `packages/gacha-forge/client.js`, `server.mjs`, `manifest.json`, the artifact zip, the catalog family and the release-notes sidecars were **re-derived** by `node scripts/build-gacha-forge-package.mjs` from the committed payload bytes. Nothing was hand-edited; re-running the builder after the commit leaves the tree clean. ## Package and security impact - **`capabilityApi`, the `engine` range, permissions, contribution slots, assets, `builtAgainst` and `restartRequired` are unchanged.** The only manifest field that moved is `version`, verified by diffing against the `staging` manifest with the hash lines filtered out. - **Routes: 121 → 121.** None added, none removed. `POST /compress/merge` changes its body from `{ from, to }` to `{ rows }`; the only caller is the package's own client, shipped in the same payload. - **No new model calls.** The merge is the same call as before, with labelled inputs; a merged text that leaves a story out is retried once through the existing corrective turn, then refused. - **New stored values:** `bonds` on a merged summary (the keys of the stories it swallowed) and `opened` on each Character Story part when it is opened. Both are absent on older data, which reads as before. - **Payload:** `client.js` 1,436,506 → 1,438,795 bytes, `server.mjs` 498,958 → 502,921, artifact 7,835,622 → 7,841,874. All art is byte-identical: 244 of 247 payload files are unchanged (only `client.js`, `server.mjs` and `manifest.json` move). ## Validation - [x] `node scripts/validate-catalog.mjs` passes locally - [x] `git diff --check` passes locally - [x] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [x] Checked supported modes, restart behavior, and uninstall cleanup - [x] Read and followed `CONTRIBUTING.md` > ⚠️ **Why the fourth box is unticked.** 1.8.12 is not published, so it cannot be installed *through* the Engine's download path. The same bytes were installed by sideload into a `staging` Engine, and the catalog zip matches that install file by file. ### Manual verification notes - **Branch hygiene.** Branched from the current `origin/staging`; `git ls-files --eol | grep -c w/crlf` → **0**; `git diff --check "origin/staging...HEAD"` clean; the build is reproducible. - **The catalog zip matches the sideloaded install**, file by file: 247 of 248 entries are byte-identical; only `manifest.json` differs, which every installer rewrites. - **Repo checks run locally, in the workflow's own order** — the script is generated from `pull-request-checks.yml` at `origin/staging`, so its 25 steps cannot go stale: **24 of 25 green**. ⚠️ `npm run test:security` fails on Windows for a reason unrelated to this change (`catalog-path-safety.regression.mjs` expects a POSIX path and gets `D:\tmp\package\assets\icon.png`); its log never names gacha-forge, and it failed identically on a clean `staging` checkout for every earlier Gacha Forge PR. - **Package's own suite:** eleven probes plus a 132-script bench, plus the phone probe — all green (727 s). - **Every new check was verified failing against the previous code.** Rows in play order (a story opened earlier comes first even when its unit is listed later); a chapter and the story after it merge, anchored on the chapter; the story's own summary is gone and the panel stops drawing it; `/compress` refuses it; the context sends it once, inside the merge, with neither its old summary nor its raw beats; a merged text that leaves a story out is refused, says which, and deletes nothing; a merge of a merge keeps the stories it held; two stories merge alone, anchored on the first; a story and the chapter after it merge on the chapter, and the context does not send the story at its own place; a chapter with a fight still owed is refused; two merges at once answer `busy`; a stale selection is `stale`; the name check by whole word (Spanish particles, a Japanese name, accents). Client: ticks on story rows, selection by position in both directions, a gap named, the rows posted in order, refusals said, a lost anchor and `stale` restart the pick. Five existing merge checks were moved to the new request shape and pass unchanged; one that asserted the opposite rule ("a bond chapter offers no tick") was inverted. - **Reviewed before and after building** by separate read-only reviewers, against the package's crossing checklist. Their findings are in this change: a swallowed story falling back to its raw beats, the absorbed set needed before the walk, the summary reader dropping `bonds`, the merge prompt erasing whose story each part was, a name check that found "Ana" inside "semana", silent refusals, and a selection that could get stuck. - **A mockup** of the panel with ticks on Character Stories, on a real world's rows, was approved before building. ## Documentation impact - [x] Updated this README catalog and package guidance - [ ] No documentation changes needed - [ ] Updated linked Marinara Engine documentation `packages/gacha-forge/README.md` gains the 1.8.12 paragraph; `packages/gacha-forge/CHANGELOG.md` gains 1.8.12. The repository README is unchanged. ## UI evidence (if applicable) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Gacha Forge 1.8.12 lets you merge compressed Character Stories with adjacent chapters or other Character Stories in **Settings > Continuity**. Each compressed story counts as a continuity tick, and merged entries retain the names of the included stories. * Merged stories won’t be sent again separately. Only chapters played to the end can be merged; if a merge isn’t available, you’ll see why. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-21 05:09:17 +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#1344
No description provided.