mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2279] [Issue]: Cross-lorebook recursive activation is dropped: refactor narrows recursion seeding to per-book recursiveScanning #1117
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#1117
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 @Romuromylus on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2279
Originally assigned to: @cha1latte on GitHub.
Summary
The refactor only seeds the recursive-activation frontier from entries whose own lorebook has recursiveScanning enabled. Main seeds from every activated non-preventRecursion entry regardless of book, so cross-lorebook recursion (an entry in a non-recursive book chain-triggering lore in another book) is lost.
Expected behavior
When recursion is enabled for the scan, any activated entry that is not preventRecursion should be able to chain-trigger related lore, including entries that live in a book that itself has recursiveScanning off, matching main's global behavior.
Actual behavior
The refactor re-narrows the recursion seed source per-book, so activated entries from books with recursiveScanning off never seed deeper passes. Chained lore that main would have activated is silently never injected.
Steps to reproduce
Impact area
Regression notes
Worked on main. Main seeds the frontier by
!selected.entry.preventRecursiononly and gates recursion solely on the globalanyRecursiveflag (packages/server/src/services/lorebook/index.ts:665-667,837-838;keyword-scanner.ts:544-546); itslorebooksByIdis typedPick<Lorebook,"name"|"tokenBudget">so it structurally cannot gate per-book. The refactor adds a per-book gatelorebooksById.get(selected.entry.lorebookId)?.recursiveScanning && !selected.entry.preventRecursion(src/engine/generation/active-lorebook-scanner.ts:675-681, metadata at:88,:819, loop enabled at:857). Rust references recursiveScanning/preventRecursion only as storage/import/export plumbing (contracts.rs:144,normalization.rs:434,shared.rs:934), so the TS frontier loop is the only authority.Environment
5ddb9840(compared against main @b4ab97f)Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: