[GH-ISSUE #5172] [Issue]: Inventory Tracker section can stay hidden, and hand edits bypass its data rules #2864

Closed
opened 2026-10-21 05:57:10 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @augusteo on GitHub (Aug 17, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5172

Originally assigned to: @SpicyMarinara on GitHub.

Summary

The Roleplay Inventory Tracker can stay invisible after upgrading, and every path that writes its three lists by hand skips the rules the agent path enforces — so values the agent could never emit can still end up stored.

Expected behavior

  • The Inventory Tracker section appears in the Tracker Panel once the agent is added, without touching the panel layout.
  • An item that is equipped never also appears in carried inventory, however it was entered.
  • Names, quantities, and duplicates are normalized the same way no matter which surface wrote them.
  • The Agent Suite JSON editor reports bad input rather than absorbing it.

Actual behavior

Five distinct problems, all reproduced on staging:

  1. The section stays hidden. useSettingsSync overwrites the freshly migrated store with the server's app-settings/ui blob (use-settings-sync.ts:284). trackerPanelSectionOrder is synced (ui.store.ts:1226) but is the one tracker preference that blob never re-normalizes on ingest, so an order captured before the section existed wins on every load. Affects anyone whose stored blob predates the section; fresh installs are fine. This is general — any future tracker section hits it.

  2. Hand edits bypass the data rules. Tracker Panel edits (TrackerSectionList.tsx:300) and HUD edits (RoleplayHUD.tsx:384) send raw rows through patchPlayerStats, skipping name trimming, duplicate merging, the quantity clamp, and the equipped/carried exclusivity that applyTrackerFieldLocksToGameStatePatch applies on the agent path.

  3. The Agent Suite JSON editor accepts malformed rows. It checks only that the three keys are arrays (agent-suite-tracker-slices.ts:110), then writes them straight through, so a row with no name is stored as-is.

  4. The panel lays out differently in its two hosts. @min-[360px]:grid-cols-3 needs a @container ancestor. The docked sidebar has one (TrackerDataSidebar.tsx:188); the HUD popover is portaled to document.body and has none, so the same component renders 3-up docked and 1-up in the popover at comparable widths.

  5. The server accepts any playerStats payload. chats.routes.ts:2339 is fields.playerStats = body.playerStats with no validation, while neighbouring fields normalize. Every client-side rule is bypassable by a direct API call or an older client.

Separately, the panel's density is poor: a fixed 36 px quantity cell is drawn on every row including the ones with no quantity, and three fixed columns split the panel between three groups of very unequal length, so at the widest setting each column is around 95 px and item names truncate.

Steps to reproduce

Hidden section (1):

  1. Use an install whose synced UI settings were saved before the Inventory Tracker shipped.
  2. Install the inventory-tracker package and add the agent to a Roleplay chat.
  3. Open the Tracker Panel. The section is absent until the panel is reordered by hand.
localVersion: 94
localOrder:  ["world","persona","characters","quests","custom"]   <- no "inventory"
serverOrder: ["world","persona","characters","quests","custom"]

Hand-edit bypass (2):

  1. With an item in Equipped, rename a carried entry to that same name in the Tracker Panel.
  2. It stays in both lists instead of moving.

Server write (5):

  1. PATCH /api/chats/<id>/game-state with playerStats.inventoryTrackerCurrencies = [{ "name": " Copper bit " }].
  2. The untrimmed name is stored verbatim.

Environment

  • Marinara Engine version: 2.4.3 (staging)
  • Install type: source
  • OS + version: macOS (Darwin 25.6.0)
  • Browser or app shell: Chrome

Logs, screenshots, or video

The Tracker Panel with the agent active and holding data, but no Inventory Tracker section — Quest Board follows Present Characters directly, while Custom Stats below still shows the prose blob this feature replaced:

Section missing

The three-column layout at the widest panel setting, with names truncated:

Truncated at 420px

Additional context

Follow-up to #5105 / #5112, found while testing that work end to end after #5117 merged. A fix is up at #5168, with the translated documentation in #5169.

Not covered there, and worth its own issue: there is still no way to move an item between groups — equipping means deleting it from one group and retyping it in the other.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @augusteo on GitHub (Aug 17, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5172 Originally assigned to: @SpicyMarinara on GitHub. ## Summary The Roleplay Inventory Tracker can stay invisible after upgrading, and every path that writes its three lists by hand skips the rules the agent path enforces — so values the agent could never emit can still end up stored. ## Expected behavior - The **Inventory Tracker** section appears in the Tracker Panel once the agent is added, without touching the panel layout. - An item that is equipped never also appears in carried inventory, however it was entered. - Names, quantities, and duplicates are normalized the same way no matter which surface wrote them. - The Agent Suite JSON editor reports bad input rather than absorbing it. ## Actual behavior Five distinct problems, all reproduced on `staging`: 1. **The section stays hidden.** `useSettingsSync` overwrites the freshly migrated store with the server's `app-settings/ui` blob (`use-settings-sync.ts:284`). `trackerPanelSectionOrder` is synced (`ui.store.ts:1226`) but is the one tracker preference that blob never re-normalizes on ingest, so an order captured before the section existed wins on every load. Affects anyone whose stored blob predates the section; fresh installs are fine. This is general — any future tracker section hits it. 2. **Hand edits bypass the data rules.** Tracker Panel edits (`TrackerSectionList.tsx:300`) and HUD edits (`RoleplayHUD.tsx:384`) send raw rows through `patchPlayerStats`, skipping name trimming, duplicate merging, the quantity clamp, and the equipped/carried exclusivity that `applyTrackerFieldLocksToGameStatePatch` applies on the agent path. 3. **The Agent Suite JSON editor accepts malformed rows.** It checks only that the three keys are arrays (`agent-suite-tracker-slices.ts:110`), then writes them straight through, so a row with no `name` is stored as-is. 4. **The panel lays out differently in its two hosts.** `@min-[360px]:grid-cols-3` needs a `@container` ancestor. The docked sidebar has one (`TrackerDataSidebar.tsx:188`); the HUD popover is portaled to `document.body` and has none, so the same component renders 3-up docked and 1-up in the popover at comparable widths. 5. **The server accepts any `playerStats` payload.** `chats.routes.ts:2339` is `fields.playerStats = body.playerStats` with no validation, while neighbouring fields normalize. Every client-side rule is bypassable by a direct API call or an older client. Separately, the panel's density is poor: a fixed 36&nbsp;px quantity cell is drawn on every row including the ones with no quantity, and three fixed columns split the panel between three groups of very unequal length, so at the widest setting each column is around 95&nbsp;px and item names truncate. ## Steps to reproduce **Hidden section (1):** 1. Use an install whose synced UI settings were saved before the Inventory Tracker shipped. 2. Install the `inventory-tracker` package and add the agent to a Roleplay chat. 3. Open the Tracker Panel. The section is absent until the panel is reordered by hand. ``` localVersion: 94 localOrder: ["world","persona","characters","quests","custom"] <- no "inventory" serverOrder: ["world","persona","characters","quests","custom"] ``` **Hand-edit bypass (2):** 1. With an item in **Equipped**, rename a carried entry to that same name in the Tracker Panel. 2. It stays in both lists instead of moving. **Server write (5):** 1. `PATCH /api/chats/<id>/game-state` with `playerStats.inventoryTrackerCurrencies = [{ "name": " Copper bit " }]`. 2. The untrimmed name is stored verbatim. ## Environment - Marinara Engine version: 2.4.3 (`staging`) - Install type: source - OS + version: macOS (Darwin 25.6.0) - Browser or app shell: Chrome ## Logs, screenshots, or video The Tracker Panel with the agent active and holding data, but no Inventory Tracker section — Quest Board follows Present Characters directly, while Custom Stats below still shows the prose blob this feature replaced: ![Section missing](https://raw.githubusercontent.com/augusteo/Marinara-Engine/pr-assets/inventory-tracker-density/08-bug-b1-section-missing.png) The three-column layout at the widest panel setting, with names truncated: ![Truncated at 420px](https://raw.githubusercontent.com/augusteo/Marinara-Engine/pr-assets/inventory-tracker-density/02-before-columns-420px-truncated.png) ## Additional context Follow-up to #5105 / #5112, found while testing that work end to end after #5117 merged. A fix is up at #5168, with the translated documentation in #5169. Not covered there, and worth its own issue: there is still no way to move an item between groups — equipping means deleting it from one group and retyping it in the other. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:57:10 +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#2864
No description provided.