[PR #1807] [MERGED] perf(ci): cut the Gacha Forge bundle rebuild regression from minutes to seconds #1975

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

📋 Pull Request Information

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

Base: staging ← Head: ccr-a997ecd2-e6lxc8


📝 Commits (2)

  • b0f53be perf(ci): cut the Forge bundle rebuild regression from ~6.5 min to seconds
  • 68575df Merge remote-tracking branch 'origin/staging' into ccr-a997ecd2-e6lxc8

📊 Changes

2 files changed (+62 additions, -43 deletions)

View changed files

📝 scripts/gacha-forge-bundle-patches.mjs (+19 -9)
📝 tests/gacha-forge-bundle-rebuild.regression.mjs (+43 -34)

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #1806

Why this change

  • Pull Request Checks takes about 8.5 min, and about 6.5 min of that is tests/gacha-forge-bundle-rebuild.regression.mjs. Every PR waits on it, whatever package it touches. #1806 has the timings and the profile.

What changed

  • scripts/gacha-forge-bundle-patches.mjs: rebuildGachaBundles reads the bundles as bytes and swaps ledger edits with Buffer.indexOf / Buffer.concat, using a new private swapGachaBundleBytes. The bundles are 1–2 MB of non-ASCII text, and the string search made one rebuild take ~4 s; it now takes ~1 s locally. A UTF-8 match always starts on a character boundary, so the bytes match exactly where the text did. The anchor-must-occur-once rule and its error message are unchanged. The exported swapGachaBundleText is unchanged for the tests that call it with strings.
  • tests/gacha-forge-bundle-rebuild.regression.mjs: changes all 54 listed sources at once, each with its own proof string (// source rebuild proof: <name>.; the trailing period keeps one proof from being a prefix of another, e.g. story-memory / story-memory-integration). It then rebuilds 4 times instead of ~163. It still asserts that each source reaches each bundle it lists, that the replay is deterministic, that restoring the sources restores both bundles byte for byte, and that an unknown bundle edit is rejected.
  • Generated outputs: none changed. packages/gacha-forge/client.js and server.mjs rebuild to the committed bytes, and no manifest, artifact, hash or catalog entry changes.

Package and security impact

  • Affected package IDs: gacha-forge (build tooling and its regression only; the shipped package is unchanged)
  • Engine compatibility impact: none
  • New or changed permissions/entrypoints: none. scripts/gacha-forge-bundle-patches.mjs builds the package's executable client.js / server.mjs, and on the committed ledger it produces the same bytes as before.
  • 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

What the agent ran in its session (Node 22, 4 cores). These notes are not a substitute for the boxes above.

  • node tests/gacha-forge-bundle-rebuild.regression.mjs: passes in ~5.4 s; before this change it hit the 600 s run-parallel.mjs ceiling.
  • Negative check: a temporary copy of the test that claims audio-en regenerates server.mjs fails with audio-en changes regenerate server.mjs.
  • rebuildGachaBundles on the real packages/gacha-forge/: left the working tree clean (output byte-identical to the committed bundles).
  • Other ledger users still pass: tests/gacha-forge-music-prompts.regression.mjs, tests/gacha-forge-achievements.regression.mjs, tests/gacha-forge-location-ids.regression.mjs.
  • npx prettier --check and npx eslint on both changed files: clean.
  • tests/gacha-forge-animation-diagnostics.regression.mjs fails locally with and without this change. That is likely Node 22 vs CI's Node 24; CI on this PR will show.
  • CI timing on this PR has not been observed yet.

Documentation impact

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

UI evidence (if applicable)

  • n/a (no UI change)

Generated by 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/1807 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `ccr-a997ecd2-e6lxc8` --- ### 📝 Commits (2) - [`b0f53be`](https://github.com/Pasta-Devs/Marinara-Agents/commit/b0f53be5d54f68094849ac952807dbf39dfe7a1f) perf(ci): cut the Forge bundle rebuild regression from ~6.5 min to seconds - [`68575df`](https://github.com/Pasta-Devs/Marinara-Agents/commit/68575df3dc2d1ed06af74e2199105d4426c924c2) Merge remote-tracking branch 'origin/staging' into ccr-a997ecd2-e6lxc8 ### 📊 Changes **2 files changed** (+62 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `scripts/gacha-forge-bundle-patches.mjs` (+19 -9) 📝 `tests/gacha-forge-bundle-rebuild.regression.mjs` (+43 -34) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #1806 ## Why this change - Pull Request Checks takes about 8.5 min, and about 6.5 min of that is `tests/gacha-forge-bundle-rebuild.regression.mjs`. Every PR waits on it, whatever package it touches. #1806 has the timings and the profile. ## What changed - `scripts/gacha-forge-bundle-patches.mjs`: `rebuildGachaBundles` reads the bundles as bytes and swaps ledger edits with `Buffer.indexOf` / `Buffer.concat`, using a new private `swapGachaBundleBytes`. The bundles are 1–2 MB of non-ASCII text, and the string search made one rebuild take ~4 s; it now takes ~1 s locally. A UTF-8 match always starts on a character boundary, so the bytes match exactly where the text did. The anchor-must-occur-once rule and its error message are unchanged. The exported `swapGachaBundleText` is unchanged for the tests that call it with strings. - `tests/gacha-forge-bundle-rebuild.regression.mjs`: changes all 54 listed sources at once, each with its own proof string (`// source rebuild proof: <name>.`; the trailing period keeps one proof from being a prefix of another, e.g. `story-memory` / `story-memory-integration`). It then rebuilds 4 times instead of ~163. It still asserts that each source reaches each bundle it lists, that the replay is deterministic, that restoring the sources restores both bundles byte for byte, and that an unknown bundle edit is rejected. - Generated outputs: none changed. `packages/gacha-forge/client.js` and `server.mjs` rebuild to the committed bytes, and no manifest, artifact, hash or catalog entry changes. ## Package and security impact - Affected package IDs: `gacha-forge` (build tooling and its regression only; the shipped package is unchanged) - Engine compatibility impact: none - New or changed permissions/entrypoints: none. `scripts/gacha-forge-bundle-patches.mjs` builds the package's executable `client.js` / `server.mjs`, and on the committed ledger it produces the same bytes as before. - Restart, storage, update, or uninstall impact: none ## Validation <!-- These are human tasks. Never tick a box for a check that was not actually performed. --> - [ ] `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 What the agent ran in its session (Node 22, 4 cores). These notes are not a substitute for the boxes above. - `node tests/gacha-forge-bundle-rebuild.regression.mjs`: passes in ~5.4 s; before this change it hit the 600 s `run-parallel.mjs` ceiling. - Negative check: a temporary copy of the test that claims `audio-en` regenerates `server.mjs` fails with `audio-en changes regenerate server.mjs`. - `rebuildGachaBundles` on the real `packages/gacha-forge/`: left the working tree clean (output byte-identical to the committed bundles). - Other ledger users still pass: `tests/gacha-forge-music-prompts.regression.mjs`, `tests/gacha-forge-achievements.regression.mjs`, `tests/gacha-forge-location-ids.regression.mjs`. - `npx prettier --check` and `npx eslint` on both changed files: clean. - `tests/gacha-forge-animation-diagnostics.regression.mjs` fails locally with and without this change. That is likely Node 22 vs CI's Node 24; CI on this PR will show. - CI timing on this PR has not been observed yet. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) - n/a (no UI change) --- _Generated by [Claude Code](https://claude.ai/code/session_01KvwcBV67HdsFd9tvuAhkYC)_ --- <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:26 +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#1975
No description provided.