mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #2377] [MERGED] Auto-detect entry tags and lorebook category on SillyTavern import #5566
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#5566
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2377
Author: @Romuromylus
Created: 6/5/2026
Status: ✅ Merged
Merged: 6/6/2026
Merged by: @Romuromylus
Base:
refactor← Head:fix/st-lorebook-tag-category📝 Commits (2)
0c08713Auto-detect entry tags and lorebook category on SillyTavern importfc36106Move lorebook signal detection into its own module📊 Changes
4 files changed (+206 additions, -3 deletions)
View changed files
➕
src-tauri/src/commands/storage/imports/lorebook_signals.rs(+140 -0)📝
src-tauri/src/commands/storage/imports/normalization.rs(+4 -3)📝
src-tauri/src/commands/storage/imports/service.rs(+2 -0)📝
src-tauri/src/commands/storage/imports/service_tests.rs(+60 -0)📄 Description
Linked issue
Closes #2298
Why this change
The Rust importer hardcoded every imported entry's
tagto""and the lorebookcategoryto"uncategorized", dropping the tag and category auto-detection the upstreammainweb importer applies. Imported SillyTavern lorebooks therefore lost their entry tags and landed uncategorized — a regression vsmain.What changed
detectEntryTaganddetectCategory/CATEGORY_SIGNALSfrommain'sst-lorebook.importer.tsintonormalization.rsas pure signal-scoring helpers.main's deterministic tie-breaking (earlier tag/category wins; category defaults toworld).Refactor impact
Primary owner: Rust imports (
src-tauri/src/commands/storage/imports/normalization.rs)Impact areas reviewed:
normalize_lorebook_entry) and lorebook path (normalize_lorebook). The ST-import wrapper copies source keys but ST entries carry notag, so the computed tag is preserved.Boundary notes:
Pressure points touched:
normalization.rs)Validation
pnpm checkpasses before PR push/handoffManual verification notes
cargo clippy --workspace --all-targets -- -D warnings— cleancargo test --workspace— green, including 4 new tests (tag detection, category detection, empty-tag default, world-category default).Feature Discoverability
Reason:
Docs and release impact
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.