[PR #2348] [MERGED] world-state: preserve manual tracker pins #5549

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2348
Author: @Xelvanis
Created: 6/5/2026
Status: ✅ Merged
Merged: 6/5/2026
Merged by: @Xelvanis

Base: refactor ← Head: fix/world-state-manual-overrides


📝 Commits (1)

  • c03be8e world-state: preserve manual tracker pins

📊 Changes

4 files changed (+5 additions, -35 deletions)

View changed files

📝 knip.json (+1 -0)
📝 src/engine/generation/tracker-snapshots.ts (+2 -16)
📝 src/features/runtime/generation/hooks/use-generate.ts (+1 -14)
📝 src/features/runtime/world-state/api/world-state-api.ts (+1 -5)

📄 Description

Linked issue

Closes #2317

Why this change

  • Manual world-state pins for fields like Location, Date, Time, Weather, and Temperature were being dropped or overwritten by non-manual tracker agent updates on fresh turn snapshots.

What changed

  • Preserve carried manualOverrides when creating a fresh tracker snapshot for a new assistant turn.
  • Keep pinned world-state fields authoritative when non-manual world-state agent patches touch those fields in both persisted engine snapshots and live runtime state.
  • Keep manual edits and explicit clear operations as the paths that update or remove pins.
  • Whitelist the retained CoreModulesSettings export in knip.json so the full PR gate remains green.

Refactor impact

Primary owner:

  • Engine generation and runtime world-state.

Impact areas reviewed:

  • Tracker snapshot persistence.
  • World-state agent result patching.
  • Live generation optimistic game-state updates.
  • Runtime world-state patch API manual edit/clear behavior.
  • Game and roleplay tracker surfaces that consume shared world-state behavior.

Boundary notes:

  • Engine changes stay in src/engine/generation and use existing storage ports.
  • Runtime feature changes stay in src/features/runtime and continue using existing shared API wrappers.
  • No new imports, raw Tauri calls, Rust commands, remote-runtime routes, or cross-mode imports added.

Pressure points touched:

  • None of the named pressure points were touched.

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

  • pnpm exec vitest run src/engine/generation/tracker-snapshots.test.ts --reporter=verbose passed.
  • Temporary local repro verified the pre-fix failure (Agent Drift replacing pinned location) and the post-fix pass, then the scratch test was removed from the submitted diff.
  • pnpm typecheck passed.
  • pnpm check:architecture passed.
  • pnpm check:unused passed after the CoreModulesSettings knip allowlist entry.
  • pnpm check passed.
  • Native Tauri/manual tracker UI validation was not run.

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:

  • This restores existing manual tracker pin behavior and does not add a new user-discoverable 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

  • Not included; no visible UI layout change.

🔄 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/2348 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 6/5/2026 **Status:** ✅ Merged **Merged:** 6/5/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `fix/world-state-manual-overrides` --- ### 📝 Commits (1) - [`c03be8e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c03be8eef2233575bc75797ad28a170083083852) world-state: preserve manual tracker pins ### 📊 Changes **4 files changed** (+5 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `knip.json` (+1 -0) 📝 `src/engine/generation/tracker-snapshots.ts` (+2 -16) 📝 `src/features/runtime/generation/hooks/use-generate.ts` (+1 -14) 📝 `src/features/runtime/world-state/api/world-state-api.ts` (+1 -5) </details> ### 📄 Description ## Linked issue Closes #2317 ## Why this change - Manual world-state pins for fields like Location, Date, Time, Weather, and Temperature were being dropped or overwritten by non-manual tracker agent updates on fresh turn snapshots. ## What changed - Preserve carried `manualOverrides` when creating a fresh tracker snapshot for a new assistant turn. - Keep pinned world-state fields authoritative when non-manual world-state agent patches touch those fields in both persisted engine snapshots and live runtime state. - Keep manual edits and explicit clear operations as the paths that update or remove pins. - Whitelist the retained `CoreModulesSettings` export in `knip.json` so the full PR gate remains green. ## Refactor impact Primary owner: - Engine generation and runtime world-state. Impact areas reviewed: - Tracker snapshot persistence. - World-state agent result patching. - Live generation optimistic game-state updates. - Runtime world-state patch API manual edit/clear behavior. - Game and roleplay tracker surfaces that consume shared world-state behavior. Boundary notes: - Engine changes stay in `src/engine/generation` and use existing storage ports. - Runtime feature changes stay in `src/features/runtime` and continue using existing shared API wrappers. - No new imports, raw Tauri calls, Rust commands, remote-runtime routes, or cross-mode imports added. Pressure points touched: - None of the named pressure points were touched. ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `pnpm exec vitest run src/engine/generation/tracker-snapshots.test.ts --reporter=verbose` passed. - Temporary local repro verified the pre-fix failure (`Agent Drift` replacing pinned location) and the post-fix pass, then the scratch test was removed from the submitted diff. - `pnpm typecheck` passed. - `pnpm check:architecture` passed. - `pnpm check:unused` passed after the `CoreModulesSettings` knip allowlist entry. - `pnpm check` passed. - Native Tauri/manual tracker UI validation was not run. ## 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: - This restores existing manual tracker pin behavior and does not add a new user-discoverable workflow. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence - Not included; no visible UI layout change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:17:17 +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#5549
No description provided.