mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6180] An Experience-owned Game narrates its opening turn before the Experience has built its world #3442
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#3442
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 @kolacheee on GitHub (Sep 14, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6180
Originally assigned to: @SpicyMarinara on GitHub.
When a Game chat is owned by an Experience package such as Pixelforge, the Engine shows its own Start Game screen and streams the Game Master's opening turn before the Experience surface has mounted at all. The surface, and with it the package's world-building call, only starts after the player presses Continue on the intro. So the Game Master narrates an opening about a settlement, its people and its places, and the tile world that is supposed to be that settlement is designed afterwards by a separate call that never sees the opening it has to live up to.
How to reproduce (try it yourself)
What you'll see: The opening narration comes first and the world comes second, with a long wait between them. The two were produced by two different model calls with two different inputs, so the names and places in the narration and the names and places in the world can disagree, and a player who reads the intro then walks into a village that does not match it has no way to know which one the game means. It only happens on a chat's first visit; a returning player never sees the intro again.
What should happen: For a chat an Experience owns, the Experience's world should exist before the Game Master narrates it, or the Engine should let the Experience decide when the game starts.
Where it is
packages/client/src/components/game/GameSurface.tsxat stagingf2219d815. The intro early return is lines 10920 to 10926:None of those terms consults
experienceOwnsGame, which is defined at line 2332 and first used at line 12111. The Experience surface mounts at line 11513, gated onexperienceSurfaceActive(line 2324), far below the early return, so nothing from the package renders until the return stops firing.introPresentedhas four sources at lines 3296 to 3300; on a brand new chat all four are false, and the only one this flow sets is thegameIntroPresented: truePATCH sent from the Continue handler at line 10992.On the server side,
/game/setupwritesgameSessionStatus: "ready"atpackages/server/src/routes/game.routes.ts:6050, and/game/startwrites"active"at lines 7063 and 7082 while streaming the first Game Master turn.On the package side, Pixelforge arms its loading gate and starts its world design call from the surface element's mount at
packages/pixelforge/src/90-element.js:211(in Marinara-Agents), which is exactly the code path the early return keeps unmounted. The package never reads the Engine's blueprint:gameWorldOverview,gameStoryArc,gamePlotTwistsandgameStartingNpcsappear nowhere inpackages/pixelforge/src/. Its world call is fed the Setting, tone, difficulty, rating and the chat's lorebook entries (60-save.js:2188-2196).What's happening
The real order for a brand new Pixelforge chat is: create,
/game/setupwrites ready, the Start Game screen,/game/startwrites active and streams the first Game Master turn from the Engine's narrative blueprint, the typewriter runs, the player presses Continue,gameIntroPresentedis PATCHed, and only then does the surface mount, arm its gate and start the world design call. The Game Master is told aboutstartingNpcsand aworldOverviewthe Experience never reads, and the Experience builds a settlement the Game Master has not been told about yet. Both halves are working as designed on their own; the ordering between them was never decided, because the intro screen predates Experience packages and the Experience mount point was placed below it.Suggested fix
Two workable shapes, and they are not exclusive.
experienceOwnsGameis true, mount the Experience surface atreadyinstead of the Start Game screen, and hold the Engine's Start Game / intro flow until the Experience says its world is ready. That needs one small Capability API addition: a way for a game-surface package to report "ready to start" to the host (a host event or a metadata flag the host watches), since today the host has no signal for it. With that, the first Game Master turn can be given the world that exists, either through the package's existing GM prompt contribution or by the host passing the sealed world summary into the start call.ready, and let the package call/game/startitself once its gate lifts. This changes what the first turn knows only if the package also contributes the world to the prompt, which Pixelforge already does for later turns.Either way, please keep the current behaviour for classic Game Mode chats. The early return is correct for them.
Context
This came out of planning the Pixelforge 0.16.7 setup seam (Engine setup wizard hosting the Experience toggle and seed). The seam does not cause this and does not fix it; the planned work will keep the current order. Recorded in the plan as risk R1 so it is not rediscovered later. The concurrency note next to it is worth a glance too:
registerSequentialGameTaskscovers/setupand/:chatId/experience-generationonly whenmetadata.gameSequentialAgents === true(packages/server/src/services/game/sequential-tasks.ts:29-35), so without that flag the Engine blueprint pass and the package's world call could in principle run concurrently on the same connection; today the ordering above means they never actually do.Found by an AI-assisted review and re-verified against staging
f2219d815on 2026-09-13. Please verify before fixing.@SpicyMarinara commented on GitHub (Sep 14, 2026):
Codex is handling this assigned issue on behalf of @SpicyMarinara in the staging sweep branch fix/assigned-sweep-6180-6186. No existing issue-linked branch, open PR, or project item was found. I will verify the affected flow and reuse the existing implementation where possible.
@SpicyMarinara commented on GitHub (Sep 14, 2026):
Confirmed the startup ordering: Engine currently mounts the Experience only after opening narration. #6188 adds an optional package declaration to mount during preparation and wait for the existing package world-generation/retry flow before Start or first-turn retry can proceed. The package supplies bounded starting-world context to the existing opening-generation guide; Classic Game and packages without the declaration keep their current flow. Pixelforge changes stay in companion Pasta-Devs/Marinara-Agents#849, separate from its setup-wizard work in Pasta-Devs/Marinara-Agents#847.
@SpicyMarinara commented on GitHub (Sep 14, 2026):
Fixed on staging by #6188 and Pasta-Devs/Marinara-Agents#849. Opted-in Experiences prepare their saved world before Start Game, and the opening receives that world context. Classic Game startup remains supported; Pixelforge uses the new Capability API 1.17 startup contract.