mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7288] [MERGED] fix(trackers): use manual Tracker Panel edits as the base for the next generation #7666
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#7666
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7288
Author: @SpicyMarinara
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/tracker-manual-edit-base📝 Commits (10+)
2d507c9fix(trackers): use manual Tracker Panel edits as the base for the next generation5263deeMerge remote-tracking branch 'origin/staging' into fix/tracker-manual-edit-base6a81ac3Merge remote-tracking branch 'origin/staging' into fix/tracker-manual-edit-base6dfe0b0fix(trackers): retire a Tracker Panel edit once a tracker changes its value8a676a3Merge origin/staging into fix/tracker-manual-edit-basef53053aMerge origin/staging into fix/tracker-manual-edit-base61b383ffix(trackers): let the newest Tracker Panel edit win across a reply's swipes0133924Merge origin/fix/tracker-manual-edit-base into the newest-edit fix30a4602fix(trackers): keep agent prompts consistent with Tracker Panel editse49e4cdMerge origin/staging into fix/tracker-manual-edit-base📊 Changes
7 files changed (+867 additions, -53 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
docs/roleplay/hud-and-trackers.md(+1 -1)➕
e2e/tracker-manual-edit-base.e2e.ts(+151 -0)📝
packages/server/src/routes/generate.routes.ts(+48 -7)📝
packages/server/src/routes/generate/generate-route-utils.ts(+2 -2)📝
packages/server/src/services/storage/game-state.storage.ts(+202 -43)➕
scripts/regressions/tracker-manual-edit-base.regression.ts(+462 -0)📄 Description
Linked issue
Closes #7286
Why this change
Mari fixed a wrong World State location in the Tracker Panel and regenerated the reply. The regeneration ignored her fix and started from the previous reply's trackers, which held the same wrong value she had just corrected.
Her rule: a manual Tracker Panel edit replaces the committed value and becomes the base for the next generation. That includes regenerating or swiping the edited reply, and the next new message. The new generation may then change the value, and its result replaces the edit.
Root cause. A regeneration builds its base from the reply before the regenerated one (
resolveRegenerationGameStateAnchorandexcludeMessageIdingetForGeneration). The Tracker Panel PATCH writes the edit only onto the edited reply's own (message, swipe) row. That is exactly the row the regeneration base excludes, and nothing copied the edit into the base. A new message already worked, because it commits the edited row and starts from it.What changed
Server only, with no schema or storage-format change. Edits stay on the row the user edited. They are never written into the previous reply's row, so its history, branches made from it, and deletes of the edited reply behave as before.
Recording edits (
game-state.storage.ts). A manual PATCH now records every tracker value it actually changes, in the existingmanualOverridescolumn:"", so clearing also counts.worldCustomFields,presentCharactersandpersonaStatsare recorded as a short sha256 fingerprint, so the record does not copy whole lists into every prompt.playerStatsis recorded per key (playerStats.customTrackerFields), so a Custom Tracker edit does not drag Quests or Inventory along.applyManualEditslays the edits from every swipe of a reply over a base. An edit counts only while its row still holds the edited value. Every write to a row also drops the edits that row no longer holds, so once a tracker run changes a field, that edit is retired for good. It stays retired even if a later run writes the same value again.getForGenerationapplies those edits whenever it excludes a regenerated reply. This one change covers:Re-run trackers anchors the reply's own row, so the edit is not applied a second time there.
Leaving a value out. When a tracker leaves a value out on a regeneration, the value comes from the swipe just before the new one. That fallback row now carries the edits too, so the result matches what the trackers were shown. The
update_game_statetool base does the same.Regenerated swipes with no tracker run. No tracker may write a regenerated swipe's row, for example in manual-tracker chats or when a run fails. That swipe now gets a row from the edited base, so the panel and the next message keep the edit. Game mode is excluded.
Rewriting the same row. When a tracker run rewrites its own row, as a continuation does, it now keeps that row's edit record.
CHANGELOG entry, plus one sentence in
docs/roleplay/hud-and-trackers.md. Translation follow-up: #7287.Behaviour for Mari to confirm
ponytail:note; the upgrade path is to record the edit time).ponytail:note; the upgrade path is a per-row diff).getGameStateis a separate read path and is unchanged.Not on this path
Validation
pnpm checkpasses locallyCONTRIBUTING.mdAgent-run checks (for the reviewer to confirm, not ticked):
pnpm checkexited 0.pnpm regression:promptpassed.New
scripts/regressions/tracker-manual-edit-base.regression.tspasses. Onorigin/stagingit fails at:The new-message and delete cases already pass on staging, as guard tests. The A → B → A case (a retired edit must not return) fails without the second commit.
These related regressions passed:
tracker-sections,agent-context-generation,roleplay-swipe-media,advanced-memory-core,open-issues,lazy-chat-units,capability-package-lifecycle,multiplayer-game-persona.checkpoint-retention,game-checkpoint-engine-state,experience-state,experience-state-ordinal.game-tool-controls,game-tool-outcomes,game-inventory-bags,game-inventory-turn.game-ruleset-*(6 files).combat-director-route,ruleset-combat-director-route.New
e2e/tracker-manual-edit-base.e2e.tspasses on desktop-chromium and mobile-webkit. It edits the location through the real Tracker Panel, reloads, regenerates from the message row, and checks the prompt and the new swipe. On staging it fails because the prompt still saysLocation: Old town.world-tracker-controls,docked-tracker-panelandtracker-windowe2e passed on both projects.Full
node scripts/run-regressions.mjs(first commit): 537/538 passed. The one failure,termux-sharp, isERR_PNPM_NO_OFFLINE_TARBALLfrom its offline pnpm install simulation in this environment, not this change.Local CodeRabbit (
coderabbit review --agent --committed --base-commit <merge-base>) on the first commit returned 0 findings. Its outcome was "completed_with_warnings" ("Review completed with unverified findings"), with no finding items in the output.The GitHub CodeRabbit review found one valid issue: a retired edit came back when a tracker later wrote the same value again. It is fixed in the second commit, with a regression case, and the thread is resolved.
Manual verification notes
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)CHANGELOG
[Unreleased]entry added.docs/roleplay/hud-and-trackers.mdgained one sentence; translation follow-up is #7287.UI evidence (if applicable)
No UI change. The fix is on the server.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.