mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4924] [Issue]: Professor Mari has no safe lorebook entry-delete and mass-deletes via raw mari db delete --where #2728
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#2728
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 @kolacheee on GitHub (Aug 11, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4924
Originally assigned to: @kolacheee on GitHub.
Summary
Professor Mari has no safe way to delete a single lorebook entry: her structured
app_datatoolkit exposeslorebook.addEntryandlorebook.updateEntrybut nolorebook.deleteEntry. When a user asked her to delete one entry, she triedlorebook.deleteEntry(not a real action, so it failed), then fell back to the rawmari db delete <table> --where <expr>command — which matched and deleted 77 entries across multiple unrelated lorebooks instead of the one entry.Expected behavior
Mari can delete a single lorebook entry by id through a structured, scoped action that goes through the normal Keep/Restore review, the same way she adds and updates entries.
Actual behavior
lorebook.deleteEntryfails (unsupported action), so Mari improvises withmari db delete lorebook_entries --where …, a raw bulk-delete with no row-count guard, and removes far more than intended. The deletion is recoverable via the Keep/Restore card, but the blast radius is the whole matched set.Steps to reproduce
lorebook.deleteEntry(fails), then usesmari db deletewith a--whereexpression.Environment
Logs, screenshots, or video
Mari: "
lorebook.deleteEntryisn't a direct action inapp_data. To delete an entry via CLI/DB commands, I can usemari lorebooksormari db. Let's delete entry<id>usingmari db." Result: a Keep/Restore card reading "77 lorebook_entries / 77 rows" removed.Additional context
Root cause is the missing structured delete:
packages/server/src/services/mari-db/mari-db.service.tshasaddentry/updateentrycases in the lorebookapp_datahandler but nodeleteentry; the CLI already has a safemari lorebooks delete-entry <id>(single row), but Mari reached for rawmari db deleteinstead.Proposed fix (this issue):
lorebook.deleteEntryapp_dataaction — single entry by id, scoped tolorebook_entries, routed through the same Keep/Restore review as add/update.lorebook.deleteEntry(ormari lorebooks delete-entry <id>); never usemari db delete --wherefor routine entry deletes.A separate, more invasive guardrail on raw
mari db delete --wherebulk deletes (dry-run-and-confirm before applying) is deliberately out of scope here and can be tracked separately.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: