[PR #8671] [MERGED] feat(scene): lasting facts, story direction and opening moment (scenario setup 3) #8737

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8671
Author: @Gunterlie
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @Gunterlie

Base: scenarios-for-hoes ← Head: scenarios/03-facts-direction


📝 Commits (3)

  • 7d6547b feat(scene): keep lasting facts apart from story direction in scenario drafts
  • b3b4b67 feat(chat): story direction field in the scenario step
  • cb58824 fix(scene): keep the user's story direction when revising

📊 Changes

7 files changed (+98 additions, -17 deletions)

View changed files

📝 packages/client/src/components/chat/ChatSetupWizard.tsx (+34 -7)
📝 packages/client/src/localization/locales/en.json (+2 -0)
📝 packages/server/src/routes/scene.routes.ts (+21 -9)
📝 packages/shared/src/index.ts (+1 -0)
📝 packages/shared/src/types/scene.ts (+3 -0)
➕ packages/shared/src/utils/scenario-text.ts (+6 -0)
📝 scripts/regressions/scene-scenario-draft.regression.ts (+31 -1)

📄 Description

Why

PR 2 saves the drafted premise as the chat's scenario for the whole chat. When the premise described the starting event ("we are stuck in an elevator") or a wish for the story ("slow-burn romance"), the model treated both as permanent facts: characters stayed stuck in the opening situation, or acted as if the romance already existed.

This is part 3 of the scenario setup feature; it merges into the feature branch scenarios-for-hoes. Planned work, no linked issue.

What changed

  • Premise = lasting facts only (setting, who the characters are to each other, shared history). The draft prompt now forbids the current scene/event in the premise; the starting moment belongs only in the opening.
  • New optional story direction: wishes for how the story may develop (tone, pacing, where it may go), written as preferences. SceneScenarioDraft.direction (may be empty); the parser defaults it to "".
  • Wizard: a third editable field "Story direction (optional)" with a hint, under the premise.
  • Storage, no new field: composeScenarioText(premise, direction) (new, packages/shared/src/utils/scenario-text.ts) saves the premise plus, only when a direction is set, a labelled block:
    [Story direction — preferences for how the story may develop, not established facts: …]
    Both wizards use it. No prompt assembly code changed.
  • Revise rules: a new opening keeps premise and direction byte-identical, and the prompt says not to act the direction out in the opening. A new premise keeps the opening byte-identical and keeps the user's direction unless the revision note asks to change it.
  • revise.current.direction is optional (old clients keep working); when present it must be text ≤ 8000 characters.

Validation

  • pnpm check passed (before the last prompt-only fix); after it: server tsc passed, Prettier passed, regression passed.
  • scripts/regressions/scene-scenario-draft.regression.ts extended: missing/empty direction, revise byte-identity in both directions, composeScenarioText with no / whitespace / set direction. It fails without the server change.
  • pnpm localization:check passed.
  • Browser proof with the draft route mocked: three fields shown; Start saves the composed text; empty direction saves the premise only.
  • Local CodeRabbit: 0 findings.
  • Opus review: no blockers. Fixed: "New premise" no longer drops a typed direction; the opening revise no longer pushes the direction into the opening. Not changed (harmless): the video clip writer and gallery metadata read groupScenarioText raw, so they also see the direction block.

Manual verification

  • Draft against a real model with an idea that contains a starting event and a wish (e.g. "stuck in an elevator, slow burn"); check the event lands in the opening and the wish in the direction, not in the premise.
  • Play a few turns; check the characters move on from the opening situation.
  • Type a direction, press "New premise"; check the direction stays.

🔄 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-Engine/pull/8671 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `scenarios-for-hoes` ← **Head:** `scenarios/03-facts-direction` --- ### 📝 Commits (3) - [`7d6547b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7d6547b24e678e3cc88de74d7b0963bb047ac154) feat(scene): keep lasting facts apart from story direction in scenario drafts - [`b3b4b67`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b3b4b67d963cbe07dfc460a308112178dca8b76f) feat(chat): story direction field in the scenario step - [`cb58824`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cb588247448b1fbeac901526bbb34ce0a10ddfec) fix(scene): keep the user's story direction when revising ### 📊 Changes **7 files changed** (+98 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatSetupWizard.tsx` (+34 -7) 📝 `packages/client/src/localization/locales/en.json` (+2 -0) 📝 `packages/server/src/routes/scene.routes.ts` (+21 -9) 📝 `packages/shared/src/index.ts` (+1 -0) 📝 `packages/shared/src/types/scene.ts` (+3 -0) ➕ `packages/shared/src/utils/scenario-text.ts` (+6 -0) 📝 `scripts/regressions/scene-scenario-draft.regression.ts` (+31 -1) </details> ### 📄 Description ## Why PR 2 saves the drafted premise as the chat's scenario for the whole chat. When the premise described the starting event ("we are stuck in an elevator") or a wish for the story ("slow-burn romance"), the model treated both as permanent facts: characters stayed stuck in the opening situation, or acted as if the romance already existed. This is **part 3** of the scenario setup feature; it merges into the feature branch `scenarios-for-hoes`. Planned work, no linked issue. ## What changed - **Premise = lasting facts only** (setting, who the characters are to each other, shared history). The draft prompt now forbids the current scene/event in the premise; the starting moment belongs only in the opening. - **New optional story direction**: wishes for how the story may develop (tone, pacing, where it may go), written as preferences. `SceneScenarioDraft.direction` (may be empty); the parser defaults it to `""`. - **Wizard**: a third editable field "Story direction (optional)" with a hint, under the premise. - **Storage, no new field**: `composeScenarioText(premise, direction)` (new, `packages/shared/src/utils/scenario-text.ts`) saves the premise plus, only when a direction is set, a labelled block: `[Story direction — preferences for how the story may develop, not established facts: …]` Both wizards use it. No prompt assembly code changed. - **Revise rules**: a new opening keeps premise and direction byte-identical, and the prompt says not to act the direction out in the opening. A new premise keeps the opening byte-identical and keeps the user's direction unless the revision note asks to change it. - `revise.current.direction` is optional (old clients keep working); when present it must be text ≤ 8000 characters. ## Validation - `pnpm check` passed (before the last prompt-only fix); after it: server `tsc` passed, Prettier passed, regression passed. - `scripts/regressions/scene-scenario-draft.regression.ts` extended: missing/empty direction, revise byte-identity in both directions, `composeScenarioText` with no / whitespace / set direction. It fails without the server change. - `pnpm localization:check` passed. - Browser proof with the draft route mocked: three fields shown; Start saves the composed text; empty direction saves the premise only. - Local CodeRabbit: 0 findings. - Opus review: no blockers. Fixed: "New premise" no longer drops a typed direction; the opening revise no longer pushes the direction into the opening. Not changed (harmless): the video clip writer and gallery metadata read `groupScenarioText` raw, so they also see the direction block. ## Manual verification - [ ] Draft against a real model with an idea that contains a starting event and a wish (e.g. "stuck in an elevator, slow burn"); check the event lands in the opening and the wish in the direction, not in the premise. - [ ] Play a few turns; check the characters move on from the opening situation. - [ ] Type a direction, press "New premise"; check the direction stays. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:39:21 +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-Engine#8737
No description provided.