[PR #2178] [MERGED] Sync linked embedded lorebook edits #5458

Closed
opened 2026-10-22 04:16:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2178
Author: @Promansis
Created: 6/4/2026
Status: ✅ Merged
Merged: 6/4/2026
Merged by: @Promansis

Base: refactor ← Head: fix/issue-2158-linked-character-book-sync


📝 Commits (3)

  • 8d25557 Sync linked character books from lorebook entries
  • 90ce358 Harden linked character book sync
  • 45ed358 Fix lorebook sync clippy lifetime warning

📊 Changes

1 file changed (+556 additions, -11 deletions)

View changed files

📝 src-tauri/src/commands/storage/commands/entities.rs (+556 -11)

📄 Description

Linked issue

Closes #2158

Why this change

  • Linked lorebooks imported from embedded character books were edited as standalone lorebooks, but the character's data.character_book was not mirrored after entry create/update/delete. The character editor could reopen stale embedded entries and exports could carry stale data.

What changed

  • Synced linked embedded character_book.entries after lorebook-entries create, update, move, and delete mutations.
  • Translated standalone lorebook entry fields back to the embedded character-book shape, including secondary_keys and insertion_order.
  • Added Rust coverage for create, update, move-away, and delete sync behavior.

Refactor impact

Primary owner:

Rust storage

Impact areas reviewed:

  • Generic storage create/update/delete command paths
  • Character embedded lorebook metadata
  • Lorebook entry field mapping used by the character editor

Boundary notes:

  • Fix lives in privileged storage because persisted character data must stay in sync for every caller, not only the React lorebook editor. No React, shared API, or remote-runtime command shape changes.

Pressure points touched:

  • none

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • cargo fmt --manifest-path src-tauri/Cargo.toml
  • cargo test --manifest-path src-tauri/Cargo.toml linked_lorebook_entry
  • cargo test --manifest-path src-tauri/Cargo.toml moving_entry_out_of_linked_lorebook
  • cargo check --manifest-path src-tauri/Cargo.toml
  • pnpm check

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Bugfix for existing linked embedded lorebook behavior.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

N/A, storage sync behavior covered by Rust command tests.


🔄 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/2178 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/4/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `fix/issue-2158-linked-character-book-sync` --- ### 📝 Commits (3) - [`8d25557`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8d25557b619a2e1a19337663b1c14414679577d2) Sync linked character books from lorebook entries - [`90ce358`](https://github.com/Pasta-Devs/Marinara-Engine/commit/90ce358be185a4bdd39e57b7a119f2068e26adb7) Harden linked character book sync - [`45ed358`](https://github.com/Pasta-Devs/Marinara-Engine/commit/45ed3585230987a7d7a8de3de8f634db1a62dcef) Fix lorebook sync clippy lifetime warning ### 📊 Changes **1 file changed** (+556 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/commands/entities.rs` (+556 -11) </details> ### 📄 Description ## Linked issue Closes #2158 ## Why this change - Linked lorebooks imported from embedded character books were edited as standalone lorebooks, but the character's `data.character_book` was not mirrored after entry create/update/delete. The character editor could reopen stale embedded entries and exports could carry stale data. ## What changed - Synced linked embedded `character_book.entries` after `lorebook-entries` create, update, move, and delete mutations. - Translated standalone lorebook entry fields back to the embedded character-book shape, including `secondary_keys` and `insertion_order`. - Added Rust coverage for create, update, move-away, and delete sync behavior. ## Refactor impact Primary owner: Rust storage Impact areas reviewed: - Generic storage create/update/delete command paths - Character embedded lorebook metadata - Lorebook entry field mapping used by the character editor Boundary notes: - Fix lives in privileged storage because persisted character data must stay in sync for every caller, not only the React lorebook editor. No React, shared API, or remote-runtime command shape changes. Pressure points touched: - none ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `cargo fmt --manifest-path src-tauri/Cargo.toml` - `cargo test --manifest-path src-tauri/Cargo.toml linked_lorebook_entry` - `cargo test --manifest-path src-tauri/Cargo.toml moving_entry_out_of_linked_lorebook` - `cargo check --manifest-path src-tauri/Cargo.toml` - `pnpm check` ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Bugfix for existing linked embedded lorebook behavior. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence N/A, storage sync behavior covered by Rust command tests. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:16:29 +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#5458
No description provided.