mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1793] Restore lorebook parity for delete cleanup, prompt injection, ephemeral entries, and imports #874
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#874
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 @Xelvanis on GitHub (Jun 1, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1793
Originally assigned to: @cha1latte on GitHub.
Summary
Legacy lorebook behavior has several parity gaps in the refactor path. These affect deletion cleanup, prompt assembly correctness, ephemeral entry state, macro/budget handling, and SillyTavern import normalization.
Refactor commit audited:
84f40efdFindings
1. Deleting a lorebook does not clear linked references
Refactor generic deletion removes the lorebook plus child entries/folders, but does not clear chat metadata or linked character embedded-lorebook metadata.
Refactor paths:
src/features/catalog/lorebooks/hooks/use-lorebooks.tssrc-tauri/src/commands/storage/commands/entities.rsLegacy paths:
packages/server/src/routes/lorebooks.routes.tspackages/server/src/services/lorebook/character-book-sync.tsExpected behavior:
activeLorebookIdscharacter_bookextensions.importMetadata.embeddedLorebook2. Depth injection can shift prompt positions
Refactor depth injection computes insertion indexes against a mutating message array. Legacy anchors insertion against original history bounds before splicing.
Refactor paths:
src/engine/generation-core/lorebooks/prompt-injector.tssrc/engine/generation/prompt-assembly.tsLegacy paths:
packages/server/src/services/lorebook/prompt-injector.tspackages/server/src/services/prompt/assembler.tsImpact:
Mixed-depth lorebook entries, character depth prompts, and author note insertion can land at different positions than legacy.
3. Ephemeral lore entries do not decrement per chat
Refactor has
entryStateOverridesin the chat contract, but active lorebook scanning does not apply or persist ephemeral countdown state.Refactor paths:
src/engine/contracts/types/chat.tssrc/engine/generation/active-lorebook-scanner.tssrc/engine/generation/start-generation.tsLegacy path:
packages/server/src/services/lorebook/index.tsImpact:
Finite-use lore entries can continue activating after their intended use count reaches zero.
4. Lore macro and budget handling is weaker than legacy
Refactor budgets raw lore content and injects some lore without macro resolution. Legacy resolves lore content with variable snapshot commit/rollback before final budget selection.
Refactor paths:
src/engine/generation/active-lorebook-scanner.tssrc/engine/generation-core/lorebooks/prompt-injector.tssrc/engine/generation/prompt-assembly.tsLegacy paths:
packages/server/src/services/prompt/macro-context.tspackages/server/src/services/lorebook/index.tspackages/server/src/services/prompt/marker-expander.tsImpact:
Lore entries can be selected based on pre-expansion size, dropped macro side effects are not handled like legacy, and some injected lore can keep unresolved macros.
5. SillyTavern import normalization misses selective/probability cases
Refactor import normalization can preserve raw numeric
selectiveLogicand does not handleuseProbability: false.Refactor path:
src-tauri/src/commands/storage/imports/normalization.rsLegacy path:
packages/server/src/services/import/st-lorebook.importer.tsExpected behavior:
selectiveLogicvalues:0 -> and,1 -> or,2 -> notuseProbability: false/use_probability: falseas disabled probabilityNon-gaps / intentional differences
Suggested fix order
Verification
Static parity audit only. No app run or automated test pass was performed for this report.
@cha1latte commented on GitHub (Jun 1, 2026):
Fixed in #1834