mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #4910] [MERGED] feat(server): let Professor Mari set every user-editable lorebook entry field #6538
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#6538
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/4910
Author: @kolacheee
Created: 8/11/2026
Status: ✅ Merged
Merged: 8/11/2026
Merged by: @kolacheee
Base:
staging← Head:feat/4791-mari-lorebook-all-fields📝 Commits (3)
e6451cffeat(server): let Professor Mari set every user-editable lorebook entry field (#4791)2d48d3fMerge branch 'staging' into feat/4791-mari-lorebook-all-fields8b9e415fix(server): apply full entry settings to embedded lorebook.create entries (#4791)📊 Changes
4 files changed (+345 additions, -8 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
packages/server/src/services/mari-db/mari-db.service.ts(+209 -7)📝
packages/server/src/services/professor-mari/workspace-agent.service.ts(+3 -0)📝
scripts/regressions/open-issues.regression.ts(+132 -1)📄 Description
Linked issue
Closes #4909
Follow-up to #4791 / #4796.
Why this change
After #4791 taught the workspace Professor Mari to author well-parameterized lorebooks, a user testing her found she still couldn't change an entry's activation chance — she reported that changing
probabilityfrom 50 to 100 was something "this workspace helper does not support."The cause: her entry action handler (
assignLorebookEntryActionFields) only read a subset of entry fields, so bothlorebook.addEntryandlorebook.updateEntrysilently dropped the rest. A human can set these in the UI (they're all part ofbulkUpdateLorebookEntryChangesSchema), but Mari could not. This makes her the full-fidelity author #4791 intended.What changed
packages/server/src/services/mari-db/mari-db.service.ts— extendedassignLorebookEntryActionFields(used by both theaddentryandupdateentryapp-data actions) to accept every remaining user-editable entry setting, and added those field names to both action allowlists:probability(clamped 0–100 via the existing bounded-number helper).sticky/cooldown/delay/ephemeral.preventRecursion/excludeRecursion/delayUntilRecursion.groupWeight, per-entryscanDepth,locked, folder placementfolderId.characterFilterMode/characterFilterIds,characterTagFilterMode/characterTagFilters,generationTriggerFilterMode/generationTriggerFilters, andadditionalMatchingSources.assignArrayFieldhelper for the object-array field (additionalMatchingSources); element shape is validated downstream on save.packages/server/src/services/professor-mari/workspace-agent.service.ts— two prompt bullets: one listing the newly-settable fields (leave at defaults unless asked;docs_readfor the less-common ones), and one describing the vectorization gate.scripts/regressions/open-issues.regression.ts— extended the #4791 regression to assert the new fields round-trip throughupdateEntry, including theprobabilityclamp (150 → 100).CHANGELOG.md— one entry under Added.Vectorization is gated prompt-side (by design)
Per the request, Mari can set every field freely except vectorization, which she should only enable when an embedding model is configured. That gate is enforced in the prompt (she is told to set
excludeFromVectorization: falseonly whenembeddingModelConfigured: true), not in code — consistent with how #4791 treatsembeddingModelConfiguredas a signal rather than a hard gate. Rationale: including an entry in vectorization with no embedding model is a harmless no-op (it simply participates once one exists), so a hard reject would block a no-op; the real concern is Mari promising semantic recall she can't deliver, which the prompt gate prevents. Excluding an entry is always allowed.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Automated, done by me:
pnpm checkpasses (TypeScript + ESLint + build, exit 0).open-issuesregression runs through the new lorebook assertions (probability clamp 150 → 100, plussticky/cooldown/delay/groupWeight/scanDepth/preventRecursion/excludeRecursion/delayUntilRecursion/excludeFromVectorization/locked/characterFilterIdsround-trips) via the realupdateEntrycode path.Summary entries must expose a shared desktop and touch reorder surface, chat-summary UI) that also fails on a cleanstagingcheckout — not introduced by this PR.Still needs a human (please verify in a real browser, don't trust the boxes above):
probabilityupdates in the lorebook editor.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)CHANGELOG.mdupdated. Nodocs/change needed — every one of these entry settings is already documented indocs/lorebooks/entries.md, so there is nodocs-i18nfollow-up. No version bump.Summary by CodeRabbit
New Features
Bug Fixes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.