[PR #1172] [MERGED] Phase 1: AI sprite cleanup runtime discovery #4957

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/refactor-issue-24-ai-runtime


📝 Commits (1)

  • 32c82e5 Fix refactor sprite cleanup runtime discovery

📊 Changes

8 files changed (+283 additions, -22 deletions)

View changed files

➕ src-tauri/resources/background-remover/README.md (+16 -0)
📝 src-tauri/src/commands/storage/sprites.rs (+237 -7)
📝 src-tauri/src/state.rs (+12 -1)
📝 src-tauri/tauri.conf.json (+5 -1)
📝 src/features/catalog/characters/components/CharacterEditor.tsx (+4 -4)
📝 src/features/catalog/personas/components/PersonaEditor.tsx (+4 -4)
📝 src/shared/components/ui/SpriteGenerationModal.tsx (+3 -3)
📝 src/shared/types/sprite-capabilities.ts (+2 -2)

📄 Description

What?

Phase 1 plumbing for bundled/app-managed AI sprite background cleanup on the refactor branch.

This adds the runtime discovery and status path: sprite cleanup now prefers resources/background-remover/... packaged runtimes before env vars, app-data .venv, or PATH. Generated and saved sprite cleanup now request engine: "auto" so an app-managed AI cleanup runtime can be used when one exists, with built-in matte cleanup still available as fallback.

Why?

Refs https://github.com/Pasta-Devs/Marinara-Engine-Refactor/issues/24

The refactor code still only discovered externally installed backgroundremover/Python runtimes, and UI cleanup paths forced built-in cleanup. That meant a packaged AI cleanup runtime would not be used even if a later packaging/runtime phase provided one.

Verification

  • cargo test --manifest-path src-tauri\Cargo.toml background_remover_runtime_tests
    • bundled runtime is preferred before env/PATH
    • forced built-in cleanup reports source: "builtin"
    • forced AI cleanup with no runtime reports unavailable and does not claim built-in source
  • pnpm check
  • node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json
  • GitHub CI passed on PR #1172:
    • Frontend, Architecture, and Organization
    • Rust Capability Layer
    • Browser Smoke and Performance

Manual verification needed

  • None for this Phase 1 discovery/status plumbing.

Follow-up architecture/release decision

This PR does not bundle the actual third-party runtime binary/dependency payload. Phase 2 needs an architecture/release decision: should AI sprite cleanup runtime be app-managed first-run download or bundled into installers?

That decision should cover hosting, checksums/signatures, platform matrix, update cleanup, license/security review, model files, and installer size.


🔄 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/1172 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/24/2026 **Status:** ✅ Merged **Merged:** 5/24/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/refactor-issue-24-ai-runtime` --- ### 📝 Commits (1) - [`32c82e5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/32c82e5e872c628d8fc44ab342122ef17519622a) Fix refactor sprite cleanup runtime discovery ### 📊 Changes **8 files changed** (+283 additions, -22 deletions) <details> <summary>View changed files</summary> ➕ `src-tauri/resources/background-remover/README.md` (+16 -0) 📝 `src-tauri/src/commands/storage/sprites.rs` (+237 -7) 📝 `src-tauri/src/state.rs` (+12 -1) 📝 `src-tauri/tauri.conf.json` (+5 -1) 📝 `src/features/catalog/characters/components/CharacterEditor.tsx` (+4 -4) 📝 `src/features/catalog/personas/components/PersonaEditor.tsx` (+4 -4) 📝 `src/shared/components/ui/SpriteGenerationModal.tsx` (+3 -3) 📝 `src/shared/types/sprite-capabilities.ts` (+2 -2) </details> ### 📄 Description ## What? Phase 1 plumbing for bundled/app-managed AI sprite background cleanup on the refactor branch. This adds the runtime discovery and status path: sprite cleanup now prefers `resources/background-remover/...` packaged runtimes before env vars, app-data `.venv`, or PATH. Generated and saved sprite cleanup now request `engine: "auto"` so an app-managed AI cleanup runtime can be used when one exists, with built-in matte cleanup still available as fallback. ## Why? Refs https://github.com/Pasta-Devs/Marinara-Engine-Refactor/issues/24 The refactor code still only discovered externally installed `backgroundremover`/Python runtimes, and UI cleanup paths forced built-in cleanup. That meant a packaged AI cleanup runtime would not be used even if a later packaging/runtime phase provided one. ## Verification - `cargo test --manifest-path src-tauri\Cargo.toml background_remover_runtime_tests` - bundled runtime is preferred before env/PATH - forced built-in cleanup reports `source: "builtin"` - forced AI cleanup with no runtime reports unavailable and does not claim built-in source - `pnpm check` - `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json` - GitHub CI passed on PR #1172: - Frontend, Architecture, and Organization - Rust Capability Layer - Browser Smoke and Performance ## Manual verification needed - None for this Phase 1 discovery/status plumbing. ## Follow-up architecture/release decision This PR does not bundle the actual third-party runtime binary/dependency payload. Phase 2 needs an architecture/release decision: should AI sprite cleanup runtime be app-managed first-run download or bundled into installers? That decision should cover hosting, checksums/signatures, platform matrix, update cleanup, license/security review, model files, and installer size. --- <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:01 +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#4957
No description provided.