[GH-ISSUE #5405] [Feature]: Player-controlled deletion and export/import of experience-state saves #2994

Closed
opened 2026-10-21 05:58:40 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Aug 22, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5405

Originally assigned to: @kolacheee on GitHub.

What exists today

A game-surface Experience persists its save through GET/PUT /api/game/:chatId/experience-state (#5102). Every narration turn keeps its own snapshot row in game_engine_state, pruned to the newest 100 anchors. There is no DELETE verb, and no way to read any row other than the visible anchor's — so a package can neither remove old saves nor extract them.

Why this matters (concrete scenario)

Pixelforge is adding a "New Game" flow. Starting over in the same chat leaves up to ~100 rows of the previous campaign at old anchors. The package can make them inert (a game ordinal in its own state), but:

  1. The player should decide what happens to an old game — keep it, delete it to free device space, or export it and re-import later. None of those are possible today. On Termux installs, 100 anchors × a growing save blob is real storage.
  2. Deleting a chat's routine per-turn rows is safe for checkpoint restores — checkpoints already capture engineStateData by value (#5102/#5077) — so old campaigns stay restorable from their checkpoints even after their rows are cleaned.

The ask

On the experience-state route family, scoped to the chat's experience:<id> namespace:

  • Delete: remove the namespace's rows for a chat (optionally "all except the newest N" or "rows whose stored state matches a caller-supplied predicate is overkill — a plain full-namespace delete is enough; the package keeps its current game's rows alive by re-writing them).
  • Export: a bulk GET returning all of the namespace's rows (anchor + state + schemaVersion + createdAt), so a player can save a campaign off-device.
  • Import: accept such an export back (re-anchoring is fine to leave crude — even "import to the live anchor as one row" makes an exported campaign playable again).

All three are player-initiated from the package UI; nothing automatic.

Context: this came out of the Pixelforge S5 (player state) implementation plan; happy to adjust the shape to whatever fits the route conventions.

Originally created by @kolacheee on GitHub (Aug 22, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5405 Originally assigned to: @kolacheee on GitHub. ## What exists today A game-surface Experience persists its save through `GET/PUT /api/game/:chatId/experience-state` (#5102). Every narration turn keeps its own snapshot row in `game_engine_state`, pruned to the newest 100 anchors. There is no DELETE verb, and no way to read any row other than the visible anchor's — so a package can neither remove old saves nor extract them. ## Why this matters (concrete scenario) Pixelforge is adding a "New Game" flow. Starting over in the same chat leaves up to ~100 rows of the previous campaign at old anchors. The package can make them inert (a game ordinal in its own state), but: 1. **The player should decide what happens to an old game** — keep it, delete it to free device space, or export it and re-import later. None of those are possible today. On Termux installs, 100 anchors × a growing save blob is real storage. 2. Deleting a chat's routine per-turn rows is safe for checkpoint restores — checkpoints already capture `engineStateData` by value (#5102/#5077) — so old campaigns stay restorable from their checkpoints even after their rows are cleaned. ## The ask On the experience-state route family, scoped to the chat's `experience:<id>` namespace: - **Delete**: remove the namespace's rows for a chat (optionally "all except the newest N" or "rows whose stored state matches a caller-supplied predicate is overkill — a plain full-namespace delete is enough; the package keeps its current game's rows alive by re-writing them). - **Export**: a bulk GET returning all of the namespace's rows (anchor + state + schemaVersion + createdAt), so a player can save a campaign off-device. - **Import**: accept such an export back (re-anchoring is fine to leave crude — even "import to the live anchor as one row" makes an exported campaign playable again). All three are player-initiated from the package UI; nothing automatic. Context: this came out of the Pixelforge S5 (player state) implementation plan; happy to adjust the shape to whatever fits the route conventions.
bsakaguchi 2026-10-21 05:58:40 +07:00
Author
Owner

@kolacheee commented on GitHub (Aug 22, 2026):

Claiming this one — implementing the three verbs (DELETE / export GET / import POST) on the experience-state route family, gated by the same resolveExperienceStateGameType 404/409 checks and scoped strictly to the chat's experience:<id> namespace. Working on feat/5405-save-management off staging.

<!-- gh-comment-id:5382477434 --> @kolacheee commented on GitHub (Aug 22, 2026): Claiming this one — implementing the three verbs (DELETE / export GET / import POST) on the experience-state route family, gated by the same `resolveExperienceStateGameType` 404/409 checks and scoped strictly to the chat's `experience:<id>` namespace. Working on `feat/5405-save-management` off `staging`.
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#2994
No description provided.