[PR #2098] [MERGED] Add lorebook context to Conversation schedule generation #5436

Closed
opened 2026-10-22 04:16:18 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2098
Author: @cha1latte
Created: 6/3/2026
Status: ✅ Merged
Merged: 6/3/2026
Merged by: @cha1latte

Base: refactor ← Head: feat/issue-2097-schedule-lorebook-context


📝 Commits (2)

  • 24255c3 Add lorebook context to schedule generation
  • 4ccc009 Tighten schedule lorebook context handling

📊 Changes

2 files changed (+401 additions, -0 deletions)

View changed files

➕ src/engine/modes/chat/schedules/schedule.service.test.ts (+232 -0)
📝 src/engine/modes/chat/schedules/schedule.service.ts (+169 -0)

📄 Description

Linked issue

Closes #2097

Why this change

  • Conversation schedule generation could only use character card fields, continuity, and the global schedule preferences box. Lorebook-backed routine facts such as jobs, locations, commutes, culture, or recurring obligations had to be copied into the card/chat/preferences manually.

What changed

  • Adds a capped schedule-lorebook context block to the Conversation schedule-generation prompt.
  • Reuses existing active lorebook scope resolution so chat-selected, character-linked, persona-linked, chat-scoped, and global lorebooks follow the same relevance rules as the rest of the engine.
  • Reuses existing lorebook entry activation loading so disabled entries and disabled folders stay excluded.
  • Applies character/generation-trigger lorebook entry filters and caps oversized entry text before injection.
  • Adds focused tests for included scoped lore, excluded lore, character-filtered lore, and oversized-entry truncation.

Refactor impact

Primary owner:

Chat mode / React-free engine schedule generation.

Impact areas reviewed:

  • src/engine/modes/chat/schedules
  • Existing active lorebook scope and entry-loading helpers
  • Architecture/import guard

Boundary notes:

  • Keeps the change in React-free engine code.
  • Does not add a Schedule Planner settings panel, editable prompt, schema field, or new agent type.
  • Does not change normal chat prompt assembly; this only affects Conversation schedule generation when an LLM schedule is generated.

Pressure points touched:

  • None of the listed broad pressure points. This does not touch ModeSurface, GameSurface, shared mode UI, Tauri command registration, or import modules.

Validation

  • Focused proof or matching lane command passes locally
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Codex ran pnpm test -- src/engine/modes/chat/schedules/schedule.service.test.ts — 2 tests passed.
  • Codex ran pnpm typecheck — passed.
  • Codex ran pnpm check:architecture — passed.
  • Codex ran pnpm check — passed.
  • Bunny review pass: local diff passed before PR open.
  • Manual app verification not run; this is a non-UI prompt assembly behavior change covered by focused tests.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • N/A: this improves existing Conversation schedule generation behavior without adding a new UI surface, setting, mode, panel, or user-discoverable entry point.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

N/A — no visible UI changes.

Summary by CodeRabbit

  • New Features

    • Character schedules now include scoped lorebook context, enriching generated routines with relevant durable details (work, school, location, commute, obligations, sleep patterns) while avoiding irrelevant lore.
  • Tests

    • Added tests for schedule generation with lore context, verifying entry filtering and that oversized lore content is capped before inclusion.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/2098 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/3/2026 **Status:** ✅ Merged **Merged:** 6/3/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `feat/issue-2097-schedule-lorebook-context` --- ### 📝 Commits (2) - [`24255c3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/24255c38efc3e4f23bd1d30c70c379a2ad2d5876) Add lorebook context to schedule generation - [`4ccc009`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4ccc009e5713e417166d6b1ce7c9db9c573cfcb7) Tighten schedule lorebook context handling ### 📊 Changes **2 files changed** (+401 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `src/engine/modes/chat/schedules/schedule.service.test.ts` (+232 -0) 📝 `src/engine/modes/chat/schedules/schedule.service.ts` (+169 -0) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #2097 ## Why this change - Conversation schedule generation could only use character card fields, continuity, and the global schedule preferences box. Lorebook-backed routine facts such as jobs, locations, commutes, culture, or recurring obligations had to be copied into the card/chat/preferences manually. ## What changed - Adds a capped schedule-lorebook context block to the Conversation schedule-generation prompt. - Reuses existing active lorebook scope resolution so chat-selected, character-linked, persona-linked, chat-scoped, and global lorebooks follow the same relevance rules as the rest of the engine. - Reuses existing lorebook entry activation loading so disabled entries and disabled folders stay excluded. - Applies character/generation-trigger lorebook entry filters and caps oversized entry text before injection. - Adds focused tests for included scoped lore, excluded lore, character-filtered lore, and oversized-entry truncation. ## Refactor impact Primary owner: Chat mode / React-free engine schedule generation. Impact areas reviewed: - `src/engine/modes/chat/schedules` - Existing active lorebook scope and entry-loading helpers - Architecture/import guard Boundary notes: - Keeps the change in React-free engine code. - Does not add a Schedule Planner settings panel, editable prompt, schema field, or new agent type. - Does not change normal chat prompt assembly; this only affects Conversation schedule generation when an LLM schedule is generated. Pressure points touched: - None of the listed broad pressure points. This does not touch ModeSurface, GameSurface, shared mode UI, Tauri command registration, or import modules. ## Validation - [ ] Focused proof or matching lane command passes locally - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Codex ran `pnpm test -- src/engine/modes/chat/schedules/schedule.service.test.ts` — 2 tests passed. - Codex ran `pnpm typecheck` — passed. - Codex ran `pnpm check:architecture` — passed. - Codex ran `pnpm check` — passed. - Bunny review pass: local diff passed before PR open. - Manual app verification not run; this is a non-UI prompt assembly behavior change covered by focused tests. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [ ] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - N/A: this improves existing Conversation schedule generation behavior without adding a new UI surface, setting, mode, panel, or user-discoverable entry point. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence N/A — no visible UI changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Character schedules now include scoped lorebook context, enriching generated routines with relevant durable details (work, school, location, commute, obligations, sleep patterns) while avoiding irrelevant lore. * **Tests** * Added tests for schedule generation with lore context, verifying entry filtering and that oversized lore content is capped before inclusion. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:16:18 +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#5436
No description provided.