mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6704] [MERGED] feat(game): sections on abilities, skills and saves; untrained rules per skill or section #7293
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#7293
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/6704
Author: @kolacheee
Created: 9/26/2026
Status: ✅ Merged
Merged: 9/26/2026
Merged by: @kolacheee
Base:
staging← Head:feat/ruleset-sections📝 Commits (2)
d84c00bfeat(game): sections on abilities, skills and saves; untrained rules per skill or section758352ftest(game): pin the unsectioned sheet block byte for byte📊 Changes
37 files changed (+1371 additions, -150 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
docs/development/game-rulesets-and-sheets-implementation.md(+30 -0)📝
docs/examples/rulesets/ember-roads.json(+3 -1)📝
docs/examples/rulesets/gravewatch.json(+30 -7)📝
docs/extending/ruleset.schema.json(+96 -0)📝
docs/extending/writing-rulesets.md(+21 -2)📝
docs/game/dice-and-skill-checks.md(+1 -0)➕
e2e/ruleset-sheet-sections.e2e.ts(+130 -0)📝
packages/client/src/components/game/GameNarration.tsx(+9 -1)📝
packages/client/src/components/game/GameRulesetSheet.tsx(+43 -27)📝
packages/client/src/components/game/GameSurface.tsx(+2 -1)📝
packages/client/src/components/rulesets/RulesetSheetEditor.tsx(+125 -71)📝
packages/client/src/localization/locales/en.json(+3 -0)📝
packages/server/src/routes/game.routes.ts(+11 -1)📝
packages/server/src/routes/generate.routes.ts(+7 -2)📝
packages/server/src/services/capability-packages/package-manager.service.ts(+25 -0)📝
packages/server/src/services/game/gm-prompts.ts(+35 -0)📝
packages/server/src/services/game/one-request-dice.ts(+40 -1)📝
packages/server/src/services/game/skill-check-resolution.service.ts(+75 -5)📝
packages/shared/src/features/rulesets/sheet-math.ts(+42 -2)...and 17 more files
📄 Description
Linked issue
Closes #6655
Why this change
The author of Marinara-RPG-Extension wrote two of their shipped tabletop systems as
ruleset.jsonfiles. Abilities, skills and saves printed as two flat lists, and every skill a character had no training in rolled the same way, which left two common rules unsayable:This is slice 5 of the series in the plan doc (§ Gaps a ruleset author found). Slices 1 to 4 were #6663, #6669, #6682 and #6689.
What changed
Capability API 1.41 (file keys:
sectionon abilities, skills and saves, anduntrainedon skills, saves and sections). None of it names one game's words.sheet.sections, checked like the others. The sheet editor, the game's sheet (ability cards and trained chips) and the Game Master's sheet block group them under their headings, in the sheet's section order, then the ones with no section. A sheet that names no section on them prints exactly as before.untrainedon a skill or save, or on the section it sits in (the entry's own rule wins). Untrained means the entry's tier is the first proficiency tier. A character with no sheet has no training to read, so no rule applies to them."normal": as today.{ "by": N }(-20 to 20): added to the check's number, dice on a pool and a flat amount on a sum, before anycap, so the sheet shows it and every check rolls it. Differs from the issue on purpose: the issue named thisdice, but on a summed ruleset it is a flat number, andbyis the word rests and track commands already use."harder": the per-die target goes up one (clamped to the target's range). Refused at import on a dice-sum ruleset or a pool whose target cannot move, since it could never change a roll."refuse": the check is not rolled. The engine writes the ask back withreason="untrained", which settles it: the client's fallback never rolls it, the skill-check endpoint answers 400skill_check_untrained, and a one-request branch on it keeps neither half. The outcome narration is told the character could not attempt it (instead of "remain unresolved"), and the narration log shows "not attempted". The engine decides from the sheet either way: areasonthe Game Master writes itself does not stop a roll, and no numbers, dice or difficulty it writes on a refused check get it past the refusal.who=,with=,threshold=andbonus=, so it always rolled for the player with their default ability. It now carries them like any other check, so it rolls, or refuses untrained, for the member it names, and the record keeps whose check it was.reason="untrained"when anything refuses.en.json.docs/extending/writing-rulesets.md), player page (docs/game/dice-and-skill-checks.md), the regenerated JSON Schema, the plan doc's slice 5 notes, CHANGELOG. Gravewatch puts its skills in Labour (untrained costs a die), The watch and Company, with Dig refused untrained and Listen one step harder; Ember Roads takes two off an untrained Tinker check.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Run by the agent on
d84c00b58(this branch's one commit on stagingfe877afa0), all exit 0:pnpm check,pnpm localization:check,pnpm version:check,pnpm regression:node(399/399),pnpm ruleset:schema(no diff after regeneration),pnpm smoke:ui(7/7), andpnpm regression:ui e2e/ruleset-sheet-sections.e2e.ts e2e/ruleset-wound-sheet.e2e.ts e2e/game-combat-director.e2e.ts e2e/game-native-dice.e2e.ts e2e/game-one-request-dice.e2e.ts --project=desktop-chromium --workers=1(14/14: the new sections case in light and dark, the wound sheet, the ruleset fights, and the two dice specs that pin the rewrite prompt). Mobile projects were not run locally. Local CodeRabbit, four completed passes (several more lost their connection and were re-run): nine findings, seven fixed, two declined. Fixed: a branch check carrieswho=and the rest (the lane case for it too); the rewrite prompt no longer says dice were rolled when none were; the general dice pass leaves a settled untrained ask alone (it was rewriting it without its reason and reporting it unresolved); the untrained refusal comes before the vouching audit, the rollability check and the difficulty read, so no record the Game Master writes gets past it; section groups have keys that cannot collide with the unsectioned group. Declined: clamping the harder target a second time (the roller already clamps it into the ruleset's range, and the lane asserts a target of 9 stays 9), and rewordingui.rulesets.sheet.untrainedRefusedFor(its{{name}}is the skill's label, so it reads "Dig cannot be attempted untrained", which the browser case checks).scripts/regressions/game-ruleset-sections.regression.tscovers every import refusal, section grouping (and the byte-identical output with none), each untrained rule on both kinds, the entry-over-section precedence, the stranger case, the content resolver's refusal and settled record, the endpoint's 400, the one-request branch, the narration counter, the reminder and the 1.41 gate. Twenty-five deliberate breaks were each caught, and each fix the review prompted adds a case that fails without it (a branch check for another member, a written record and an unreadable difficulty on a refused skill, the dice pass after a refusal).e2e/ruleset-sheet-sections.e2e.tsrenders the sheet editor for Gravewatch and Ember Roads and the game's sheet for a trained warden in light and dark: headings come before their skills in order, untrained Wrestle shows one die, Dig shows a dash, Ember Roads draws no heading and Tinker shows -2, and the trained chips sit under their headings.gm-skill-check-resolutionpins the settled-ask guard in the client fallback and the endpoint.Still to verify by hand (not done by the agent):
[skill_check: skill="Dig" dc="1"]for an untrained character: confirm nothing is rolled, the narration says they could not attempt it, and the narration log shows "Dig check: not attempted".Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Docs touched:
docs/extending/writing-rulesets.md(not carried bydocs-i18n),docs/game/dice-and-skill-checks.md(carried bydocs-i18n),docs/extending/ruleset.schema.json,docs/examples/rulesets/gravewatch.json,docs/examples/rulesets/ember-roads.json,docs/development/game-rulesets-and-sheets-implementation.md(internal plan),CHANGELOG.md. Translations are batched into one later pass by the maintainer's standing decision, so no per-PR[docs-i18n]issue is opened here.UI evidence (if applicable)
None attached. The new browser case saves a full-page screenshot of both sheet editors and the game's sheet in each theme; the manual steps above cover it at mobile width.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.