[PR #2053] [MERGED] feat(otome-forge): a chapter may close on a judgment the player can get wrong (0.6.21) #2091

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

📋 Pull Request Information

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

Base: staging ← Head: feat/otome-judgment-choices-2047


📝 Commits (4)

  • 3b90055 feat(otome-forge): an arc may close a chapter on a judgment the player can get wrong
  • 4760095 chore(otome-forge): release 0.6.21
  • 61172a2 fix(otome-forge): a listed chapter leaves its end free for the judgment, and the arc names its answer
  • e2fc983 Merge staging (0.6.20) into feat/otome-judgment-choices-2047; rebuild 0.6.21

📊 Changes

18 files changed (+595 additions, -176 deletions)

View changed files

➕ artifacts/otome-forge-0.6.21.zip (+0 -0)
📝 catalog/preview/catalog.json (+6 -6)
📝 catalog/preview/notes.json (+6 -6)
📝 catalog/preview/v2/catalog.json (+6 -6)
📝 catalog/preview/v2/notes.json (+6 -6)
📝 catalog/preview/v3/catalog.json (+6 -6)
📝 catalog/preview/v3/notes.json (+6 -6)
📝 packages/otome-forge/CHANGELOG.md (+4 -0)
📝 packages/otome-forge/manifest.json (+3 -3)
📝 packages/otome-forge/server.mjs (+127 -127)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/api-types.ts (+13 -0)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/schemas/story-arc.ts (+50 -2)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/schemas/story.ts (+5 -0)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/story/arc.ts (+6 -3)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/story/chapters.ts (+41 -1)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/story/prompts.ts (+21 -1)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/otome-forge-story-arcs.regression.ts (+288 -2)

📄 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 #2047

Why this change

The maintainer hadn't had an end-of-chapter big choice in six chapters. They asked that those choices can also be judgments the player may get wrong:

  • solving a mystery;
  • naming a traitor;
  • deciding whom to believe.

The true answer should always be among the options, and a wrong guess plays out in the arc.

A narrator-only prompt line can't promise that. The scene writer never sees the mystery's hidden truth; only the arc planner does. So the line could produce a judgment with no correct option. The maintainer chose to let the arc planner list the suspects. They also asked that an arc with no such question never gets one, and that the model knows the judgment is optional.

What changed

Package: otome-forge (Otome Hearth) 0.6.21. sources/forge-kit and Gacha Forge are untouched.

  • Arc planner (story/arc.ts): a new, optional judgment field: a short question, 2 to 4 plausible answers worded the same way, and the 1-based chapters whose end may close on it.
    • The prompt says the true answer, the one its hidden truth, reveals and ending make true, is always among the answers and never marked.
    • Only chapters where the clues allow a real guess are listed, and only before a reveal or the ending answers the question.
    • Later purposes must hold either way.
    • The true answer must be named in endsWith.what or in the reveal that answers it, since later writers see only those. When neither the hidden truth nor the ending answers the question, the judgment is omitted. Without this, an arc-local answer (a traitor in arc 2) lived only in the planner's head. The arc's last chapter would then settle the culprit after the pick, most likely matching it, so the player could never be wrong.
    • It's never used in a breathing arc, and "never invented to fill the field: when the arc has no such question, omit judgment."
  • Validation (schemas/story-arc.ts, judgmentOf): a judgment is dropped, never retried, when it breaks a rule:
    • no question, or a question over 300 characters;
    • fewer than 2 or more than 4 answers, an empty answer, an answer over 160 characters, or duplicate answers;
    • no listed chapter left inside the arc and before the truth's chapter.
    • The answers are sorted, so their order gives nothing away. Which answer is true is never stored.
  • Chapter planning (story/chapters.ts, judgmentFor):
    • A listed chapter's last node carries only the question and the answers.
    • The chapter planner of a listed chapter is told only that its end may close on a judgment the narrator may choose, so it puts the climax second-to-last. A climax-last plan has no big choice at its end and would silently drop the judgment. It never sees the question or the truth.
    • Once a listed chapter ends on a picked big choice, the judgment is spent for the arc.
    • A ponytail: comment notes the ceiling: any picked big choice on that node spends it, because a beat doesn't record which kind of big choice it was.
  • Narrator (story/prompts.ts): on such a node, after the existing "make it a different kind of decision" line, one more line:
    • the big choice MAY be this judgment, with exactly one option per answer;
    • one answer is true, and neither the narrator nor the protagonist is told which, so nothing hints at it;
    • whatever the player picks is canon;
    • "This is optional: a different kind of big choice, or none, is just as good."
  • Player view: toArcView and the client never see the judgment.

Release: 0.6.21 with a CHANGELOG entry. The rebuilt server.mjs, manifest, preview catalogs and artifacts/otome-forge-0.6.21.zip agree.

This PR and #2052 (0.6.20) both change the release files. Whichever merges second is rebased and rebuilt on the other.

Package and security impact

  • Affected package IDs: otome-forge (0.6.19 → 0.6.21).
  • Engine compatibility impact: none.
  • New or changed permissions/entrypoints: none.
  • Restart, storage, update, or uninstall impact:
    • Arcs planned from now on may carry an optional judgment. Arcs already planned have none and play as before.
    • Saved nodes gain an optional judgment field; older saves read unchanged.

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

What the agent ran locally:

  • Regression suites: all 593 Otome TypeScript regressions and 12 .mjs regressions pass.
  • Typecheck: 0 strict errors in 88 server and 139 client files.
  • Other checks: git diff --check passes.
  • New proofs in tests/otome-forge-story-arcs.regression.ts:
    • an arc keeps a valid judgment, with its chapters before the truth, and drops a broken one without refusing the arc;
    • the arc planner is told the judgment is optional, only for a real mystery, and never in a breathing arc;
    • the last node of a listed chapter may close on it, with every answer, the optional wording and no hint of the truth;
    • a chapter in an arc without a judgment, or one not listed for it, gets no line at all;
    • a judgment already asked is not offered again in the arc;
    • POST /chapters/next stamps the arc's judgment on a listed chapter's last node, and the player never sees it. The chapter planner's prompt says the end may close on one, without the question;
    • the chapter planner of a listed chapter is told to leave its last node free for a big choice, and an unlisted chapter isn't;
    • the arc planner is told to name the true answer in endsWith.what or in the reveal that answers it.
    • The last three assertions fail with the source change reverted.
  • Independent review: a review workflow had two agents look for defects, one tracing the data flow and one reading the prompts, with a skeptic checking each finding. Two were confirmed, a climax-last plan dropping the judgment and an arc-local answer never being written down, and both are fixed above. A probe through the real routes reproduced the first. Three were refuted:
    • a later arc re-asking an answered judgment: the irrevocable decisions block tells the arc planner;
    • a judgment after a truth-less ending;
    • the planner not seeing earlier judgments.
  • Local CodeRabbit: one finding, not changed. It (major) asked code to check that the true answer is among the planner's answers. The truth is free text that only the arc planner sees, so code can't compare it with the answers. The planner is told the true one is always among them. The maintainer decided that this is up to the model.

For a human to verify:

  • Start a new story arc on a world with a mystery. With debug prompt logging on, manually verify the arc plan's JSON may include a judgment whose answers include the arc's real answer.
  • Play to the end of a listed chapter. Manually verify that the closing big choice, when the model picks the judgment, offers one option per answer, with nothing hinting which is right.
  • Pick a wrong answer. Manually verify the next chapters play it out as canon and later chapters don't offer the judgment again.
  • On a breathing arc, or an arc with no mystery, manually verify no chapter offers a judgment.

Documentation impact

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

The package CHANGELOG describes the 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/2053 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/otome-judgment-choices-2047` --- ### 📝 Commits (4) - [`3b90055`](https://github.com/Pasta-Devs/Marinara-Agents/commit/3b90055ef60d71c429e4fab49d54e6acb33d8769) feat(otome-forge): an arc may close a chapter on a judgment the player can get wrong - [`4760095`](https://github.com/Pasta-Devs/Marinara-Agents/commit/47600952f8553738345a6151164d18f3646cbb52) chore(otome-forge): release 0.6.21 - [`61172a2`](https://github.com/Pasta-Devs/Marinara-Agents/commit/61172a2dd41ffee1d49bffd79cb7309fb00b424e) fix(otome-forge): a listed chapter leaves its end free for the judgment, and the arc names its answer - [`e2fc983`](https://github.com/Pasta-Devs/Marinara-Agents/commit/e2fc98381984e19280c4d30f6766fd00870256cd) Merge staging (0.6.20) into feat/otome-judgment-choices-2047; rebuild 0.6.21 ### 📊 Changes **18 files changed** (+595 additions, -176 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/otome-forge-0.6.21.zip` (+0 -0) 📝 `catalog/preview/catalog.json` (+6 -6) 📝 `catalog/preview/notes.json` (+6 -6) 📝 `catalog/preview/v2/catalog.json` (+6 -6) 📝 `catalog/preview/v2/notes.json` (+6 -6) 📝 `catalog/preview/v3/catalog.json` (+6 -6) 📝 `catalog/preview/v3/notes.json` (+6 -6) 📝 `packages/otome-forge/CHANGELOG.md` (+4 -0) 📝 `packages/otome-forge/manifest.json` (+3 -3) 📝 `packages/otome-forge/server.mjs` (+127 -127) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/api-types.ts` (+13 -0) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/schemas/story-arc.ts` (+50 -2) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/schemas/story.ts` (+5 -0) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/story/arc.ts` (+6 -3) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/story/chapters.ts` (+41 -1) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/story/prompts.ts` (+21 -1) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/otome-forge-story-arcs.regression.ts` (+288 -2) </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 #2047 ## Why this change The maintainer hadn't had an end-of-chapter big choice in six chapters. They asked that those choices can also be **judgments the player may get wrong**: - solving a mystery; - naming a traitor; - deciding whom to believe. The true answer should always be among the options, and a wrong guess plays out in the arc. A narrator-only prompt line can't promise that. The scene writer never sees the mystery's hidden truth; only the arc planner does. So the line could produce a judgment with no correct option. The maintainer chose to let **the arc planner list the suspects**. They also asked that an arc with no such question never gets one, and that the model knows the judgment is optional. ## What changed Package: `otome-forge` (Otome Hearth) **0.6.21**. `sources/forge-kit` and Gacha Forge are untouched. - **Arc planner (`story/arc.ts`):** a new, **optional** `judgment` field: a short question, 2 to 4 plausible answers worded the same way, and the 1-based chapters whose end may close on it. - The prompt says the true answer, the one its hidden truth, reveals and ending make true, is always among the answers and never marked. - Only chapters where the clues allow a real guess are listed, and only before a reveal or the ending answers the question. - Later purposes must hold either way. - The true answer must be named in `endsWith.what` or in the reveal that answers it, since later writers see only those. When neither the hidden truth nor the ending answers the question, the judgment is omitted. Without this, an arc-local answer (a traitor in arc 2) lived only in the planner's head. The arc's last chapter would then settle the culprit after the pick, most likely matching it, so the player could never be wrong. - It's never used in a breathing arc, and "never invented to fill the field: when the arc has no such question, omit judgment." - **Validation (`schemas/story-arc.ts`, `judgmentOf`):** a judgment is dropped, never retried, when it breaks a rule: - no question, or a question over 300 characters; - fewer than 2 or more than 4 answers, an empty answer, an answer over 160 characters, or duplicate answers; - no listed chapter left inside the arc and before the truth's chapter. - The answers are sorted, so their order gives nothing away. Which answer is true is never stored. - **Chapter planning (`story/chapters.ts`, `judgmentFor`):** - A listed chapter's last node carries only the question and the answers. - The chapter planner of a listed chapter is told only that its end may close on a judgment the narrator may choose, so it puts the climax second-to-last. A climax-last plan has no big choice at its end and would silently drop the judgment. It never sees the question or the truth. - Once a listed chapter ends on a picked big choice, the judgment is spent for the arc. - A `ponytail:` comment notes the ceiling: any picked big choice on that node spends it, because a beat doesn't record which kind of big choice it was. - **Narrator (`story/prompts.ts`):** on such a node, after the existing "make it a different kind of decision" line, one more line: - the big choice MAY be this judgment, with exactly one option per answer; - one answer is true, and neither the narrator nor the protagonist is told which, so nothing hints at it; - whatever the player picks is canon; - "This is optional: a different kind of big choice, or none, is just as good." - **Player view:** `toArcView` and the client never see the judgment. **Release:** 0.6.21 with a CHANGELOG entry. The rebuilt `server.mjs`, manifest, preview catalogs and `artifacts/otome-forge-0.6.21.zip` agree. This PR and #2052 (0.6.20) both change the release files. Whichever merges second is rebased and rebuilt on the other. ## Package and security impact - Affected package IDs: `otome-forge` (0.6.19 → 0.6.21). - Engine compatibility impact: none. - New or changed permissions/entrypoints: none. - Restart, storage, update, or uninstall impact: - Arcs planned from now on may carry an optional `judgment`. Arcs already planned have none and play as before. - Saved nodes gain an optional `judgment` field; older saves read unchanged. ## 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 What the agent ran locally: - **Regression suites:** all 593 Otome TypeScript regressions and 12 `.mjs` regressions pass. - **Typecheck:** 0 strict errors in 88 server and 139 client files. - **Other checks:** `git diff --check` passes. - **New proofs in `tests/otome-forge-story-arcs.regression.ts`:** - an arc keeps a valid judgment, with its chapters before the truth, and drops a broken one without refusing the arc; - the arc planner is told the judgment is optional, only for a real mystery, and never in a breathing arc; - the last node of a listed chapter may close on it, with every answer, the optional wording and no hint of the truth; - a chapter in an arc without a judgment, or one not listed for it, gets no line at all; - a judgment already asked is not offered again in the arc; - `POST /chapters/next` stamps the arc's judgment on a listed chapter's last node, and the player never sees it. The chapter planner's prompt says the end may close on one, without the question; - the chapter planner of a listed chapter is told to leave its last node free for a big choice, and an unlisted chapter isn't; - the arc planner is told to name the true answer in `endsWith.what` or in the reveal that answers it. - The last three assertions fail with the source change reverted. - **Independent review:** a review workflow had two agents look for defects, one tracing the data flow and one reading the prompts, with a skeptic checking each finding. Two were confirmed, a climax-last plan dropping the judgment and an arc-local answer never being written down, and both are fixed above. A probe through the real routes reproduced the first. Three were refuted: - a later arc re-asking an answered judgment: the irrevocable decisions block tells the arc planner; - a judgment after a truth-less ending; - the planner not seeing earlier judgments. - **Local CodeRabbit:** one finding, not changed. It (major) asked code to check that the true answer is among the planner's answers. The truth is free text that only the arc planner sees, so code can't compare it with the answers. The planner is told the true one is always among them. The maintainer decided that this is up to the model. For a human to verify: - Start a new story arc on a world with a mystery. With debug prompt logging on, manually verify the arc plan's JSON may include a `judgment` whose answers include the arc's real answer. - Play to the end of a listed chapter. Manually verify that the closing big choice, when the model picks the judgment, offers one option per answer, with nothing hinting which is right. - Pick a wrong answer. Manually verify the next chapters play it out as canon and later chapters don't offer the judgment again. - On a breathing arc, or an arc with no mystery, manually verify no chapter offers a judgment. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation The package CHANGELOG describes the 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 2026-11-07 16:39: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#2091
No description provided.