[GH-ISSUE #2298] [Issue]: SillyTavern lorebook import drops entry-tag and category auto-detection #1134

Closed
opened 2026-10-21 05:27:38 +07:00 by bsakaguchi · 1 comment
Owner

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

Originally assigned to: @Romuromylus on GitHub.

Summary

When importing a SillyTavern World Info (.json) lorebook, the refactor leaves every entry's semantic tag empty and files the whole lorebook under "Uncategorized". The main web app auto-detected both. These are two related losses on the same import function (normalize_lorebook).

Expected behavior

A SillyTavern World Info import should, like main:

  1. Auto-assign each entry a semantic tag (one of location / character / item / faction / lore / magic / creature / event) from its keywords and content.
  2. Auto-detect the lorebook category (World / Character / NPC / Spellbook) by scoring entry signals.

Actual behavior

On the refactor, every imported entry lands with an empty tag, and every imported lorebook lands in the "Uncategorized" bucket. The user has to manually tag each entry and re-assign the lorebook category. No core import data (keys, content, activation, position) is lost; this is an organizational/convenience regression.

Steps to reproduce

  1. Export a World Info JSON from SillyTavern.
  2. Import it into the refactor.
  3. Observe: each entry shows a blank tag chip, and the lorebook appears under "Uncategorized" in the lorebook panel.

Impact area

  • App shell, navigation, startup, or providers
  • 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 @ f56a3774 (compared against main @ b4ab97fb)
  • Run mode: Tauri desktop
  • OS + version: Windows 11
  • Node + pnpm versions: not relevant (static source comparison)
  • Rust version, if relevant: not relevant
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

Not applicable (identified via source comparison).

Regression notes

Both worked in main; the refactor's normalize_lorebook does not port main's import-time heuristics. Same root, two parts.

  • Entry tag: main packages/server/src/services/import/st-lorebook.importer.ts:423 sets tag: detectEntryTag(entry); refactor src-tauri/src/commands/storage/imports/normalization.rs:303 hardcodes "tag": "".
  • Lorebook category: main st-lorebook.importer.ts:337 (detectCategory defined 233-270, scoring against CATEGORY_SIGNALS) sets the category; refactor normalization.rs:430 hardcodes "category": "uncategorized".
  • Absence proof: grepping the entire refactor tree (src/ TS + src-tauri/ Rust incl crates/*) for detectCategory|detect_category|detectEntryTag|detect_entry_tag|CATEGORY_SIGNALS returns 0 matches, and there is no post-import category/tag assignment anywhere.
  • Both are on the common ST World Info import path via service.rs -> create_lorebook_from_payload -> normalize_lorebook.

Additional context

Downstream effects of the empty tag: the Lorebook Keeper agent's tag-based category filter and search haystack lose the signal for imported entries (refactor tools-runtime.ts:304, :309), and the missing category lands everything in the wrong bucket in groupLorebooksByCategory (lorebook-panel-model.ts:91-97). The fix is localized to the single normalize_lorebook function.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Romuromylus on GitHub (Jun 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2298 Originally assigned to: @Romuromylus on GitHub. ## Summary When importing a SillyTavern World Info (`.json`) lorebook, the refactor leaves every entry's semantic tag empty and files the whole lorebook under "Uncategorized". The main web app auto-detected both. These are two related losses on the same import function (`normalize_lorebook`). ## Expected behavior A SillyTavern World Info import should, like main: 1. Auto-assign each entry a semantic tag (one of `location` / `character` / `item` / `faction` / `lore` / `magic` / `creature` / `event`) from its keywords and content. 2. Auto-detect the lorebook category (World / Character / NPC / Spellbook) by scoring entry signals. ## Actual behavior On the refactor, every imported entry lands with an empty tag, and every imported lorebook lands in the "Uncategorized" bucket. The user has to manually tag each entry and re-assign the lorebook category. No core import data (keys, content, activation, position) is lost; this is an organizational/convenience regression. ## Steps to reproduce 1. Export a World Info JSON from SillyTavern. 2. Import it into the refactor. 3. Observe: each entry shows a blank tag chip, and the lorebook appears under "Uncategorized" in the lorebook panel. ## Impact area <!-- Check the areas you think are relevant. Leave uncertain items unchecked. --> - [ ] App shell, navigation, startup, or providers - [x] 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 - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: refactor @ f56a3774 (compared against main @ b4ab97fb) - Run mode: Tauri desktop - OS + version: Windows 11 - Node + pnpm versions: not relevant (static source comparison) - Rust version, if relevant: not relevant - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video Not applicable (identified via source comparison). ## Regression notes Both worked in main; the refactor's `normalize_lorebook` does not port main's import-time heuristics. Same root, two parts. - Entry tag: main `packages/server/src/services/import/st-lorebook.importer.ts:423` sets `tag: detectEntryTag(entry)`; refactor `src-tauri/src/commands/storage/imports/normalization.rs:303` hardcodes `"tag": ""`. - Lorebook category: main `st-lorebook.importer.ts:337` (`detectCategory` defined 233-270, scoring against `CATEGORY_SIGNALS`) sets the category; refactor `normalization.rs:430` hardcodes `"category": "uncategorized"`. - Absence proof: grepping the entire refactor tree (src/ TS + src-tauri/ Rust incl crates/*) for `detectCategory|detect_category|detectEntryTag|detect_entry_tag|CATEGORY_SIGNALS` returns 0 matches, and there is no post-import category/tag assignment anywhere. - Both are on the common ST World Info import path via `service.rs` -> `create_lorebook_from_payload` -> `normalize_lorebook`. ## Additional context Downstream effects of the empty tag: the Lorebook Keeper agent's tag-based category filter and search haystack lose the signal for imported entries (refactor `tools-runtime.ts:304`, `:309`), and the missing category lands everything in the wrong bucket in `groupLorebooksByCategory` (`lorebook-panel-model.ts:91-97`). The fix is localized to the single `normalize_lorebook` function. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:27:38 +07:00
Author
Owner

@Romuromylus commented on GitHub (Jun 6, 2026):

Fixed by #2377, merged into refactor (squash 17aa62cc).

<!-- gh-comment-id:4637084346 --> @Romuromylus commented on GitHub (Jun 6, 2026): Fixed by #2377, merged into `refactor` (squash 17aa62cc).
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#1134
No description provided.