mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
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#6512
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4836
Author: @kolacheee
Created: 8/9/2026
Status: ✅ Merged
Merged: 8/10/2026
Merged by: @kolacheee
Base:
staging← Head:fix/4812-mari-preset-granular📝 Commits (3)
b125e6ffeat(mari-db): let Professor Mari see and edit specific parts of a preset (#4812)4abdabfMerge branch 'staging' into fix/4812-mari-preset-granulard14d063Merge branch 'staging' into fix/4812-mari-preset-granular📊 Changes
6 files changed (+1241 additions, -14 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
docs/home/professor-mari.md(+1 -0)📝
package.json(+2 -1)📝
packages/server/src/services/mari-db/mari-db.service.ts(+899 -9)📝
packages/server/src/services/professor-mari/workspace-agent.service.ts(+26 -4)➕
scripts/regressions/mari-preset-granular.regression.ts(+312 -0)📄 Description
Linked issue
Fixes #4812.
Why this change
Professor Mari could only create or replace a whole preset.
preset.getreturned bare section-id arrays with no content, and nothing resolved to a patch against one section, so she couldn't single out "the formatting section" to add a line — while the same request asked out-of-character to the roleplay AI (which has the preset rendered into its prompt as text) succeeded easily. In the reporter's words, she "lacks the ability to see or edit parts of presets."What changed
Granular section / group / choice-block actions on
MariDbService, modeled on the lorebook entry actions and all routed throughexecuteMutation, so each edit gets the reversible Keep/Restore review for free:preset.sections/getSection,preset.groups/getGroup,preset.choiceBlocks/getChoiceBlock— a compact index (id + name + a content preview, ordered by the preset'ssectionOrder/groupOrder) plus a full single-item read. This is the "let her see it" half.preset.updateSection/updateGroup/updateChoiceBlockvia a plain patch on the child table. A marker section rejects a content patch (its content is generated).preset.addSection/addGroupinsert the child and append its id to the parent's order array in one atomic reviewable plan (a child missing from the order array is never assembled);preset.addChoiceBlockis a plain insert (choice-blocks order by their ownsortOrder).preset-section-delete,preset-group-delete) prune the order array and delete the row; deleting a group orphans its member sections and un-nests its child groups, exactly matching the storage layer'sremoveGroup.restorePlanreverses all of these FK-safe."Add a line to a specific spot" is served by
getSection→ splice the line into the full content →updateSection— the section is the finest addressable unit (content is one opaque text column; there is no line/offset addressing).CLI: a new
mari presetscommand group (list|get|sections|get-section|groups|get-group|choice-blocks|get-choice-block,add/update/deletefor each child type, andcreate/updatevia--json) that parses flags and delegates to the same handlers, so the granular edits are available from the shell too.Folded-in data-safety fix (from the merged #4825 review):
planRelatedInsertsnow refuses a colliding child id the same wayplanInsertdoes. On the file-native backend a colliding child insert already hard-fails; the guard's value is failing early with a clear message and fixing a deceptiveapply:falsepreview (which showed the colliding child as a clean insert) instead of a late unique-constraint abort.Prompt,
docs/home/professor-mari.md, andCHANGELOG.mdupdated.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm check(TypeScript + ESLint + localization + build) passes.pnpm regression:mari-preset-granular(wired into theregression:issueslane) drives the real service through: seed a preset → read (she sees section content) → a targeted update that changes only that section and reverts on Restore → add (appended tosectionOrder) → delete (pruned) → group-delete (orphans its sections) → a CLI round-trip (mari presets sections,mari presets add-section --apply) → the child-clobber guard. The professor-mari prompt/documentation regressions still pass.updateChoiceBlockempty-options guard and identifier/variableName de-duplication for single add/rename.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Updated
docs/home/professor-mari.md(one capability bullet) andCHANGELOG.md. A[docs-i18n]follow-up will be filed to mirror the professor-mari.md change. No version bump.Summary by CodeRabbit
New Features
Documentation
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.