[PR #1968] [MERGED] Fix Character Tracker player persona rows #5364

Closed
opened 2026-10-22 04:15:37 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1968
Author: @cha1latte
Created: 6/2/2026
Status: ✅ Merged
Merged: 6/2/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-1949-tracker-user


📝 Commits (2)

  • 1859fc5 Fix character tracker persona rows
  • 69aca06 Refresh PR discovery metadata

📊 Changes

5 files changed (+223 additions, -19 deletions)

View changed files

➕ src/engine/generation/tracker-snapshots.test.ts (+88 -0)
📝 src/engine/generation/tracker-snapshots.ts (+39 -12)
➕ src/engine/shared/game-state/present-character-filter.test.ts (+30 -0)
➕ src/engine/shared/game-state/present-character-filter.ts (+51 -0)
📝 src/features/runtime/generation/hooks/use-generate.ts (+15 -7)

📄 Description

Linked issue

Closes #1949

Why this change

  • Character Tracker can accept {{user}} or the active player persona as a normal present-character row when the model returns it, which lets the player persona appear in the character tracker and be recreated after deletion.

What changed

  • Added a shared engine helper that filters present-character rows matching {{user}}, {{userName}}, the active persona id, or the active persona name.
  • Applied that filter to persisted tracker snapshots and to the live generation hook so bad rows are blocked in both saved state and immediate UI state.
  • Added focused regression coverage for macro rows, active persona rows, NPC negative controls, and persisted snapshot recovery from legacy {{user}} state.

Refactor impact

Primary owner:

  • engine generation

Impact areas reviewed:

  • Runtime generation live tracker patching
  • Tracker snapshot persistence
  • Existing persisted chat.gameState.presentCharacters and game-state-snapshots rows

Boundary notes:

  • Engine owns the tracker-row contract. React feature code imports the shared engine filter instead of inventing a UI-only guard.

Pressure points touched:

  • Character Tracker agent result handling
  • Live runtime generation tracker sync

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Codex machine proof:
  • pnpm test -- src/engine/shared/game-state/present-character-filter.test.ts src/engine/generation/tracker-snapshots.test.ts passed.
  • pnpm typecheck passed.
  • pnpm check passed.
  • node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json passed locally.
  • No human-only verification is required for the core claim; this is a tracker-state parsing/persistence fix with focused command proof.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Bugfix only; no new user-discoverable feature or workflow.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

N/A. The bug is in tracker-state filtering/persistence, not visible layout; the focused regression tests prove the affected state path.


🔄 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/1968 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/2/2026 **Status:** ✅ Merged **Merged:** 6/2/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-1949-tracker-user` --- ### 📝 Commits (2) - [`1859fc5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1859fc52dbae0de9aa04fa2c6de8993dd23861bb) Fix character tracker persona rows - [`69aca06`](https://github.com/Pasta-Devs/Marinara-Engine/commit/69aca06087e8d7a76cd8a431ead81261cce3d8d1) Refresh PR discovery metadata ### 📊 Changes **5 files changed** (+223 additions, -19 deletions) <details> <summary>View changed files</summary> ➕ `src/engine/generation/tracker-snapshots.test.ts` (+88 -0) 📝 `src/engine/generation/tracker-snapshots.ts` (+39 -12) ➕ `src/engine/shared/game-state/present-character-filter.test.ts` (+30 -0) ➕ `src/engine/shared/game-state/present-character-filter.ts` (+51 -0) 📝 `src/features/runtime/generation/hooks/use-generate.ts` (+15 -7) </details> ### 📄 Description ## Linked issue Closes #1949 ## Why this change - Character Tracker can accept `{{user}}` or the active player persona as a normal present-character row when the model returns it, which lets the player persona appear in the character tracker and be recreated after deletion. ## What changed - Added a shared engine helper that filters present-character rows matching `{{user}}`, `{{userName}}`, the active persona id, or the active persona name. - Applied that filter to persisted tracker snapshots and to the live generation hook so bad rows are blocked in both saved state and immediate UI state. - Added focused regression coverage for macro rows, active persona rows, NPC negative controls, and persisted snapshot recovery from legacy `{{user}}` state. ## Refactor impact Primary owner: - engine generation Impact areas reviewed: - Runtime generation live tracker patching - Tracker snapshot persistence - Existing persisted `chat.gameState.presentCharacters` and `game-state-snapshots` rows Boundary notes: - Engine owns the tracker-row contract. React feature code imports the shared engine filter instead of inventing a UI-only guard. Pressure points touched: - Character Tracker agent result handling - Live runtime generation tracker sync ## Validation - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Codex machine proof: - `pnpm test -- src/engine/shared/game-state/present-character-filter.test.ts src/engine/generation/tracker-snapshots.test.ts` passed. - `pnpm typecheck` passed. - `pnpm check` passed. - `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json` passed locally. - No human-only verification is required for the core claim; this is a tracker-state parsing/persistence fix with focused command proof. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Bugfix only; no new user-discoverable feature or workflow. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence N/A. The bug is in tracker-state filtering/persistence, not visible layout; the focused regression tests prove the affected state path. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:15:37 +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#5364
No description provided.