[PR #1902] [MERGED] Prepare scene backgrounds, reuse saved locations, and ground protagonist voice #2020

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

📋 Pull Request Information

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

Base: staging ← Head: fix/otome-background-preparation


📝 Commits (10+)

  • c75928f Reserve Otome background preparation and persona voice lane
  • a07223c Integrate the validated Otome 0.1.15 candidate before background preparation work
  • 8ac2708 Prepare current scene backgrounds reuse saved places and ground protagonist voice
  • 82b7cb0 Merge remote-tracking branch 'origin/staging' into fix/otome-background-preparation
  • d05929b Preserve recovery fallback and seen-line progress across background preparation
  • ecdefe8 Build Otome Hearth 0.1.16 background readiness and persona voice improvements
  • 82268bc Accept omitted place references and align background browser fixtures with Engine UI
  • eba5393 Rebuild Otome Hearth with optional saved-background reference normalization
  • f314c99 Keep registered scene reads off the generation queue and preserve place repair reasons
  • 6674dfc Rebuild Otome Hearth with reviewed scene queue and repair fixes

📊 Changes

29 files changed (+1557 additions, -438 deletions)

View changed files

➕ artifacts/otome-forge-0.1.16.zip (+0 -0)
📝 catalog/preview/catalog.json (+8 -8)
📝 catalog/preview/notes.json (+6 -6)
📝 catalog/preview/v2/catalog.json (+8 -8)
📝 catalog/preview/v2/notes.json (+6 -6)
📝 catalog/preview/v3/catalog.json (+8 -8)
📝 catalog/preview/v3/notes.json (+6 -6)
📝 packages/otome-forge/CHANGELOG.md (+6 -0)
📝 packages/otome-forge/README.md (+5 -3)
📝 packages/otome-forge/client.js (+192 -192)
📝 packages/otome-forge/manifest.json (+5 -5)
📝 packages/otome-forge/server.mjs (+108 -107)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/hooks/use-reader.ts (+86 -20)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/lib/reader-state.ts (+1 -2)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/locales/en.json (+2 -0)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/screens/reader/Reader.tsx (+41 -22)
➕ packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/places.ts (+12 -0)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/art/expressions.ts (+7 -1)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/art/places.ts (+37 -29)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/schemas/player.ts (+1 -1)

...and 9 more files

📄 Description

Linked issue

Closes #1900. Closes #1901. Owner: @SpicyMarinara (Codex).

Why this change

Scene backgrounds can appear after their lines have already started, and repeated visits with different scene labels can repaint the same location. The protagonist's dialogue and choices also need explicit grounding in the selected persona, alongside the existing complete writing instructions.

What changed

Otome Hearth 0.1.16 prepares the automatically painted current-location background before reading starts. Scene-art registration finishes before the first scene response; paid painting still runs outside the foreground lock. The reader waits for the current image to decode, with a quiet Continue without background action. Future locations, CGs and expressions do not delay reading. Ask/review, missing connections, failed/stopped painting and unavailable images leave reading available. Once a place has opened, a manual repaint does not interrupt it. Leaving during preparation preserves only lines actually seen. Reopening a stored scene whose places already need no registration returns without waiting behind lookahead generation; places needing a write still use the foreground queue and are saved before the scene response.

The existing scene writer receives the saved-location catalog and can reuse a validated saved place key. Mainline and choice-branch labels become consistent before storage/painting; existing artwork is retained. Blank optional references are omitted, valid keys are trimmed, and invalid types or unknown keys are rejected. Distinct numbered rooms/floors remain distinct. There is no extra lookup generation, persisted alias field or automatic paid retry.

Existing whole, refreshed persona Description, Personality, Backstory and Appearance now explicitly guide protagonist dialogue, thoughts, reactions, choice intents/labels and performed selections. Options remain distinct and accepted choices remain authoritative. Scenario, greetings and example dialogue stay excluded. The full How it's written setting already reaches the planners, scene writer and choice writer; it remains intact. Guidance applies to new writing, without rewriting saved scenes.

Package and security impact

  • Affected package: otome-forge only. Rebuilt client/server payloads, manifest, ZIP, preview catalogs and release notes.
  • Engine compatibility stays 2.5.1 / Capability API 1.386. No new dependency, permission, provider or entrypoint.
  • Existing package client reader/art routes and server scene/background/prompt orchestration change; no Engine source, storage migration, uninstall behavior or output budget changes.
  • Existing background keys and original gallery references are retained. Gacha Forge's manifest, all 266 payloads and archive remain byte-identical to staging.
  • Install/update the package and restart Engine. No paid-provider calls were used for validation.

Validation

Machine results for head 6674dfc190da2f1ebafe595549d8b8679d394dd6:

  • Supported package build, npm run check, strict package types (78 server/shared and 131 client files), all catalog/localization/release-note checks and git diff --check passed. ESLint reports zero errors and 815 existing warnings.
  • All 443 package regressions passed (438 source + 5 shipped-bundle cases), with no skips. Registration race, saved-art reuse, invalid/blank references and full persona/style strings have focused regression proof. Shared Forge options and unchanged Gacha bundle/location guards passed.
  • Whole-change CodeRabbit review found one minor optional-reference defect; it was reproduced and fixed. The first follow-up committed review completed with zero findings. The committed Dottore-repair delta also completed CodeRabbit review with zero findings. Independent artifact audit verified all six payload pins, seven unique safe ZIP members/CRC, loose/archive byte equality, all preview catalog/notes versions and unchanged non-Otome entries.
  • Isolated Engine fixture installation/activation and fresh runtime snapshots match all six final payloads in desktop and mobile profiles. This is automated fixture installation, not a claim of manual Agents UI update/offline/uninstall verification.
  • The byte-identical client bundle passed all 64 background cases across desktop/mobile Chromium and WebKit at prior head eba5393e, plus two separate inspected settled screenshots. Coverage includes automatic paint/decode, guarded progress/audio, manual settings, explicit bypass, failure recovery, stale callbacks and seen-line resume. All four positive paint/decode cases were rerun successfully across the four profiles with the final installed server at 6674dfc1; both runtime snapshots and all six payloads match the final artifact. Server queue and error propagation changes additionally have direct route/normalizer regressions.

Review repairs and control evidence

Dottore's initial review found two valid LOW defects. Both were reproduced before repair: a held-foreground route test proved stored registered scenes waited unnecessarily, and a confrontation test proved invalid reuse reported an unrelated opening-segment error. The repairs add a read-only fast path for existing, unretagged, automatic-keep records, and preserve the specific place-validation reason through the existing segment-list interface. Negative cases retain queued registration for missing, waiting-consent-with-Ask-off and retagged places; ready/live-pending cases return while the foreground task stays held. Unknown keys, missing names and conflicting aliases retain their exact errors; valid reuse and the null list contract remain intact.

Both reply schemas retain nested reuse through places: z.unknown().optional(); JSON parsing and schema validation precede normalization. The catalog uses the existing 400-place limit and serializes only saved key/name/tags. Writer prompts retain the visual-only rule and existing knowledge boundary; event/choice/ledger filtering stays separate. All saved place descriptions are model-visible, so this is a prompt-enforced knowledge boundary, not technical audience isolation of location descriptions. The persona regression captures real chapter/beat route messages and checks all four fresh authored fields, whole writingStyle, choice/content rules and a card edit after planning; it proves routing, not generated prose quality.

The cancelled prior-head hosted browser run recorded one Caring Message cache assertion across UTC midnight. Its retained trace shows the pre-click screenshot crossed midnight and the unchanged daily expiry guard withheld the prior-day cache. The same test body passed on mobile with its original real clock, assertions and 150-second budget after normally dismissing Engine's holiday greeting; the initial greeting-blocked replay is also preserved. No caring-message code or test assertions were changed. The broader hosted browser job for the current head remains in progress; it is not counted as passed here.

Manual verification notes

  • Manually verify current automatic backgrounds and recurring-location reuse in a normal playthrough with the selected image provider.
  • Manually verify Ask before painting, prompt review and failure recovery on a physical iPhone.
  • Manually verify the intended persona voice, distinct choices and complete writing instructions with the selected text provider.
  • Manually verify Agents UI update, restart, offline restart and uninstall cleanup.

Browser image/text/voice paths use controlled fixtures. Physical-device behavior, actual provider timing and generated prose quality are not proven by these checks.

Documentation impact

Updated the package README and 0.1.16 changelog; generated preview release notes match. Two new reader labels use canonical English localization keys with existing fallback behavior.

UI evidence

Final installed-bundle browser traces and desktop/phone preparation/settled screenshots are retained with the local validation receipts. The original failing traces and test-harness corrections are preserved; no runtime assertions or time budgets were weakened.


🔄 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/1902 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/otome-background-preparation` --- ### 📝 Commits (10+) - [`c75928f`](https://github.com/Pasta-Devs/Marinara-Agents/commit/c75928ff89f0ff6793ff4289b2764f68262601d3) Reserve Otome background preparation and persona voice lane - [`a07223c`](https://github.com/Pasta-Devs/Marinara-Agents/commit/a07223c8bbb63dba6661c23915f07e746c8c2a6f) Integrate the validated Otome 0.1.15 candidate before background preparation work - [`8ac2708`](https://github.com/Pasta-Devs/Marinara-Agents/commit/8ac2708380b70a598328a1823c6f0f267446208c) Prepare current scene backgrounds reuse saved places and ground protagonist voice - [`82b7cb0`](https://github.com/Pasta-Devs/Marinara-Agents/commit/82b7cb0a27d1029060c79db00233173c17a110ba) Merge remote-tracking branch 'origin/staging' into fix/otome-background-preparation - [`d05929b`](https://github.com/Pasta-Devs/Marinara-Agents/commit/d05929b135cbf7a20143d8fb059b3dfdcefd15e6) Preserve recovery fallback and seen-line progress across background preparation - [`ecdefe8`](https://github.com/Pasta-Devs/Marinara-Agents/commit/ecdefe83e2064efa7d0f4750af3a855269c34988) Build Otome Hearth 0.1.16 background readiness and persona voice improvements - [`82268bc`](https://github.com/Pasta-Devs/Marinara-Agents/commit/82268bc3b2b55358b6359bd893b8311dd55e6a49) Accept omitted place references and align background browser fixtures with Engine UI - [`eba5393`](https://github.com/Pasta-Devs/Marinara-Agents/commit/eba5393ed5802dd4baf2b0119a078a87f0bbd6a6) Rebuild Otome Hearth with optional saved-background reference normalization - [`f314c99`](https://github.com/Pasta-Devs/Marinara-Agents/commit/f314c99524f3358e005210cb4c76d0835007cf9e) Keep registered scene reads off the generation queue and preserve place repair reasons - [`6674dfc`](https://github.com/Pasta-Devs/Marinara-Agents/commit/6674dfc190da2f1ebafe595549d8b8679d394dd6) Rebuild Otome Hearth with reviewed scene queue and repair fixes ### 📊 Changes **29 files changed** (+1557 additions, -438 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/otome-forge-0.1.16.zip` (+0 -0) 📝 `catalog/preview/catalog.json` (+8 -8) 📝 `catalog/preview/notes.json` (+6 -6) 📝 `catalog/preview/v2/catalog.json` (+8 -8) 📝 `catalog/preview/v2/notes.json` (+6 -6) 📝 `catalog/preview/v3/catalog.json` (+8 -8) 📝 `catalog/preview/v3/notes.json` (+6 -6) 📝 `packages/otome-forge/CHANGELOG.md` (+6 -0) 📝 `packages/otome-forge/README.md` (+5 -3) 📝 `packages/otome-forge/client.js` (+192 -192) 📝 `packages/otome-forge/manifest.json` (+5 -5) 📝 `packages/otome-forge/server.mjs` (+108 -107) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/hooks/use-reader.ts` (+86 -20) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/lib/reader-state.ts` (+1 -2) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/locales/en.json` (+2 -0) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/screens/reader/Reader.tsx` (+41 -22) ➕ `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/places.ts` (+12 -0) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/art/expressions.ts` (+7 -1) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/art/places.ts` (+37 -29) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/schemas/player.ts` (+1 -1) _...and 9 more files_ </details> ### 📄 Description ## Linked issue Closes #1900. Closes #1901. Owner: @SpicyMarinara (Codex). ## Why this change Scene backgrounds can appear after their lines have already started, and repeated visits with different scene labels can repaint the same location. The protagonist's dialogue and choices also need explicit grounding in the selected persona, alongside the existing complete writing instructions. ## What changed Otome Hearth 0.1.16 prepares the automatically painted current-location background before reading starts. Scene-art registration finishes before the first scene response; paid painting still runs outside the foreground lock. The reader waits for the current image to decode, with a quiet **Continue without background** action. Future locations, CGs and expressions do not delay reading. Ask/review, missing connections, failed/stopped painting and unavailable images leave reading available. Once a place has opened, a manual repaint does not interrupt it. Leaving during preparation preserves only lines actually seen. Reopening a stored scene whose places already need no registration returns without waiting behind lookahead generation; places needing a write still use the foreground queue and are saved before the scene response. The existing scene writer receives the saved-location catalog and can reuse a validated saved place key. Mainline and choice-branch labels become consistent before storage/painting; existing artwork is retained. Blank optional references are omitted, valid keys are trimmed, and invalid types or unknown keys are rejected. Distinct numbered rooms/floors remain distinct. There is no extra lookup generation, persisted alias field or automatic paid retry. Existing whole, refreshed persona Description, Personality, Backstory and Appearance now explicitly guide protagonist dialogue, thoughts, reactions, choice intents/labels and performed selections. Options remain distinct and accepted choices remain authoritative. Scenario, greetings and example dialogue stay excluded. The full **How it's written** setting already reaches the planners, scene writer and choice writer; it remains intact. Guidance applies to new writing, without rewriting saved scenes. ## Package and security impact - Affected package: `otome-forge` only. Rebuilt client/server payloads, manifest, ZIP, preview catalogs and release notes. - Engine compatibility stays 2.5.1 / Capability API 1.386. No new dependency, permission, provider or entrypoint. - Existing package client reader/art routes and server scene/background/prompt orchestration change; no Engine source, storage migration, uninstall behavior or output budget changes. - Existing background keys and original gallery references are retained. Gacha Forge's manifest, all 266 payloads and archive remain byte-identical to staging. - Install/update the package and restart Engine. No paid-provider calls were used for validation. ## Validation Machine results for head `6674dfc190da2f1ebafe595549d8b8679d394dd6`: - Supported package build, `npm run check`, strict package types (78 server/shared and 131 client files), all catalog/localization/release-note checks and `git diff --check` passed. ESLint reports zero errors and 815 existing warnings. - All 443 package regressions passed (438 source + 5 shipped-bundle cases), with no skips. Registration race, saved-art reuse, invalid/blank references and full persona/style strings have focused regression proof. Shared Forge options and unchanged Gacha bundle/location guards passed. - Whole-change CodeRabbit review found one minor optional-reference defect; it was reproduced and fixed. The first follow-up committed review completed with zero findings. The committed Dottore-repair delta also completed CodeRabbit review with zero findings. Independent artifact audit verified all six payload pins, seven unique safe ZIP members/CRC, loose/archive byte equality, all preview catalog/notes versions and unchanged non-Otome entries. - Isolated Engine fixture installation/activation and fresh runtime snapshots match all six final payloads in desktop and mobile profiles. This is automated fixture installation, not a claim of manual Agents UI update/offline/uninstall verification. - The byte-identical client bundle passed all 64 background cases across desktop/mobile Chromium and WebKit at prior head `eba5393e`, plus two separate inspected settled screenshots. Coverage includes automatic paint/decode, guarded progress/audio, manual settings, explicit bypass, failure recovery, stale callbacks and seen-line resume. All four positive paint/decode cases were rerun successfully across the four profiles with the final installed server at `6674dfc1`; both runtime snapshots and all six payloads match the final artifact. Server queue and error propagation changes additionally have direct route/normalizer regressions. ### Review repairs and control evidence Dottore's initial review found two valid LOW defects. Both were reproduced before repair: a held-foreground route test proved stored registered scenes waited unnecessarily, and a confrontation test proved invalid reuse reported an unrelated opening-segment error. The repairs add a read-only fast path for existing, unretagged, automatic-keep records, and preserve the specific place-validation reason through the existing segment-list interface. Negative cases retain queued registration for missing, waiting-consent-with-Ask-off and retagged places; ready/live-pending cases return while the foreground task stays held. Unknown keys, missing names and conflicting aliases retain their exact errors; valid reuse and the null list contract remain intact. Both reply schemas retain nested `reuse` through `places: z.unknown().optional()`; JSON parsing and schema validation precede normalization. The catalog uses the existing 400-place limit and serializes only saved key/name/tags. Writer prompts retain the visual-only rule and existing knowledge boundary; event/choice/ledger filtering stays separate. All saved place descriptions are model-visible, so this is a prompt-enforced knowledge boundary, not technical audience isolation of location descriptions. The persona regression captures real chapter/beat route messages and checks all four fresh authored fields, whole writingStyle, choice/content rules and a card edit after planning; it proves routing, not generated prose quality. The cancelled prior-head hosted browser run recorded one Caring Message cache assertion across UTC midnight. Its retained trace shows the pre-click screenshot crossed midnight and the unchanged daily expiry guard withheld the prior-day cache. The same test body passed on mobile with its original real clock, assertions and 150-second budget after normally dismissing Engine's holiday greeting; the initial greeting-blocked replay is also preserved. No caring-message code or test assertions were changed. The broader hosted browser job for the current head remains in progress; it is not counted as passed here. ### Manual verification notes - [ ] Manually verify current automatic backgrounds and recurring-location reuse in a normal playthrough with the selected image provider. - [ ] Manually verify Ask before painting, prompt review and failure recovery on a physical iPhone. - [ ] Manually verify the intended persona voice, distinct choices and complete writing instructions with the selected text provider. - [ ] Manually verify Agents UI update, restart, offline restart and uninstall cleanup. Browser image/text/voice paths use controlled fixtures. Physical-device behavior, actual provider timing and generated prose quality are not proven by these checks. ## Documentation impact Updated the package README and 0.1.16 changelog; generated preview release notes match. Two new reader labels use canonical English localization keys with existing fallback behavior. ## UI evidence Final installed-bundle browser traces and desktop/phone preparation/settled screenshots are retained with the local validation receipts. The original failing traces and test-harness corrections are preserved; no runtime assertions or time budgets were weakened. --- <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:48 +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#2020
No description provided.