[PR #2239] [MERGED] Fix RisuAI card camelCase imports #5501

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-2160-risuai-card-fields


📝 Commits (1)

  • 55a5779 Fix RisuAI character card imports

📊 Changes

2 files changed (+102 additions, -5 deletions)

View changed files

📝 src-tauri/src/commands/storage/imports/normalization.rs (+5 -5)
📝 src-tauri/src/commands/storage/imports/service_tests.rs (+97 -0)

📄 Description

Linked issue

Closes #2160

Why this change

  • RisuAI character cards store key prompt fields in camelCase. The refactor importer unwraps RisuAI type: character payloads but only read the canonical snake_case V2 keys afterward, so greeting, examples, system prompt, creator notes, and alternate greetings imported empty.

What changed

  • Added RisuAI camelCase aliases for firstMessage, exampleMessage, systemPrompt, creatorNotes, and alternateGreetings during character import normalization.
  • Added a Rust regression that imports a RisuAI-style card through import_st_character.
  • Added a canonical V2 negative control proving snake_case fields keep precedence when both forms are present.

Refactor impact

Primary owner:

Rust storage/imports

Impact areas reviewed:

  • Character card import normalization
  • RisuAI type: character JSON payloads
  • Canonical chara_card_v2 snake_case payloads

Boundary notes:

  • Change stays inside src-tauri import normalization and does not touch React UI, engine prompt assembly, shared API wrappers, dependencies, schema, auth, storage migrations, or release metadata.

Pressure points touched:

  • src-tauri/src/commands/storage/imports/normalization.rs
  • src-tauri/src/commands/storage/imports/service_tests.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

  • Codex proof: before-fix focused Rust regression failed because first_mes imported as empty from RisuAI firstMessage.
  • Codex proof: cargo test --manifest-path src-tauri\Cargo.toml import_st_character_maps_risuai_camel_case_fields -- --nocapture passed after the fix.
  • Codex proof: pnpm check passed after the final diff.
  • Bunny pass recorded in scratch/bugfix-verification.json.
  • No human-only manual verification blocker remains; this is a non-UI import-normalization fix.

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 path; no new discoverable feature.

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: non-UI Rust import-normalization bug. Evidence is the before/after focused Rust regression and passing pnpm check.

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced character data import functionality to accept alternative field naming conventions (both camelCase and snake_case variants), improving compatibility with diverse character formats.
  • Tests

    • Added test coverage for character import field normalization across different naming conventions.

🔄 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/2239 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/4/2026 **Status:** ✅ Merged **Merged:** 6/5/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-2160-risuai-card-fields` --- ### 📝 Commits (1) - [`55a5779`](https://github.com/Pasta-Devs/Marinara-Engine/commit/55a5779376bff39e38ffbc10352d8c971f8bf139) Fix RisuAI character card imports ### 📊 Changes **2 files changed** (+102 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/imports/normalization.rs` (+5 -5) 📝 `src-tauri/src/commands/storage/imports/service_tests.rs` (+97 -0) </details> ### 📄 Description ## Linked issue Closes #2160 ## Why this change - RisuAI character cards store key prompt fields in camelCase. The refactor importer unwraps RisuAI `type: character` payloads but only read the canonical snake_case V2 keys afterward, so greeting, examples, system prompt, creator notes, and alternate greetings imported empty. ## What changed - Added RisuAI camelCase aliases for `firstMessage`, `exampleMessage`, `systemPrompt`, `creatorNotes`, and `alternateGreetings` during character import normalization. - Added a Rust regression that imports a RisuAI-style card through `import_st_character`. - Added a canonical V2 negative control proving snake_case fields keep precedence when both forms are present. ## Refactor impact Primary owner: Rust storage/imports Impact areas reviewed: - Character card import normalization - RisuAI `type: character` JSON payloads - Canonical `chara_card_v2` snake_case payloads Boundary notes: - Change stays inside `src-tauri` import normalization and does not touch React UI, engine prompt assembly, shared API wrappers, dependencies, schema, auth, storage migrations, or release metadata. Pressure points touched: - `src-tauri/src/commands/storage/imports/normalization.rs` - `src-tauri/src/commands/storage/imports/service_tests.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 - Codex proof: before-fix focused Rust regression failed because `first_mes` imported as empty from RisuAI `firstMessage`. - Codex proof: `cargo test --manifest-path src-tauri\Cargo.toml import_st_character_maps_risuai_camel_case_fields -- --nocapture` passed after the fix. - Codex proof: `pnpm check` passed after the final diff. - Bunny pass recorded in `scratch/bugfix-verification.json`. - No human-only manual verification blocker remains; this is a non-UI import-normalization fix. ## 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 path; no new discoverable feature. ## 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: non-UI Rust import-normalization bug. Evidence is the before/after focused Rust regression and passing `pnpm check`. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Enhanced character data import functionality to accept alternative field naming conventions (both camelCase and snake_case variants), improving compatibility with diverse character formats. * **Tests** * Added test coverage for character import field normalization across different naming conventions. <!-- 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:16:52 +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#5501
No description provided.