mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6853] [Feature]: Unified selectable backup and restore with package scopes and package entry points #3840
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#3840
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 @Gunterlie on GitHub (Sep 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6853
Originally assigned to: @Gunterlie on GitHub.
What problem does this solve?
Users need to choose what to back up and what to restore, including downloadable packages, and have the normal import flow account for everything selected. Today a backup can contain package data that the in-app importer does not restore.
Concrete example: exporting Slurp2 0.2.40 and restoring through Slurp2 0.3.1 works at the archive-format level, but exporting through Engine has different semantics:
storage/and managed media directories. This captures Slurp2's registeredslurp2_*tables on disk.app_settings, and owns media under the shared gallery directory. Shared resources such as Garnish ads need explicit treatment.There is no package-selection option that closes this gap. Users should not need to understand Engine-defined versus runtime-registered tables to recover their data.
Proposed solution
Build a unified, selectable Engine backup/import service with a public package participation contract. Engine owns archives, selection, progress and restore coordination; each package declares its data and supplies the domain-specific validation/migration that Engine cannot infer.
This is a phased feature, not a request to add every package table to the current profile allowlist. Keep the existing portable-profile behavior until the explicit package-aware path is available.
One service, multiple entry points
Selection and presets
Use readable groups: characters/personas, chats and attachments, lorebooks/knowledge, presets/settings/connections, and individual packages. Show counts, media size and exclusions when practical. Add Full recovery and Portable export presets; scheduled backups should eventually use the same selection plan.
Package selection includes saved state by default. Offer package preferences separately where the package can safely distinguish them. Wallet balances and projects are data, not optional preferences. Media selection follows the selected records; selecting one package must not include or replace another package's media merely because both use
gallery/.A full recovery backup may retain credentials as today's raw backup does, with clear private-backup labeling. Portable export omits secrets by default. Restoring credentials must be an explicit, validated operation; do not replace the destination encryption key globally during a scoped restore. Existing redaction and quarantine rules for executable user content remain intact.
Package participation contract
Design the smallest public capability API that can describe a package backup contribution and launch the host flow. Exact method names remain an implementation decision. It should cover:
Engine validates claims against the installed package identity and approved resource boundaries. A package cannot claim another package's datasets, arbitrary filesystem paths or all of
app_settings. Shared datasets need an explicit host policy; do not copy them into multiple scopes accidentally. Legacy Engine-owned Noodle/Slurp tables should be mapped into their appropriate selectable scopes without duplicating rows in the generic Engine scope.Keep capability API compatibility additive. Packages using the new surface must declare the appropriate Engine/API minimum; older packages and hosts keep their existing backup paths during migration. Package inventory and state backup are separate from automatic package installation or code restoration.
Archive and dependency rules
Extend/reuse the existing streamed archive and table-shard machinery rather than introducing another general ZIP engine. Include a versioned manifest with scope ownership, dataset versions, required Engine/package compatibility, selected settings/media policy and completeness information. Validate integrity before applying data; checksums do not establish trust in executable content.
Preserve identities and resolve references. A Slurp2-only transfer may need Engine personas, character cards, associated media or connection configuration. Preview must offer to include missing dependencies, reuse valid destination identities, or explain why the selected restore cannot proceed. It must not silently restore broken references or overwrite unrelated destination entities. Existing ID collisions must be planned, not guessed by display name.
Missing/inactive/incompatible packages must be listed explicitly. Let users skip a scope or install/enable a compatible package through the normal trusted package flow and retry the archive. Do not create silent schema-less orphan rows or install executable payloads from a data backup. The UI must distinguish data successfully archived for manual recovery from data supported by the current in-app restore.
Preview and apply
Upload/scan once and reuse the existing staged-preview/token approach. Show source Engine/package versions, selected scopes, counts/bytes, dependencies, unsupported schemas, missing assets and the expected effect on destination data. Bind confirmation to the exact staged archive, selection and restore plan, with expiry and compatibility revalidation before applying.
Initially retain Engine's identity-based import semantics for supported Engine items and use whole-package replacement for Slurp2. Clearly say which current package world will be replaced. Arbitrary merging of two Slurp2 worlds is out of scope until the package has defined rules for wallets, subscriptions, messages and linked records. Do not offer a Merge switch without supported semantics.
Validate and stage all selected data before destructive writes. Pause affected writers, checkpoint the data that will be replaced, and coordinate database rows, app settings and assets so an error cannot leave a half-restored world. Reuse existing transactions and asset rollback where they apply; define durable recovery for crashes and multi-scope failures rather than promising that one database transaction covers filesystem changes. Document whether an operation is atomic across selected scopes or commits scope by scope; never report partial success as a completed full restore. Unselected scopes and their media stay unchanged.
Handle pending jobs explicitly: restored queues/claims must be reconciled to avoid replaying paid commissions, payments, notifications or other already-completed side effects. Resume workers only after consistency checks succeed.
Use bounded memory and streaming for large backups, with progress, available-space checks, cancellation and cleanup. No browser-sized whole-archive buffers. Retain existing archive/path/image validation and privileged-access protections. The final report lists restored, skipped, omitted and failed datasets/assets with reasons.
Delivery order: Engine foundation and user flow first, package adoption second
The prerequisite is the Engine feature itself: portable archives, export/import selectors, dependency planning, preview and safe restore. A Slurp2 button or package-specific pilot is not the first deliverable. Package integration must consume a working host flow rather than drive a partial replacement for it.
marinara-slurp-backupformat-v1 imports, including 0.2.40 and Legacy sources supported by Slurp2 today, by translating them into the host restore plan. Then adopt the same contract in Noodle and other packages; check shared-row/media ownership and avoid duplicate generic Engine/package scopes. Declare the new Engine/API minimum in the package releases.Acceptance and regression proof
Leave these as implementation requirements, not claims that the feature is tested:
Localize the new UI, document the difference between portable import and manual full recovery, and update the backup guide alongside implementation.
Alternatives considered
Additional context
Research was read-only. No new backup/import implementation, live restore, browser test or production-data access was performed for this issue.
Engine staging baseline inspected:
0cad58d3577acec7ea9bb2912fa346c288dbe3ec. Package baseline: Marinara-Agentscfdc5d22(Slurp2 0.3.1).Relevant sources:
Related prior work: #5878 (package-owned table persistence and intentional profile exclusion), #5624 (large archive and preview transport), #3683 (partial import failures), #2469 (unselected asset deletion), #6083 (writer leases in raw backups), and #6087 (automatic-backup free-space handling).
Engine owns the host capability/service/UI work; Slurp2 and other downloadable-package adapters belong in Pasta-Devs/Marinara-Agents. Future implementation targets Engine
staging; this issue is filed in the main Engine repository.Template check