mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2191] Embedded character-book reimport drops lorebook fields #1094
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#1094
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?
Originally created by @Promansis on GitHub (Jun 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2191
Originally assigned to: @Promansis on GitHub.
Summary
Parityscan row
07-LB-COMPAT-embedded-character-bookfound that the refactor branch loses embedded character-book fields when a user imports or reimports a character's embedded lorebook from the Character Lorebook tab.The direct character import path still uses the fuller ST/character-book normalization, but the later
character_embedded_lorebook_importcommand uses a narrow converter that only preserves a small subset of entry fields.Expected behavior
Importing or reimporting a character card
character_bookas a standalone Marinara lorebook should preserve the same important ST/V2 character-book fields as the legacymainroute did:entriesLinked lorebook sync and character export should keep the embedded
character_bookmirror compatible enough that reimport/export does not silently drop behavior.Actual behavior
In the refactor branch,
character_embedded_lorebook_importreadscharacter_book.entriesonly as an array, then maps entries throughnormalize_character_book_entry.That helper preserves only:
This drops or mishandles fields that the full ST lorebook normalizer handles, including depth, scanDepth, probability/useProbability, role, timing fields, caseSensitive/case_sensitive, matchWholeWords/match_whole_words, regex/useRegex, groupWeight, preventRecursion/excludeRecursion, and locked.
Legacy
mainrouted the Character Lorebook tab import throughimportSTLorebook, passing the embeddedcharacter_bookentries and extensions into the full ST importer.Steps to reproduce
refactor, import or create a character whosedata.character_book.entriesinclude non-basic ST/V2 fields such asdepth,role,probability,case_sensitive,match_whole_words,sticky, orexcludeRecursion.mainbehavior.Impact area
Environment
refactorat577de008; legacy comparison was localmainat77a30fa4Logs, screenshots, or video
Static trace evidence:
src-tauri/src/commands/storage/exports.rsimport_character_embedded_lorebookreads the embedded book and creates entries throughnormalize_character_book_entry.normalize_character_book_entryonly maps a narrow field subset.src-tauri/src/commands/storage/imports/normalization.rsnormalize_lorebook_entrymaps the broader ST/V2 field surface.src/features/catalog/characters/components/CharacterLorebookTab.tsxcallscharacterApi.importEmbeddedLorebook;src/shared/api/character-api.tsinvokescharacter_embedded_lorebook_import.main:packages/server/src/routes/characters.routes.tsusedimportSTLorebookforPOST /characters/:id/embedded-lorebook/import, preserving the full importer mapping.Targeted checks run during parityscan:
Regression notes
This worked better on legacy
mainbecause the Character Lorebook tab import route delegated to the full ST lorebook importer. The refactor replacement command is narrower and loses compatibility fields.Additional context
Parityscan batch: Import Export Compat.
Rows scanned:
07-LB-COMPAT-st-import-export07-LB-COMPAT-native-profile-backup07-LB-COMPAT-embedded-character-book07-LB-ASSET-cover-imagesOnly this row produced a blocking parity gap. The native profile/backup and cover-image rows were refactor-better, and ST import/export had no blocking gap in the named surface.
Likely fix direction: make
character_embedded_lorebook_importreuse the same normalization used for ST/character-book import, or extend its converter to preserve the full ST/V2 field set and object-formentries.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: