mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4526] [Feature]: Let a capability package provide a whole Game mode #2467
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#2467
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 @SonaGat3 on GitHub (Aug 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4526
Originally assigned to: @SpicyMarinara on GitHub.
What problem does this solve?
A package can extend Marinara in a lot of ways — a panel, a chat surface, a settings section, a
conversation game. What it cannot do is provide a Game mode of its own: one that draws its own HUD,
menus and combat, keeps its own state, and replaces the built-in systems it implements.
Building one surfaced four gaps, three of them small and independent of the main idea:
GameSurfacehas no capability slot.view="surface"exists only inConversationView, forturn-games. There is no way for a package to render over the game area.
prompt-contextpermission has no consumer. It is in the manifest enum, but nothing in theserver reads it — declaring it does nothing. A package that owns live state has no way to tell the
model about it, so the model narrates against state it cannot see.
lorebook, which is the minimum a game mode needs to start.
packages activate and install their assets, and nothing re-runs it. Anything reading the manifest —
scene analysis, the asset pickers — cannot see that art for a whole session. This one affects any
package that ships assets, not just game modes.
The motivating case is a Persona-style game mode (calendar, bonds, palaces, card combat).
Proposed solution
Four separable pieces. Everything is declarative: the engine never names a package, an experience
DECLARES what it replaces, and anything left undeclared stays built-in. A game without an experience
behaves exactly as it does today.
1. Re-run the asset manifest scan after packages activate. The same idempotent scan the upload routes
already re-run, guarded so a package's freshly written files can't take down startup.
2. A per-turn
prompt-contexthook. Gives the existing permission a consumer: a package can append ablock to the system prompt of each turn. Contributors are keyed by package id, gated on the permission,
and a contributor that throws is logged and skipped so it can never break a turn. A contribution may also
declare which built-in systems it replaces (
provides, today{ inventory }), and the GM prompt stopsdriving those.
3. Resource writes. Six optional methods on
CapabilityResourceHost, thin passthroughs to storage, soa setup flow can find-or-create the player persona and its lorebook.
4. A
game-surfaceslot. The experience is chosen when the game is CREATED, from an Experiences blockin the setup wizard, and belongs to that game for its lifetime — not a per-chat toggle, since an
experience owns the whole run. Which package it is comes from the manifest. The seams are declarative and
each is gated host-side: background, speaker avatars, active speaker, an in-flow choice slot, sprite
scale, and a chrome declaration by which the experience says which built-in chrome it replaces.
Alternatives considered
Doing it entirely package-side. This was the starting assumption and most of it does work that way —
the state, the assets, the sprites, the combat, the storage all live in the package. These four are what
could not: there is no slot to render into, the format reminder is host-built, the resource facade is
read-only, and the manifest scan is host-side.
Injecting per-turn state through a constant lorebook entry instead of a prompt hook. Rejected after
measuring: that block is ~3-5k tokens on a typical turn, and a lorebook entry lands inside the lorebook's
own
tokenBudget(15k, shared with every other entry), so it would compete with — and truncate — thelore it sits next to.
Using
gameSpecialInstructionsfor the same thing. It is injected every turn, but it is capped at2000 characters, an order of magnitude short.
Telling the model not to use the built-in inventory from the package's own prompt, instead of the
providesdeclaration. The[inventory: …]command lives in the format reminder, which is pushed asthe last user message — closest to generation. A rule in the package's system prompt loses that argument,
and the model keeps logging items into a panel the player cannot see.
Hiding built-in chrome with CSS from the package's stylesheet rather than withholding the callbacks.
There are no stable selectors for those buttons, and hiding leaves the built-in flow reachable underneath
the surface.
Registering the cast as tracked NPCs (
chatMeta.gameNpcs) so the narration would resolve avatarswithout a new seam. Rejected: those NPCs are injected into the GM prompt as
<tracked_npcs>, so a25-character cast would pollute every turn and the persisted state.
Enabling the experience as a per-chat agent, which is how the first version worked. Changed on
@SpicyMarinara's direction, and it is better: toggling mid-run left a half-built game either way.
Additional context
grepfor any package id across the changed files returns zero.staging:pnpm check,pnpm version:check,pnpm guard:installer-artifactsandscripts/test-owner-approval.mjsall pass;pnpm regression:promptpasses 147 checks and leaves onefailure that reproduces identically on unmodified
staging.pnpm regression:promptiscurrently red on
stagingforStoryboard host consumes package-owned prompts without restoring Engine globals; andpnpm smoke:uicannot run where pnpm is the standalone binary, becausee2e/start-servers.mjsassumesnpm_execpathpoints at a JS file (with@pnpm/exeit points atpnpm.exe, so Node tries to parse the executable as a script).supportedCapabilityApiat 1.7, sincebumping it felt like a maintainer call. Bumping would be backward compatible either way.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Aug 3, 2026):
Groundwork for adding Agents introducing new Game modes.
@SpicyMarinara commented on GitHub (Aug 4, 2026):
Implemented and merged into staging via #4528 (merge commit
4efeafe7df).