[GH-ISSUE #1546] [Issue]: Lorebook scan depth and recursion settings are ignored during prompt activation #789

Closed
opened 2026-10-20 17:33:25 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Xelvanis on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1546

Originally assigned to: @Xelvanis on GitHub.

Found during the 2026-05-29 native Tauri Lorebooks QA pass on origin/refactor commit f120eb33.

Proof method: seeded disposable lorebook/chat records through the app's Tauri storage API, then ran the app's own prompt-preview assembly from the native WebView. The same pass included positive controls for selected, global, character-scoped, persona-scoped, and roleplay-trigger-filtered entries.

What happened

Lorebook-level scanDepth and recursiveScanning settings are saved but not honored by prompt activation.

Repro A: lorebook scan depth

  1. Create an active lorebook with scanDepth: 1.
  2. Add an entry with no entry-level scan-depth override and key LQA_OLD_KEY.
  3. Put LQA_OLD_KEY only in an older message, not the latest message.
  4. Run prompt preview / active world-info scan.

Expected: the entry should not activate because the lorebook default scan depth should limit scanning to the latest message.
Actual: the entry activated and LQA_SCAN_DEPTH_CONTENT_SHOULD_NOT_APPEAR appeared in the assembled prompt.

Repro B: recursive scanning

  1. Use an active lorebook with recursiveScanning: true.
  2. Add a parent entry triggered by chat text whose content includes the child entry's key.
  3. Add a child entry triggered only by that parent content.
  4. Run prompt preview.

Expected: recursive scanning should activate the child entry when recursion is enabled.
Actual: only the parent activated; LQA_RECURSIVE_CHILD_CONTENT_SHOULD_APPEAR_IF_RECURSION_WIRED was absent.

Likely owner

loadActivatedLore(...) in src/engine/generation/prompt-assembly.ts normalizes flat entries and calls scanForActivatedEntries(...) directly. It does not apply lorebook-level scanDepth defaults to entries, and it does not call recursiveScan(...) when a selected book has recursiveScanning: true.

Acceptance criteria

  • Entry activation honors the selected lorebook's default scanDepth for entries without an entry-level override.
  • Recursive scanning is either wired for lorebooks with recursiveScanning: true, or the UI/storage contract is changed so the setting is not presented as active behavior.
  • Add focused regression tests for lorebook-level scan depth and recursive activation.
Originally created by @Xelvanis on GitHub (May 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1546 Originally assigned to: @Xelvanis on GitHub. Found during the 2026-05-29 native Tauri Lorebooks QA pass on `origin/refactor` commit `f120eb33`. Proof method: seeded disposable lorebook/chat records through the app's Tauri storage API, then ran the app's own prompt-preview assembly from the native WebView. The same pass included positive controls for selected, global, character-scoped, persona-scoped, and roleplay-trigger-filtered entries. ## What happened Lorebook-level `scanDepth` and `recursiveScanning` settings are saved but not honored by prompt activation. ## Repro A: lorebook scan depth 1. Create an active lorebook with `scanDepth: 1`. 2. Add an entry with no entry-level scan-depth override and key `LQA_OLD_KEY`. 3. Put `LQA_OLD_KEY` only in an older message, not the latest message. 4. Run prompt preview / active world-info scan. Expected: the entry should not activate because the lorebook default scan depth should limit scanning to the latest message. Actual: the entry activated and `LQA_SCAN_DEPTH_CONTENT_SHOULD_NOT_APPEAR` appeared in the assembled prompt. ## Repro B: recursive scanning 1. Use an active lorebook with `recursiveScanning: true`. 2. Add a parent entry triggered by chat text whose content includes the child entry's key. 3. Add a child entry triggered only by that parent content. 4. Run prompt preview. Expected: recursive scanning should activate the child entry when recursion is enabled. Actual: only the parent activated; `LQA_RECURSIVE_CHILD_CONTENT_SHOULD_APPEAR_IF_RECURSION_WIRED` was absent. ## Likely owner `loadActivatedLore(...)` in `src/engine/generation/prompt-assembly.ts` normalizes flat entries and calls `scanForActivatedEntries(...)` directly. It does not apply lorebook-level `scanDepth` defaults to entries, and it does not call `recursiveScan(...)` when a selected book has `recursiveScanning: true`. ## Acceptance criteria - Entry activation honors the selected lorebook's default `scanDepth` for entries without an entry-level override. - Recursive scanning is either wired for lorebooks with `recursiveScanning: true`, or the UI/storage contract is changed so the setting is not presented as active behavior. - Add focused regression tests for lorebook-level scan depth and recursive activation.
bsakaguchi 2026-10-20 17:33:25 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#789
No description provided.