mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1977] Restore selective-only secondary key gating for lorebook entries #969
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#969
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 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1977
Originally assigned to: @cha1latte on GitHub.
Problem
Target 7 lorebooks parityscan found a refactor runtime regression in selective secondary-key handling.
Legacy lorebook entries only required
secondaryKeyswhenselectivewas enabled. Refactor currently requires secondary keys whenever the array is non-empty, even whenselectiveis false.Refactor evidence
src/engine/generation-core/lorebooks/keyword-scanner.ts:493-496appliestestSecondaryKeyswheneverentry.secondaryKeys.length > 0.src/features/catalog/lorebooks/components/editor/LorebookEditor.tsx:422-423uses the same preview behavior.src-tauri/src/commands/storage/imports/normalization.rs:272-276importssecondaryKeysandselectiveindependently, defaultingselectivetofalse.Legacy behavior
packages/server/src/services/lorebook/keyword-scanner.ts:480-482only checked secondary keys underentry.selective && entry.secondaryKeys.length > 0.packages/client/src/components/lorebooks/LorebookEditor.tsx:636-637preview matched the same rule.Impact
ST and legacy imports can carry secondary keys while selective is off. Those entries used to activate on primary keys alone; refactor can now skip them until secondary keys also match.
Expected behavior
Keep
secondaryKeysgated byselective, or explicitly migrate/import such entries with selective enabled if a product decision says secondary keys should always gate.Suggested fix
Restore
entry.selective && entry.secondaryKeys.length > 0in the runtime scanner and editor preview, then add focused local proof for an entry with a primary key match, secondary key miss, andselective=false.Parent: #1904 target 7 lorebooks parityscan.