mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
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#7928
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/7787
Author: @ylli-selmani
Created: 10/18/2026
Status: ✅ Merged
Merged: 10/18/2026
Merged by: @ylli-selmani
Base:
staging← Head:feat/checkpoint-world-edits📝 Commits (6)
b22145cfix(game): a checkpoint rewind puts the world's hand edits back (#7783)d4ebe0bdocs(game): a checkpoint load undoes World Edits (#7783)da893f4fix(game): a checkpoint load only touches the world when its edits differ (#7783)2d2dcb5fix(game): save the checkpoint's world snapshot inside the edits lock (#7783)ecad34efix(game): make the checkpoint restore and its world snapshot one write (#7783)4b6c2bctest(game): pin that a failed snapshot save leaves the restore unwritten (#7783)📊 Changes
7 files changed (+495 additions, -21 deletions)
View changed files
📝
docs/game/sessions-and-saves.md(+1 -1)📝
packages/client/src/localization/locales/en.json(+2 -2)📝
packages/server/src/db/schema/checkpoints.ts(+4 -0)📝
packages/server/src/routes/game.routes.ts(+68 -12)📝
packages/server/src/services/game/checkpoint.service.ts(+80 -3)📝
packages/server/src/services/storage/chats.storage.ts(+6 -3)➕
scripts/regressions/game-checkpoint-world-edits.regression.ts(+334 -0)📄 Description
Linked issue
Closes #7783
On top of
stagingafter #7773 (c8d108c7c). Commits:b22145c10(capture + restore + regression),d4ebe0bc3(copy),da893f470(review: skip the world write when the layer is unchanged),2d2dcb5da(review: snapshot save inside the world lock),ecad34e24(review: the restore and its snapshot are one transaction),4b6c2bcd0(review: a failed snapshot save leaves the restore unwritten).Why this change
What changed
gameWorld.edits) in its own field, and a Load puts it back together with the story from the same checkpoint, in one metadata write — so the pair captured together always fits each other afterwards.PUT /world/editsholds, with the metadata queue taken before the transaction (the orderchats.storagedocuments). So an editor save landing mid-Load can neither have its snapshot overwritten by the Load's older metadata, nor be rolled back by a failed Load, and a snapshot that cannot be saved takes the whole restore back instead of leaving the restored story beside the old world. A checkpoint whose layer cannot be put back safely leaves the current layer alone, and the rest of the Load still happens.ui.game.checkpoints.loadMessage, which #7773 had just worded as "but not your World Edits"), the World Edits section description (keeping #7743's wording, minus "stay when you load a checkpoint"), and the checkpoint paragraph indocs/game/sessions-and-saves.md.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Proven locally:
pnpm checkpasses on the final tree (and on the same tree before the review fix).node scripts/run-regressions.mjs --filter checkpoint→ 5/5 passed, including the newgame-checkpoint-world-edits.regression.ts.POST /game/checkpoint/loadroute: it seeds a world with a story and a hand-added person, takes a checkpoint, then rewrites the story and removes the person, seeds a stale snapshot without the layer (soloadGameWorldcannot fall back to the metadata), then loads. After the load the layer is back,gameStoryFromMetadatais not null (the story plays again), and the world snapshot — read back throughloadGameWorld— describes the restored layer, which only a re-save by the Load can produce. It also covers: clearing a layer added after an empty capture; an empty capture over a chat whose layer is already absent (nothing written); a legacy checkpoint leaving the layer alone; a chat with no world; a capture refused by the story check; and a chat carrying a world from a generator this Engine no longer reads, which loads fine and keeps its world exactly as it was.pnpm localization:checkpasses after the copy change.Local CodeRabbit (one batched run on the 3-commit diff, base
origin/staging), 3 findings:worldMadeByThisGenerator": already true above this helper;gameWorldFromMetadatareturns null for any world whose generator version this Engine does not read, so the restore refuses before applying an edit. Pinned by regression part 4. The second half of the finding (skip the write when the edits match) was real: fixed inda893f470, with pure and end-to-end assertions.2d2dcb5da).GitHub review (CodeRabbit, after the first push), 3 findings:
2d2dcb5da).scripts/vendored-engine-baseline.json(thecheckpoints.tsentry isdrifted). Adding the column will make their Noodle vendored-engine check want that entry refreshed after this lands onstaging. Nothing to change in this PR; see the cross-repo note under Docs and release impact.GitHub review, round 2 (CodeRabbit), 1 finding:
ecad34e24: both writes run in oneapp.db.transaction; the metadata queue is taken before it and the patch runs withmetadataQueueHeld, the orderingchats.storagedocuments andadvanced-memoryalready uses, andpatchMetadataWithCharacterIdsnow accepts that opt the waypatchMetadatadoes. The compensatinggameWorld-only rollback is gone, so a failed snapshot save rolls the whole restore back.GitHub review, round 3 (CodeRabbit), 1 finding:
4b6c2bcd0, regression part 5). Moving the patch out of the transaction, or droppingmetadataQueueHeld, makes it fail.Not verified by me (please do in the app):
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)docs/game/sessions-and-saves.mdis already tracked by the open[docs-i18n]follow-up #7774. This PR changes that file's English text (the "doesn't undo World Edits" exception is gone), and #7774's thread now carries the final English of the changed paragraph and the two UI strings, so the translated packs are not edited here.Cross-repo note: the new column changes
packages/server/src/db/schema/checkpoints.ts, which Marinara-Agents vendors undersources/engine/and pins inscripts/vendored-engine-baseline.json(that path's entry isdriftedtoday). Once this lands onstaging, their Noodle vendored-engine check will see the new host fingerprint, so that snapshot and baseline want a separate Marinara-Agents change (re-vendor the file and drop the resolved entry — their validator allows the baseline only to shrink). No Engine-side action; flagged here so it is not a surprise after merge.UI evidence (if applicable)
No new UI surface: three strings changed (two in the Game data editor and checkpoints dialog, one doc paragraph). No screenshot.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.