[PR #3350] [MERGED] Preserve lorebook angle-bracket markup #5893

Closed
opened 2026-10-23 04:04:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3350
Author: @SpicyMarinara
Created: 7/7/2026
Status: ✅ Merged
Merged: 7/7/2026
Merged by: @SpicyMarinara

Base: staging ← Head: agent/preserve-lorebook-angle-markup


📝 Commits (1)

  • 70db8ab Preserve lorebook angle markup

📊 Changes

2 files changed (+43 additions, -4 deletions)

View changed files

📝 packages/server/src/services/prompt/marker-expander.ts (+4 -4)
📝 scripts/regressions/prompt.regression.ts (+39 -0)

📄 Description

Linked issue

No linked issue yet. This PR was opened from a maintainer/user bug report about Peek Prompt showing lorebook entry < characters as &lt;.

Why this change

Lorebook entries can intentionally contain prompt markup such as <START>, XML-like control tags, or other angle-bracket syntax. Preset lorebook markers were passing lorebook content through XML leaf escaping, so the actual assembled prompt, and therefore Peek Prompt, showed authorial < as &lt;. That changes the prompt text users wrote and can break imported/worldbook prompt conventions.

What changed

  • Stopped XML leaf escaping for lorebook marker output in preset prompt assembly.
  • Stopped XML leaf escaping for lorebook depth entries collected by lorebook markers.
  • Added a prompt regression that proves lorebook marker content and depth entries preserve authored angle-bracket markup.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Automated checks run locally by Codex:

  • pnpm regression:prompt passed.
  • pnpm check passed.

No browser/manual click-through was performed. The regression directly exercises lorebook marker expansion and asserts <START>, <tone soft>, <ritual_step id="2">, and depth-injected <scene-note> remain literal rather than becoming &lt;....

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

Prompt behavior only; no user-facing docs or release metadata updated.

UI evidence (if applicable)

Not applicable; no UI changes.


🔄 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/3350 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/7/2026 **Status:** ✅ Merged **Merged:** 7/7/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/preserve-lorebook-angle-markup` --- ### 📝 Commits (1) - [`70db8ab`](https://github.com/Pasta-Devs/Marinara-Engine/commit/70db8ab2403c31e36ae0050b627a824f09c5753d) Preserve lorebook angle markup ### 📊 Changes **2 files changed** (+43 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/prompt/marker-expander.ts` (+4 -4) 📝 `scripts/regressions/prompt.regression.ts` (+39 -0) </details> ### 📄 Description ## Linked issue No linked issue yet. This PR was opened from a maintainer/user bug report about Peek Prompt showing lorebook entry `<` characters as `&lt;`. ## Why this change Lorebook entries can intentionally contain prompt markup such as `<START>`, XML-like control tags, or other angle-bracket syntax. Preset lorebook markers were passing lorebook content through XML leaf escaping, so the actual assembled prompt, and therefore Peek Prompt, showed authorial `<` as `&lt;`. That changes the prompt text users wrote and can break imported/worldbook prompt conventions. ## What changed - Stopped XML leaf escaping for lorebook marker output in preset prompt assembly. - Stopped XML leaf escaping for lorebook depth entries collected by lorebook markers. - Added a prompt regression that proves lorebook marker content and depth entries preserve authored angle-bracket markup. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Automated checks run locally by Codex: - `pnpm regression:prompt` passed. - `pnpm check` passed. No browser/manual click-through was performed. The regression directly exercises lorebook marker expansion and asserts `<START>`, `<tone soft>`, `<ritual_step id="2">`, and depth-injected `<scene-note>` remain literal rather than becoming `&lt;...`. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) Prompt behavior only; no user-facing docs or release metadata updated. ## UI evidence (if applicable) Not applicable; no UI changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:04:54 +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#5893
No description provided.