[PR #5979] [MERGED] fix(game): keep every roll and resolve text dice requests #7011

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5979
Author: @SpicyMarinara
Created: 9/8/2026
Status: ✅ Merged
Merged: 9/9/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/game-dice-results-5956-5961


📝 Commits (8)

  • 92c07cd chore: start Game dice issue sweep
  • ad8b596 fix(game): preserve every roll and narrate actual dice outcomes
  • ec76bb5 Merge remote-tracking branch 'origin/staging' into fix/game-dice-results-5956-5961
  • 144035a fix: keep Game log actions on their Chroma colors
  • 6e0faa1 fix: preserve queued dice when the next Game turn starts
  • ec24f4d Merge remote-tracking branch 'origin/staging' into fix/game-dice-results-5956-5961
  • 94743de Merge remote-tracking branch 'origin/staging' into fix/game-dice-results-5956-5961
  • 5d3c6a6 fix: keep Game log actions and translations on narration

📊 Changes

16 files changed (+746 additions, -232 deletions)

View changed files

📝 CHANGELOG.md (+3 -1)
📝 docs/game/dice-and-skill-checks.md (+12 -2)
📝 e2e/game-native-dice.e2e.ts (+120 -14)
📝 packages/client/src/components/game/GameNarration.tsx (+54 -28)
📝 packages/client/src/components/game/GameSurface.tsx (+41 -37)
📝 packages/client/src/lib/chat-message-visibility.ts (+1 -0)
📝 packages/client/src/lib/dice-roll-result.ts (+5 -0)
📝 packages/client/src/stores/game-mode.store.ts (+16 -5)
📝 packages/server/src/routes/generate.routes.ts (+177 -102)
📝 packages/server/src/services/game/dice.service.ts (+100 -0)
📝 packages/server/src/services/game/gm-prompts.ts (+8 -7)
📝 packages/server/src/services/game/skill-check-resolution.service.ts (+9 -4)
📝 packages/shared/src/types/chat.ts (+2 -0)
📝 scripts/regressions/game-mode-dice-tool.regression.ts (+2 -2)
➕ scripts/regressions/game-text-dice.regression.ts (+170 -0)
📝 scripts/regressions/gm-skill-check-resolution.regression.ts (+26 -30)

📄 Description

Linked issue

Closes #5956
Closes #5960
Closes #5959
Closes #5961

Why this change

A Game turn can roll multiple real dice but retain or animate only one result. Text-only connections also need real dice outside d20 checks, with narration kept consistent with outcomes the engine resolves after generation.

What changed

Keep every Game dice result on its swipe and queue the existing dice/skill-check cards in order. Logs retain the full roll history after reload; regeneration clears replaced rolls and continuation preserves them. Logs use readable light-theme colors and localized accessible names for their icon controls.

Reuse the shared dice grammar for text-requested ordinary dice and explicitly defined success pools. After resolving fresh requests, make one text-only follow-up on the same connection to rewrite the complete narration using real outcomes. Preserve the engine's roll records exactly once, discard superseded package/movement commands, and save actual results if that follow-up fails. This adds one model request on turns using the text-roll fallback; native tool rolls retain their existing loop.

Validation

Passed pnpm check, pnpm regression:prompt, and focused dice-tool, text-dice, skill-check, notation, GM-verb, and spatial-visibility regressions. The new real-route regression exercises both subscription adapters with a synthetic transport, including a failed continuation; disabling the continuation makes its two-call assertion fail. The browser regression fails on baseline because only the final roll is presented.

All nine game-native-dice.e2e.ts cases passed across desktop Chromium, mobile Chromium, and mobile WebKit in light/dark themes. They exercise multi-round cards, two sequential checks, reload/Logs, continuation/regeneration persistence, and unchanged Conversation cards. Inspected the saved light/dark screenshots.

  • Manually verify outcome wording with live Claude and Grok subscription sessions; the automated proof replaces their transport and does not contact paid services.
  • Manually verify long-running narration, cancellation, and dice-card timing on physical mobile devices.

Docs and release impact

Updated the Unreleased changelog and docs/game/dice-and-skill-checks.md. Translation follow-up: #5980. No release version bump.

Additional integration proof: 14 browser cases passed, including all dice-card scenarios, the existing Game log Chroma regression, and mobile Conversation editing. The Chroma regression caught and verified removal of a conflicting desktop text-color override.

Summary by CodeRabbit

  • New Features

    • Dice rolls and skill checks now appear as sequential cards within the same game turn.
    • Roll history is retained across reloads and available in Session Logs.
    • Text-only connections can request standard dice rolls and supported success-pool checks.
    • Game outcomes now use actual engine-generated results before narration is completed.
    • Dice notation and skill-check requests receive improved validation.
  • Bug Fixes

    • Multiple rolls are preserved reliably instead of being overwritten.
    • Failed follow-up requests retain recorded rolls without showing incomplete outcomes.

🔄 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/5979 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/8/2026 **Status:** ✅ Merged **Merged:** 9/9/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/game-dice-results-5956-5961` --- ### 📝 Commits (8) - [`92c07cd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/92c07cd7b0177db44f933d38828b1db5a762f667) chore: start Game dice issue sweep - [`ad8b596`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ad8b5961f6b243f98be377a756e07932032e0b65) fix(game): preserve every roll and narrate actual dice outcomes - [`ec76bb5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ec76bb570043e74b95e00ca8969a347fffafea8b) Merge remote-tracking branch 'origin/staging' into fix/game-dice-results-5956-5961 - [`144035a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/144035aaa3d641f0c3a5f279bcbbfabccd8349e9) fix: keep Game log actions on their Chroma colors - [`6e0faa1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6e0faa1231a37b3f846ba0b7ea5d2218bdb095b0) fix: preserve queued dice when the next Game turn starts - [`ec24f4d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ec24f4d4e6350a5d968b018caf406b7e35167319) Merge remote-tracking branch 'origin/staging' into fix/game-dice-results-5956-5961 - [`94743de`](https://github.com/Pasta-Devs/Marinara-Engine/commit/94743de7488413b41596831e7cb55fef99087e37) Merge remote-tracking branch 'origin/staging' into fix/game-dice-results-5956-5961 - [`5d3c6a6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5d3c6a6471d2206ac9e1f4345f0a0756881b2937) fix: keep Game log actions and translations on narration ### 📊 Changes **16 files changed** (+746 additions, -232 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+3 -1) 📝 `docs/game/dice-and-skill-checks.md` (+12 -2) 📝 `e2e/game-native-dice.e2e.ts` (+120 -14) 📝 `packages/client/src/components/game/GameNarration.tsx` (+54 -28) 📝 `packages/client/src/components/game/GameSurface.tsx` (+41 -37) 📝 `packages/client/src/lib/chat-message-visibility.ts` (+1 -0) 📝 `packages/client/src/lib/dice-roll-result.ts` (+5 -0) 📝 `packages/client/src/stores/game-mode.store.ts` (+16 -5) 📝 `packages/server/src/routes/generate.routes.ts` (+177 -102) 📝 `packages/server/src/services/game/dice.service.ts` (+100 -0) 📝 `packages/server/src/services/game/gm-prompts.ts` (+8 -7) 📝 `packages/server/src/services/game/skill-check-resolution.service.ts` (+9 -4) 📝 `packages/shared/src/types/chat.ts` (+2 -0) 📝 `scripts/regressions/game-mode-dice-tool.regression.ts` (+2 -2) ➕ `scripts/regressions/game-text-dice.regression.ts` (+170 -0) 📝 `scripts/regressions/gm-skill-check-resolution.regression.ts` (+26 -30) </details> ### 📄 Description ## Linked issue Closes #5956 Closes #5960 Closes #5959 Closes #5961 ## Why this change A Game turn can roll multiple real dice but retain or animate only one result. Text-only connections also need real dice outside d20 checks, with narration kept consistent with outcomes the engine resolves after generation. ## What changed Keep every Game dice result on its swipe and queue the existing dice/skill-check cards in order. Logs retain the full roll history after reload; regeneration clears replaced rolls and continuation preserves them. Logs use readable light-theme colors and localized accessible names for their icon controls. Reuse the shared dice grammar for text-requested ordinary dice and explicitly defined success pools. After resolving fresh requests, make one text-only follow-up on the same connection to rewrite the complete narration using real outcomes. Preserve the engine's roll records exactly once, discard superseded package/movement commands, and save actual results if that follow-up fails. This adds one model request on turns using the text-roll fallback; native tool rolls retain their existing loop. ## Validation Passed `pnpm check`, `pnpm regression:prompt`, and focused dice-tool, text-dice, skill-check, notation, GM-verb, and spatial-visibility regressions. The new real-route regression exercises both subscription adapters with a synthetic transport, including a failed continuation; disabling the continuation makes its two-call assertion fail. The browser regression fails on baseline because only the final roll is presented. All nine `game-native-dice.e2e.ts` cases passed across desktop Chromium, mobile Chromium, and mobile WebKit in light/dark themes. They exercise multi-round cards, two sequential checks, reload/Logs, continuation/regeneration persistence, and unchanged Conversation cards. Inspected the saved light/dark screenshots. - [ ] Manually verify outcome wording with live Claude and Grok subscription sessions; the automated proof replaces their transport and does not contact paid services. - [ ] Manually verify long-running narration, cancellation, and dice-card timing on physical mobile devices. ## Docs and release impact Updated the Unreleased changelog and `docs/game/dice-and-skill-checks.md`. Translation follow-up: #5980. No release version bump. Additional integration proof: 14 browser cases passed, including all dice-card scenarios, the existing Game log Chroma regression, and mobile Conversation editing. The Chroma regression caught and verified removal of a conflicting desktop text-color override. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Dice rolls and skill checks now appear as sequential cards within the same game turn. - Roll history is retained across reloads and available in Session Logs. - Text-only connections can request standard dice rolls and supported success-pool checks. - Game outcomes now use actual engine-generated results before narration is completed. - Dice notation and skill-check requests receive improved validation. - **Bug Fixes** - Multiple rolls are preserved reliably instead of being overwritten. - Failed follow-up requests retain recorded rolls without showing incomplete outcomes. <!-- 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:15:44 +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#7011
No description provided.