[GH-ISSUE #6128] When the Game Master asks for a dice roll the engine can't read, nothing is rolled and nothing anywhere says why #3405

Closed
opened 2026-10-21 06:02:45 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @kolacheee on GitHub (Sep 13, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6128

Originally assigned to: @SpicyMarinara on GitHub.

If the Game Master writes a dice request in notation the engine doesn't support (for example [dice: 4d6kh3] for keep-highest, [dice: 3d6!] for exploding dice, or [dice: 4dF] for Fate dice), the request is quietly dropped: no dice are rolled, the tag is removed from the narration, and the turn continues as if it was never asked for. Leaving the player's screen clean is intended, but nothing is written to the server log either, so when a game stops producing rolls there is no way for anyone - player or maintainer - to find out why.

How to reproduce (try it yourself)

  1. Open a Game Mode chat (any connection; the only requirement is Game Mode and a normal, non-impersonated Game Master turn).
  2. In the Game Master instructions or an author's note, add: When the player attacks, request the damage roll by writing exactly [dice: 4d6kh3] in your narration and write no numbers yourself.
  3. Send a player action such as I swing my greatsword at the ogre. Keep the turn to that one request.

What you'll see: the narration arrives with the request simply gone - no animated dice card, no dice badge, no rewrite of the narration around a real total, and no line at any log level (including debug) about the request. The Game Master either leaves the outcome hanging or makes one up.

  1. Control: repeat with [dice: 4d6]. The same turn now shows the dice card, the badge, and narration rewritten around the real total. The only difference is the notation.

What should happen: the dropped request should leave a trace. At minimum a server warning naming the notation the engine could not read, and a way for the Game Master to learn its request was not understood so it can re-ask in supported notation. Whether the player also sees a one-line note is a product call.

A faster check without a model: from the repository, run resolveGameDiceRequests("[dice: 4d6kh3]") from packages/server/src/services/game/dice.service.ts under packages/server/node_modules/.bin/tsx. It returns the text byte-identical with rolled = 0 and no rolls.

Where it is

At staging 52799569c:

  • packages/server/src/services/game/dice.service.ts:85-87, in resolveGameDiceRequests: const notation = parseDiceNotation(body); then if (!notation) return original; - no logging anywhere in the file.
  • packages/shared/src/utils/dice-notation.ts:22 - DICE_NOTATION_REGEX = /^(\d+)?d(\d+)([+-]\d+)?$/i, anchored, so kh3, !, dF, inner spaces and trailing attributes all miss.
  • packages/server/src/routes/generate.routes.ts:7943 (the call) and :7948-7958 (the roll_dice event that draws the card is sent only for rolls that actually happened).
  • packages/client/src/lib/game-tag-parser.ts:497, :923, :961, :1023 - every [dice: ...] tag is stripped from visible text regardless of body.

What's happening

The engine finds the tag, fails to parse its contents, and returns the tag exactly as written - deliberately, so that already-resolved records like [dice: 2d6 = 10 (4 + 6)] survive a re-scan untouched. The unread request then rides that same path: no roll, so no dice card and no second pass that rewrites the narration around real numbers, and the client strips the leftover tag before the player sees it. The parse failure is never recorded, so the only evidence is a missing roll.

Suggested fix

Separate "already resolved" from "cannot be read" at the parse site instead of treating both as leave-alone. A resolved record already has a recognisable shape (= total (...)), so a body that matches neither that nor the supported notation can be treated as a genuine miss: log a warning naming the notation, and count it so a fix or regression is observable. Then decide one policy for telling the Game Master, ideally reusing whatever path already feeds roll results back into the same turn, so the model can re-ask in supported notation rather than inventing an outcome. If a player-visible note is wanted too, it should match how unresolvable skill checks already behave rather than inventing a second style. Worth pinning in the game-text-dice regression lane: it already asserts that unreadable notation rolls nothing, but nothing asserts that the miss is reported.

Context

This path arrived with merged PR #5979, which delivered issue #5959 (let the Game Master request rolls from narration text); it landed after v2.4.4, so it is unreleased on staging. Worth saying plainly: the silence toward the player looks intentional, not accidental - the Game Master instructions state the supported notation and say exploding dice, botches and other special pool rules are not implemented (packages/server/src/services/game/gm-prompts.ts:776-777), and docs/game/dice-and-skill-checks.md already describes leaving unresolvable checks alone with no banner. So the gap worth closing here is the missing server warning and the missing feedback to the model, not the quiet screen; the same reporting would naturally cover the unresolvable skill-check cases the documentation describes. A separate issue covers the [skill_check:] variant of the same parse failure, where the Game Master's invented numbers are also kept in the saved message.

Found by an AI-assisted sweep of merged PR #5979 against issue #5959, then re-verified against staging 52799569c on 2026-09-13. Please verify before fixing.

Related issue from the same sweep: #6123 (the [skill_check:] variant where invented numbers are kept).

Originally created by @kolacheee on GitHub (Sep 13, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6128 Originally assigned to: @SpicyMarinara on GitHub. If the Game Master writes a dice request in notation the engine doesn't support (for example `[dice: 4d6kh3]` for keep-highest, `[dice: 3d6!]` for exploding dice, or `[dice: 4dF]` for Fate dice), the request is quietly dropped: no dice are rolled, the tag is removed from the narration, and the turn continues as if it was never asked for. Leaving the player's screen clean is intended, but nothing is written to the server log either, so when a game stops producing rolls there is no way for anyone - player or maintainer - to find out why. ## How to reproduce (try it yourself) 1. Open a Game Mode chat (any connection; the only requirement is Game Mode and a normal, non-impersonated Game Master turn). 2. In the Game Master instructions or an author's note, add: `When the player attacks, request the damage roll by writing exactly [dice: 4d6kh3] in your narration and write no numbers yourself.` 3. Send a player action such as `I swing my greatsword at the ogre.` Keep the turn to that one request. **What you'll see:** the narration arrives with the request simply gone - no animated dice card, no dice badge, no rewrite of the narration around a real total, and no line at any log level (including `debug`) about the request. The Game Master either leaves the outcome hanging or makes one up. 4. Control: repeat with `[dice: 4d6]`. The same turn now shows the dice card, the badge, and narration rewritten around the real total. The only difference is the notation. **What should happen:** the dropped request should leave a trace. At minimum a server warning naming the notation the engine could not read, and a way for the Game Master to learn its request was not understood so it can re-ask in supported notation. Whether the player also sees a one-line note is a product call. A faster check without a model: from the repository, run `resolveGameDiceRequests("[dice: 4d6kh3]")` from `packages/server/src/services/game/dice.service.ts` under `packages/server/node_modules/.bin/tsx`. It returns the text byte-identical with `rolled = 0` and no rolls. ## Where it is At staging `52799569c`: - `packages/server/src/services/game/dice.service.ts:85-87`, in `resolveGameDiceRequests`: `const notation = parseDiceNotation(body);` then `if (!notation) return original;` - no logging anywhere in the file. - `packages/shared/src/utils/dice-notation.ts:22` - `DICE_NOTATION_REGEX = /^(\d+)?d(\d+)([+-]\d+)?$/i`, anchored, so `kh3`, `!`, `dF`, inner spaces and trailing attributes all miss. - `packages/server/src/routes/generate.routes.ts:7943` (the call) and `:7948-7958` (the `roll_dice` event that draws the card is sent only for rolls that actually happened). - `packages/client/src/lib/game-tag-parser.ts:497, :923, :961, :1023` - every `[dice: ...]` tag is stripped from visible text regardless of body. ## What's happening The engine finds the tag, fails to parse its contents, and returns the tag exactly as written - deliberately, so that already-resolved records like `[dice: 2d6 = 10 (4 + 6)]` survive a re-scan untouched. The unread request then rides that same path: no roll, so no dice card and no second pass that rewrites the narration around real numbers, and the client strips the leftover tag before the player sees it. The parse failure is never recorded, so the only evidence is a missing roll. ## Suggested fix Separate "already resolved" from "cannot be read" at the parse site instead of treating both as leave-alone. A resolved record already has a recognisable shape (`= total (...)`), so a body that matches neither that nor the supported notation can be treated as a genuine miss: log a warning naming the notation, and count it so a fix or regression is observable. Then decide one policy for telling the Game Master, ideally reusing whatever path already feeds roll results back into the same turn, so the model can re-ask in supported notation rather than inventing an outcome. If a player-visible note is wanted too, it should match how unresolvable skill checks already behave rather than inventing a second style. Worth pinning in the `game-text-dice` regression lane: it already asserts that unreadable notation rolls nothing, but nothing asserts that the miss is reported. ## Context This path arrived with merged PR #5979, which delivered issue #5959 (let the Game Master request rolls from narration text); it landed after v2.4.4, so it is unreleased on staging. Worth saying plainly: the silence toward the player looks intentional, not accidental - the Game Master instructions state the supported notation and say exploding dice, botches and other special pool rules are not implemented (`packages/server/src/services/game/gm-prompts.ts:776-777`), and `docs/game/dice-and-skill-checks.md` already describes leaving unresolvable checks alone with no banner. So the gap worth closing here is the missing server warning and the missing feedback to the model, not the quiet screen; the same reporting would naturally cover the unresolvable skill-check cases the documentation describes. A separate issue covers the `[skill_check:]` variant of the same parse failure, where the Game Master's invented numbers are also kept in the saved message. Found by an AI-assisted sweep of merged PR #5979 against issue #5959, then re-verified against staging 52799569c on 2026-09-13. Please verify before fixing. Related issue from the same sweep: #6123 (the `[skill_check:]` variant where invented numbers are kept).
bsakaguchi 2026-10-21 06:02:45 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Sep 13, 2026):

@SpicyMarinara is taking this report through the issue sweep in draft PR #6137, with Codex assisting. The affected current-code path has been checked; implementation and focused regression verification are in progress.

<!-- gh-comment-id:5651923792 --> @SpicyMarinara commented on GitHub (Sep 13, 2026): @SpicyMarinara is taking this report through the issue sweep in draft PR #6137, with Codex assisting. The affected current-code path has been checked; implementation and focused regression verification are in progress.
Author
Owner

@SpicyMarinara commented on GitHub (Sep 13, 2026):

Fixed in #6137, now merged to staging (e044997a2). Unsupported dice requests produce bounded diagnostics and a corrective generation path.

<!-- gh-comment-id:5652784484 --> @SpicyMarinara commented on GitHub (Sep 13, 2026): Fixed in #6137, now merged to staging (`e044997a2`). Unsupported dice requests produce bounded diagnostics and a corrective generation path.
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#3405
No description provided.