[GH-ISSUE #2183] [Issue]: Lorebook condition and schedule gates drift from legacy when game state is absent #1086

Closed
opened 2026-10-21 05:26:31 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Jun 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2183

Originally assigned to: @Promansis on GitHub.

Summary

The lorebook runtime rescan found a behavior drift in entry activation conditions and schedules. Refactor fails closed when a lorebook entry has game-state conditions or schedule gates but the relevant game-state value is absent; legacy main was permissive when no game state or no matching field was available.

Expected behavior

Decide and document whether condition/schedule-gated entries should remain legacy-permissive when game state is unavailable, or whether refactor's fail-closed behavior is intentional. Runtime behavior should then be made consistent across scanner preview, prompt assembly, and active-world-info scan output.

Actual behavior

Refactor evaluateConditions returns false without game state and also returns false when a required field is missing. Refactor evaluateSchedule returns false when a schedule has gates but the matching game-state field is missing. Legacy returned true when game state was absent and only rejected schedule gates when a current field existed but did not match.

Steps to reproduce

  1. Create or import a lorebook entry with a primary keyword plus an activation condition or schedule gate.
  2. Generate in a context where the entry's keyword matches but the relevant game-state value is absent or unavailable.
  3. Compare refactor against legacy main scanner behavior.

Impact area

  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor
  • Run mode: Tauri desktop / web shell / remote runtime, wherever prompt assembly uses the shared engine scanner
  • OS + version: not OS-specific
  • Node + pnpm versions: not relevant
  • Rust version, if relevant: not relevant
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: not provider-specific

Logs, screenshots, or video

Static trace:

  • Refactor: src/engine/generation-core/lorebooks/keyword-scanner.ts
  • Legacy: packages/server/src/services/lorebook/keyword-scanner.ts on main

Regression notes

Legacy main behavior was permissive when game state was absent. No intentional divergence entry was found in docs/REFACTOR_PARITY_PIPELINE.md.

Additional context

Parity row: 07-LB-RUNTIME-keyword-gates.

Classification from rescan: Unknown/product decision.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Jun 4, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2183 Originally assigned to: @Promansis on GitHub. ## Summary The lorebook runtime rescan found a behavior drift in entry activation conditions and schedules. Refactor fails closed when a lorebook entry has game-state conditions or schedule gates but the relevant game-state value is absent; legacy `main` was permissive when no game state or no matching field was available. ## Expected behavior Decide and document whether condition/schedule-gated entries should remain legacy-permissive when game state is unavailable, or whether refactor's fail-closed behavior is intentional. Runtime behavior should then be made consistent across scanner preview, prompt assembly, and active-world-info scan output. ## Actual behavior Refactor `evaluateConditions` returns false without game state and also returns false when a required field is missing. Refactor `evaluateSchedule` returns false when a schedule has gates but the matching game-state field is missing. Legacy returned true when game state was absent and only rejected schedule gates when a current field existed but did not match. ## Steps to reproduce 1. Create or import a lorebook entry with a primary keyword plus an activation condition or schedule gate. 2. Generate in a context where the entry's keyword matches but the relevant game-state value is absent or unavailable. 3. Compare refactor against legacy `main` scanner behavior. ## Impact area - [x] Catalog resources - [ ] Chat mode - [x] Roleplay mode - [x] Game mode - [ ] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [x] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [ ] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `refactor` - Run mode: Tauri desktop / web shell / remote runtime, wherever prompt assembly uses the shared engine scanner - OS + version: not OS-specific - Node + pnpm versions: not relevant - Rust version, if relevant: not relevant - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: not provider-specific ## Logs, screenshots, or video Static trace: - Refactor: `src/engine/generation-core/lorebooks/keyword-scanner.ts` - Legacy: `packages/server/src/services/lorebook/keyword-scanner.ts` on `main` ## Regression notes Legacy `main` behavior was permissive when game state was absent. No intentional divergence entry was found in `docs/REFACTOR_PARITY_PIPELINE.md`. ## Additional context Parity row: `07-LB-RUNTIME-keyword-gates`. Classification from rescan: `Unknown/product decision`. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:26:31 +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#1086
No description provided.