mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1796] Restore roleplay scene planner grounding and background validation #878
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#878
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Xelvanis on GitHub (Jun 1, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1796
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Roleplay scene planning appears to have lost important grounding from the legacy implementation. The current planner mostly gives the model selected character IDs, recent conversation, and the user request, but it does not appear to provide selected character card context, active persona context, or the real list of available backgrounds.
This can produce weaker scene openings, mismatched POV/persona grounding, and invalid background filenames even though the scene plan contract says
backgroundshould be a filename from the available list ornull.Evidence
Current refactor path:
src/engine/modes/roleplay/scene/scene-service.ts:46definesplanRoleplayScene.src/engine/modes/roleplay/scene/scene-service.ts:65builds recent history from recent chat messages.src/engine/modes/roleplay/scene/scene-service.ts:84builds a planner prompt around scene JSON, IDs, and recent conversation.src/engine/modes/roleplay/scene/scene-service.ts:396sanitizesbackgroundbut accepts any non-null string.src/engine/contracts/types/scene.ts:46documentsbackgroundas a filename from the available list ornull.Legacy behavior had more grounding:
packages/server/src/routes/scene.routes.ts:721loaded character and persona context before planning.packages/server/src/routes/scene.routes.ts:726loaded available backgrounds and told the planner to choose from that list or usenull.packages/server/src/routes/scene.routes.ts:739included character, persona, available character IDs, backgrounds, and recent conversation in the prompt.packages/server/src/routes/scene.routes.ts:843validated the chosen background against the available background list before returning the plan.Related quality gap:
src/engine/modes/roleplay/scene/scene-service.ts:317summarizes concluded scenes with a much more generic transcript-based prompt.Expected behavior
Scene planning should have enough context to produce a grounded scene setup:
backgroundis either an exact available filename ornullnullScene conclusion summaries should also use the relevant scene, character, and persona context so character scene memories remain high quality.
Suggested fix
planRoleplaySceneand include it in the planner prompt.summarizeScenewith the scene metadata and selected character/persona context.Acceptance criteria
SceneFullPlan.backgroundcannot contain arbitrary or unavailable filenames.@SpicyMarinara commented on GitHub (Jun 1, 2026):
On it, queen.
@SpicyMarinara commented on GitHub (Jun 1, 2026):
Fixed on
refactorina2461f33.\n\nWhat changed:\n- Restored scene planner grounding with selected character card context, active persona context, and available background filenames.\n- Enforced exact background filename validation during planning and scene creation, including connected-command overrides.\n- Enriched concluded scene summaries with scene metadata, date, selected character context, persona context, and transcript grounding.\n- Wired the visual asset gateway through roleplay hooks, slash commands, and connected command scene creation without breaking engine/shared API boundaries.\n\nVerification:\n-pnpm typecheck\n-pnpm check:architecture\n-git diff --check