[PR #1878] [MERGED] feat(otome-forge): save an optional theme for each chapter #2013

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

📋 Pull Request Information

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

Base: staging ← Head: feat/otome-chapter-themes


📝 Commits (10+)

  • df4b6e1 feat(otome-forge): prepare optional chapter theme settings
  • 2a9f3cb feat(otome-forge): retain chapter themes and guard playback
  • 1707df5 Merge commit 'f288c046a8' into feat/otome-chapter-themes
  • 5e44a12 feat(otome-forge): package saved chapter themes in 0.1.8
  • a3b7f73 Merge remote-tracking branch 'origin/staging' into feat/otome-chapter-themes
  • 1568015 fix(otome-forge): never regenerate unavailable saved themes
  • 805a000 test(otome-forge): respect saved chapter resume position
  • 9533ed2 test(otome-forge): declare ready faces in presentation fixtures
  • 5e14543 fix(otome-forge): trust freshly kept chapter tracks for the visit
  • de2d656 Merge remote-tracking branch 'origin/staging' into feat/otome-chapter-themes

📊 Changes

26 files changed (+877 additions, -233 deletions)

View changed files

➕ artifacts/otome-forge-0.1.8.zip (+0 -0)
📝 catalog/preview/catalog.json (+8 -8)
📝 catalog/preview/notes.json (+6 -0)
📝 catalog/preview/v2/catalog.json (+8 -8)
📝 catalog/preview/v2/notes.json (+6 -0)
📝 catalog/preview/v3/catalog.json (+8 -8)
📝 catalog/preview/v3/notes.json (+6 -0)
📝 packages/otome-forge/CHANGELOG.md (+4 -0)
📝 packages/otome-forge/README.md (+2 -0)
📝 packages/otome-forge/client.js (+41 -41)
📝 packages/otome-forge/manifest.json (+5 -5)
📝 packages/otome-forge/server.mjs (+114 -112)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/hooks/use-otome-audio.ts (+82 -27)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/locales/en.json (+4 -0)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/screens/reader/Reader.tsx (+7 -1)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/screens/settings/Audio.tsx (+20 -4)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/api-types.ts (+11 -1)
➕ packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/audio.ts (+13 -0)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/audio/music.ts (+78 -2)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/routes/audio.ts (+24 -9)

...and 6 more files

📄 Description

Linked issue

Closes #1874. Owner: @SpicyMarinara (Codex).

Why this change

Readers can opt into a thematic track for each chapter and hear the same saved theme on replay. The setting is off by default so existing mood-based playback stays available.

What changed

  • Add “Generate a theme for each chapter” under enabled music generation in Settings → Audio, with localized cost and replay guidance.
  • Keep the chapter’s brief and first saved track on its chapter document, independent of bounded world mood caches. Briefs use public premise, setting, title, summary and tags; hidden story plans stay out.
  • Begin the existing brief/audio/recording pipeline only after reading starts. Reuse pending requests and saved assets, validate run/chapter/package ownership, and retain current playback during pending, failed or stale requests.
  • A missing saved chapter asset reports unavailable and keeps current music without automatically paying for a replacement. Fresh generated tracks work before the listing refreshes. No generation while muted, at zero volume or during planning.
  • Rebuild Otome Hearth 0.1.8: payloads, manifest, ZIP, release notes and all preview catalog lanes.

Package and security impact

  • Package: otome-forge 0.1.8; Engine >=2.5.1 <4.0.0, Capability API 1.386 unchanged.
  • No new permissions, entrypoints, providers or host APIs. Optional chapter-owned brief/track state uses existing documents; saved runs normalize with the setting off.
  • Package update requests an Engine restart. Existing artifact cleanup owns the chapter music alongside other run assets.

Validation

Passed: npm check (0 errors, 815 existing warnings), strict package types (78 server/shared, 125 client files), all 396 source and rebuilt-bundle regressions, catalog lanes, localization, catalog/archive validation, release notes and whitespace.

All 36 final focused browser cases passed against exact installed 0.1.8 bytes: desktop/mobile Chromium and WebKit, one worker. They cover opt-in settings, first generation, replay/reload reuse, failure retention, late-result isolation, missing saved chapter tracks and existing audio guards. The missing-track regression first reproduced unintended paid brief/music calls on the earlier candidate; after repair the same request guards pass with zero replacement generation through later lines, reentry and reload. One test-only saved-reader-position expectation was corrected after its preserved failure; production and request assertions were unchanged.

Dottore’s initial review found one LOW replay-cache defect: when a concurrent save returns a different first-kept track, that returned tag was not marked fresh. The one-line repair marks only the accepted save response fresh, preserving the missing-saved-file guard. A public leave/reenter regression failed on the prior bytes and now passes on all four projects, with no second chapter generation call. The private generator has exactly two guarded playCue callers; no speculative API expansion was added.

The optional 0.1.7 whole hosted run ended with 174 passing and four failing assertions: two old positive expression fixtures omitted clean-sprite metadata. This PR corrects only those two positive declarations, retaining all image/framing/request assertions and all negative defaults. The same four cases pass on exact 0.1.8 bytes; the original hosted failure is preserved.

Final local CodeRabbit at 018b407 completed with zero findings across 25 changed text files. Independent archive audit verifies all declared payload hashes/bytes, exact safe membership and CRC. Hosted CI and Dottore remain merge gates.

  • Manually verify chapter theme playback on a physical phone with configured providers.
  • Manually verify Engine UI package update/restart, offline replay and uninstall cleanup.
  • node scripts/validate-catalog.mjs passes locally.
  • git diff --check passes locally.

Manual verification notes

Automated proof uses isolated Engine package installation and controlled provider responses in browser emulation. No physical-device or live-provider claim. Original failing traces and final captures are retained in the /tmp/otome-018-* proof files and browser result directories.

Documentation impact

Package README and 0.1.8 release notes describe the optional chapter theme and reuse behavior. No Engine documentation change.

UI evidence (if applicable)

Final browser proof: /tmp/otome-018-final-music-browser.log and matching result directory; artifact pins recorded in /tmp/otome-018-root-final-artifact-audit.json.

ZIP SHA256: f8f10a761bb239f6b7a1c5b1ed39991c5a5fc229090d4e68696f3031c38995ad (1,640,891 bytes). Client: 688196fa523f45315cda7f3d16401bd34014bc7388d3af6b45d420d2e8aced15. Server: ff478b2e66d52e992a9893f0af10a29043d8f8468645a83b5d855b363c3a58a4.


🔄 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/1878 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/otome-chapter-themes` --- ### 📝 Commits (10+) - [`df4b6e1`](https://github.com/Pasta-Devs/Marinara-Agents/commit/df4b6e133b34502961eaca53b5d11833c9395ee1) feat(otome-forge): prepare optional chapter theme settings - [`2a9f3cb`](https://github.com/Pasta-Devs/Marinara-Agents/commit/2a9f3cbdd5d1d4a1f57c062aa63a3df1df2fbfd6) feat(otome-forge): retain chapter themes and guard playback - [`1707df5`](https://github.com/Pasta-Devs/Marinara-Agents/commit/1707df5a2459d33ab518152a486ebbb1109ea2ff) Merge commit 'f288c046a8acee4bb070a277a1bcd73e86ff7f5d' into feat/otome-chapter-themes - [`5e44a12`](https://github.com/Pasta-Devs/Marinara-Agents/commit/5e44a12e45eb5bbaa515957859b7685ceb85a43e) feat(otome-forge): package saved chapter themes in 0.1.8 - [`a3b7f73`](https://github.com/Pasta-Devs/Marinara-Agents/commit/a3b7f7351c52c233532eca20ca8894d9433f9ff3) Merge remote-tracking branch 'origin/staging' into feat/otome-chapter-themes - [`1568015`](https://github.com/Pasta-Devs/Marinara-Agents/commit/1568015102e4e6b564d3185a771b49f7cfb0da21) fix(otome-forge): never regenerate unavailable saved themes - [`805a000`](https://github.com/Pasta-Devs/Marinara-Agents/commit/805a000dee7edd4bd1b08b8af156704a415c1e29) test(otome-forge): respect saved chapter resume position - [`9533ed2`](https://github.com/Pasta-Devs/Marinara-Agents/commit/9533ed2f9f27f25eef49c2088ad8871d330f3a41) test(otome-forge): declare ready faces in presentation fixtures - [`5e14543`](https://github.com/Pasta-Devs/Marinara-Agents/commit/5e14543aff66471a0a156a52d3894101612c2826) fix(otome-forge): trust freshly kept chapter tracks for the visit - [`de2d656`](https://github.com/Pasta-Devs/Marinara-Agents/commit/de2d6562b7264f618d8b4c5913c964e26500ab9b) Merge remote-tracking branch 'origin/staging' into feat/otome-chapter-themes ### 📊 Changes **26 files changed** (+877 additions, -233 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/otome-forge-0.1.8.zip` (+0 -0) 📝 `catalog/preview/catalog.json` (+8 -8) 📝 `catalog/preview/notes.json` (+6 -0) 📝 `catalog/preview/v2/catalog.json` (+8 -8) 📝 `catalog/preview/v2/notes.json` (+6 -0) 📝 `catalog/preview/v3/catalog.json` (+8 -8) 📝 `catalog/preview/v3/notes.json` (+6 -0) 📝 `packages/otome-forge/CHANGELOG.md` (+4 -0) 📝 `packages/otome-forge/README.md` (+2 -0) 📝 `packages/otome-forge/client.js` (+41 -41) 📝 `packages/otome-forge/manifest.json` (+5 -5) 📝 `packages/otome-forge/server.mjs` (+114 -112) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/hooks/use-otome-audio.ts` (+82 -27) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/locales/en.json` (+4 -0) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/screens/reader/Reader.tsx` (+7 -1) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/screens/settings/Audio.tsx` (+20 -4) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/api-types.ts` (+11 -1) ➕ `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/audio.ts` (+13 -0) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/audio/music.ts` (+78 -2) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/routes/audio.ts` (+24 -9) _...and 6 more files_ </details> ### 📄 Description ## Linked issue Closes #1874. Owner: @SpicyMarinara (Codex). ## Why this change Readers can opt into a thematic track for each chapter and hear the same saved theme on replay. The setting is off by default so existing mood-based playback stays available. ## What changed - Add “Generate a theme for each chapter” under enabled music generation in Settings → Audio, with localized cost and replay guidance. - Keep the chapter’s brief and first saved track on its chapter document, independent of bounded world mood caches. Briefs use public premise, setting, title, summary and tags; hidden story plans stay out. - Begin the existing brief/audio/recording pipeline only after reading starts. Reuse pending requests and saved assets, validate run/chapter/package ownership, and retain current playback during pending, failed or stale requests. - A missing saved chapter asset reports unavailable and keeps current music without automatically paying for a replacement. Fresh generated tracks work before the listing refreshes. No generation while muted, at zero volume or during planning. - Rebuild Otome Hearth 0.1.8: payloads, manifest, ZIP, release notes and all preview catalog lanes. ## Package and security impact - Package: `otome-forge` 0.1.8; Engine >=2.5.1 <4.0.0, Capability API 1.386 unchanged. - No new permissions, entrypoints, providers or host APIs. Optional chapter-owned brief/track state uses existing documents; saved runs normalize with the setting off. - Package update requests an Engine restart. Existing artifact cleanup owns the chapter music alongside other run assets. ## Validation Passed: npm check (0 errors, 815 existing warnings), strict package types (78 server/shared, 125 client files), all 396 source and rebuilt-bundle regressions, catalog lanes, localization, catalog/archive validation, release notes and whitespace. All 36 final focused browser cases passed against exact installed 0.1.8 bytes: desktop/mobile Chromium and WebKit, one worker. They cover opt-in settings, first generation, replay/reload reuse, failure retention, late-result isolation, missing saved chapter tracks and existing audio guards. The missing-track regression first reproduced unintended paid brief/music calls on the earlier candidate; after repair the same request guards pass with zero replacement generation through later lines, reentry and reload. One test-only saved-reader-position expectation was corrected after its preserved failure; production and request assertions were unchanged. Dottore’s initial review found one LOW replay-cache defect: when a concurrent save returns a different first-kept track, that returned tag was not marked fresh. The one-line repair marks only the accepted save response fresh, preserving the missing-saved-file guard. A public leave/reenter regression failed on the prior bytes and now passes on all four projects, with no second chapter generation call. The private generator has exactly two guarded playCue callers; no speculative API expansion was added. The optional 0.1.7 whole hosted run ended with 174 passing and four failing assertions: two old positive expression fixtures omitted clean-sprite metadata. This PR corrects only those two positive declarations, retaining all image/framing/request assertions and all negative defaults. The same four cases pass on exact 0.1.8 bytes; the original hosted failure is preserved. Final local CodeRabbit at `018b407` completed with zero findings across 25 changed text files. Independent archive audit verifies all declared payload hashes/bytes, exact safe membership and CRC. Hosted CI and Dottore remain merge gates. - [ ] Manually verify chapter theme playback on a physical phone with configured providers. - [ ] Manually verify Engine UI package update/restart, offline replay and uninstall cleanup. - [ ] `node scripts/validate-catalog.mjs` passes locally. - [ ] `git diff --check` passes locally. ### Manual verification notes Automated proof uses isolated Engine package installation and controlled provider responses in browser emulation. No physical-device or live-provider claim. Original failing traces and final captures are retained in the `/tmp/otome-018-*` proof files and browser result directories. ## Documentation impact Package README and 0.1.8 release notes describe the optional chapter theme and reuse behavior. No Engine documentation change. ## UI evidence (if applicable) Final browser proof: `/tmp/otome-018-final-music-browser.log` and matching result directory; artifact pins recorded in `/tmp/otome-018-root-final-artifact-audit.json`. ZIP SHA256: `f8f10a761bb239f6b7a1c5b1ed39991c5a5fc229090d4e68696f3031c38995ad` (1,640,891 bytes). Client: `688196fa523f45315cda7f3d16401bd34014bc7388d3af6b45d420d2e8aced15`. Server: `ff478b2e66d52e992a9893f0af10a29043d8f8468645a83b5d855b363c3a58a4`. --- <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:44 +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#2013
No description provided.