mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5878] [Feature]: Let capability packages register and persist their own file tables #3244
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#3244
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 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5878
Originally assigned to: @Gunterlie on GitHub.
What problem does this solve?
The Slurp capability package needs package-owned storage. Slurp declares its own file tables and cannot persist them.
The file-backed store builds all table metadata once, at module load, from a hardcoded allowlist of the Engine's own tables. Any table name outside that list has no metadata, so
getMeta()throws:A downloaded capability package therefore has no supported way to persist its own data. Its only option is to borrow an Engine table that was designed for something else, which means writing package rows into a schema the package does not own, sharing a flush and manifest entry with unrelated Engine data, and having those rows travel in profile export/import as if they were Engine data.
This is an Engine-side gap. The package side already declares tables; the store simply has no entry point to accept them.
Proposed solution
Add a storage-side API on the live store that registers package-supplied file tables.
Packages activate after the store's
initialize(), so registration has to work against an already-running store rather than at boot. A registered table should end up with everything a boot-loaded table gets, or it would accept writes and silently lose them: validated metadata, a row container, its existing rows read off disk, membership in the flush loop, and an entry in the snapshot manifest.Required properties:
Security is the load-bearing part. Table names become filesystem paths (
tables/<name>.json,tables/<name>/) with no escaping anywhere in the store. That was safe only while every name came from the Engine's own hardcoded list. An unvalidated package-supplied name such as../../.ssh/authorized_keyswould be an arbitrary-write primitive outside the data directory, so a package-supplied name must be validated before it reaches any path join or any registry.Two further constraints follow from how the store already works:
SHARDED_TABLESaliases the file-backed table list, so a name added to that list becomes sharded by array identity whether or not that was intended. The sharded-table lookup set must be kept in step with the list rather than remaining a module-load snapshot, or the load, flush and delete paths would each classify the same table differently.Profile export/import should deliberately exclude registered tables. A profile snapshot is portable user data that may be restored into a different install, where the owning package may not exist; importing those rows would fail at restore time or leave silent orphans with no schema to validate against. Package data still persists normally and is captured by a full data-directory backup, which is scoped to one install.
Alternatives considered
getMeta()and the whole lookup surface. That is a much larger change than the gap warrants while production runs a single store per process.Additional context
The Engine currently has no caller that loads package-supplied table objects, so the first change here is the storage-side API only. Wiring a package loader to it is separate work.
Template check