[PR #8349] [MERGED] fix(game): tell the GM which named items nobody carries, and refuse an add made only to hand on #8312

Closed
opened 2026-10-27 06:07:36 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8349
Author: @kolacheee
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @kolacheee

Base: staging ← Head: claude/project-thread-r412n9


📝 Commits (2)

  • 5bf2bc1 fix(game): tell the GM which named items nobody carries, and refuse an add made only to hand on
  • 0f39901 fix(game): say two book entries that name each other once, and share the item name stem

📊 Changes

5 files changed (+240 additions, -3 deletions)

View changed files

📝 packages/server/src/routes/generate.routes.ts (+16 -1)
📝 packages/server/src/services/game/gm-prompts.ts (+4 -0)
➕ packages/server/src/services/game/gm-turn-notices.ts (+49 -0)
📝 packages/shared/src/utils/game-inventory-tags.ts (+41 -2)
➕ scripts/regressions/game-gm-turn-notices.regression.ts (+130 -0)

📄 Description

Linked issue

Closes #8348

Why this change

  • After #8331, Claude and GPT models say in the story that an item nobody carries isn't there. Small models such as Gemini 3.5 Flash-Lite read past that general rule and still hand the item over.
  • Some replies make the item out of nothing to hand it on: an add into a companion's bag, then a give of it to someone else. The Engine carried out both.

What changed

  • When the player's message names an item from the ruleset's item book that no bag in the party holds, the turn part of the GM reminder says so just before its closing lines: Nobody in the party carries: Torch. It matches whole words, plural and case aside, counts nicknames as held, and names an item once when a longer one holds its name. It says "carries", not "isn't there", so an item in the scene can still be picked up.
  • An inventory add that the same reply then gives or removes from the same bag is refused with reason no-source. An add that says where it came from (source= or from=) stands. An add with to is read as a give, so it needs the item in who's bag.

Validation

  • pnpm check passes locally: server tsc --noEmit and Prettier on the changed files pass. The full check was not run.
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually (described below)
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths): not applicable, no UI change
  • Above manual verification completed (described below)
  • Read and followed CONTRIBUTING.md

A new game-gm-turn-notices regression pins the notice's matching, where it sits in the reminder (turn part only), and which adds are refused. 379 regressions matching game, gm-, party, inventory and prompt pass.

Manual verification notes

  • Real Game Mode turns on a 5e game, run against a copy of the data with the same checks, on Gemini 3.5 Flash-Lite, Claude Sonnet 5.5, Claude Haiku 5.5 and GPT-5.6 Terra (336 turns, no errors).
  • Asking for a torch nobody carries: Flash-Lite's clean replies went from 0 of 6 to 4 of 6, the first change in six rounds that moved it. The other models stayed at 5/6, 6/6 and 6/6.
  • The notice fired on every turn that named the torch, and never on a potion the party holds. Searching still finds light as often as before.
  • The add backstop never fired, because with #8331's wording models stopped writing add-then-give. It stays as a cheap guard for prompts that don't have that wording.
  • Healing, reply length and the cached share of the prompt were unchanged.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) 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)

🔄 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/8349 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `claude/project-thread-r412n9` --- ### 📝 Commits (2) - [`5bf2bc1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5bf2bc15061e4db946596c4f17af46b0e1611479) fix(game): tell the GM which named items nobody carries, and refuse an add made only to hand on - [`0f39901`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0f399010a453bcbba7993ff164e0bb71ffcdb017) fix(game): say two book entries that name each other once, and share the item name stem ### 📊 Changes **5 files changed** (+240 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/generate.routes.ts` (+16 -1) 📝 `packages/server/src/services/game/gm-prompts.ts` (+4 -0) ➕ `packages/server/src/services/game/gm-turn-notices.ts` (+49 -0) 📝 `packages/shared/src/utils/game-inventory-tags.ts` (+41 -2) ➕ `scripts/regressions/game-gm-turn-notices.regression.ts` (+130 -0) </details> ### 📄 Description ## Linked issue Closes #8348 ## Why this change - After #8331, Claude and GPT models say in the story that an item nobody carries isn't there. Small models such as Gemini 3.5 Flash-Lite read past that general rule and still hand the item over. - Some replies make the item out of nothing to hand it on: an add into a companion's bag, then a give of it to someone else. The Engine carried out both. ## What changed - When the player's message names an item from the ruleset's item book that no bag in the party holds, the turn part of the GM reminder says so just before its closing lines: `Nobody in the party carries: Torch.` It matches whole words, plural and case aside, counts nicknames as held, and names an item once when a longer one holds its name. It says "carries", not "isn't there", so an item in the scene can still be picked up. - An inventory add that the same reply then gives or removes from the same bag is refused with reason `no-source`. An add that says where it came from (`source=` or `from=`) stands. An add with `to` is read as a give, so it needs the item in `who`'s bag. ## Validation - [ ] `pnpm check` passes locally: server `tsc --noEmit` and Prettier on the changed files pass. The full check was not run. - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually (described below) - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths): not applicable, no UI change - [x] Above manual verification completed (described below) - [x] Read and followed `CONTRIBUTING.md` A new `game-gm-turn-notices` regression pins the notice's matching, where it sits in the reminder (turn part only), and which adds are refused. 379 regressions matching game, gm-, party, inventory and prompt pass. ### Manual verification notes - Real Game Mode turns on a 5e game, run against a copy of the data with the same checks, on Gemini 3.5 Flash-Lite, Claude Sonnet 5.5, Claude Haiku 5.5 and GPT-5.6 Terra (336 turns, no errors). - Asking for a torch nobody carries: Flash-Lite's clean replies went from 0 of 6 to 4 of 6, the first change in six rounds that moved it. The other models stayed at 5/6, 6/6 and 6/6. - The notice fired on every turn that named the torch, and never on a potion the party holds. Searching still finds light as often as before. - The add backstop never fired, because with #8331's wording models stopped writing add-then-give. It stays as a cheap guard for prompts that don't have that wording. - Healing, reply length and the cached share of the prompt were unchanged. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-27 06:07:36 +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#8312
No description provided.