[PR #6797] [MERGED] feat(game): a ruleset's own items in the inventory #7334

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

📋 Pull Request Information

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

Base: staging ← Head: feat/ruleset-items-inventory


📝 Commits (7)

  • e4d07ca feat(game): a ruleset's own items in the inventory
  • 7434831 test(game): spend a ruleset item in a fight
  • 2ffdf61 fix(game): compare ruleset items in the turn record, and show the add row only when something can be added
  • 1c94d44 test(game): check the Game Master's streamed answers read the ruleset's items
  • 9638ea8 fix(game): stack what a new session brings back as its ruleset item allows, and word an item's price for any amount
  • 17e8f52 fix(game): add by id only what the game's layers leave in, restore only ids the ruleset has, and say fights already spend ruleset items
  • 2b6d138 fix(game): say when a picked item is no longer one of the ruleset's items

📊 Changes

26 files changed (+1968 additions, -140 deletions)

View changed files

📝 CHANGELOG.md (+3 -1)
📝 docs/extending/writing-rulesets.md (+9 -1)
📝 docs/game/party-and-npcs.md (+4 -1)
➕ e2e/game-ruleset-items.e2e.ts (+172 -0)
📝 packages/client/src/components/game/GameInventory.tsx (+137 -27)
📝 packages/client/src/components/game/GameSurface.tsx (+74 -3)
➕ packages/client/src/components/game/RulesetItemPicker.tsx (+248 -0)
➕ packages/client/src/hooks/use-ruleset-item-book.ts (+47 -0)
📝 packages/client/src/localization/locales/en.json (+13 -0)
📝 packages/client/vite.config.ts (+2 -1)
📝 packages/server/src/routes/combat-director.routes.ts (+3 -3)
📝 packages/server/src/routes/game-inventory.routes.ts (+4 -2)
📝 packages/server/src/routes/game.routes.ts (+4 -1)
📝 packages/server/src/routes/generate.routes.ts (+39 -3)
📝 packages/server/src/services/game/game-inventory.service.ts (+56 -0)
📝 packages/server/src/services/game/gm-prompts.ts (+29 -7)
➕ packages/shared/src/features/rulesets/item-book.ts (+151 -0)
📝 packages/shared/src/index.ts (+1 -0)
📝 packages/shared/src/utils/game-inventory-ops.ts (+34 -11)
📝 packages/shared/src/utils/game-inventory-stacks.ts (+247 -72)

...and 6 more files

📄 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 #6795

Builds on #6794 (item ids and nicknames), now merged.

Why this change

Capability API 1.49 (#6771) lets a ruleset ship catalogs of its own items, each with a category, rarity, tags, stats, a stack size and a price. Nothing in a game read them: Game Mode's inventory only held plain items typed in by name, so a ruleset's Hand axe was just a name, with none of its details, and the ruleset's freeform setting did nothing.

This is the second part of slice I2b of the ruleset items plan. I split I2b-2 in two (my call, like the I2 split, recorded in the plan): this PR puts the ruleset's items in the bag, and I2b-3 adds wearing and carrying (equip and bind with slots and the binding maximum, the Game Master's equip and bind commands, placement by carrying capacity, load and encumbrance). It needs no Capability API change.

What changed

  • A stack can be one of the ruleset's items. It stores item: "<catalog>/<entry>", which is its identity from then on, whatever it is called. Plain stacks are unchanged and still store no id, so saved games read exactly as before.
  • One item book (rulesetItemBook in packages/shared/src/features/rulesets/item-book.ts) reads a game's item catalogs the same way on the server and in the browser: which name is which item (its label, in any case; the first listed wins a shared label), how many one stack holds, and what each item is in the ruleset's own words (category, rarity and tag labels, the stats it gives, its summary and price). A layer that hides an entry takes it out of names and the picker, and an item already held still reads as itself.
  • Names find the ruleset's items. A name the player types, or one the Game Master writes in [inventory: action="add"], that is one of the ruleset's items adds that item. A held item still wins by its own name or a nickname, and a ruleset item wins over a plain item that only has its name.
  • A picker. The inventory's From the ruleset opens a picker over the ruleset's item catalogs (RulesetItemPicker, built like the sheet editor's catalog picker), with the catalogs' search and filters, each item's kind, stats, summary, price ("Price in marks: 4", since a ruleset's unit labels are plural) and stack size. The items ticked go into the bag of the open tab, one of each, in one change.
  • Details on the selected item: its category, rarity and tags, its stats, its summary, and how many one stack holds.
  • Stack sizes. An item's stack is the most one stack holds. Adding fills the bag's stacks of the item in order and starts new ones of at most that size; setting a count past it fills the stack and starts new ones right after it; merging pours in only what fits; giving fills the receiver's stack and starts a new one. One change never starts more than 50 stacks.
  • freeform: "refuse" leaves the player only the ruleset's items: the name field is hidden and the server refuses a typed plain item (not-ruleset-item). The Game Master's untyped items stay allowed; switching those off is slice I3's native.
  • The Game Master sees each ruleset item it holds with its facts in brackets, such as Hand axe ×2 [Weapon, Common, Thrown; Bulk 1, Damage 1d6, Rolls with brawn, Reach close], only the stats the ruleset leaves promptVisible. The command line adds that a name that is one of the ruleset's items becomes that item. The inventory tags stay on their own server path (I2), with the ruleset's items passed in, rather than moving into the sheet commands as the plan first said; the plan records this.
  • Fights and carry-over. A fight's spend check counts every item whose own name the spent name is, so a ruleset item can be spent. A new session brings a ruleset item back as itself, and what only the detailed inventory still names comes back stacked as its item allows. The turn record that decides whether a regenerated reply may restart the inventory now tells two stacks apart by their item too.
  • Also fixed: the inventory's toast after setting a count now says everything that moved when the count started new stacks (it said 19 when 24 arrows were added).
  • Docs. The author guide's "What reads items" now says what the inventory reads, and its stale "Nothing in a game reads items yet" is gone, along with the same claim in the I1 CHANGELOG entry. The inventory section in docs/game/party-and-npcs.md covers From the ruleset and stack sizes.

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 at 2b6d13824 (e4d07caed and the follow-up commits 7434831f7, 2ffdf618b, 1c94d4416, 9638ea858, 17e8f52b0 and 2b6d13824, on staging 50249cee9):

  • pnpm check exits 0, and pnpm localization:check exits 0.
  • pnpm regression:node passes 421/421.
  • pnpm smoke:ui passes 7/7.
  • pnpm regression:ui e2e/game-ruleset-items.e2e.ts e2e/game-inventory-bags.e2e.ts e2e/game-inventory-stacks.e2e.ts e2e/game-combat-ai.e2e.ts e2e/game-combat-director.e2e.ts --project=desktop-chromium --workers=1 passes 14/14.

Lanes:

  • game-inventory-stacks.regression.ts: a stack of a ruleset item is that item whatever it is called; saved item values are read back, and anything that is not a catalog and an entry is dropped; a name finds a ruleset item by its label, a nickname still finds a held one, and a ruleset item wins over a plain item that only has its name; adding by id, and refusing one the ruleset does not have; freeform: "refuse" refuses a new plain item but not one already held; stack sizes when adding (in order across stacks, then new ones), setting, merging and giving (the receiver's stack filled and a new one started); never more than 50 new stacks in one change; taking, counting, splitting, renaming and totals by item; the turn record telling apart stacks that differ only in their item; carry-over bringing a ruleset item back as itself, stacked as its item allows.
  • game-ruleset-items.regression.ts: the item book from both examples (names in any case, ids, stack sizes, labels, stats, prices, value labels, yes-or-no stats, stats hidden from the Game Master, a layer hiding an entry from names but not from what is held, the first of two same-named items winning); the Game Master's inventory with facts in brackets, for the player and per bag, and the command line only when the ruleset has an item catalog.
  • game-inventory-turn.regression.ts, through the real routes: the inventory route adding a ruleset item by typed name and by id and stacking arrows by 20; a freeform: "refuse" ruleset refusing a typed plain item as not-ruleset-item; a real Game Master turn whose tags add the ruleset's road rations (stacked by 7), a plain lamp, and the ruleset's arrows beside an old plain Arrows stack, with the streamed answers already reading the ruleset; the next turn's prompt showing the facts; a new session bringing thirty arrows back as 20 and 10.
  • combat-director-route.regression.ts: a fight spending a ruleset item.

Forty-seven deliberate breaks of these rules, in the shared helpers, the item book, the inventory route, the turn, carry-over, the prompt and the fight route, were each caught. The first full run caught 39 of 40: dropping the ruleset from the turn's first answering pass was missed, because the pass after saving corrects the saved reply. The lane now checks the answers streamed before the save, with an item whose answer differs, and that break is caught.

Local CodeRabbit (coderabbit review --agent), before opening:

  • First pass, four findings. Fixed in 2ffdf618b: the turn record compares items, the add row's condition, and the give test now overflows the receiver's stack. Declined: carry-over reading an item's own name back off a plain id in lowercase. That is #6794's code: the id keeps only the case-folded name, so there is no original spelling to recover; the item stays exactly itself, and the nickname the player sees keeps its spelling.
  • Second pass, two findings. Fixed in 9638ea858: carry-over now stacks what it brings back as the ruleset allows. Declined: using the "only takes its own items" message when a picked item is refused. A picked item is refused only when the ruleset no longer has it, whatever freeform says, so that message would be wrong; the general "Failed to add" message is the honest one.
  • Third pass, on 9638ea858: no findings.
  • Fourth pass, after GitHub's first review: one finding, the refused-pick message again. Fixed differently in 2b6d13824: a pick refused because the ruleset no longer offers it (a layer hides it, or its catalog changed since the picker loaded) now says "... is no longer one of this ruleset's items", apart from picks that failed for another reason.

GitHub CodeRabbit's first review found five. Four are fixed in 17e8f52b0: an item a layer hides can no longer be added by its id (the item rules gained offers, while itemOf still reads a hidden item already held); carry-over restores an item id only while the ruleset still has it; the author guide says a fight already spends a ruleset item; and the browser test opens the strict ruleset's game on a page of its own. Its translated-docs note is answered by the batched [docs-i18n] issue.

Clicked through by the agent in the browser test, at desktop width and, in a throwaway copy, at phone width (mobile-chromium, 1024 by 2216 screenshots): the picker, the item details, the stack split and a typed ruleset item. At phone width the picker is full screen, the chips wrap, and the item details, the nickname field, the amount row and the Add row (name, Add and From the ruleset) all fit inside the panel. The committed test runs at desktop width only: at phone width the Inventory button's text label is hidden and it has no accessible name, so getByRole("button", { name: /Inventory/ }) cannot find it. That is older than this PR and is filed as #6796.

A real model, run by the agent after opening: eight Game Master tellings on a local model (Gemma 4 E4B, Q8, through llama-server), in an isolated Engine on this branch with Ember Roads, a ruleset Hand axe, arrows nicknamed "Quiver" and a plain rope. In one telling of a purchase it wrote add item="Leather Coat" and add item="Road Rations" count="2". Both matched the ruleset's items despite the capital letters, were answered ok, and landed as Leather coat <outfitter/leather-coat> and Road rations <outfitter/road-rations>. It never copied the bracketed facts into a tag or its narration. In the other seven tellings it wrote no inventory tag, as on #6794 (a small local model rarely writes the command), so a real model spending an item it holds was not seen; the lanes cover that with a scripted reply.

Nothing is left to verify by hand.

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)

Docs touched: docs/game/party-and-npcs.md and docs/extending/writing-rulesets.md (both carried by docs-i18n) and CHANGELOG.md. Translations are batched for the items arc: these sections join the batched [docs-i18n] issue opened after the arc's last slice, so no per-PR issue is opened.

UI evidence (if applicable)

The new browser test e2e/game-ruleset-items.e2e.ts picks a Hand axe and Arrows from the picker, checks what the selected item shows, sets 25 arrows and sees a stack of 20 and one of 5, adds a Hand axe by typing its name, and checks that a ruleset that takes only its own items shows only the picker. It saves screenshots of the picker and the inventory.

Summary by CodeRabbit

  • New Features
    • Browse ruleset item catalogs with search and filters, view item details, and add selected items to inventory.
    • Add items by name when allowed; rulesets can restrict player inventories to catalog items.
    • Inventory stacks follow ruleset quantity limits, and item details are available in the Game Master’s view.
    • Ruleset items carry over between game sessions and can be recognized by name during combat.
  • Bug Fixes
    • Inventory transfers, merging, and quantity changes now respect item stack limits.
    • Combat item use now matches items by their own names, not nicknames.

🔄 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/6797 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 9/28/2026 **Status:** ✅ Merged **Merged:** 9/28/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `feat/ruleset-items-inventory` --- ### 📝 Commits (7) - [`e4d07ca`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e4d07caed49e369f8590701718a1d30251dffa63) feat(game): a ruleset's own items in the inventory - [`7434831`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7434831f744036568554d18cd746ea15cb4d4d3c) test(game): spend a ruleset item in a fight - [`2ffdf61`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2ffdf618b7c4ed586ad2f215c3609b2628badfec) fix(game): compare ruleset items in the turn record, and show the add row only when something can be added - [`1c94d44`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1c94d4416c12cf0fab1d52cac1b0256360b2ed62) test(game): check the Game Master's streamed answers read the ruleset's items - [`9638ea8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9638ea858958e42741de918e9865b79776f0c511) fix(game): stack what a new session brings back as its ruleset item allows, and word an item's price for any amount - [`17e8f52`](https://github.com/Pasta-Devs/Marinara-Engine/commit/17e8f52b069e7738eb0a337766e089e59c9f67db) fix(game): add by id only what the game's layers leave in, restore only ids the ruleset has, and say fights already spend ruleset items - [`2b6d138`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2b6d1382471f7b4fe853347f9f783339497e13fd) fix(game): say when a picked item is no longer one of the ruleset's items ### 📊 Changes **26 files changed** (+1968 additions, -140 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+3 -1) 📝 `docs/extending/writing-rulesets.md` (+9 -1) 📝 `docs/game/party-and-npcs.md` (+4 -1) ➕ `e2e/game-ruleset-items.e2e.ts` (+172 -0) 📝 `packages/client/src/components/game/GameInventory.tsx` (+137 -27) 📝 `packages/client/src/components/game/GameSurface.tsx` (+74 -3) ➕ `packages/client/src/components/game/RulesetItemPicker.tsx` (+248 -0) ➕ `packages/client/src/hooks/use-ruleset-item-book.ts` (+47 -0) 📝 `packages/client/src/localization/locales/en.json` (+13 -0) 📝 `packages/client/vite.config.ts` (+2 -1) 📝 `packages/server/src/routes/combat-director.routes.ts` (+3 -3) 📝 `packages/server/src/routes/game-inventory.routes.ts` (+4 -2) 📝 `packages/server/src/routes/game.routes.ts` (+4 -1) 📝 `packages/server/src/routes/generate.routes.ts` (+39 -3) 📝 `packages/server/src/services/game/game-inventory.service.ts` (+56 -0) 📝 `packages/server/src/services/game/gm-prompts.ts` (+29 -7) ➕ `packages/shared/src/features/rulesets/item-book.ts` (+151 -0) 📝 `packages/shared/src/index.ts` (+1 -0) 📝 `packages/shared/src/utils/game-inventory-ops.ts` (+34 -11) 📝 `packages/shared/src/utils/game-inventory-stacks.ts` (+247 -72) _...and 6 more files_ </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 #6795 Builds on #6794 (item ids and nicknames), now merged. ## Why this change Capability API 1.49 (#6771) lets a ruleset ship catalogs of its own items, each with a category, rarity, tags, stats, a stack size and a price. Nothing in a game read them: Game Mode's inventory only held plain items typed in by name, so a ruleset's Hand axe was just a name, with none of its details, and the ruleset's `freeform` setting did nothing. This is the second part of slice I2b of the ruleset items plan. I split I2b-2 in two (my call, like the I2 split, recorded in the plan): this PR puts the ruleset's items in the bag, and I2b-3 adds wearing and carrying (equip and bind with slots and the binding maximum, the Game Master's equip and bind commands, placement by carrying capacity, load and encumbrance). It needs no Capability API change. ## What changed - **A stack can be one of the ruleset's items.** It stores `item: "<catalog>/<entry>"`, which is its identity from then on, whatever it is called. Plain stacks are unchanged and still store no id, so saved games read exactly as before. - **One item book** (`rulesetItemBook` in `packages/shared/src/features/rulesets/item-book.ts`) reads a game's item catalogs the same way on the server and in the browser: which name is which item (its label, in any case; the first listed wins a shared label), how many one stack holds, and what each item is in the ruleset's own words (category, rarity and tag labels, the stats it gives, its summary and price). A layer that hides an entry takes it out of names and the picker, and an item already held still reads as itself. - **Names find the ruleset's items.** A name the player types, or one the Game Master writes in `[inventory: action="add"]`, that is one of the ruleset's items adds that item. A held item still wins by its own name or a nickname, and a ruleset item wins over a plain item that only has its name. - **A picker.** The inventory's **From the ruleset** opens a picker over the ruleset's item catalogs (`RulesetItemPicker`, built like the sheet editor's catalog picker), with the catalogs' search and filters, each item's kind, stats, summary, price ("Price in marks: 4", since a ruleset's unit labels are plural) and stack size. The items ticked go into the bag of the open tab, one of each, in one change. - **Details on the selected item:** its category, rarity and tags, its stats, its summary, and how many one stack holds. - **Stack sizes.** An item's `stack` is the most one stack holds. Adding fills the bag's stacks of the item in order and starts new ones of at most that size; setting a count past it fills the stack and starts new ones right after it; merging pours in only what fits; giving fills the receiver's stack and starts a new one. One change never starts more than 50 stacks. - **`freeform: "refuse"`** leaves the player only the ruleset's items: the name field is hidden and the server refuses a typed plain item (`not-ruleset-item`). The Game Master's untyped items stay allowed; switching those off is slice I3's `native`. - **The Game Master** sees each ruleset item it holds with its facts in brackets, such as `Hand axe ×2 [Weapon, Common, Thrown; Bulk 1, Damage 1d6, Rolls with brawn, Reach close]`, only the stats the ruleset leaves `promptVisible`. The command line adds that a name that is one of the ruleset's items becomes that item. The inventory tags stay on their own server path (I2), with the ruleset's items passed in, rather than moving into the sheet commands as the plan first said; the plan records this. - **Fights and carry-over.** A fight's spend check counts every item whose own name the spent name is, so a ruleset item can be spent. A new session brings a ruleset item back as itself, and what only the detailed inventory still names comes back stacked as its item allows. The turn record that decides whether a regenerated reply may restart the inventory now tells two stacks apart by their item too. - **Also fixed:** the inventory's toast after setting a count now says everything that moved when the count started new stacks (it said 19 when 24 arrows were added). - **Docs.** The author guide's "What reads items" now says what the inventory reads, and its stale "Nothing in a game reads items yet" is gone, along with the same claim in the I1 CHANGELOG entry. The inventory section in `docs/game/party-and-npcs.md` covers **From the ruleset** and stack sizes. ## 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 at 2b6d13824 (e4d07caed and the follow-up commits 7434831f7, 2ffdf618b, 1c94d4416, 9638ea858, 17e8f52b0 and 2b6d13824, on staging 50249cee9): - `pnpm check` exits 0, and `pnpm localization:check` exits 0. - `pnpm regression:node` passes 421/421. - `pnpm smoke:ui` passes 7/7. - `pnpm regression:ui e2e/game-ruleset-items.e2e.ts e2e/game-inventory-bags.e2e.ts e2e/game-inventory-stacks.e2e.ts e2e/game-combat-ai.e2e.ts e2e/game-combat-director.e2e.ts --project=desktop-chromium --workers=1` passes 14/14. Lanes: - `game-inventory-stacks.regression.ts`: a stack of a ruleset item is that item whatever it is called; saved `item` values are read back, and anything that is not a catalog and an entry is dropped; a name finds a ruleset item by its label, a nickname still finds a held one, and a ruleset item wins over a plain item that only has its name; adding by id, and refusing one the ruleset does not have; `freeform: "refuse"` refuses a new plain item but not one already held; stack sizes when adding (in order across stacks, then new ones), setting, merging and giving (the receiver's stack filled and a new one started); never more than 50 new stacks in one change; taking, counting, splitting, renaming and totals by item; the turn record telling apart stacks that differ only in their item; carry-over bringing a ruleset item back as itself, stacked as its item allows. - `game-ruleset-items.regression.ts`: the item book from both examples (names in any case, ids, stack sizes, labels, stats, prices, value labels, yes-or-no stats, stats hidden from the Game Master, a layer hiding an entry from names but not from what is held, the first of two same-named items winning); the Game Master's inventory with facts in brackets, for the player and per bag, and the command line only when the ruleset has an item catalog. - `game-inventory-turn.regression.ts`, through the real routes: the inventory route adding a ruleset item by typed name and by id and stacking arrows by 20; a `freeform: "refuse"` ruleset refusing a typed plain item as `not-ruleset-item`; a real Game Master turn whose tags add the ruleset's road rations (stacked by 7), a plain lamp, and the ruleset's arrows beside an old plain Arrows stack, with the streamed answers already reading the ruleset; the next turn's prompt showing the facts; a new session bringing thirty arrows back as 20 and 10. - `combat-director-route.regression.ts`: a fight spending a ruleset item. Forty-seven deliberate breaks of these rules, in the shared helpers, the item book, the inventory route, the turn, carry-over, the prompt and the fight route, were each caught. The first full run caught 39 of 40: dropping the ruleset from the turn's first answering pass was missed, because the pass after saving corrects the saved reply. The lane now checks the answers streamed before the save, with an item whose answer differs, and that break is caught. Local CodeRabbit (`coderabbit review --agent`), before opening: - First pass, four findings. Fixed in 2ffdf618b: the turn record compares items, the add row's condition, and the give test now overflows the receiver's stack. Declined: carry-over reading an item's own name back off a plain id in lowercase. That is #6794's code: the id keeps only the case-folded name, so there is no original spelling to recover; the item stays exactly itself, and the nickname the player sees keeps its spelling. - Second pass, two findings. Fixed in 9638ea858: carry-over now stacks what it brings back as the ruleset allows. Declined: using the "only takes its own items" message when a picked item is refused. A picked item is refused only when the ruleset no longer has it, whatever `freeform` says, so that message would be wrong; the general "Failed to add" message is the honest one. - Third pass, on 9638ea858: no findings. - Fourth pass, after GitHub's first review: one finding, the refused-pick message again. Fixed differently in 2b6d13824: a pick refused because the ruleset no longer offers it (a layer hides it, or its catalog changed since the picker loaded) now says "... is no longer one of this ruleset's items", apart from picks that failed for another reason. GitHub CodeRabbit's first review found five. Four are fixed in 17e8f52b0: an item a layer hides can no longer be added by its id (the item rules gained `offers`, while `itemOf` still reads a hidden item already held); carry-over restores an item id only while the ruleset still has it; the author guide says a fight already spends a ruleset item; and the browser test opens the strict ruleset's game on a page of its own. Its translated-docs note is answered by the batched `[docs-i18n]` issue. Clicked through by the agent in the browser test, at desktop width and, in a throwaway copy, at phone width (mobile-chromium, 1024 by 2216 screenshots): the picker, the item details, the stack split and a typed ruleset item. At phone width the picker is full screen, the chips wrap, and the item details, the nickname field, the amount row and the Add row (name, Add and **From the ruleset**) all fit inside the panel. The committed test runs at desktop width only: at phone width the Inventory button's text label is hidden and it has no accessible name, so `getByRole("button", { name: /Inventory/ })` cannot find it. That is older than this PR and is filed as #6796. A real model, run by the agent after opening: eight Game Master tellings on a local model (Gemma 4 E4B, Q8, through llama-server), in an isolated Engine on this branch with Ember Roads, a ruleset Hand axe, arrows nicknamed "Quiver" and a plain rope. In one telling of a purchase it wrote `add item="Leather Coat"` and `add item="Road Rations" count="2"`. Both matched the ruleset's items despite the capital letters, were answered `ok`, and landed as `Leather coat <outfitter/leather-coat>` and `Road rations <outfitter/road-rations>`. It never copied the bracketed facts into a tag or its narration. In the other seven tellings it wrote no inventory tag, as on #6794 (a small local model rarely writes the command), so a real model spending an item it holds was not seen; the lanes cover that with a scripted reply. Nothing is left to verify by hand. ## 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) Docs touched: `docs/game/party-and-npcs.md` and `docs/extending/writing-rulesets.md` (both carried by `docs-i18n`) and `CHANGELOG.md`. Translations are batched for the items arc: these sections join the batched `[docs-i18n]` issue opened after the arc's last slice, so no per-PR issue is opened. ## UI evidence (if applicable) The new browser test `e2e/game-ruleset-items.e2e.ts` picks a Hand axe and Arrows from the picker, checks what the selected item shows, sets 25 arrows and sees a stack of 20 and one of 5, adds a Hand axe by typing its name, and checks that a ruleset that takes only its own items shows only the picker. It saves screenshots of the picker and the inventory. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Browse ruleset item catalogs with search and filters, view item details, and add selected items to inventory. * Add items by name when allowed; rulesets can restrict player inventories to catalog items. * Inventory stacks follow ruleset quantity limits, and item details are available in the Game Master’s view. * Ruleset items carry over between game sessions and can be recognized by name during combat. * **Bug Fixes** * Inventory transfers, merging, and quantity changes now respect item stack limits. * Combat item use now matches items by their own names, not nicknames. <!-- 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:45 +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#7334
No description provided.