[PR #1800] [MERGED] feat(otome-forge): chapters, reader, story memory and relationship state (0.0.3, M2a) #1973

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/1800
Author: @SpicyMarinara
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/otome-forge-m2a


📝 Commits (5)

  • 749bfa4 feat(otome-forge): chapters, reader, story memory and relationship state (Otome Forge 0.0.3, M2a)
  • efe0f52 fix(otome-forge): name who remembers a choice, keep focus on memory Retry
  • bb9dc6d fix(otome-forge): Dottore review of M2a (picks past a cut, memory status, grievances, reader)
  • c0e19d4 Merge remote-tracking branch 'origin/staging' into feat/otome-forge-m2a
  • 7efa324 docs(otome-forge): say when memory status reads as pending

📊 Changes

65 files changed (+11495 additions, -145 deletions)

View changed files

📝 README.md (+1 -1)
➕ artifacts/otome-forge-0.0.3.zip (+0 -0)
📝 catalog/preview/catalog.json (+74 -0)
📝 catalog/preview/notes.json (+22 -0)
📝 catalog/preview/v2/catalog.json (+74 -0)
📝 catalog/preview/v2/notes.json (+22 -0)
📝 catalog/preview/v3/catalog.json (+74 -0)
📝 catalog/preview/v3/notes.json (+22 -0)
📝 packages/otome-forge/CHANGELOG.md (+8 -0)
📝 packages/otome-forge/README.md (+13 -3)
📝 packages/otome-forge/client.js (+481 -45)
📝 packages/otome-forge/manifest.json (+5 -5)
📝 packages/otome-forge/server.mjs (+113 -23)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/OtomeForgeView.tsx (+43 -14)
➕ packages/otome-forge/src/engine/packages/client/src/features/otome-forge/components/DeclinedPanel.tsx (+141 -0)
➕ packages/otome-forge/src/engine/packages/client/src/features/otome-forge/forge-kit.d.ts (+14 -0)
➕ packages/otome-forge/src/engine/packages/client/src/features/otome-forge/hooks/use-reader.ts (+659 -0)
➕ packages/otome-forge/src/engine/packages/client/src/features/otome-forge/lib/reader-state.ts (+187 -0)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/locales/en.json (+136 -1)
➕ packages/otome-forge/src/engine/packages/client/src/features/otome-forge/screens/reader/Backlog.tsx (+125 -0)

...and 45 more files

📄 Description

Pull request

Important

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

Linked issue

Fixes #1799 (milestone M2a of #1781, Otome Forge release 1).

Why this change

After setup (M1, #1793) a player has a world, a cast and their bibles, but nothing to read. The maintainer asked for a character-driven story with flawed, dynamic love interests, conflict and angst. This milestone adds that story: chapters written in beats around each love interest's flaw, a visual-novel reader, choices that move the relationship, and private story memory so each love interest remembers only what they were present for.

What changed

otome-forge 0.0.3. It moves from no catalog to staging-only (the preview overlay).

  • Chapters (server, story/):
    • A planner picks the chapter's Lead from two candidates: the least recent, and an unresolved conflict once one is ripe. The player picks in the Lead dialog.
    • A Foil (the flaw in action) must appear in at least one node. The plan carries content tags, which are shown before anything is written. Unknown tags are dropped.
    • Beats are written one at a time, with a lookahead. P5 gives every Foil candidate their full bible and the others only scene cards. The content contract and the knowledge boundary reach every scene prompt.
    • Choices carry trust, tension and disclosure effects, capped per chapter. The big choice is irrevocable and recalled in every later chapter. A pick touching two love interests opens a grievance.
    • Rewrite saves a second version. It refuses (409) if the beat was read, eased off or picked from in the meantime.
    • Ease off cuts the current scene with no model call and softens what comes next. It also works on a declined scene.
  • Reader (client, screens/reader/): dialogue box, face plate (only someone in the scene), backlog with favourites, choice pills, the content-tags card, the declined panel and the ease-off dialog. Keyboard: → and PageDown advance; focus lands on each new panel's action.
  • Story memory: the shared forge kit (summaries, recall audience, prompt fit) with Otome's ids.
    • M2a writes only shared main chapters. The canonical-history fallback and the decisions block already hold a private chapter (route, repair, story) to its own love interest. The ready-memory path (the kit's overview, recent canon and details) does not yet, so M2b, which writes those chapters, closes it (#1803).
    • Until memory is ready, prompts get the chapters themselves: the latest in full, earlier ones newest-first within budget.
    • Settings → Debug shows the memory status, with Retry.
  • State: relationship points, trust and tension, the conflict ledger, ruptures, and Starlight rewards (30 the first time a scene is read to its end, 160 per chapter). A pick applies once, when its beat is read.
  • Prompt logging goes through the kit's logForgeStoryPrompt with redaction first.
  • Tests: chapters, beats, memory audience, reader state and state caps (101 .ts + 5 .mjs). New tests/package-otome-forge-reader.e2e.ts.

Internal review

A review pass before this PR confirmed 22 findings (21 distinct). All are fixed here, including:

  • memory-not-ready no longer drops history;
  • big choices stay canon;
  • the rewrite and ease-off races;
  • a lost pick lands on read;
  • a second open rupture keeps the gates shut;
  • the end-report loop;
  • Next waits for the save;
  • reader focus;
  • idempotent favourites.

Choices made for the maintainer to confirm

  • Caps: trust (−3..+3) and tension (0..3) move at most ±1 per beat and ±2 per chapter for each love interest, and are never shown.
  • Rewards: 30 Starlight per scene read and 160 per chapter, from the design's economy table.
  • The second Lead candidate is "unresolved conflict" only when its ripeness is above 0; otherwise the next least recent.

Dottore review

Ten findings and two nitpicks on efe0f52d8; eleven fixed in bb9dc6d7a with regressions (each shown to fail without its fix). The ready-memory boundary finding was not live in M2a (only main chapters exist), so it is answered on its thread and closed in M2b. The incremental re-review is "Viable, With Notes"; its one nitpick (a comment in memory.ts) is fixed.

Local CodeRabbit review

Two minor findings, both fixed in efe0f52d8:

  • The changelog and README quoted a toast the reader never shows ("He'll remember that."), with a gender assumed. They now say the toast names who will remember it. The preview notes were regenerated.
  • Settings → Debug's memory Retry used disabled, which drops keyboard focus. It now uses aria-disabled like the package's other buttons.

Package and security impact

  • Affected package IDs: otome-forge (0.0.3, staging-only).
  • Engine compatibility impact: Capability API 1.386, unchanged.
  • New or changed permissions/entrypoints: none beyond routes, storage, ui.
  • Restart, storage, update, or uninstall impact: new chapter, beat, memory and state documents under otome-forge:. Deleting a world removes them and invalidates its memory.

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, on the tree merged with current staging:

  • npm run test:otome-forge: 109 .ts and 5 .mjs pass.
  • npm run check, npm run typecheck:packages, the strict typecheck against an Engine root, both locale validators, test-catalog-lanes and git diff --check are clean.
  • validate-catalog passes, with otome-forge in the preview overlay.
  • Two builds are byte-identical. The preview catalog entry matches the manifest and the zip.
  • A Chromium smoke of the built client against the built server, with a scripted model, read a whole chapter:
    • choices, Rewrite, Ease off, a declined scene, the big choice and the chapter end;
    • the exact Starlight, points and trust afterwards;
    • memory reaching Ready, and a private date kept out of other love interests' prompts.

Please verify by hand:

  • Manually verify, on a staging Engine with a real model, that a new world's first chapter plans, shows its content tags, and reads to the end.
  • Manually verify the Lead dialog offers two candidates, and that a pick shows "… will remember that."
  • Manually verify Ease off mid-scene and on a declined scene, and that the next scene is softer.
  • Manually verify Settings → Debug → Story memory reaches Ready after a chapter ends.
  • Manually verify the reader at phone width (390 px) in both looks, and with keyboard only (→, PageDown, Enter).

🤖 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/1800 **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/otome-forge-m2a` --- ### 📝 Commits (5) - [`749bfa4`](https://github.com/Pasta-Devs/Marinara-Agents/commit/749bfa48f764d1ce60440ac652a7dd18a39ec1a1) feat(otome-forge): chapters, reader, story memory and relationship state (Otome Forge 0.0.3, M2a) - [`efe0f52`](https://github.com/Pasta-Devs/Marinara-Agents/commit/efe0f52d88aecddf2fa982cf6289cf371fb658ba) fix(otome-forge): name who remembers a choice, keep focus on memory Retry - [`bb9dc6d`](https://github.com/Pasta-Devs/Marinara-Agents/commit/bb9dc6d7aa06a23b2a37b751a847b7c01b522b5c) fix(otome-forge): Dottore review of M2a (picks past a cut, memory status, grievances, reader) - [`c0e19d4`](https://github.com/Pasta-Devs/Marinara-Agents/commit/c0e19d40ddca008eb51100fa054081c77b54e5fc) Merge remote-tracking branch 'origin/staging' into feat/otome-forge-m2a - [`7efa324`](https://github.com/Pasta-Devs/Marinara-Agents/commit/7efa3243eef2bde5755fec0028fdabf0393d0931) docs(otome-forge): say when memory status reads as pending ### 📊 Changes **65 files changed** (+11495 additions, -145 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+1 -1) ➕ `artifacts/otome-forge-0.0.3.zip` (+0 -0) 📝 `catalog/preview/catalog.json` (+74 -0) 📝 `catalog/preview/notes.json` (+22 -0) 📝 `catalog/preview/v2/catalog.json` (+74 -0) 📝 `catalog/preview/v2/notes.json` (+22 -0) 📝 `catalog/preview/v3/catalog.json` (+74 -0) 📝 `catalog/preview/v3/notes.json` (+22 -0) 📝 `packages/otome-forge/CHANGELOG.md` (+8 -0) 📝 `packages/otome-forge/README.md` (+13 -3) 📝 `packages/otome-forge/client.js` (+481 -45) 📝 `packages/otome-forge/manifest.json` (+5 -5) 📝 `packages/otome-forge/server.mjs` (+113 -23) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/OtomeForgeView.tsx` (+43 -14) ➕ `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/components/DeclinedPanel.tsx` (+141 -0) ➕ `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/forge-kit.d.ts` (+14 -0) ➕ `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/hooks/use-reader.ts` (+659 -0) ➕ `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/lib/reader-state.ts` (+187 -0) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/locales/en.json` (+136 -1) ➕ `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/screens/reader/Backlog.tsx` (+125 -0) _...and 45 more files_ </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. ## Linked issue Fixes #1799 (milestone M2a of #1781, Otome Forge release 1). ## Why this change After setup (M1, #1793) a player has a world, a cast and their bibles, but nothing to read. The maintainer asked for a character-driven story with flawed, dynamic love interests, conflict and angst. This milestone adds that story: chapters written in beats around each love interest's flaw, a visual-novel reader, choices that move the relationship, and private story memory so each love interest remembers only what they were present for. ## What changed `otome-forge` 0.0.3. It moves from no catalog to **staging-only** (the preview overlay). - **Chapters (server, `story/`):** - A planner picks the chapter's Lead from two candidates: the least recent, and an unresolved conflict once one is ripe. The player picks in the Lead dialog. - A Foil (the flaw in action) must appear in at least one node. The plan carries content tags, which are shown before anything is written. Unknown tags are dropped. - Beats are written one at a time, with a lookahead. P5 gives every Foil candidate their full bible and the others only scene cards. The content contract and the knowledge boundary reach every scene prompt. - Choices carry trust, tension and disclosure effects, capped per chapter. The big choice is irrevocable and recalled in every later chapter. A pick touching two love interests opens a grievance. - Rewrite saves a second version. It refuses (409) if the beat was read, eased off or picked from in the meantime. - **Ease off** cuts the current scene with no model call and softens what comes next. It also works on a declined scene. - **Reader (client, `screens/reader/`):** dialogue box, face plate (only someone in the scene), backlog with favourites, choice pills, the content-tags card, the declined panel and the ease-off dialog. Keyboard: → and PageDown advance; focus lands on each new panel's action. - **Story memory:** the shared forge kit (summaries, recall audience, prompt fit) with Otome's ids. - M2a writes only shared main chapters. The canonical-history fallback and the decisions block already hold a private chapter (route, repair, story) to its own love interest. The ready-memory path (the kit's overview, recent canon and details) does not yet, so M2b, which writes those chapters, closes it (#1803). - Until memory is ready, prompts get the chapters themselves: the latest in full, earlier ones newest-first within budget. - Settings → Debug shows the memory status, with Retry. - **State:** relationship points, trust and tension, the conflict ledger, ruptures, and Starlight rewards (30 the first time a scene is read to its end, 160 per chapter). A pick applies once, when its beat is read. - **Prompt logging** goes through the kit's `logForgeStoryPrompt` with redaction first. - **Tests:** chapters, beats, memory audience, reader state and state caps (101 `.ts` + 5 `.mjs`). New `tests/package-otome-forge-reader.e2e.ts`. ### Internal review A review pass before this PR confirmed 22 findings (21 distinct). All are fixed here, including: - memory-not-ready no longer drops history; - big choices stay canon; - the rewrite and ease-off races; - a lost pick lands on read; - a second open rupture keeps the gates shut; - the end-report loop; - Next waits for the save; - reader focus; - idempotent favourites. ### Choices made for the maintainer to confirm - Caps: trust (−3..+3) and tension (0..3) move at most ±1 per beat and ±2 per chapter for each love interest, and are never shown. - Rewards: 30 Starlight per scene read and 160 per chapter, from the design's economy table. - The second Lead candidate is "unresolved conflict" only when its ripeness is above 0; otherwise the next least recent. ### Dottore review Ten findings and two nitpicks on efe0f52d8; eleven fixed in bb9dc6d7a with regressions (each shown to fail without its fix). The ready-memory boundary finding was not live in M2a (only main chapters exist), so it is answered on its thread and closed in M2b. The incremental re-review is "Viable, With Notes"; its one nitpick (a comment in memory.ts) is fixed. ### Local CodeRabbit review Two minor findings, both fixed in efe0f52d8: - The changelog and README quoted a toast the reader never shows ("He'll remember that."), with a gender assumed. They now say the toast names who will remember it. The preview notes were regenerated. - Settings → Debug's memory Retry used `disabled`, which drops keyboard focus. It now uses `aria-disabled` like the package's other buttons. ## Package and security impact - Affected package IDs: `otome-forge` (0.0.3, staging-only). - Engine compatibility impact: Capability API 1.386, unchanged. - New or changed permissions/entrypoints: none beyond `routes`, `storage`, `ui`. - Restart, storage, update, or uninstall impact: new chapter, beat, memory and state documents under `otome-forge:`. Deleting a world removes them and invalidates its memory. ## 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, on the tree merged with current `staging`: - `npm run test:otome-forge`: 109 `.ts` and 5 `.mjs` pass. - `npm run check`, `npm run typecheck:packages`, the strict typecheck against an Engine root, both locale validators, `test-catalog-lanes` and `git diff --check` are clean. - `validate-catalog` passes, with otome-forge in the preview overlay. - Two builds are byte-identical. The preview catalog entry matches the manifest and the zip. - A Chromium smoke of the built client against the built server, with a scripted model, read a whole chapter: - choices, Rewrite, Ease off, a declined scene, the big choice and the chapter end; - the exact Starlight, points and trust afterwards; - memory reaching Ready, and a private date kept out of other love interests' prompts. Please verify by hand: - Manually verify, on a staging Engine with a real model, that a new world's first chapter plans, shows its content tags, and reads to the end. - Manually verify the Lead dialog offers two candidates, and that a pick shows "… will remember that." - Manually verify Ease off mid-scene and on a declined scene, and that the next scene is softer. - Manually verify Settings → Debug → Story memory reaches Ready after a chapter ends. - Manually verify the reader at phone width (390 px) in both looks, and with keyboard only (→, PageDown, Enter). 🤖 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: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#1973
No description provided.