[PR #2252] [MERGED] Preserve embedded character book lore fields #5512

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-2191-embedded-lorebook-fields


📝 Commits (2)

  • 3d04886 Preserve embedded character book lore fields
  • 2fa9b05 Keep embedded lorebook key order

📊 Changes

4 files changed (+109 additions, -32 deletions)

View changed files

📝 src-tauri/src/commands/storage/exports.rs (+99 -27)
📝 src-tauri/src/commands/storage/imports.rs (+2 -0)
📝 src-tauri/src/commands/storage/imports/normalization.rs (+6 -5)
📝 src-tauri/src/commands/storage/imports/service.rs (+2 -0)

📄 Description

Linked issue

Closes #2191

Why this change

  • Embedded character-book import/reimport used a narrow converter that dropped ST/V2 lorebook entry fields. Direct ST lorebook import already preserved those fields through the full lorebook normalizer, so the Character Lorebook tab path could silently lose behavior on reimport.

What changed

  • Reused the existing ST lorebook entry normalization for character_embedded_lorebook_import.
  • Reused the existing lorebook entry extraction helper so embedded character_book.entries works as either an array or object map.
  • Removed the narrower embedded character-book entry converter.
  • Added a focused Rust regression test covering object-form entries and ST/V2 fields such as disable/enabled, order, position, role, depth, scan depth, probability, matching flags, timing fields, group weight, recursion, and locked.

Refactor impact

Primary owner:

Rust storage, imports, and catalog resource compatibility.

Impact areas reviewed:

  • Embedded character lorebook import/reimport storage command.
  • Direct ST lorebook import normalizer reused by the command.
  • Existing character-book sync tests for linked lorebook behavior.
  • Tauri and remote-runtime command boundary, which stays unchanged.

Boundary notes:

  • No React, engine, or shared API changes.
  • No new command, route, allowlist entry, or HTTP dispatch change.
  • The fix stays inside Rust storage/import modules and reuses the existing import normalizer rather than adding a second compatibility mapper.

Pressure points touched:

  • src-tauri/src/commands/storage/exports.rs
  • src-tauri/src/commands/storage/imports.rs
  • src-tauri/src/commands/storage/imports/service.rs
  • src-tauri/src/commands/storage/imports/normalization.rs

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 embedded_lorebook_import_preserves_st_character_book_fields
  • cargo test --manifest-path src-tauri/Cargo.toml character_book
  • cargo check --manifest-path src-tauri/Cargo.toml
  • git diff --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:

  • Compatibility bugfix for an existing import/reimport workflow; no new discoverable feature or workflow added.

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. Rust storage/import compatibility fix with no visible UI changes.


🔄 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/2252 **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-2191-embedded-lorebook-fields` --- ### 📝 Commits (2) - [`3d04886`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3d0488621347e0afc876c297502da17257a2c349) Preserve embedded character book lore fields - [`2fa9b05`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2fa9b050d7e49841adc29aa0bd669ae5389d5066) Keep embedded lorebook key order ### 📊 Changes **4 files changed** (+109 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/exports.rs` (+99 -27) 📝 `src-tauri/src/commands/storage/imports.rs` (+2 -0) 📝 `src-tauri/src/commands/storage/imports/normalization.rs` (+6 -5) 📝 `src-tauri/src/commands/storage/imports/service.rs` (+2 -0) </details> ### 📄 Description ## Linked issue Closes #2191 ## Why this change - Embedded character-book import/reimport used a narrow converter that dropped ST/V2 lorebook entry fields. Direct ST lorebook import already preserved those fields through the full lorebook normalizer, so the Character Lorebook tab path could silently lose behavior on reimport. ## What changed - Reused the existing ST lorebook entry normalization for `character_embedded_lorebook_import`. - Reused the existing lorebook entry extraction helper so embedded `character_book.entries` works as either an array or object map. - Removed the narrower embedded character-book entry converter. - Added a focused Rust regression test covering object-form entries and ST/V2 fields such as disable/enabled, order, position, role, depth, scan depth, probability, matching flags, timing fields, group weight, recursion, and locked. ## Refactor impact Primary owner: Rust storage, imports, and catalog resource compatibility. Impact areas reviewed: - Embedded character lorebook import/reimport storage command. - Direct ST lorebook import normalizer reused by the command. - Existing character-book sync tests for linked lorebook behavior. - Tauri and remote-runtime command boundary, which stays unchanged. Boundary notes: - No React, engine, or shared API changes. - No new command, route, allowlist entry, or HTTP dispatch change. - The fix stays inside Rust storage/import modules and reuses the existing import normalizer rather than adding a second compatibility mapper. Pressure points touched: - `src-tauri/src/commands/storage/exports.rs` - `src-tauri/src/commands/storage/imports.rs` - `src-tauri/src/commands/storage/imports/service.rs` - `src-tauri/src/commands/storage/imports/normalization.rs` ## 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) - [ ] 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 embedded_lorebook_import_preserves_st_character_book_fields` - `cargo test --manifest-path src-tauri/Cargo.toml character_book` - `cargo check --manifest-path src-tauri/Cargo.toml` - `git diff --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: - Compatibility bugfix for an existing import/reimport workflow; no new discoverable feature or workflow added. ## 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. Rust storage/import compatibility fix with no visible UI changes. --- <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:58 +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#5512
No description provided.