[PR #6836] [MERGED] fix(game): keep a ruleset check rolled with 2d6 or a pool as the ruleset rolled it (#6835) #7349

Closed
opened 2026-10-23 04:18:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6836
Author: @kolacheee
Created: 9/29/2026
Status: ✅ Merged
Merged: 9/29/2026
Merged by: @kolacheee

Base: staging ← Head: fix/ruleset-checks-rolled-twice


📝 Commits (1)

  • b955209 fix(game): keep a ruleset check rolled with 2d6 or a pool as the ruleset rolled it (#6835)

📊 Changes

6 files changed (+33 additions, -1 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 packages/server/src/routes/generate.routes.ts (+2 -0)
📝 packages/server/src/services/game/dice.service.ts (+5 -0)
📝 scripts/regressions/game-inventory-turn.regression.ts (+14 -0)
📝 scripts/regressions/game-ruleset-dice-pool.regression.ts (+9 -0)
📝 scripts/regressions/gm-skill-check-resolution.regression.ts (+1 -1)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #6835

Why this change

  • In a Game Mode game whose ruleset rolls something other than one d20 (Ember Roads rolls 2d6; Gravewatch and V20-style rulesets roll a dice pool), every check the Game Master called for during a turn was rolled twice: first by the ruleset's own resolver with the character's sheet, then again by the general dice resolver, which knows nothing about rulesets. The second roll was the one saved, so the sheet's modifier became 0 and who=, wound penalties, sheet modifiers and pool rules were lost. Found while building #6832, whose check effects never survived a real turn in those games.

What changed

  • resolveGameDiceRequests takes a rulesetChecks flag. In a game that pins a ruleset, it leaves every [skill_check] tag as the ruleset's resolver wrote it (a record, or an ask left on purpose) and still rolls plain [dice: ...] requests. The generate route passes it on the same terms as the ruleset pass (chatMeta.gameRuleset != null). Games with no ruleset are unchanged, which is who that path was written for.
  • Regressions: the resolver leaves a 2d6 record and a pool ask alone in a ruleset game (game-ruleset-dice-pool), a real turn in an Ember Roads game saves Bram's Scrap check with his Brawn of 3 and his who= (game-inventory-turn), and the route's pinned call carries the flag (gm-skill-check-resolution).
  • CHANGELOG entry.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Run by the agent on this branch (one commit on staging 6d3022d56):

  • Reproduced on clean staging first: an Ember Roads turn with [skill_check: skill="Scrap" dc="8" who="Bram"] (Bram has Brawn 3) saved modifier="0" and no who. With the fix the same turn saves modifier="3" and who="Bram".
  • pnpm check exits 0; pnpm regression passes 442/442; pnpm smoke:ui passes 7/7.
  • Each half of the fix was removed in turn and its lane failed: the route passing false fails game-inventory-turn, and the resolver without the skip fails game-ruleset-dice-pool.
  • Local CodeRabbit (coderabbit review --agent --base staging): one pass, no findings. The only change after it was the source-shape regex in gm-skill-check-resolution.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

CHANGELOG entry only; no user-facing docs describe this path.

UI evidence (if applicable)

None: server only.

Summary by CodeRabbit

  • Bug Fixes
    • In Game Mode rulesets that use dice other than a single d20, Engine-rolled skill checks are no longer rolled a second time without reading the character sheet. Saved results retain sheet values, roller identity, and applicable wound penalties or modifiers.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/6836 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 9/29/2026 **Status:** ✅ Merged **Merged:** 9/29/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `fix/ruleset-checks-rolled-twice` --- ### 📝 Commits (1) - [`b955209`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b95520963e3b2cbc1049a0c1d5dcd6df6a484e84) fix(game): keep a ruleset check rolled with 2d6 or a pool as the ruleset rolled it (#6835) ### 📊 Changes **6 files changed** (+33 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `packages/server/src/routes/generate.routes.ts` (+2 -0) 📝 `packages/server/src/services/game/dice.service.ts` (+5 -0) 📝 `scripts/regressions/game-inventory-turn.regression.ts` (+14 -0) 📝 `scripts/regressions/game-ruleset-dice-pool.regression.ts` (+9 -0) 📝 `scripts/regressions/gm-skill-check-resolution.regression.ts` (+1 -1) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #6835 ## Why this change - In a Game Mode game whose ruleset rolls something other than one d20 (Ember Roads rolls 2d6; Gravewatch and V20-style rulesets roll a dice pool), every check the Game Master called for during a turn was rolled twice: first by the ruleset's own resolver with the character's sheet, then again by the general dice resolver, which knows nothing about rulesets. The second roll was the one saved, so the sheet's modifier became 0 and `who=`, wound penalties, sheet modifiers and pool rules were lost. Found while building #6832, whose check effects never survived a real turn in those games. ## What changed - `resolveGameDiceRequests` takes a `rulesetChecks` flag. In a game that pins a ruleset, it leaves every `[skill_check]` tag as the ruleset's resolver wrote it (a record, or an ask left on purpose) and still rolls plain `[dice: ...]` requests. The generate route passes it on the same terms as the ruleset pass (`chatMeta.gameRuleset != null`). Games with no ruleset are unchanged, which is who that path was written for. - Regressions: the resolver leaves a 2d6 record and a pool ask alone in a ruleset game (`game-ruleset-dice-pool`), a real turn in an Ember Roads game saves Bram's Scrap check with his Brawn of 3 and his `who=` (`game-inventory-turn`), and the route's pinned call carries the flag (`gm-skill-check-resolution`). - CHANGELOG entry. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Run by the agent on this branch (one commit on staging 6d3022d56): - Reproduced on clean staging first: an Ember Roads turn with `[skill_check: skill="Scrap" dc="8" who="Bram"]` (Bram has Brawn 3) saved `modifier="0"` and no `who`. With the fix the same turn saves `modifier="3"` and `who="Bram"`. - `pnpm check` exits 0; `pnpm regression` passes 442/442; `pnpm smoke:ui` passes 7/7. - Each half of the fix was removed in turn and its lane failed: the route passing `false` fails `game-inventory-turn`, and the resolver without the skip fails `game-ruleset-dice-pool`. - Local CodeRabbit (`coderabbit review --agent --base staging`): one pass, no findings. The only change after it was the source-shape regex in `gm-skill-check-resolution`. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) CHANGELOG entry only; no user-facing docs describe this path. ## UI evidence (if applicable) None: server only. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * In Game Mode rulesets that use dice other than a single d20, Engine-rolled skill checks are no longer rolled a second time without reading the character sheet. Saved results retain sheet values, roller identity, and applicable wound penalties or modifiers. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:18:53 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7349
No description provided.