mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #7743] [Feature]: Edit Game Mode data in the State Editor #4273
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#4273
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 @ylli-selmani on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7743
Originally assigned to: @ylli-selmani on GitHub.
What problem does this solve?
The State Editor (#7736, shipped in #7737 and #7739) fixes roleplay tracker data and chat variables. Game Mode keeps most of its state elsewhere, in chat metadata: the party's character cards, NPCs, journal and quests, inventory stacks, story, world. When the model gets one of these wrong (an NPC with the wrong reputation, a quest stuck open, a duplicated item), there's no screen to fix it.
The only generic way to write those keys today is
PATCH /api/chats/:id/metadata. It merges any key with no checks and replaces arrays likegameNpcsorgameCharacterCardswith the client's copy, so it can quietly undo a turn that landed in between. It shouldn't be used for this.Proposed solution
A Game data source for the State Editor, shown in Game Mode chats, with a clear warning that hand edits can break a game. The plan follows kolacheee's review of what is safe to edit and how.
Editable, through one new validating route. A new server route saves only keys on an allow-list (so new keys from upcoming Game Mode work stay locked until they're added on purpose). Each key gets its own check, and the write goes through the chat metadata queue. A server-side staleness check refuses a save when a key changed since the editor opened it.
gameCharacterCards(eachrulesetSheetthroughreadRulesetSheetEnvelope)gameNpcs(idkept, reputation clamped to -100..100)gamePlayerNotesgameWorldOverview,gameStoryArc,gamePlotTwists,gamePartyArcsgamePreviousSessionSummariesgameSetupConfig, and the prompt and media settingsNames. Cards, NPCs, party ids, live sheet state (
rulesetLive) and bag holders all match on the normalized character name. The first version refuses renames, with a message saying why.Saved through the routes that already check them:
POST /api/game/inventory(add,take,set,rename,give,equip, …). That route checks the item book, writes the journal and updates the turn in one queued transaction. Never throughplayerStats.inventoryin the game-state PATCH, which only writes the turn's tracker copy.GET /api/game/:chatId/world/editand saved withPUT /api/game/:chatId/world/edits(schema, issue and story checks, snapshot re-save).gameWorlditself is never written.PUT /:chatId/story, party sheet via the party sheet service (revision check, 409 when stale), HUD widgets viaPUT /:chatId/widgets.Read-only sections (shown so you can see and search them, never saved):
gameJournalas reconciled on read,gameMap/gameMaps/activeGameMapIdand party position, dungeon walk keys,gameTime,gameWeather,gameMorale, scene and music caches,gameInventoryTurn.gameId, linked chat ids,gameRuleset,gameExperienceId,gameStyle,gameIntro,gameWorldKit,gameMapPack,gameInitialSetup,gamePartyCharacterIds), lifecycle keys,gamePartySheetRevision,gameRulesetAdvancementBase,gameInventedItems,gameLootedFights,gameStartingGearTaken, live combat (gameCombatState,gameTacticalCombatSnapshot),metadataWriteOrdinals.Undo: saving creates a checkpoint first. That only works once checkpoints also save the game's metadata (#7742), so that lands first. A Load checkpoint button comes with this feature, since the client has none yet.
Character and party sheet saving stays open to players, as it is in play. It isn't put behind admin-only.
Planned slices (commits, listed with hashes in each PR body):
Alternatives considered
PATCH /api/chats/:id/metadata. No checks, and arrays replace wholesale, so it can undo a turn that landed meanwhile.playerStats.inventoryin the game-state PATCH. In Game Mode that copy drifts from the real stacks inmetadata.gameInventory.Additional context
Template check