mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3345] [Bug]: Native export bundles & forks linked (assigned) lorebooks — linked lorebooks should never export; only embedded should #1814
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#1814
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 @kolacheee on GitHub (Jul 7, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3345
Originally assigned to: @kolacheee on GitHub.
Summary
#3342 made native (
.marinara.json) Character/Persona export bundle all attached lorebooks (via unfilteredlistByCharacter/listByPersona) and re-link them on import. But linked (assigned) lorebooks are not supposed to export at all — they are shared, standalone entities that can be attached to many owners. Only an embedded lorebook (character_book) should travel with a card. So the native bundling is incorrect: it exports linked lorebooks and forks shared ones on import.Expected behavior
Neither native nor compatible export should include linked/assigned lorebooks. Only the embedded lorebook (
character_book, already part of the card data) travels. The intentional, explicit way to make a lorebook part of a card is to embed it (see #3341 / #3343) — not to have it auto-exported because it happens to be assigned.Actual behavior
buildNativeCharacterEnvelope/buildNativePersonaEnvelope(packages/server/src/routes/characters.routes.ts) callreadAttachedLorebooksForCharacter/readAttachedLorebooksForPersona→listByCharacter/listByPersona, which return every owner-linked lorebook with no filter (shared/assigned ones included), and add them as a top-levellorebooksbundle. On import (marinara.importer.tsimportBundledLorebooks→importLorebookPayload) each is re-created as a new row linked to the imported owner. Consequences:character_book, once as the bundled standalone), producing the duplicated imported state reported in #3344 — which this issue supersedes, since that double-count is just one symptom of exporting linked lorebooks at all.Steps to reproduce
.marinara.json: it contains a top-levellorebooksbundle carrying the shared lorebook.Environment
bb26008b9)Logs, screenshots, or video
N/A (data-shape issue). Code refs:
readAttachedLorebooksForCharacter/readAttachedLorebooksForPersona/readLorebookBundles+ thelorebooksbundle inbuildNativeCharacterEnvelope/buildNativePersonaEnvelope(characters.routes.ts);importBundledLorebooks(marinara.importer.ts);listByCharacter/listByPersona(lorebooks.storage.ts) are unfiltered.Suggested fix
Revert the attached-lorebook bundling (both the export side and the import re-link) from #3342, so native export — like compatible export — carries only the embedded
character_book. Linked/assigned lorebooks stay in their own store and do not travel with the owner. Making a lorebook part of a card remains the user-driven Embed into card action (#3341 / #3343). This also resolves #3344 (the embedded double-count), which is a symptom of the same root cause.Template check