[PR #1985] [MERGED] feat(otome-forge): 0.6.8 — story arcs that land, the end-of-arc choice, and a love interest who arrives (M1–M3) #2060

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

📋 Pull Request Information

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

Base: staging ← Head: feat/otome-story-arcs-m1


📝 Commits (9)

  • c4bcc58 feat(otome-forge): story arcs, with the mystery's answer on a schedule (#1980, M1)
  • ba8f614 fix(otome-forge): the arc's repeat checks read the run's history; one piece per love interest per arc
  • 492591a fix(otome-forge): the arc line reads its own locale key
  • 661ad69 feat(otome-forge): the end-of-arc choice, breathing arcs, and a love interest who arrives (#1983 M2, M3)
  • 9bf8dcb test(otome-forge): pin the newcomer's arrival and the refused arrival
  • 65d2267 docs(otome-forge): the chapter list does not name each chapter's arc yet
  • f3aa0c3 build(otome-forge): ship the 0.6.8 artifact the catalog points at
  • 78941b6 fix(otome-forge): Dottore's five findings on the arc choice and the newcomer
  • 1208560 Merge branch 'staging' into feat/otome-story-arcs-m1

📊 Changes

36 files changed (+2318 additions, -312 deletions)

View changed files

➕ artifacts/otome-forge-0.6.7.zip (+0 -0)
➕ artifacts/otome-forge-0.6.8.zip (+0 -0)
📝 catalog/preview/catalog.json (+8 -8)
📝 catalog/preview/notes.json (+12 -12)
📝 catalog/preview/v2/catalog.json (+8 -8)
📝 catalog/preview/v2/notes.json (+12 -12)
📝 catalog/preview/v3/catalog.json (+8 -8)
📝 catalog/preview/v3/notes.json (+12 -12)
📝 packages/otome-forge/CHANGELOG.md (+9 -0)
📝 packages/otome-forge/README.md (+4 -0)
📝 packages/otome-forge/client.js (+45 -45)
📝 packages/otome-forge/manifest.json (+5 -5)
📝 packages/otome-forge/server.mjs (+150 -141)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/locales/en.json (+53 -33)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/screens/setup/draft.ts (+7 -3)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/screens/story/StoryHome.tsx (+194 -0)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/api-types.ts (+53 -0)
➕ packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/cast.ts (+7 -0)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/ids.ts (+3 -0)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/routes/runs.ts (+1 -2)

...and 16 more files

📄 Description

Pull request

Linked issue

Closes #1984
Closes #1985
Closes #1986
Refs #1983

Why this change

Before this, Otome Hearth planned one main chapter at a time. There was no long-term plan, and the mystery's whole truth was handed to every chapter planner with the instruction "(never stated outright)", so the mystery raised at setup could never be answered.

This PR delivers the first three milestones of #1983 in one release (0.6.8), as the maintainer asked:

  • M1 — arcs that land: a plan of 8–12 chapters with a goal, a big event and a reveal schedule, enforced in code.
  • M2 — the end-of-arc choice: breathing room, the story goes on, or someone new.
  • M3 — someone new arrives: a card of the player's, or one invented, written into the cast and the arc.

M4 (polish) follows after this merges.

What changed

M1 — the arc itself

  • The arc document (schemas/story-arc.ts, story/arc.ts, ids.ts): one ${R}:arc:<n> per arc, swept with the run. Chapter numbers stay global; completion and progress are derived from the chapters, never stored.
  • The arc planner (P25): 8–12 chapters with one purpose each, a goal, a big event, an antagonist and 1–4 scheduled reveals. The model gives 1-based positions only; the server stamps every chapter number. It is the only writer that always sees the truth, and it reads what earlier arcs already revealed so a repeat is refused. Output budget 16,000 tokens; purposes capped at 20 words.
  • Scheduled reveals (story/chapters.ts, story/prompts.ts): the truth now reaches a planner prompt only in the chapter scheduled to reveal it (the route/repair line that always carried it is gone); a scheduled chapter must place the reveal on a node whose cast holds the piece's holder; any other chapter's reveal is dropped; the arc's last chapter must carry the big event in its climax. Chapter plan budget raised from 4,000 to 10,000 tokens.
  • Narration: at a reveal node the narrator gets the piece or the truth, with the same scene-card waiver a route gate already uses.
  • Story screen: "Arc The drowned bell · chapter 4 of 10".

M2 — the end-of-arc choice

  • POST /runs/:run/arcs {choice} plans the next arc: breathe (3–5 chapters, no plot, no reveals, a warm ending), continue (another story arc), or newcomer. Writing one document keeps it atomic; a repeat call returns the arc already there; 409 while the current arc is unfinished.
  • The choice decides the arc's kind, so the model cannot make a breathing arc plot-heavy or a story arc silent.
  • storyView.arcChoice offers the three ways exactly when an arc has ended and no next arc exists; next is null meanwhile, and POST /chapters/next answers 409 "Choose how the story goes on."
  • The Story screen shows the three explained options and the cost before the tap.

M3 — someone new

  • story/introduce.ts: a card or an invented love interest writes their unit, their bible (checked against every existing love interest), their ties into world.web, and appends them last to the cast order — the arc's first chapter meets them beside at least one of the others. Nothing touches world.forge.steps, so a mid-run arrival never drops the player onto a forge screen.
  • A refused choice writes no one: the newcomer is written only after every gate has passed (the first version of this PR wrote them before the arc gate; the test caught it).
  • Five is the cast's limit; at five the option is hidden and the server refuses it. LIS_MIN/LIS_MAX moved into shared/cast.ts so the client and server cannot drift.
  • The newcomer dialog offers a card picker or an invented name and archetype.

Package and security impact

  • Affected package IDs: otome-forge
  • Engine compatibility impact: none; no new capability, same engine range.
  • New or changed permissions/entrypoints: none. One new route inside the package's existing prefix (POST /runs/:run/arcs).
  • Restart, storage, update, or uninstall impact: none. Old runs load unchanged and are not migrated; deleting a run removes its arcs.

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:

  • typecheck-packages.mjs otome-forge: no errors (86 server/shared, 137 client).
  • npm run test:otome-forge: all pass, including the 17 assertions in tests/otome-forge-story-arcs.regression.ts:
    • M1: the server stamps every chapter number; 8–12 / 3–5 lengths and the 20-word purpose cap; a reveal past the end, twice in one chapter, an old piece, a repeated truth, the truth before its chapter and the same piece twice all refused; a stored arc keeps its range and drops out-of-range reveals; the truth absent from a chapter not scheduled to reveal it and present when it is; a scheduled chapter without revealNode refused; a node without the holder refused; an unscheduled revealNode dropped; the last chapter's eventNode required; both stamped fields absent from the client; progress counted from completed chapters.
    • M2: the three ways on, and the newcomer hidden at five; the choice decides the arc's kind; POST /arcs refused mid-arc and for a newcomer nobody named.
    • M3: the arrival appends last with a bible and a tie to everyone already there; an unknown archetype is a 400 that writes nothing.
  • Fail-without-fix: the schedule checks, the truth-absence assertion, the arc-kind mapping and the arrival assertions all fail on the pre-change code.
  • format:check, test-catalog-lanes, validate-package-locales and validate-package-locale-keys pass. validate-catalog needs the full artifacts set, so CI's Catalog validation runs it.
  • The chapter plan and SFW digests moved once, as the planner's prompt did; the header note says so.
  • Dottore's review of the M1 commit was addressed in ba8f614dc (repeat history, one piece per love interest, ending position, blank label, README claim) and 492591a70 (a locale key).

Please verify by hand:

  • Manually verify a new story plans an arc and the Story screen shows "Arc … · chapter 1 of N".
  • Manually verify the scheduled reveal chapter says it and no earlier scene does.
  • Manually verify an arc's last chapter offers the three ways, and each one plans a different kind of arc.
  • Manually verify "Meet someone new" with a card and with an invented name, and that the next chapter puts them in a room with another love interest.
  • Manually verify the option is gone at a full cast of five.
  • Manually verify a run made before this update keeps playing and starts its first arc at the next chapter.

Documentation impact

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

UI evidence (if applicable)

The Story screen gains an arc line and, at an arc's end, a three-button card; the newcomer opens a dialog with a card list or a name field.

Owner: @SpicyMarinara (made by Claude).

🤖 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/1985 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/otome-story-arcs-m1` --- ### 📝 Commits (9) - [`c4bcc58`](https://github.com/Pasta-Devs/Marinara-Agents/commit/c4bcc586bf2304a23164cab06320cbd39c771eb8) feat(otome-forge): story arcs, with the mystery's answer on a schedule (#1980, M1) - [`ba8f614`](https://github.com/Pasta-Devs/Marinara-Agents/commit/ba8f614dce17c7689ddd963219f46ee11d728ddc) fix(otome-forge): the arc's repeat checks read the run's history; one piece per love interest per arc - [`492591a`](https://github.com/Pasta-Devs/Marinara-Agents/commit/492591a704815e0c97c54354b804e9aee442530c) fix(otome-forge): the arc line reads its own locale key - [`661ad69`](https://github.com/Pasta-Devs/Marinara-Agents/commit/661ad69b08425835f13af2e268c181badfb1f3a5) feat(otome-forge): the end-of-arc choice, breathing arcs, and a love interest who arrives (#1983 M2, M3) - [`9bf8dcb`](https://github.com/Pasta-Devs/Marinara-Agents/commit/9bf8dcbb0fbf4d11f18b095fd85c10d22c323399) test(otome-forge): pin the newcomer's arrival and the refused arrival - [`65d2267`](https://github.com/Pasta-Devs/Marinara-Agents/commit/65d22678168d9250188adee726317fa17d3e3e0e) docs(otome-forge): the chapter list does not name each chapter's arc yet - [`f3aa0c3`](https://github.com/Pasta-Devs/Marinara-Agents/commit/f3aa0c32abd11e28056a1d6ed7cf4afd4de7d95a) build(otome-forge): ship the 0.6.8 artifact the catalog points at - [`78941b6`](https://github.com/Pasta-Devs/Marinara-Agents/commit/78941b6aa6d3f43a48d0a925b7e3b06014ae78d1) fix(otome-forge): Dottore's five findings on the arc choice and the newcomer - [`1208560`](https://github.com/Pasta-Devs/Marinara-Agents/commit/1208560c8b799d83912ff243bd49efa842c7aac8) Merge branch 'staging' into feat/otome-story-arcs-m1 ### 📊 Changes **36 files changed** (+2318 additions, -312 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/otome-forge-0.6.7.zip` (+0 -0) ➕ `artifacts/otome-forge-0.6.8.zip` (+0 -0) 📝 `catalog/preview/catalog.json` (+8 -8) 📝 `catalog/preview/notes.json` (+12 -12) 📝 `catalog/preview/v2/catalog.json` (+8 -8) 📝 `catalog/preview/v2/notes.json` (+12 -12) 📝 `catalog/preview/v3/catalog.json` (+8 -8) 📝 `catalog/preview/v3/notes.json` (+12 -12) 📝 `packages/otome-forge/CHANGELOG.md` (+9 -0) 📝 `packages/otome-forge/README.md` (+4 -0) 📝 `packages/otome-forge/client.js` (+45 -45) 📝 `packages/otome-forge/manifest.json` (+5 -5) 📝 `packages/otome-forge/server.mjs` (+150 -141) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/locales/en.json` (+53 -33) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/screens/setup/draft.ts` (+7 -3) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/screens/story/StoryHome.tsx` (+194 -0) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/api-types.ts` (+53 -0) ➕ `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/cast.ts` (+7 -0) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/ids.ts` (+3 -0) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/routes/runs.ts` (+1 -2) _...and 16 more files_ </details> ### 📄 Description # Pull request ## Linked issue Closes #1984 Closes #1985 Closes #1986 Refs #1983 ## Why this change Before this, Otome Hearth planned one main chapter at a time. There was no long-term plan, and the mystery's whole truth was handed to *every* chapter planner with the instruction "(never stated outright)", so the mystery raised at setup could never be answered. This PR delivers the first three milestones of #1983 in one release (0.6.8), as the maintainer asked: - **M1 — arcs that land:** a plan of 8–12 chapters with a goal, a big event and a reveal schedule, enforced in code. - **M2 — the end-of-arc choice:** breathing room, the story goes on, or someone new. - **M3 — someone new arrives:** a card of the player's, or one invented, written into the cast and the arc. M4 (polish) follows after this merges. ## What changed ### M1 — the arc itself - **The arc document** (`schemas/story-arc.ts`, `story/arc.ts`, `ids.ts`): one `${R}:arc:<n>` per arc, swept with the run. Chapter numbers stay global; completion and progress are derived from the chapters, never stored. - **The arc planner** (P25): 8–12 chapters with one purpose each, a goal, a big event, an antagonist and 1–4 scheduled reveals. The model gives 1-based positions only; the server stamps every chapter number. It is the only writer that always sees the truth, and it reads what earlier arcs already revealed so a repeat is refused. Output budget 16,000 tokens; purposes capped at 20 words. - **Scheduled reveals** (`story/chapters.ts`, `story/prompts.ts`): the truth now reaches a planner prompt only in the chapter scheduled to reveal it (the route/repair line that always carried it is gone); a scheduled chapter must place the reveal on a node whose cast holds the piece's holder; any other chapter's reveal is dropped; the arc's last chapter must carry the big event in its climax. Chapter plan budget raised from 4,000 to 10,000 tokens. - **Narration:** at a reveal node the narrator gets the piece or the truth, with the same scene-card waiver a route gate already uses. - **Story screen:** "Arc The drowned bell · chapter 4 of 10". ### M2 — the end-of-arc choice - `POST /runs/:run/arcs {choice}` plans the next arc: **breathe** (3–5 chapters, no plot, no reveals, a warm ending), **continue** (another story arc), or **newcomer**. Writing one document keeps it atomic; a repeat call returns the arc already there; 409 while the current arc is unfinished. - The choice decides the arc's kind, so the model cannot make a breathing arc plot-heavy or a story arc silent. - `storyView.arcChoice` offers the three ways exactly when an arc has ended and no next arc exists; `next` is null meanwhile, and `POST /chapters/next` answers 409 "Choose how the story goes on." - The Story screen shows the three explained options and the cost before the tap. ### M3 — someone new - `story/introduce.ts`: a card or an invented love interest writes their unit, their bible (checked against every existing love interest), their ties into `world.web`, and appends them last to the cast order — the arc's first chapter meets them beside at least one of the others. Nothing touches `world.forge.steps`, so a mid-run arrival never drops the player onto a forge screen. - **A refused choice writes no one:** the newcomer is written only after every gate has passed (the first version of this PR wrote them before the arc gate; the test caught it). - Five is the cast's limit; at five the option is hidden and the server refuses it. `LIS_MIN`/`LIS_MAX` moved into `shared/cast.ts` so the client and server cannot drift. - The newcomer dialog offers a card picker or an invented name and archetype. ## Package and security impact - Affected package IDs: `otome-forge` - Engine compatibility impact: none; no new capability, same engine range. - New or changed permissions/entrypoints: none. One new route inside the package's existing prefix (`POST /runs/:run/arcs`). - Restart, storage, update, or uninstall impact: none. Old runs load unchanged and are not migrated; deleting a run removes its arcs. ## 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: - `typecheck-packages.mjs otome-forge`: no errors (86 server/shared, 137 client). - `npm run test:otome-forge`: all pass, including the 17 assertions in `tests/otome-forge-story-arcs.regression.ts`: - M1: the server stamps every chapter number; 8–12 / 3–5 lengths and the 20-word purpose cap; a reveal past the end, twice in one chapter, an old piece, a repeated truth, the truth before its chapter and the same piece twice all refused; a stored arc keeps its range and drops out-of-range reveals; the truth absent from a chapter not scheduled to reveal it and present when it is; a scheduled chapter without `revealNode` refused; a node without the holder refused; an unscheduled `revealNode` dropped; the last chapter's `eventNode` required; both stamped fields absent from the client; progress counted from completed chapters. - M2: the three ways on, and the newcomer hidden at five; the choice decides the arc's kind; `POST /arcs` refused mid-arc and for a newcomer nobody named. - M3: the arrival appends last with a bible and a tie to everyone already there; an unknown archetype is a 400 that writes nothing. - Fail-without-fix: the schedule checks, the truth-absence assertion, the arc-kind mapping and the arrival assertions all fail on the pre-change code. - `format:check`, `test-catalog-lanes`, `validate-package-locales` and `validate-package-locale-keys` pass. `validate-catalog` needs the full artifacts set, so CI's Catalog validation runs it. - The chapter plan and SFW digests moved once, as the planner's prompt did; the header note says so. - Dottore's review of the M1 commit was addressed in `ba8f614dc` (repeat history, one piece per love interest, ending position, blank label, README claim) and `492591a70` (a locale key). Please verify by hand: - [ ] Manually verify a new story plans an arc and the Story screen shows "Arc … · chapter 1 of N". - [ ] Manually verify the scheduled reveal chapter says it and no earlier scene does. - [ ] Manually verify an arc's last chapter offers the three ways, and each one plans a different kind of arc. - [ ] Manually verify "Meet someone new" with a card and with an invented name, and that the next chapter puts them in a room with another love interest. - [ ] Manually verify the option is gone at a full cast of five. - [ ] Manually verify a run made before this update keeps playing and starts its first arc at the next chapter. ## Documentation impact - [x] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) The Story screen gains an arc line and, at an arc's end, a three-button card; the newcomer opens a dialog with a card list or a name field. Owner: @SpicyMarinara (made by Claude). 🤖 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:39:08 +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#2060
No description provided.