[PR #1795] [MERGED] refactor: move 15 Gacha Forge modules into sources/forge-kit (Otome Forge M0a) #1969

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

📋 Pull Request Information

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

Base: staging ← Head: feat/forge-kit-move


📝 Commits (1)

  • 7931375 refactor: move 15 Gacha Forge modules into sources/forge-kit (Otome Forge M0a)

📊 Changes

53 files changed (+109 additions, -76 deletions)

View changed files

📝 .github/workflows/gacha-forge-browser.yml (+1 -0)
📝 .github/workflows/pull-request-checks.yml (+9 -0)
📝 CONTRIBUTING.md (+1 -0)
📝 eslint.config.mjs (+16 -0)
📝 package.json (+3 -3)
📝 packages/gacha-forge/bundle-patches.json (+17 -17)
📝 packages/gacha-forge/src/story-memory-shared.mjs (+1 -1)
📝 scripts/build-feature-packages.mjs (+1 -3)
📝 sources/forge-kit/audio-prompts.mjs (+0 -0)
📝 sources/forge-kit/audio-settings.mjs (+0 -0)
📝 sources/forge-kit/character-card-context.mjs (+0 -0)
📝 sources/forge-kit/chat-continuity-server.mjs (+0 -0)
📝 sources/forge-kit/image-avatar-references.mjs (+0 -0)
📝 sources/forge-kit/player-choice-text.mjs (+0 -0)
📝 sources/forge-kit/player-choices-server.mjs (+0 -0)
📝 sources/forge-kit/shared-token-estimator.mjs (+0 -0)
📝 sources/forge-kit/story-cancel-server.mjs (+0 -0)
📝 sources/forge-kit/story-expressions-server.mjs (+0 -0)
📝 sources/forge-kit/story-expressions.mjs (+0 -0)
📝 sources/forge-kit/story-memory-fit.mjs (+0 -0)

...and 33 more files

📄 Description

Pull request

Important

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

Linked issue

Fixes #1794 (milestone M0a of #1781, Otome Forge release 1).

Why this change

Otome Forge reuses Gacha Forge's maintained server modules: story memory with the knowledge boundary, expressions, choices, time zones, chat continuity, cancel, avatar references, music prompts and card context. Building both packages from one shared copy means a fix in one reaches the other. Copying the modules would let the two drift apart, and importing them from packages/gacha-forge/src would make Gacha Forge's internals an unstated API.

What changed

  • Moved, content unchanged (git mv), 15 modules from packages/gacha-forge/src/ to sources/forge-kit/: story-memory, story-memory-fit, story-memory-integration, shared-token-estimator, story-expressions, story-expressions-server, player-choice-text, player-choices-server, time-zone-server, chat-continuity-server, story-cancel-server, image-avatar-references, audio-prompts, audio-settings and character-card-context.
  • Gacha Forge's bytes are unchanged.
    • 17 replaceFrom paths in bundle-patches.json point at the kit, and src/story-memory-shared.mjs imports the kit's token estimator.
    • A rebuild gives the same client.js, server.mjs, manifest.json, agents.json and zip. There is no version bump.
  • Three modules stay in packages/gacha-forge/src for now: background-unlocks-server, combat-voices-server and proactive-messages-server.
    • Gacha Forge's manifest ships them as payload files, so moving them would need a release or special cases in the build and payload checks.
    • Otome Forge does not use them until its release 2.
  • Rules for the kit:
    • Modules may import only node: built-ins, statically or dynamically (ESLint no-restricted-imports and no-restricted-syntax), because Gacha Forge pastes them into its bundle as text.
    • Lint and format globs cover the kit.
    • CONTRIBUTING.md documents the folder.
  • Tests and CI:
    • 42 test imports in 29 files are repointed.
    • gacha-forge-bundle-rebuild copies the kit.
    • gacha-forge-browser.yml watches sources/forge-kit/**.
    • CI now runs the moved modules' regressions that no job ran before.
  • Otome Forge: the @forge-kit alias, in the build and the regression tsconfig, points at the kit, and its ponytail: note is removed. Otome Forge rebuilds byte-identical.

Package and security impact

  • Affected package IDs: gacha-forge (no byte change), otome-forge (no byte change).
  • 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:

  • node scripts/build-gacha-forge-package.mjs leaves packages/gacha-forge/{client.js,server.mjs,manifest.json} and catalog unchanged, and the rebuilt gacha-forge-1.26.1.zip equals the committed blob.
  • A verifier rebuilt from a clean, real copy of the tree and compared against origin/staging: client.js, server.mjs, manifest.json, agents.json and the zip are all byte-identical. It also confirmed that no old path is referenced anywhere and that every kit import is node:.
  • All 74 tests/gacha-forge-*.regression.mjs files pass, including gacha-forge-bundle-rebuild run in the real worktree.
  • npm run check passes, and npm run test:otome-forge passes.
  • The Otome Forge rebuild is byte-identical.
  • The kit import rule was checked on sample code: ./other.mjs, zod and import("zod") are refused; node:crypto is allowed.
  • validate-catalog needs the full artifacts/ checkout, which this sparse worktree lacks; the payload integrity check (assertDeclaredFilesMatchManifest) passes for both packages.

To verify by hand:

  • Manually verify that Gacha Forge installed from staging after this merge plays as before (no version change is expected).

🤖 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/1795 **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:** `feat/forge-kit-move` --- ### 📝 Commits (1) - [`7931375`](https://github.com/Pasta-Devs/Marinara-Agents/commit/793137512793533170f3ccaaa5dbe6b451598c2a) refactor: move 15 Gacha Forge modules into sources/forge-kit (Otome Forge M0a) ### 📊 Changes **53 files changed** (+109 additions, -76 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/gacha-forge-browser.yml` (+1 -0) 📝 `.github/workflows/pull-request-checks.yml` (+9 -0) 📝 `CONTRIBUTING.md` (+1 -0) 📝 `eslint.config.mjs` (+16 -0) 📝 `package.json` (+3 -3) 📝 `packages/gacha-forge/bundle-patches.json` (+17 -17) 📝 `packages/gacha-forge/src/story-memory-shared.mjs` (+1 -1) 📝 `scripts/build-feature-packages.mjs` (+1 -3) 📝 `sources/forge-kit/audio-prompts.mjs` (+0 -0) 📝 `sources/forge-kit/audio-settings.mjs` (+0 -0) 📝 `sources/forge-kit/character-card-context.mjs` (+0 -0) 📝 `sources/forge-kit/chat-continuity-server.mjs` (+0 -0) 📝 `sources/forge-kit/image-avatar-references.mjs` (+0 -0) 📝 `sources/forge-kit/player-choice-text.mjs` (+0 -0) 📝 `sources/forge-kit/player-choices-server.mjs` (+0 -0) 📝 `sources/forge-kit/shared-token-estimator.mjs` (+0 -0) 📝 `sources/forge-kit/story-cancel-server.mjs` (+0 -0) 📝 `sources/forge-kit/story-expressions-server.mjs` (+0 -0) 📝 `sources/forge-kit/story-expressions.mjs` (+0 -0) 📝 `sources/forge-kit/story-memory-fit.mjs` (+0 -0) _...and 33 more files_ </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. ## Linked issue Fixes #1794 (milestone M0a of #1781, Otome Forge release 1). ## Why this change Otome Forge reuses Gacha Forge's maintained server modules: story memory with the knowledge boundary, expressions, choices, time zones, chat continuity, cancel, avatar references, music prompts and card context. Building both packages from one shared copy means a fix in one reaches the other. Copying the modules would let the two drift apart, and importing them from `packages/gacha-forge/src` would make Gacha Forge's internals an unstated API. ## What changed - **Moved, content unchanged** (`git mv`), 15 modules from `packages/gacha-forge/src/` to `sources/forge-kit/`: story-memory, story-memory-fit, story-memory-integration, shared-token-estimator, story-expressions, story-expressions-server, player-choice-text, player-choices-server, time-zone-server, chat-continuity-server, story-cancel-server, image-avatar-references, audio-prompts, audio-settings and character-card-context. - **Gacha Forge's bytes are unchanged.** - 17 `replaceFrom` paths in `bundle-patches.json` point at the kit, and `src/story-memory-shared.mjs` imports the kit's token estimator. - A rebuild gives the same `client.js`, `server.mjs`, `manifest.json`, `agents.json` and zip. There is no version bump. - **Three modules stay in `packages/gacha-forge/src` for now:** background-unlocks-server, combat-voices-server and proactive-messages-server. - Gacha Forge's manifest ships them as payload files, so moving them would need a release or special cases in the build and payload checks. - Otome Forge does not use them until its release 2. - **Rules for the kit:** - Modules may import only `node:` built-ins, statically or dynamically (ESLint `no-restricted-imports` and `no-restricted-syntax`), because Gacha Forge pastes them into its bundle as text. - Lint and format globs cover the kit. - `CONTRIBUTING.md` documents the folder. - **Tests and CI:** - 42 test imports in 29 files are repointed. - `gacha-forge-bundle-rebuild` copies the kit. - `gacha-forge-browser.yml` watches `sources/forge-kit/**`. - CI now runs the moved modules' regressions that no job ran before. - **Otome Forge:** the `@forge-kit` alias, in the build and the regression tsconfig, points at the kit, and its `ponytail:` note is removed. Otome Forge rebuilds byte-identical. ## Package and security impact - Affected package IDs: `gacha-forge` (no byte change), `otome-forge` (no byte change). - 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: - `node scripts/build-gacha-forge-package.mjs` leaves `packages/gacha-forge/{client.js,server.mjs,manifest.json}` and `catalog` unchanged, and the rebuilt `gacha-forge-1.26.1.zip` equals the committed blob. - A verifier rebuilt from a clean, real copy of the tree and compared against `origin/staging`: client.js, server.mjs, manifest.json, agents.json and the zip are all byte-identical. It also confirmed that no old path is referenced anywhere and that every kit import is `node:`. - All 74 `tests/gacha-forge-*.regression.mjs` files pass, including `gacha-forge-bundle-rebuild` run in the real worktree. - `npm run check` passes, and `npm run test:otome-forge` passes. - The Otome Forge rebuild is byte-identical. - The kit import rule was checked on sample code: `./other.mjs`, `zod` and `import("zod")` are refused; `node:crypto` is allowed. - `validate-catalog` needs the full `artifacts/` checkout, which this sparse worktree lacks; the payload integrity check (`assertDeclaredFilesMatchManifest`) passes for both packages. To verify by hand: - Manually verify that Gacha Forge installed from staging after this merge plays as before (no version change is expected). 🤖 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:23 +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#1969
No description provided.