[GH-ISSUE #2295] [Issue]: Game journal omits "acquired" entries for items added via the persona-stats tracker snapshot (only the [Inventory:] tag path journals) #1131

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

Originally created by @Romuromylus on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2295

Originally assigned to: @Xelvanis on GitHub.

Summary

In game mode, when the persona-stats tracker agent reports a newly acquired item only in its structured inventory snapshot (no [Inventory: add] GM tag), the refactor updates the live inventory panel but writes no journal "acquired" entry. Main records it.

Expected behavior

A newly acquired inventory item surfaced by the persona-stats agent should get an "acquired" line in the game journal's inventory log, regardless of whether it arrived via the agent snapshot or an [Inventory:] GM tag.

Actual behavior

Only the [Inventory:] GM-tag path writes a journal entry (parity in both builds). For items that appear only in the agent's inventory snapshot, the refactor sets playerStats.inventory but writes no journal entry, so the acquisition history is silently lost for those items.

Steps to reproduce

  1. In a game chat with the persona-stats tracker agent enabled, drive a turn where the model's inventory snapshot gains a new item but the GM text emits no [Inventory: add ...] tag.
  2. Open the game journal inventory log.
  3. Observe: the item is present in the inventory panel, but there is no "acquired" journal entry for it.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor @ f56a3774 (compared against main @ b4ab97fb)
  • Run mode: Tauri desktop
  • OS + version: Windows 11
  • Node + pnpm versions: n/a (static source audit)
  • Rust version, if relevant: n/a (static source audit)
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: Game mode with persona-stats tracker agent

Logs, screenshots, or video

n/a (static source comparison of main vs refactor)

Regression notes

Worked in main. Main packages/server/src/routes/generate.routes.ts:9150-9165 (persona_stats_update handler) builds an oldNames set from the prior snapshot and calls addInventoryEntry(j, item.name, "acquired", ...) for each new item name. Refactor persona-stats handlers (src/engine/generation/tracker-snapshots.ts:456-467 server persist, and src/features/runtime/generation/hooks/use-generate.ts:966-979 client state) set playerStats.inventory = data.inventory.map(parseInventoryItem) with no diff and no journal write. In the refactor, addInventoryEntry has exactly one caller, src/engine/modes/game/.../journal.service.ts:356 inside applyJournalEntry, reachable only from the [Inventory:] GM-tag path (game-api.ts:2862 fed by GameSurface.tsx tag parsing); the agent path never calls it. No Rust journaling exists.

Additional context

Diff the agent inventory snapshot against the prior snapshot in the persona-stats handler and emit an "acquired" journal entry for newly added names, matching main. The [Inventory:] tag path already journals correctly in both builds, so only the agent-snapshot path needs the fix.

Template check

Please uncheck 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 @Romuromylus on GitHub (Jun 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2295 Originally assigned to: @Xelvanis on GitHub. ## Summary In game mode, when the persona-stats tracker agent reports a newly acquired item only in its structured inventory snapshot (no `[Inventory: add]` GM tag), the refactor updates the live inventory panel but writes no journal "acquired" entry. Main records it. ## Expected behavior A newly acquired inventory item surfaced by the persona-stats agent should get an "acquired" line in the game journal's inventory log, regardless of whether it arrived via the agent snapshot or an `[Inventory:]` GM tag. ## Actual behavior Only the `[Inventory:]` GM-tag path writes a journal entry (parity in both builds). For items that appear only in the agent's inventory snapshot, the refactor sets `playerStats.inventory` but writes no journal entry, so the acquisition history is silently lost for those items. ## Steps to reproduce 1. In a game chat with the persona-stats tracker agent enabled, drive a turn where the model's inventory snapshot gains a new item but the GM text emits no `[Inventory: add ...]` tag. 2. Open the game journal inventory log. 3. Observe: the item is present in the inventory panel, but there is no "acquired" journal entry for it. ## Impact area - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [x] Game mode - [ ] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [ ] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: refactor @ f56a3774 (compared against main @ b4ab97fb) - Run mode: Tauri desktop - OS + version: Windows 11 - Node + pnpm versions: n/a (static source audit) - Rust version, if relevant: n/a (static source audit) - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: Game mode with persona-stats tracker agent ## Logs, screenshots, or video n/a (static source comparison of main vs refactor) ## Regression notes Worked in main. Main `packages/server/src/routes/generate.routes.ts:9150-9165` (persona_stats_update handler) builds an `oldNames` set from the prior snapshot and calls `addInventoryEntry(j, item.name, "acquired", ...)` for each new item name. Refactor persona-stats handlers (`src/engine/generation/tracker-snapshots.ts:456-467` server persist, and `src/features/runtime/generation/hooks/use-generate.ts:966-979` client state) set `playerStats.inventory = data.inventory.map(parseInventoryItem)` with no diff and no journal write. In the refactor, `addInventoryEntry` has exactly one caller, `src/engine/modes/game/.../journal.service.ts:356` inside `applyJournalEntry`, reachable only from the `[Inventory:]` GM-tag path (`game-api.ts:2862` fed by `GameSurface.tsx` tag parsing); the agent path never calls it. No Rust journaling exists. ## Additional context Diff the agent inventory snapshot against the prior snapshot in the persona-stats handler and emit an "acquired" journal entry for newly added names, matching main. The `[Inventory:]` tag path already journals correctly in both builds, so only the agent-snapshot path needs the fix. ## Template check Please uncheck 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:27:35 +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#1131
No description provided.