[PR #2173] [MERGED] fix(otome-forge): a new arc no longer fails on long purposes or spent reveals (0.13.1) #2168

Closed
opened 2026-11-08 03:50:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/2173
Author: @SpicyMarinara
Created: 11/7/2026
Status: ✅ Merged
Merged: 11/7/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/otome-arc-purpose-words


📝 Commits (4)

  • e35a872 fix(otome-forge): accept long chapter purposes in an arc plan (0.12.1)
  • 47e2d2c Merge origin/staging into fix/otome-arc-purpose-words (0.13.1 after group chat's 0.13.0)
  • 6c846ae fix(otome-forge): a later arc is told which reveals are spent and drops a repeat
  • a4764c7 fix(otome-forge): an arc plan may leave out reveals or the antagonist

📊 Changes

15 files changed (+386 additions, -290 deletions)

View changed files

➕ artifacts/otome-forge-0.13.1.zip (+0 -0)
📝 catalog/catalog.json (+6 -6)
📝 catalog/notes.json (+6 -6)
📝 catalog/v2/catalog.json (+6 -6)
📝 catalog/v2/notes.json (+6 -6)
📝 catalog/v3/catalog.json (+6 -6)
📝 catalog/v3/notes.json (+6 -6)
📝 packages/otome-forge/CHANGELOG.md (+5 -0)
📝 packages/otome-forge/manifest.json (+3 -3)
📝 packages/otome-forge/server.mjs (+143 -143)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/prompts.ts (+36 -17)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/schemas/story-arc.ts (+24 -21)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/story/arc.ts (+2 -13)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/otome-forge-story-arcs.regression.ts (+136 -56)

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #2172

Why this change

Going on with the story in Otome Hearth could fail every time with "The model's reply wasn't in the expected format. Try again." The arc planner refused the whole plan for things the model could not fix in its one repair turn.

  1. Long chapter purposes. This was reported with Opus 5.5 on very high thinking. The planner refused a plan when any chapter purpose ran over 20 words, and the schema refused any purpose over 240 characters. Thinking models often describe a chapter in more than one sentence. The single repair turn rarely shortens all ten or so purposes.
  2. Reveals already spent. The next report was "arc-plan/4 did not match: li-pantalone-9vfg's piece of the mystery was already revealed; schedule another piece". The prompt listed every love interest's piece as hidden, never said whose piece earlier arcs had revealed, and never said the truth was told. The model chose blind. By a later arc every piece may be spent, so "schedule another piece" was impossible while the prompt still asked for 1 to 4 reveals.

What changed

  • Starting a new arc no longer fails on wordy chapter outlines. Longer chapter descriptions are accepted instead of refused. The prompt's request for one short sentence is unchanged.
  • Later arcs no longer fail on mystery reveals you already know. The planner is told what has already been revealed, and a repeated reveal is skipped instead of failing the arc.

In detail (package otome-forge, 0.13.1):

  • normalizeArcPlan no longer rejects a purpose for its word count. The purpose character cap goes from 240 to 1,200, in both the reply schema and the stored arc schema. The unused PURPOSE_WORDS, overLongPurpose and wordCountOf helpers are removed.
  • arcPlanMessages takes the run's revealedSoFar result from planArc. In the prompt:
    • A spent piece is marked "ALREADY REVEALED: the protagonist knows this".
    • A told truth is marked "ALREADY TOLD", and the truth rule says never to schedule it again.
    • When every piece and the truth are spent, reveals asks to be left empty.
  • normalizeArcPlan drops a spent reveal instead of refusing the arc: a piece told in an earlier arc, a told truth, the same piece scheduled twice in one arc, or a second truth. A dropped reveal frees its chapter for another one. Model-fixable rules stay as refusals: a reveal past the arc's end, two reveals in one chapter, an unknown love interest, and the truth's position.
  • ArcPlanSchema accepts a plan that leaves out reveals or antagonist; a missing key means none, as null does. The prompt asks for optional fields to be omitted rather than null, and it now asks for no reveals once everything is spent, so a planner may leave the key out.
  • Generated outputs are rebuilt: packages/otome-forge/client.js, server.mjs and manifest.json, artifacts/otome-forge-0.13.1.zip, and the catalogs. Staging is merged in after #2168.

Package and security impact

  • Affected package IDs: otome-forge (0.13.1)
  • Engine compatibility impact: none; minEngineVersion is unchanged.
  • New or changed permissions/entrypoints: none.
  • Restart, storage, update, or uninstall impact: none. Stored arcs read as before. An arc purpose may now be up to 1,200 characters.

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

Agent runs, for the record (not a substitute for the boxes above):

  • npm run test:otome-forge: 794 passed, 0 failed. New or updated regressions cover:
    • An 81-word purpose plans the arc and is kept whole.
    • Each spent reveal is dropped and the rest of the schedule kept.
    • A dropped reveal frees its chapter.
    • planArc for arc 2 drops a repeated piece and truth, and its prompt marks the truth as told and asks for no reveals.
    • The prompt marks a spent piece, and leaves reveals empty only when nothing is left.
    • A plan with no reveals or antagonist key plans the arc, including a breathing arc.
  • node scripts/typecheck-packages.mjs otome-forge: clean.
  • ESLint and Prettier on the changed sources: clean.
  • Local CodeRabbit:
    • First pass: 0 findings.
    • After the reveal fix: 1 minor finding, dismissed. It asks to reword the prompt line "Every purpose over 20 words is refused", since long purposes are now kept. The maintainer asked to leave the prompt unchanged for this patch. The line still nudges the planner toward short purposes, and nothing now fails when one runs long.
  • Independent review (3 lenses, each finding verified separately): 12 claims raised, none confirmed. Each was pre-existing, still repairable by the retry, or a test-coverage gap only. One related risk was fixed anyway: a plan that omits reveals or antagonist, now accepted.

Manual verification notes

  • Manually verify: with a thinking model on high effort, finish an arc's last chapter and choose to go on with the story. The next arc should start with no format error.
  • Manually verify: in a run where earlier arcs already revealed some love interests' pieces, turn on debug mode and start the next arc. In the logged prompt, those pieces should read "ALREADY REVEALED", and the arc should start.
  • Manually verify: after the new arc starts, open the story view. The current chapter's purpose should read correctly, even if it is long.

Documentation impact

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

The package changelog (packages/otome-forge/CHANGELOG.md) has the 0.13.1 entry.

UI evidence (if applicable)

No UI change.

🤖 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/2173 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 11/7/2026 **Status:** ✅ Merged **Merged:** 11/7/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/otome-arc-purpose-words` --- ### 📝 Commits (4) - [`e35a872`](https://github.com/Pasta-Devs/Marinara-Agents/commit/e35a872616df621604de22bde70d212981a0b42e) fix(otome-forge): accept long chapter purposes in an arc plan (0.12.1) - [`47e2d2c`](https://github.com/Pasta-Devs/Marinara-Agents/commit/47e2d2cd2877709fde56341fbb9419d81916aea2) Merge origin/staging into fix/otome-arc-purpose-words (0.13.1 after group chat's 0.13.0) - [`6c846ae`](https://github.com/Pasta-Devs/Marinara-Agents/commit/6c846ae4928758faf488d50c990fb57f2961fd12) fix(otome-forge): a later arc is told which reveals are spent and drops a repeat - [`a4764c7`](https://github.com/Pasta-Devs/Marinara-Agents/commit/a4764c7a0c05159ddb0b9f7bb644cde5ed87fb2b) fix(otome-forge): an arc plan may leave out reveals or the antagonist ### 📊 Changes **15 files changed** (+386 additions, -290 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/otome-forge-0.13.1.zip` (+0 -0) 📝 `catalog/catalog.json` (+6 -6) 📝 `catalog/notes.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+6 -6) 📝 `catalog/v2/notes.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+6 -6) 📝 `catalog/v3/notes.json` (+6 -6) 📝 `packages/otome-forge/CHANGELOG.md` (+5 -0) 📝 `packages/otome-forge/manifest.json` (+3 -3) 📝 `packages/otome-forge/server.mjs` (+143 -143) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/prompts.ts` (+36 -17) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/schemas/story-arc.ts` (+24 -21) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/story/arc.ts` (+2 -13) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/otome-forge-story-arcs.regression.ts` (+136 -56) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #2172 ## Why this change Going on with the story in Otome Hearth could fail every time with "The model's reply wasn't in the expected format. Try again." The arc planner refused the whole plan for things the model could not fix in its one repair turn. 1. **Long chapter purposes.** This was reported with Opus 5.5 on very high thinking. The planner refused a plan when any chapter purpose ran over 20 words, and the schema refused any purpose over 240 characters. Thinking models often describe a chapter in more than one sentence. The single repair turn rarely shortens all ten or so purposes. 2. **Reveals already spent.** The next report was "arc-plan/4 did not match: li-pantalone-9vfg's piece of the mystery was already revealed; schedule another piece". The prompt listed every love interest's piece as hidden, never said whose piece earlier arcs had revealed, and never said the truth was told. The model chose blind. By a later arc every piece may be spent, so "schedule another piece" was impossible while the prompt still asked for 1 to 4 reveals. ## What changed - **Starting a new arc no longer fails on wordy chapter outlines.** Longer chapter descriptions are accepted instead of refused. The prompt's request for one short sentence is unchanged. - **Later arcs no longer fail on mystery reveals you already know.** The planner is told what has already been revealed, and a repeated reveal is skipped instead of failing the arc. In detail (package `otome-forge`, 0.13.1): - `normalizeArcPlan` no longer rejects a purpose for its word count. The purpose character cap goes from 240 to 1,200, in both the reply schema and the stored arc schema. The unused `PURPOSE_WORDS`, `overLongPurpose` and `wordCountOf` helpers are removed. - `arcPlanMessages` takes the run's `revealedSoFar` result from `planArc`. In the prompt: - A spent piece is marked "ALREADY REVEALED: the protagonist knows this". - A told truth is marked "ALREADY TOLD", and the truth rule says never to schedule it again. - When every piece and the truth are spent, `reveals` asks to be left empty. - `normalizeArcPlan` drops a spent reveal instead of refusing the arc: a piece told in an earlier arc, a told truth, the same piece scheduled twice in one arc, or a second truth. A dropped reveal frees its chapter for another one. Model-fixable rules stay as refusals: a reveal past the arc's end, two reveals in one chapter, an unknown love interest, and the truth's position. - `ArcPlanSchema` accepts a plan that leaves out `reveals` or `antagonist`; a missing key means none, as null does. The prompt asks for optional fields to be omitted rather than null, and it now asks for no reveals once everything is spent, so a planner may leave the key out. - Generated outputs are rebuilt: `packages/otome-forge/client.js`, `server.mjs` and `manifest.json`, `artifacts/otome-forge-0.13.1.zip`, and the catalogs. Staging is merged in after #2168. ## Package and security impact - Affected package IDs: `otome-forge` (0.13.1) - Engine compatibility impact: none; `minEngineVersion` is unchanged. - New or changed permissions/entrypoints: none. - Restart, storage, update, or uninstall impact: none. Stored arcs read as before. An arc purpose may now be up to 1,200 characters. ## 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` Agent runs, for the record (not a substitute for the boxes above): - `npm run test:otome-forge`: 794 passed, 0 failed. New or updated regressions cover: - An 81-word purpose plans the arc and is kept whole. - Each spent reveal is dropped and the rest of the schedule kept. - A dropped reveal frees its chapter. - `planArc` for arc 2 drops a repeated piece and truth, and its prompt marks the truth as told and asks for no reveals. - The prompt marks a spent piece, and leaves `reveals` empty only when nothing is left. - A plan with no `reveals` or `antagonist` key plans the arc, including a breathing arc. - `node scripts/typecheck-packages.mjs otome-forge`: clean. - ESLint and Prettier on the changed sources: clean. - Local CodeRabbit: - First pass: 0 findings. - After the reveal fix: 1 minor finding, dismissed. It asks to reword the prompt line "Every purpose over 20 words is refused", since long purposes are now kept. The maintainer asked to leave the prompt unchanged for this patch. The line still nudges the planner toward short purposes, and nothing now fails when one runs long. - Independent review (3 lenses, each finding verified separately): 12 claims raised, none confirmed. Each was pre-existing, still repairable by the retry, or a test-coverage gap only. One related risk was fixed anyway: a plan that omits `reveals` or `antagonist`, now accepted. ### Manual verification notes - Manually verify: with a thinking model on high effort, finish an arc's last chapter and choose to go on with the story. The next arc should start with no format error. - Manually verify: in a run where earlier arcs already revealed some love interests' pieces, turn on debug mode and start the next arc. In the logged prompt, those pieces should read "ALREADY REVEALED", and the arc should start. - Manually verify: after the new arc starts, open the story view. The current chapter's purpose should read correctly, even if it is long. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation The package changelog (`packages/otome-forge/CHANGELOG.md`) has the 0.13.1 entry. ## UI evidence (if applicable) No UI change. 🤖 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 changed title from [PR #2173] fix(otome-forge): a new arc no longer fails on long purposes or spent reveals (0.13.1) to [PR #2173] [MERGED] fix(otome-forge): a new arc no longer fails on long purposes or spent reveals (0.13.1) 2026-11-08 04:53:06 +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#2168
No description provided.