mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6336] [MERGED] feat(game): live ruleset sheets and the sheet command (rulesets slice 5) #7143
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#7143
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6336
Author: @kolacheee
Created: 9/18/2026
Status: ✅ Merged
Merged: 9/18/2026
Merged by: @kolacheee
Base:
staging← Head:feat/rulesets-ingame📝 Commits (4)
bd89365feat(game): keep ruleset sheets live in a game with the sheet command077a16dfix(game): make the sheet tag scan one bounded run02aee09fix(game): address ruleset live state review findingsafaf61efix(game): strip Unicode line and paragraph separators from sheet values📊 Changes
30 files changed (+3425 additions, -38 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
docs/development/game-rulesets-and-sheets-implementation.md(+20 -5)📝
docs/game/dice-and-skill-checks.md(+1 -0)📝
docs/game/party-and-npcs.md(+21 -0)📝
packages/client/src/components/game/GameCharacterSheet.tsx(+48 -1)➕
packages/client/src/components/game/GameRulesetSheet.tsx(+476 -0)📝
packages/client/src/components/game/GameSurface.tsx(+120 -1)📝
packages/client/src/components/game/game-narration-format.ts(+6 -1)➕
packages/client/src/hooks/use-game-ruleset.ts(+48 -0)📝
packages/client/src/hooks/use-game-state-patcher.ts(+3 -1)📝
packages/client/src/lib/game-tag-parser.ts(+12 -0)📝
packages/client/src/localization/locales/en.json(+41 -0)📝
packages/server/src/db/schema/game-state.ts(+4 -0)📝
packages/server/src/routes/chats.routes.ts(+27 -2)📝
packages/server/src/routes/game.routes.ts(+6 -1)📝
packages/server/src/routes/generate.routes.ts(+96 -3)📝
packages/server/src/routes/generate/generate-route-utils.ts(+2 -0)📝
packages/server/src/services/game/gm-prompts.ts(+55 -0)➕
packages/server/src/services/game/ruleset-sheet-turn.service.ts(+136 -0)📝
packages/server/src/services/storage/game-state.storage.ts(+26 -0)...and 10 more files
📄 Description
Linked issue
Part of #6314 (slice 5 of 7; it does not close the issue). Builds on #6330 (slice 4, merged).
Why this change
What changed
game_state_snapshots.ruleset_livecolumn holdsRulesetLiveStates, keyed by normalized card name. It is sparse: only values that were set are stored, and a value back at its default is dropped, so an untouched pool follows its maximum after a level-up. NoSTORAGE_VERSIONbump: an old row reads the column as null, which means every pool at its default.[sheet: ...]command. The Game Master records changes with one Engine-owned tag:spend,restore(healis read asrestore),damage,temp,track,condition,note,rest. The grammar is the same for every ruleset; every pool, track, condition, note and rest name comes from the ruleset and is matched by id or label. Nothing in the code knows a 5e word.whomay be left out (the player) or beparty.result="ok" now="…"orresult="refused" reason="…". Aresultthe model writes itself is ignored. A refused command changes nothing, is logged, and the client says so once per turn.createcarries it over unless the caller passes one). A new session starts with the state the last one ended with.gm.sheetGuidanceand one compact block per party member are part of the per-turn format reminder, never the system prompt, because live state changes every turn and the system prompt is what a provider caches. With no ruleset the reminder is byte-identical, and an impersonated turn gets no sheet section.applyRulesetSheetOpthe Game Master's commands do, and saves throughPATCH /chats/:id/game-state, which bounds live state (rulesetLiveStatesSchema) and judges nothing else. An unavailable ruleset or an unreadable stored sheet shows a notice instead of something editable.sheetis reserved, so a package verb with that name is refused, and[sheet:]tags are hidden from the narration.game-ruleset-live.regression.ts(the arithmetic, the tag, the prompt block, a second 2d6 ruleset with an empty-start pool to prove nothing is 5e-shaped) andgame-ruleset-live-storage.regression.ts(the column, rewind, the edit route, the reminder, an unavailable pin) against a really installed package./party-turn) do not apply sheet commands; only the Game Master's reply does. Layers on top of a ruleset (for example Low Magic on 5e) are recorded in the plan as an open decision for the community-import slice.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Commands run locally by the agent:
pnpm check(exit 0),pnpm localization:check, the full node regression lane (pnpm regression:node, 305 of 305), and the two new regressions. The agent also drove a scratch server on port 7820 with the 5e package installed and a game seeded through the API (no model was connected):[sheet:]tags did not show in the narration; the sheet showed 25/32 hit points and 1/2 third-level slots from live state; the minus button saved through the route and disabled itself at zero; Long rest returned the state to nothing stored and showed a status line; live geometry at 375 px showed no overflow. Four local CodeRabbit sweeps were run before opening (two lost their connection part way and their partial findings were fixed); the last complete one returned no findings.Still to verify by hand:
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Docs touched:
CHANGELOG.md,docs/game/party-and-npcs.md(new section The ruleset sheet),docs/game/dice-and-skill-checks.md, the plan. The[docs-i18n]follow-up is batched for the ruleset slices.UI evidence (if applicable)
To be added by a human: light, dark and phone-width screenshots of the Ruleset sheet block.
Summary by CodeRabbit
New Features
Documentation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.