[PR #8272] [MERGED] fix(game): an item name with a comma is one item, ids find items, and pools read loosely #8258

Closed
opened 2026-10-26 04:04:09 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: fix/inventory-comma-names


📝 Commits (6)

  • e1143ea fix(game): an item name with a comma is one item, ids find items, and pools read loosely
  • 3e506cc fix(game): an item is found by its catalog ref, never by a bare id
  • 0e34ce1 Merge remote-tracking branch 'origin/staging' into fix/inventory-comma-names
  • f178da5 fix(game): an item sold by its ref is seen through as a fake like one sold by name
  • b5ea1e5 fix(game): an upcast and a rest's dice find their pool by a loose name too
  • 8e5c929 fix(game): a ref stays as written when its label finds another item first

📊 Changes

8 files changed (+188 additions, -13 deletions)

View changed files

📝 packages/shared/src/features/rulesets/item-book.ts (+6 -1)
📝 packages/shared/src/features/rulesets/live-state.ts (+51 -6)
📝 packages/shared/src/utils/game-inventory-tags.ts (+19 -2)
📝 packages/shared/src/utils/inventory-command-tag.ts (+8 -1)
📝 scripts/regressions/game-inventory-bags.regression.ts (+6 -3)
📝 scripts/regressions/game-ruleset-live.regression.ts (+6 -0)
📝 scripts/regressions/game-ruleset-markets.regression.ts (+90 -0)
📝 scripts/regressions/ruleset-rest-dice.regression.ts (+2 -0)

📄 Description

Linked issue

Closes #8271

Why this change

  • Before: the Game Master could not buy or add a ruleset item whose name holds a comma ("Rope, hempen (50 feet)" became two refused buys, "Lantern, hooded" two loose items), naming an item by its catalog ref was refused, and a sheet tag on pool="hit_points" was refused as an unknown pool.
  • After: a name that is one known item stays whole, items are found by their catalog ref too, and a pool written like a key or by its initials finds the pool it fits.

What changed

  • Inventory tags: the parsed request keeps the unsplit item text (whole). When it is the name of a ruleset item, a coin, or something already held, it is one item; otherwise the list splits as before.
  • Item book: itemNamed also finds an offered item by its full ref (catalog/id). A bare id is still not a name. An inventory tag written with a ref reads as the item's name before its stack is looked up, so a fake sold by ref is seen through like one sold by name.
  • Sheet live state: a pool name that is not an exact match is compared with separators folded ("hit_points", "Hit-Points") or as the label's initials ("HP"), declared pools only and only when one alone fits. The upcast pool of a use and the pool of a rest's dice read names the same way.

Validation

  • Regressions pass locally: game-ruleset-live, game-ruleset-markets (new cases), ruleset-rest-dice, game-ruleset-combat-cast-ladder, game-ruleset-check-effects, game-ruleset-check-entries, game-ruleset-items, game-inventory-bags (parse expectations now carry whole), game-inventory-stacks, game-ruleset-invented-items, game-ruleset-money, game-ruleset-seller-honesty, game-ruleset-loot, dice-display, dice-notation, gm-skill-check-resolution, one-request-dice-branch, prompt
  • Shared and server typecheck, prettier
  • 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

  • Found in an end-to-end Game Mode pass against an SRD ruleset; covered here by regressions on the example rulesets.

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/8272 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `fix/inventory-comma-names` --- ### 📝 Commits (6) - [`e1143ea`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e1143eafc381816a08cd6a7742f55b7654f5eff5) fix(game): an item name with a comma is one item, ids find items, and pools read loosely - [`3e506cc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3e506cca7a6bf3b427c9af7b885895c5f1c96212) fix(game): an item is found by its catalog ref, never by a bare id - [`0e34ce1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0e34ce18353b423895991d799dc6bb24d98ac896) Merge remote-tracking branch 'origin/staging' into fix/inventory-comma-names - [`f178da5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f178da5804b21b480755009538e681b6d90bdcd2) fix(game): an item sold by its ref is seen through as a fake like one sold by name - [`b5ea1e5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b5ea1e519d60addaa19fd1b0cfb322cf0d63224b) fix(game): an upcast and a rest's dice find their pool by a loose name too - [`8e5c929`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8e5c929d60ed5df75e4fda16eba6967a15fed5d6) fix(game): a ref stays as written when its label finds another item first ### 📊 Changes **8 files changed** (+188 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `packages/shared/src/features/rulesets/item-book.ts` (+6 -1) 📝 `packages/shared/src/features/rulesets/live-state.ts` (+51 -6) 📝 `packages/shared/src/utils/game-inventory-tags.ts` (+19 -2) 📝 `packages/shared/src/utils/inventory-command-tag.ts` (+8 -1) 📝 `scripts/regressions/game-inventory-bags.regression.ts` (+6 -3) 📝 `scripts/regressions/game-ruleset-live.regression.ts` (+6 -0) 📝 `scripts/regressions/game-ruleset-markets.regression.ts` (+90 -0) 📝 `scripts/regressions/ruleset-rest-dice.regression.ts` (+2 -0) </details> ### 📄 Description ## Linked issue Closes #8271 ## Why this change - Before: the Game Master could not buy or add a ruleset item whose name holds a comma ("Rope, hempen (50 feet)" became two refused buys, "Lantern, hooded" two loose items), naming an item by its catalog ref was refused, and a sheet tag on `pool="hit_points"` was refused as an unknown pool. - After: a name that is one known item stays whole, items are found by their catalog ref too, and a pool written like a key or by its initials finds the pool it fits. ## What changed - Inventory tags: the parsed request keeps the unsplit item text (`whole`). When it is the name of a ruleset item, a coin, or something already held, it is one item; otherwise the list splits as before. - Item book: `itemNamed` also finds an offered item by its full ref (`catalog/id`). A bare id is still not a name. An inventory tag written with a ref reads as the item's name before its stack is looked up, so a fake sold by ref is seen through like one sold by name. - Sheet live state: a pool name that is not an exact match is compared with separators folded ("hit_points", "Hit-Points") or as the label's initials ("HP"), declared pools only and only when one alone fits. The upcast pool of a `use` and the pool of a rest's dice read names the same way. ## Validation - [x] Regressions pass locally: `game-ruleset-live`, `game-ruleset-markets` (new cases), `ruleset-rest-dice`, `game-ruleset-combat-cast-ladder`, `game-ruleset-check-effects`, `game-ruleset-check-entries`, `game-ruleset-items`, `game-inventory-bags` (parse expectations now carry `whole`), `game-inventory-stacks`, `game-ruleset-invented-items`, `game-ruleset-money`, `game-ruleset-seller-honesty`, `game-ruleset-loot`, `dice-display`, `dice-notation`, `gm-skill-check-resolution`, `one-request-dice-branch`, `prompt` - [x] Shared and server typecheck, prettier - [ ] 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) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Found in an end-to-end Game Mode pass against an SRD ruleset; covered here by regressions on the example rulesets. ## 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-26 04:04:09 +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#8258
No description provided.