mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6575] [MERGED] feat(lorebooks): activate entries on a Decision model statement #7232
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#7232
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/6575
Author: @kolacheee
Created: 9/23/2026
Status: ✅ Merged
Merged: 9/23/2026
Merged by: @kolacheee
Base:
staging← Head:feat/lorebook-decision-activation📝 Commits (9)
bf0518dfeat(lorebooks): activate entries on a Decision model statement90410a4docs(lorebooks): document decision activation for entries197b74dfix(lorebooks): let Trigger decide when secondary keys reject a match; validate Mari's decision fieldsb208fa1fix(lorebooks): gate location entries, follow resolved text, rank semantic asks, one budget per turn527fcb5fix(lorebooks): an unanswered semantic statement holds a slot only while it can still be asked; hint mentions map entriesaaa8176docs(lorebooks): list every path that asks a Require statementbe6a7a5fix(lorebooks): scope decision discovery's recursion like the real scane60d341test(lorebooks): assert scoped decision discovery still recurses8637ef7docs(decision): say exactly what a decision model reads📊 Changes
30 files changed (+1167 additions, -24 deletions)
View changed files
📝
CHANGELOG.md(+4 -0)📝
docs/connections/decision-models.md(+13 -1)📝
docs/lorebooks/entries.md(+25 -0)📝
docs/prompts/conditional-prompts.md(+1 -1)📝
packages/client/src/components/chat/ChatRoleplayPanels.tsx(+5 -3)📝
packages/client/src/components/lorebooks/LorebookEntryRow.tsx(+58 -0)📝
packages/client/src/components/ui/DecisionStatementNote.tsx(+14 -4)📝
packages/client/src/hooks/use-lorebooks.ts(+8 -4)📝
packages/client/src/localization/locales/en.json(+11 -0)📝
packages/server/src/db/schema/lorebooks.ts(+5 -0)📝
packages/server/src/routes/backup.routes.ts(+2 -0)📝
packages/server/src/routes/chats.routes.ts(+16 -0)📝
packages/server/src/routes/generate.routes.ts(+18 -1)📝
packages/server/src/routes/generate/dry-run-route.ts(+16 -0)📝
packages/server/src/routes/lorebooks.routes.ts(+29 -0)📝
packages/server/src/services/decision/prompt-decisions.ts(+54 -0)📝
packages/server/src/services/import/marinara.importer.ts(+2 -0)📝
packages/server/src/services/import/st-character.importer.ts(+2 -0)📝
packages/server/src/services/import/st-lorebook.importer.ts(+6 -0)📝
packages/server/src/services/lorebook/character-book-sync.ts(+3 -0)...and 10 more files
📄 Description
Linked issue
Closes #6570
Why this change
{{#if decision:"..."}}inside an entry (#6569) only trims the text of an entry that has already activated: it still takes budget, feeds recursion and starts timers. Nothing could decide whether the entry activates at all.What changed
decisionStatementanddecisionMode(off/require/trigger), in the shared schema and type, the database, and storage. Rows written before this read asoff.decisionactivation source.processLorebooks: the scan is synchronous and the budget pass commits macro side effects, so neither can wait for a model. A pure pre-scan (recursion included, over raw entry text) collects the entries waiting on a statement, and they are asked in one request. A second round covers entries reached only through another decision entry. The real scan then runs once with the answers, and the probability rolls are shared across passes.{{#if decision}}asking the same statement share one answer, and a regeneration activates the same entries. Lorebook statements count toward Decision statements per turn, after the prompt's own. This is wired into all four chat-generation scans: Conversation, Roleplay without a preset, the preset lorebook marker, and Game mode.docs/lorebooks/entries.md, plus links from the Decision Models and Conditional Prompts guides. The Decision Models guide also gains a "What the model sees" section: only the statement and the recent saved chat messages (the last 5 for decision statements and Smart order), never the preset, cards, persona description, lorebook entries or anything inserted @ Depth.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Run by the agent:
pnpm check,pnpm localization:checkandpnpm regression:node(362 of 362 regressions pass) on the branch rebased onto staging06bf1a6d6.scripts/regressions/lorebook-decision-activation.regression.ts:Please verify manually:
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Changed user docs for the batched
[docs-i18n]follow-up (#6532):docs/lorebooks/entries.md(new Decision activation section),docs/connections/decision-models.md(one bullet, one sentence, and a new "What the model sees" section),docs/prompts/conditional-prompts.md(one sentence).UI evidence (if applicable)
Not captured by the agent. The UI change is one field group in the lorebook entry drawer (three mode buttons, a statement box, a hint line and the missing-model warning) and a
decisionlabel in the active lorebook list.Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.