mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2317] [Issue]: Manual world-state pins (location/date/weather/etc.) silently revert after one turn — manualOverrides nulled on every fresh-turn snapshot #1145
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1145
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Romuromylus on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2317
Originally assigned to: @Xelvanis on GitHub.
Summary
Severity: High — Data-loss / correctness. When a user manually pins a world-state field (Location, Date, Time, Weather, Temperature) in the tracker, the pin is silently reverted after the next assistant turn.
persistTrackerSnapshotForTurnforce-setsmanualOverrides: nullwhen seeding a fresh-turn snapshot, so the only mechanism that re-pins overrides (mergeWorldStatePatchWithManualOverrides) has nothing to re-apply and the world-state agent's freeform value overwrites the user's correction.Expected behavior
A manually-pinned world-state field should carry forward across agent snapshots, per the documented contract in
src/engine/contracts/types/game-state.ts:36-37("JSON object of manually-edited field names -> values. Carried forward across agent snapshots."). The pin should survive subsequent turns until the user clears it.Actual behavior
In
src/engine/generation/tracker-snapshots.ts:505-508:For a fresh message/swipe,
existing(the snapshot keyed by the new messageId+swipeIndex) is null, so line 507 fires and nullsmanualOverrides— even thoughoptions.baseSnapshot(the prior committed snapshot) still carried them.manualOverrideswas wrongly bundled into the per-turn reset group alongsideid: ""andcommitted: false; unlike those, it must persist.Trace:
worldStateApi.patch(world-state-api.ts:246-285) storesmanualOverrideson the current snapshot and onchat.gameState.selectTrackerSnapshotForGenerationreturns the prior snapshot asbaseSnapshot(overrides intact).persistTrackerSnapshotForTurnnullsmanualOverrides(line 507).mergeWorldStatePatchWithManualOverrides(:434) readssnapshot.manualOverrides(now null) and returns the agent patch unmodified.location(etc.) value (world-state-agent-result.ts:274-276) overwrites the pin;applyManualOverrideson the read path has nothing to re-apply.Steps to reproduce
Impact area
Environment
b0e5561dLogs, screenshots, or video
Static source audit; cited to file:line above.
Regression notes
Found via static audit of the refactor branch; not verified against main. Directly contradicts the documented carry-forward contract in
game-state.ts:36-37.Additional context
Suggested fix: drop the
manualOverrides: nullclause at line 507 —parseManualOverrides/normalizeGameStatealready normalize the carried value frombaseSnapshot— so the prior snapshot's overrides survive formergeWorldStatePatchWithManualOverridesto re-pin. Keep resetting onlyid/committed/createdAtfor the new turn.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: