mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2006] [Feature]: Drive storage defaults and delete cleanup from the contract registry #983
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#983
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 @Xelvanis on GitHub (Jun 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2006
Originally assigned to: @Xelvanis on GitHub.
What problem does this solve?
The refactor storage contract registry now records supported collections, profile coverage, startup JSON repair, typed JSON fields, create default fields, and delete cleanup metadata. That fixed the target 1 parity gap from #1893, but create defaults and delete cleanup are still only partly registry-driven.
Current shape:
src-tauri/src/commands/storage/contracts.rsrecordscreate_default_fieldsanddelete_cleanup.src-tauri/src/commands/storage/shared.rsstill applies create defaults through a largewith_entity_defaultscollection match.src-tauri/src/commands/storage/commands/entities.rsstill runs delete cleanup through hardcoded entity branches.This is not a current user-facing break. It is follow-up debt from the contracts/schema parity pass: the registry can drift from the behavior it describes.
Proposed behavior
Make create defaults and delete cleanup use the storage contract registry as the executable source of truth where practical.
Suggested first slice:
StorageCollectionContract::create_default_fields.data, in focused helper functions, but register them through the contract path.StorageCollectionContract::delete_cleanup.Expected owner or impact area
Refactor branch considerations
Keep this Rust-side and storage-owned. Do not move product/UI behavior into the low-level file store. The goal is to make the command-layer storage contract registry harder to drift, not to make storage generic or implicit.
The registry already drives allowlisting, profile collection coverage, startup JSON repair collection selection, and typed JSON normalization. This issue is specifically about the remaining create-default and delete-cleanup behavior.
Alternatives considered
Leaving the current helper branches is acceptable short term. The current target 1 parity rescan found this bounded and non-blocking.
The downside is future drift: someone can add or update
create_default_fieldsordelete_cleanupmetadata without updating the executable helper branch, or vice versa.Additional context
Related:
refactorcommit54a9ffd3.Current paths:
src-tauri/src/commands/storage/contracts.rssrc-tauri/src/commands/storage/shared.rssrc-tauri/src/commands/storage/commands/entities.rssrc-tauri/src/commands/storage/profile.rssrc-tauri/src/state.rsFocused proof already run for target 1:
Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: