[PR #6810] [MERGED] feat(game): wear, bind and carry a ruleset's items #7338

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

📋 Pull Request Information

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

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


📝 Commits (10+)

  • 9c79723 feat(game): wear, bind and carry a ruleset's items
  • 858f274 test(game): wearing and carrying checks, and the same player sheet on the screen and the server
  • da91690 docs(game): wearing, binding and carrying ruleset items
  • 1b8e7f0 fix(game): keep every card's sheet for its own bag, and announce all picks together
  • 67a9acd test(game): a give past the limit, the most room first, and bound items counted per bag
  • 38eaebc fix(game): the player cannot use up a bound cursed item by name either
  • 1e01866 fix(game): weigh a Game Master's give by what it would move, and compare holders by their bag key
  • e89ca0f fix(game): ask each bag once when placing an addition, and read the player's sheet only when their name changes
  • a546953 fix(game): offer the Game Master only the wear actions a ruleset has (#6801)
  • b8cc844 fix(game): hold merges to the carrying limit and keep cursed items out of fights (#6801)

📊 Changes

24 files changed (+2567 additions, -147 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 docs/extending/writing-rulesets.md (+6 -1)
📝 docs/game/party-and-npcs.md (+13 -3)
📝 e2e/game-ruleset-items.e2e.ts (+4 -0)
➕ e2e/game-ruleset-wearing.e2e.ts (+246 -0)
📝 packages/client/src/components/game/GameInventory.tsx (+200 -10)
📝 packages/client/src/components/game/GameSurface.tsx (+245 -35)
📝 packages/client/src/hooks/use-ruleset-item-book.ts (+10 -3)
📝 packages/client/src/localization/locales/en.json (+28 -0)
📝 packages/server/src/routes/combat-director.routes.ts (+16 -2)
📝 packages/server/src/routes/generate.routes.ts (+18 -2)
📝 packages/server/src/services/game/game-inventory.service.ts (+47 -7)
📝 packages/server/src/services/game/gm-prompts.ts (+99 -10)
📝 packages/shared/src/features/rulesets/item-book.ts (+70 -1)
📝 packages/shared/src/utils/game-inventory-ops.ts (+106 -27)
📝 packages/shared/src/utils/game-inventory-stacks.ts (+446 -29)
📝 packages/shared/src/utils/game-inventory-tags.ts (+88 -2)
📝 packages/shared/src/utils/game-inventory-turns.ts (+5 -3)
📝 packages/shared/src/utils/inventory-command-tag.ts (+26 -10)
📝 scripts/regressions/combat-director-route.regression.ts (+69 -1)

...and 4 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 #6801

Why this change

A ruleset's items are in Game Mode's inventory since #6797, but nothing about wearing or carrying them worked:

  • The ruleset's slots and an item's slots were only stored. Nothing let a character put an item on, and nothing stopped two suits of armor being worn at once.
  • binding (5e attunement, PF2e investiture) and an item's binds did nothing, and a cursed item could be dropped like any other.
  • carry did nothing: every item went to the player's own bag however much they already carried, and nobody was ever encumbered. The maintainer asked for weight to count for rulesets like 5e.

This is the last part of slice I2b of the ruleset items plan (wearing and carrying), and needs no Capability API change.

What changed

  • Worn and bound stacks. A stack can be equipped and bound, and such a stack is always one item. Equipping or binding one item of a larger stack takes it into a stack of its own, right after. A worn or bound stack is never topped up, merged or split, a count set past one puts the rest beside it unworn, taking by name takes what nobody wears first, and a stack handed to someone else arrives neither worn nor bound. Plain stacks and saved games are unchanged.
  • Equip needs the item to take slots (slots on the entry) and its bearer to have those slots free (the ruleset's items.slots), counted per character.
  • Bind needs the item to bind, and its bearer to be under binding.max, read off their own sheet. A bound cursed item stays with its bearer: the player cannot unbind it, take it off, give it away or remove it. The Game Master can, so a curse can end in the story.
  • Carrying. An item weighs its value of carry.stat, and a character's load is what their bag weighs, against encumberedAbove and limit read off their own sheet (rulesetItemBearers). An item added into the shared view (the player's Add or picker from All, or the Game Master's add with no who=) is placed as the plan says (placeGameInventoryAddition): all of it to the first who can carry it without becoming encumbered (the player first, then the party in order); otherwise split by the room each has left; what still does not fit, one at a time to whoever is then least over. Nothing goes past anyone's limit: what nobody can carry is left behind and reported. Adding into one bag, raising a count, and giving are held to that bag's limit too. A game whose ruleset has no carry keeps adding to the player's bag, as before.
  • The player's sheet is the card named for who the chat plays as, or the first card when no card has that name, read the same way by the server and the screen.
  • The Game Master's grammar gains action="equip|unequip|bind|unbind", taught only when the ruleset has slots or binding. Putting on prefers the item already bound, and binding the one worn. A shared add is answered once per bag it went into (the player's naming nobody), plus a too-heavy refusal for what was left behind, and a give past the receiver's limit is refused as too-heavy. Its block shows each item's worn and bound counts, such as Hunting bow ×2 (1 worn), and each character's load, bound items and slots, such as - Ada (load 8 of 6, most 12, encumbered; Hands 2 of 2). The carrying sentence appears only with carry.
  • On the screen: worn and bound marks on the slots, Equipped and binding toggles on the selected item (the binding one named with the ruleset's word, such as Bound), the binding restriction and a cursed note, each bag's load, bound items and slots on its tab, and each bag's load in the shared view. Refusals say why (no free slot, cursed, too heavy for whom), a shared add says who got what, and the Game Master's equip and bind commands are announced.
  • Docs. docs/game/party-and-npcs.md gains "Wearing, binding and carrying", and the author guide's "What reads items" says what slots, binding and carrying now do, including "integer": false for fractional weights. CHANGELOG entry.

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 b8cc84482 (9c79723ae and the follow-up commits 858f2743e, da9169005, 1b8e7f063, 67a9acdbe, 38eaebc63, 1e0186631, e89ca0f26, a546953d9 and b8cc84482, rebased on staging e75e5ff61):

  • pnpm check and pnpm localization:check exit 0 (at b8cc84482).
  • pnpm regression:node passes 422/422 (at b8cc84482).
  • pnpm smoke:ui passes 7/7 (at b8cc84482; one earlier run lost the home-screen test to ERR_NETWORK_IO_SUSPENDED on this laptop and passed on the rerun).
  • pnpm regression:ui e2e/game-ruleset-wearing.e2e.ts 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 15/15 (at b8cc84482, and the three inventory specs again after its last client change).

Lanes:

  • game-inventory-stacks.regression.ts: worn and bound marks read on one item only; equipping takes free slots per bearer (a second two-handed bow finds no hand free, an item without slots cannot be worn) and one item of a larger stack into its own; binding up to the bearer's maximum (a companion's bound item not counted), only what binds; a bound cursed item kept for the player (no unbinding, taking off, giving, removing or using up by name) but not for the Game Master; worn stacks never topped up or merged, a count set past one going beside it unworn, a give arriving unworn, taking by name taking unworn first; loads with fractions; placement (whole to the first who can, the most room first, least over, never past a limit, left behind, weightless and no-carry to the first, into one bag up to its limit, a bag named twice asked once); the operations' placed, left, too-heavy, cursed and wear answers, a raised count held to the limit; worn and bound counts in totals and the turn record.
  • game-inventory-bags.regression.ts: the grammar's equip, unequip, bind and unbind; zero kept in an answer; the Game Master's shared adds answered per bag and with a too-heavy refusal for what was left, an add into one bag up to its limit, a give past the receiver's limit refused while a give of more than the giver holds weighs only what it holds; putting on, binding and ending a curse by name, each answered with how many are so now.
  • game-ruleset-items.regression.ts: weights, slots, binding and curses from both example rulesets; each character's carrying and binding limits read off their own sheet (a missing sheet reads blank); the Game Master's block with worn and bound counts, each character's load, bound items and slots, the carrying sentence only with carry, and equip and unequip offered only with slots and bind and unbind only with binding (a slots-only, a binding-only and a both ruleset).
  • game-inventory-turn.regression.ts, through the real routes: the player's shared adds placed by who can carry them; a real Game Master turn sharing ten arrows between the player and Bram, then four bows with one left behind; a give past Bram's limit refused; the coat and a bow equipped and the second bow finding no free hand; the next prompt showing each character's load, slots and what is worn; Gravewatch's binding up to Nerve, the cursed ring refused for the player four ways and unbound by the Game Master; a game whose only card is a companion's still reading it for their own bag.

Sixty deliberate breaks of these rules, in the shared helpers, the operations, the Game Master's tags and grammar, the item book, the inventory service, the generate route and the prompt, were each caught. The first full run caught 52 of 55; the three it missed (the give helper's own weight guard, the order room is shared out in, bound items counted per bag) now each have a check that catches them.

Found and fixed along the way:

  • From the maintainer's review, in b8cc84482: dragging a stack onto one in another character's bag skipped the carrying limit that Give applies. The merge now weighs what actually moves against the receiver's limit and answers too-heavy, with a message naming who cannot carry it; merges within one bag are unchanged. game-inventory-stacks.regression.ts and the browser test cover it.

  • From the maintainer's review, in b8cc84482: a directed fight could use up a bound cursed item. The fight now reads the player's item rules, refuses that spend with a message, and rolls the whole step back if any take comes up short. combat-director-route.regression.ts proves it through the real routes with Gravewatch's Widow's ring.

  • The screen and the server read the player's sheet differently: the screen showed "Bound 1/2" where the server allowed one. Both now read the card named for who the chat plays as, else the first card (858f2743e).

  • Raising a count with the amount field was not held to the carrying limit, though adding and giving were (858f2743e).

  • Equipping by the Game Master put on the unbound ring of two after binding one; it now prefers the item already bound, and binding the one worn (858f2743e).

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

  • First pass, two findings, fixed in 1b8e7f063: the party's sheets keep every card, so the first card read for the player still carries by its own sheet when it is a companion's; and items picked together are announced together, with one message for what nobody could carry.
  • Second pass, one finding, fixed in 38eaebc63: taking by name (a classic fight's Use) could use up a bound cursed item for the player.
  • Third pass, two findings, fixed in 1e0186631: a Game Master's give of more than the giver holds was weighed by the whole request; and the screen compared holders by their raw names.
  • Fourth pass: a connection error, run again after rebasing onto staging.
  • Fifth pass, on the rebased branch, two findings, fixed in e89ca0f26: a bag named twice among those an addition may go to had its room counted twice, and the screen rebuilt the party's sheets whenever the party list changed rather than when the player's name did.
  • Sixth pass, on e89ca0f26, run once the rate limit lifted: no findings. The wear-line fix from the real-model run (a546953d9) came after it.
  • Seventh pass, on the review fixes before b8cc84482: one finding, fixed in b8cc84482 (a drag that merges nothing for another reason now says so too).

Clicked through by the agent in the browser test at desktop width (screenshots of the player's bag with the coat and bow worn, and of the bound cursed ring): the tabs' status line, the worn and bound marks on the slots, the Equipped and Bound toggles, the binding restriction and cursed note, and the refusal message.
At phone width (mobile-chromium, in a throwaway copy of the same test that opens the inventory by its icon, since that button has no accessible name on phones, #6796): the status chips, the marks, the details, the wrapped action row with Equipped, Bound and Use, and the Add row all fit inside the panel.
Game Master turns on a real local model (Gemma 4 E4B, Q8, through llama.cpp) on an isolated Engine from this branch, in Ember Roads games with Bram in the party, 33 tellings in all:

  • Shared add: asked to buy twenty arrows for the party, both tellings wrote the add without who. The Engine gave 6 to the player (up to their limit of 12) and 12 to Bram (up to Bram's), refused the last 2 as too-heavy, and answered Bram's share with the name and the player's without one.
  • Give: handing the bow to Bram, already at the limit, was refused as too-heavy and the bow stayed. The model narrated the handover in the same reply, since it only sees the answer on the next turn.
  • Equip, asked plainly: the coat (1 of 1), the bow in a short game (2 of 3) and Bram's hand axe with who="Bram" (1 of 2) were put on, and the next prompt showed the new slot counts. A retelling without the tag left the item unworn.
  • What the model did not do: it never wrote an equip from the story alone ("I put on my coat", 0 of 6), stopped writing them late in a long scene even when asked plainly (0 of 9), and wrote no unequip even when asked plainly (0 of 5). Its reasoning names the change and then writes no tag, so this is the size of the model rather than the Engine: every tag it did write was carried out as written. One garbled add (count="20, road rations") became an add of one.
  • Fixed from this run in a546953d9: the wear line offered bind and unbind to Ember Roads, which has no binding, and only spoke of putting an item on, which does not fit a bow. It now lists equip and unequip only with slots and bind and unbind only with binding, and says "puts on, wields or readies". A check in game-ruleset-items.regression.ts catches the old line that offered all four.

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. The translation follow-up for this wearing, binding and carrying slice is tracked in #6813; it covers both changed documentation pages and every translated language pack on docs-i18n.

UI evidence (if applicable)

The new browser test e2e/game-ruleset-wearing.e2e.ts checks each bag's load in the shared view, picks a bow and a coat that fit the player and a second coat that goes to a party member, puts both items on with Equipped (with the body and hands counts), and binds a cursed ring that then cannot be unbound. It saves screenshots of both.

Summary by CodeRabbit

  • New Features
    • Supported games can define equipment slots, binding limits, cursed items, item weights, and carrying limits.
    • Equip, unequip, bind, and unbind items. Inventory shows worn and bound status, slot use, and character load.
    • Items added without a named recipient are distributed among characters who can carry them; excess items are left behind with an explanation.
    • Game Masters can manage equipment and binding, view character inventory status, and distribute items according to carrying rules.
  • Bug Fixes
    • Transfers respect carrying limits, and item use respects cursed-item restrictions.
  • Documentation
    • Updated guides to explain inventory rules and Game Master actions.

Maintainer verification

The carry-capacity and cursed-item findings are fixed. Independent runtime proofs confirm that cross-bag merges reject excess weight, same-bag merges still work, Classic combat refuses a cursed-item spend without saving any part of the action, and retrying with an unbound spare succeeds while preserving the bound item. Three focused retained regressions pass, and earlier hosted comments are addressed.

The prepared staging integration passes pnpm check, three prompt regressions and the real inventory-turn regression. Its 21 author-only files and 101 incoming-only files match their respective parents; the two shared source files match Git's automatic merge, and both changelog blocks are retained. Later staging follow-ups are incorporated verbatim with exact file-equivalence checks. Manual validation checkboxes remain unchanged.

Current-head hosted CodeRabbit and required checks remain merge gates.


🔄 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/6810 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 9/28/2026 **Status:** ✅ Merged **Merged:** 9/28/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/ruleset-items-wearing` --- ### 📝 Commits (10+) - [`9c79723`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9c79723ae6b86df58097bf6f81583b47967bd247) feat(game): wear, bind and carry a ruleset's items - [`858f274`](https://github.com/Pasta-Devs/Marinara-Engine/commit/858f2743e6d16b751589129dc4863d92b103e568) test(game): wearing and carrying checks, and the same player sheet on the screen and the server - [`da91690`](https://github.com/Pasta-Devs/Marinara-Engine/commit/da91690051609a5406b67e9547f3de3917a1bdc4) docs(game): wearing, binding and carrying ruleset items - [`1b8e7f0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1b8e7f0638c99e5da0384ca26bb43ae87b414103) fix(game): keep every card's sheet for its own bag, and announce all picks together - [`67a9acd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/67a9acdbea8d6822392c129d627730ebdd52a9ac) test(game): a give past the limit, the most room first, and bound items counted per bag - [`38eaebc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/38eaebc638efefacd15b337582110110fbeea303) fix(game): the player cannot use up a bound cursed item by name either - [`1e01866`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1e018663192c893c401b3eecd77201d0fcd81771) fix(game): weigh a Game Master's give by what it would move, and compare holders by their bag key - [`e89ca0f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e89ca0f26ea60bdc6076693e09daec50ae058683) fix(game): ask each bag once when placing an addition, and read the player's sheet only when their name changes - [`a546953`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a546953d935459e9518fda802a109c963c7658f8) fix(game): offer the Game Master only the wear actions a ruleset has (#6801) - [`b8cc844`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b8cc844820cedd000e8e7681122bf51637395401) fix(game): hold merges to the carrying limit and keep cursed items out of fights (#6801) ### 📊 Changes **24 files changed** (+2567 additions, -147 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `docs/extending/writing-rulesets.md` (+6 -1) 📝 `docs/game/party-and-npcs.md` (+13 -3) 📝 `e2e/game-ruleset-items.e2e.ts` (+4 -0) ➕ `e2e/game-ruleset-wearing.e2e.ts` (+246 -0) 📝 `packages/client/src/components/game/GameInventory.tsx` (+200 -10) 📝 `packages/client/src/components/game/GameSurface.tsx` (+245 -35) 📝 `packages/client/src/hooks/use-ruleset-item-book.ts` (+10 -3) 📝 `packages/client/src/localization/locales/en.json` (+28 -0) 📝 `packages/server/src/routes/combat-director.routes.ts` (+16 -2) 📝 `packages/server/src/routes/generate.routes.ts` (+18 -2) 📝 `packages/server/src/services/game/game-inventory.service.ts` (+47 -7) 📝 `packages/server/src/services/game/gm-prompts.ts` (+99 -10) 📝 `packages/shared/src/features/rulesets/item-book.ts` (+70 -1) 📝 `packages/shared/src/utils/game-inventory-ops.ts` (+106 -27) 📝 `packages/shared/src/utils/game-inventory-stacks.ts` (+446 -29) 📝 `packages/shared/src/utils/game-inventory-tags.ts` (+88 -2) 📝 `packages/shared/src/utils/game-inventory-turns.ts` (+5 -3) 📝 `packages/shared/src/utils/inventory-command-tag.ts` (+26 -10) 📝 `scripts/regressions/combat-director-route.regression.ts` (+69 -1) _...and 4 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 #6801 ## Why this change A ruleset's items are in Game Mode's inventory since #6797, but nothing about wearing or carrying them worked: - The ruleset's `slots` and an item's `slots` were only stored. Nothing let a character put an item on, and nothing stopped two suits of armor being worn at once. - `binding` (5e attunement, PF2e investiture) and an item's `binds` did nothing, and a cursed item could be dropped like any other. - `carry` did nothing: every item went to the player's own bag however much they already carried, and nobody was ever encumbered. The maintainer asked for weight to count for rulesets like 5e. This is the last part of slice I2b of the ruleset items plan (wearing and carrying), and needs no Capability API change. ## What changed - **Worn and bound stacks.** A stack can be `equipped` and `bound`, and such a stack is always one item. Equipping or binding one item of a larger stack takes it into a stack of its own, right after. A worn or bound stack is never topped up, merged or split, a count set past one puts the rest beside it unworn, taking by name takes what nobody wears first, and a stack handed to someone else arrives neither worn nor bound. Plain stacks and saved games are unchanged. - **Equip** needs the item to take slots (`slots` on the entry) and its bearer to have those slots free (the ruleset's `items.slots`), counted per character. - **Bind** needs the item to `bind`, and its bearer to be under `binding.max`, read off their own sheet. A bound `cursed` item stays with its bearer: the player cannot unbind it, take it off, give it away or remove it. The Game Master can, so a curse can end in the story. - **Carrying.** An item weighs its value of `carry.stat`, and a character's load is what their bag weighs, against `encumberedAbove` and `limit` read off their own sheet (`rulesetItemBearers`). An item added into the shared view (the player's **Add** or picker from **All**, or the Game Master's `add` with no `who=`) is placed as the plan says (`placeGameInventoryAddition`): all of it to the first who can carry it without becoming encumbered (the player first, then the party in order); otherwise split by the room each has left; what still does not fit, one at a time to whoever is then least over. Nothing goes past anyone's `limit`: what nobody can carry is left behind and reported. Adding into one bag, raising a count, and giving are held to that bag's limit too. A game whose ruleset has no `carry` keeps adding to the player's bag, as before. - **The player's sheet** is the card named for who the chat plays as, or the first card when no card has that name, read the same way by the server and the screen. - **The Game Master's grammar** gains `action="equip|unequip|bind|unbind"`, taught only when the ruleset has slots or binding. Putting on prefers the item already bound, and binding the one worn. A shared `add` is answered once per bag it went into (the player's naming nobody), plus a `too-heavy` refusal for what was left behind, and a give past the receiver's limit is refused as `too-heavy`. Its block shows each item's worn and bound counts, such as `Hunting bow ×2 (1 worn)`, and each character's load, bound items and slots, such as `- Ada (load 8 of 6, most 12, encumbered; Hands 2 of 2)`. The carrying sentence appears only with `carry`. - **On the screen:** worn and bound marks on the slots, **Equipped** and binding toggles on the selected item (the binding one named with the ruleset's word, such as **Bound**), the binding restriction and a cursed note, each bag's load, bound items and slots on its tab, and each bag's load in the shared view. Refusals say why (no free slot, cursed, too heavy for whom), a shared add says who got what, and the Game Master's equip and bind commands are announced. - **Docs.** `docs/game/party-and-npcs.md` gains "Wearing, binding and carrying", and the author guide's "What reads items" says what slots, binding and carrying now do, including `"integer": false` for fractional weights. CHANGELOG entry. ## 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 b8cc84482 (9c79723ae and the follow-up commits 858f2743e, da9169005, 1b8e7f063, 67a9acdbe, 38eaebc63, 1e0186631, e89ca0f26, a546953d9 and b8cc84482, rebased on staging e75e5ff61): - `pnpm check` and `pnpm localization:check` exit 0 (at b8cc84482). - `pnpm regression:node` passes 422/422 (at b8cc84482). - `pnpm smoke:ui` passes 7/7 (at b8cc84482; one earlier run lost the home-screen test to `ERR_NETWORK_IO_SUSPENDED` on this laptop and passed on the rerun). - `pnpm regression:ui e2e/game-ruleset-wearing.e2e.ts 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 15/15 (at b8cc84482, and the three inventory specs again after its last client change). Lanes: - `game-inventory-stacks.regression.ts`: worn and bound marks read on one item only; equipping takes free slots per bearer (a second two-handed bow finds no hand free, an item without slots cannot be worn) and one item of a larger stack into its own; binding up to the bearer's maximum (a companion's bound item not counted), only what binds; a bound cursed item kept for the player (no unbinding, taking off, giving, removing or using up by name) but not for the Game Master; worn stacks never topped up or merged, a count set past one going beside it unworn, a give arriving unworn, taking by name taking unworn first; loads with fractions; placement (whole to the first who can, the most room first, least over, never past a limit, left behind, weightless and no-`carry` to the first, into one bag up to its limit, a bag named twice asked once); the operations' `placed`, `left`, `too-heavy`, `cursed` and wear answers, a raised count held to the limit; worn and bound counts in totals and the turn record. - `game-inventory-bags.regression.ts`: the grammar's `equip`, `unequip`, `bind` and `unbind`; zero kept in an answer; the Game Master's shared adds answered per bag and with a `too-heavy` refusal for what was left, an add into one bag up to its limit, a give past the receiver's limit refused while a give of more than the giver holds weighs only what it holds; putting on, binding and ending a curse by name, each answered with how many are so now. - `game-ruleset-items.regression.ts`: weights, slots, binding and curses from both example rulesets; each character's carrying and binding limits read off their own sheet (a missing sheet reads blank); the Game Master's block with worn and bound counts, each character's load, bound items and slots, the carrying sentence only with `carry`, and `equip` and `unequip` offered only with slots and `bind` and `unbind` only with binding (a slots-only, a binding-only and a both ruleset). - `game-inventory-turn.regression.ts`, through the real routes: the player's shared adds placed by who can carry them; a real Game Master turn sharing ten arrows between the player and Bram, then four bows with one left behind; a give past Bram's limit refused; the coat and a bow equipped and the second bow finding no free hand; the next prompt showing each character's load, slots and what is worn; Gravewatch's binding up to Nerve, the cursed ring refused for the player four ways and unbound by the Game Master; a game whose only card is a companion's still reading it for their own bag. Sixty deliberate breaks of these rules, in the shared helpers, the operations, the Game Master's tags and grammar, the item book, the inventory service, the generate route and the prompt, were each caught. The first full run caught 52 of 55; the three it missed (the give helper's own weight guard, the order room is shared out in, bound items counted per bag) now each have a check that catches them. Found and fixed along the way: - From the maintainer's review, in b8cc84482: dragging a stack onto one in another character's bag skipped the carrying limit that **Give** applies. The merge now weighs what actually moves against the receiver's limit and answers `too-heavy`, with a message naming who cannot carry it; merges within one bag are unchanged. `game-inventory-stacks.regression.ts` and the browser test cover it. - From the maintainer's review, in b8cc84482: a directed fight could use up a bound cursed item. The fight now reads the player's item rules, refuses that spend with a message, and rolls the whole step back if any take comes up short. `combat-director-route.regression.ts` proves it through the real routes with Gravewatch's Widow's ring. - The screen and the server read the player's sheet differently: the screen showed "Bound 1/2" where the server allowed one. Both now read the card named for who the chat plays as, else the first card (858f2743e). - Raising a count with the amount field was not held to the carrying limit, though adding and giving were (858f2743e). - Equipping by the Game Master put on the unbound ring of two after binding one; it now prefers the item already bound, and binding the one worn (858f2743e). Local CodeRabbit (`coderabbit review --agent`), before opening: - First pass, two findings, fixed in 1b8e7f063: the party's sheets keep every card, so the first card read for the player still carries by its own sheet when it is a companion's; and items picked together are announced together, with one message for what nobody could carry. - Second pass, one finding, fixed in 38eaebc63: taking by name (a classic fight's **Use**) could use up a bound cursed item for the player. - Third pass, two findings, fixed in 1e0186631: a Game Master's give of more than the giver holds was weighed by the whole request; and the screen compared holders by their raw names. - Fourth pass: a connection error, run again after rebasing onto staging. - Fifth pass, on the rebased branch, two findings, fixed in e89ca0f26: a bag named twice among those an addition may go to had its room counted twice, and the screen rebuilt the party's sheets whenever the party list changed rather than when the player's name did. - Sixth pass, on e89ca0f26, run once the rate limit lifted: no findings. The wear-line fix from the real-model run (a546953d9) came after it. - Seventh pass, on the review fixes before b8cc84482: one finding, fixed in b8cc84482 (a drag that merges nothing for another reason now says so too). Clicked through by the agent in the browser test at desktop width (screenshots of the player's bag with the coat and bow worn, and of the bound cursed ring): the tabs' status line, the worn and bound marks on the slots, the **Equipped** and **Bound** toggles, the binding restriction and cursed note, and the refusal message. At phone width (mobile-chromium, in a throwaway copy of the same test that opens the inventory by its icon, since that button has no accessible name on phones, #6796): the status chips, the marks, the details, the wrapped action row with **Equipped**, **Bound** and **Use**, and the Add row all fit inside the panel. Game Master turns on a real local model (Gemma 4 E4B, Q8, through llama.cpp) on an isolated Engine from this branch, in Ember Roads games with Bram in the party, 33 tellings in all: - Shared add: asked to buy twenty arrows for the party, both tellings wrote the add without `who`. The Engine gave 6 to the player (up to their limit of 12) and 12 to Bram (up to Bram's), refused the last 2 as too-heavy, and answered Bram's share with the name and the player's without one. - Give: handing the bow to Bram, already at the limit, was refused as too-heavy and the bow stayed. The model narrated the handover in the same reply, since it only sees the answer on the next turn. - Equip, asked plainly: the coat (1 of 1), the bow in a short game (2 of 3) and Bram's hand axe with `who="Bram"` (1 of 2) were put on, and the next prompt showed the new slot counts. A retelling without the tag left the item unworn. - What the model did not do: it never wrote an equip from the story alone ("I put on my coat", 0 of 6), stopped writing them late in a long scene even when asked plainly (0 of 9), and wrote no unequip even when asked plainly (0 of 5). Its reasoning names the change and then writes no tag, so this is the size of the model rather than the Engine: every tag it did write was carried out as written. One garbled add (`count="20, road rations"`) became an add of one. - Fixed from this run in a546953d9: the wear line offered `bind` and `unbind` to Ember Roads, which has no binding, and only spoke of putting an item on, which does not fit a bow. It now lists `equip` and `unequip` only with slots and `bind` and `unbind` only with binding, and says "puts on, wields or readies". A check in `game-ruleset-items.regression.ts` catches the old line that offered all four. ## 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`. The translation follow-up for this wearing, binding and carrying slice is tracked in #6813; it covers both changed documentation pages and every translated language pack on `docs-i18n`. ## UI evidence (if applicable) The new browser test `e2e/game-ruleset-wearing.e2e.ts` checks each bag's load in the shared view, picks a bow and a coat that fit the player and a second coat that goes to a party member, puts both items on with **Equipped** (with the body and hands counts), and binds a cursed ring that then cannot be unbound. It saves screenshots of both. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Supported games can define equipment slots, binding limits, cursed items, item weights, and carrying limits. * Equip, unequip, bind, and unbind items. Inventory shows worn and bound status, slot use, and character load. * Items added without a named recipient are distributed among characters who can carry them; excess items are left behind with an explanation. * Game Masters can manage equipment and binding, view character inventory status, and distribute items according to carrying rules. * **Bug Fixes** * Transfers respect carrying limits, and item use respects cursed-item restrictions. * **Documentation** * Updated guides to explain inventory rules and Game Master actions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> <!-- maintainer-final-review --> ### Maintainer verification The carry-capacity and cursed-item findings are fixed. Independent runtime proofs confirm that cross-bag merges reject excess weight, same-bag merges still work, Classic combat refuses a cursed-item spend without saving any part of the action, and retrying with an unbound spare succeeds while preserving the bound item. Three focused retained regressions pass, and earlier hosted comments are addressed. The prepared staging integration passes `pnpm check`, three prompt regressions and the real inventory-turn regression. Its 21 author-only files and 101 incoming-only files match their respective parents; the two shared source files match Git's automatic merge, and both changelog blocks are retained. Later staging follow-ups are incorporated verbatim with exact file-equivalence checks. Manual validation checkboxes remain unchanged. Current-head hosted CodeRabbit and required checks remain merge gates. <!-- /maintainer-final-review --> --- <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:47 +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#7338
No description provided.