[PR #1244] [MERGED] Clean up Marinara import remapping #5001

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1244
Author: @Xelvanis
Created: 5/26/2026
Status: ✅ Merged
Merged: 5/26/2026
Merged by: @Xelvanis

Base: refactor ← Head: codex/cleanup-marinara-imports


📝 Commits (2)

  • e237b4a Clean up Marinara import remapping
  • 8e6fd38 Address Marinara import review findings

📊 Changes

2 files changed (+386 additions, -191 deletions)

View changed files

📝 src-tauri/src/commands/storage/imports/marinara.rs (+142 -191)
➕ src-tauri/src/commands/storage/imports/marinara_tests.rs (+244 -0)

📄 Description

Linked issue

No linked issue. Internal Rust import cleanup discovered while reviewing Marinara import failure paths.

Why this change

  • Reduces duplicated Marinara import remapping logic for lorebook folders and prompt groups.
  • Makes missing or blank created-record IDs fail explicitly instead of flowing into child imports.
  • Prevents imported preset sections from retaining stale old groupId values when the old group was not imported.

What changed

  • Added shared helpers for import timestamp application, created-record ID extraction, and parented child-record remapping.
  • Reused the parent remap helper for lorebook folders and prompt groups.
  • Moved Marinara import tests into marinara_tests.rs and added coverage for nested folder/group remaps, orphan folder/group references, profile-envelope rejection, and blank/missing ID handling.

Refactor impact

Primary owner:

Rust storage imports.

Impact areas reviewed:

  • Marinara lorebook import parent/entry folder remapping.
  • Marinara preset import group/section remapping.
  • Created record ID failure paths.
  • Rust structure guard for marinara.rs.

Boundary notes:

  • Stays inside src-tauri Rust import implementation and tests.
  • No React, TypeScript engine, shared API, command registration, or remote-runtime contract changes.

Pressure points touched:

  • src-tauri/src/commands/storage/imports/marinara.rs
  • src-tauri/src/commands/storage/imports/marinara_tests.rs

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

Agent-run validation:

  • cargo fmt --manifest-path src-tauri/Cargo.toml --check
  • cargo clippy --manifest-path src-tauri/Cargo.toml --workspace --all-targets -- -D warnings
  • cargo test --manifest-path src-tauri/Cargo.toml
  • pnpm check:architecture
  • git diff --check

No browser/Tauri UI pass was run because this change is limited to Rust import internals and unit coverage.

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

No changelog update: this checkout has no CHANGELOG.md, and the change is internal Rust import cleanup.

UI evidence

N/A. No visible UI changes.

Summary by CodeRabbit

  • Bug Fixes

    • Improved validation and error messaging for Marinara imports
    • Enhanced handling of timestamp data across character, persona, lorebook, and preset imports
    • Fixed preservation of parent-child relationships in hierarchical imported structures
  • Tests

    • Added comprehensive test coverage for Marinara import operations and data validation

Review Change Stack


🔄 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/1244 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/26/2026 **Status:** ✅ Merged **Merged:** 5/26/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `codex/cleanup-marinara-imports` --- ### 📝 Commits (2) - [`e237b4a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e237b4a501dc15b5d5ec65cab40d828667c8a164) Clean up Marinara import remapping - [`8e6fd38`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8e6fd387b2d03580c8011aa18b481cee80e20572) Address Marinara import review findings ### 📊 Changes **2 files changed** (+386 additions, -191 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/imports/marinara.rs` (+142 -191) ➕ `src-tauri/src/commands/storage/imports/marinara_tests.rs` (+244 -0) </details> ### 📄 Description ## Linked issue No linked issue. Internal Rust import cleanup discovered while reviewing Marinara import failure paths. ## Why this change - Reduces duplicated Marinara import remapping logic for lorebook folders and prompt groups. - Makes missing or blank created-record IDs fail explicitly instead of flowing into child imports. - Prevents imported preset sections from retaining stale old `groupId` values when the old group was not imported. ## What changed - Added shared helpers for import timestamp application, created-record ID extraction, and parented child-record remapping. - Reused the parent remap helper for lorebook folders and prompt groups. - Moved Marinara import tests into `marinara_tests.rs` and added coverage for nested folder/group remaps, orphan folder/group references, profile-envelope rejection, and blank/missing ID handling. ## Refactor impact Primary owner: Rust storage imports. Impact areas reviewed: - Marinara lorebook import parent/entry folder remapping. - Marinara preset import group/section remapping. - Created record ID failure paths. - Rust structure guard for `marinara.rs`. Boundary notes: - Stays inside `src-tauri` Rust import implementation and tests. - No React, TypeScript engine, shared API, command registration, or remote-runtime contract changes. Pressure points touched: - `src-tauri/src/commands/storage/imports/marinara.rs` - `src-tauri/src/commands/storage/imports/marinara_tests.rs` ## Validation - [x] `pnpm check` passes locally - [x] `pnpm typecheck` passes locally - [x] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [x] `pnpm check:docs` passes locally - [x] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes Agent-run validation: - `cargo fmt --manifest-path src-tauri/Cargo.toml --check` - `cargo clippy --manifest-path src-tauri/Cargo.toml --workspace --all-targets -- -D warnings` - `cargo test --manifest-path src-tauri/Cargo.toml` - `pnpm check:architecture` - `git diff --check` No browser/Tauri UI pass was run because this change is limited to Rust import internals and unit coverage. ## 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 No changelog update: this checkout has no `CHANGELOG.md`, and the change is internal Rust import cleanup. ## UI evidence N/A. No visible UI changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved validation and error messaging for Marinara imports * Enhanced handling of timestamp data across character, persona, lorebook, and preset imports * Fixed preservation of parent-child relationships in hierarchical imported structures * **Tests** * Added comprehensive test coverage for Marinara import operations and data validation <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1244?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:12:22 +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#5001
No description provided.