[PR #1833] [MERGED] Fix game asset parity regressions #5303

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-1794-game-assets-parity


📝 Commits (1)

  • 46c284b Fix game asset parity regressions

📊 Changes

3 files changed (+274 additions, -4 deletions)

View changed files

📝 src-tauri/crates/assets/src/lib.rs (+264 -2)
📝 src-tauri/src/commands/storage/game_assets.rs (+6 -2)
📝 src/engine/contracts/constants/game-assets.ts (+4 -0)

📄 Description

Linked issue

Closes #1794

Why this change

  • Restores refactor parity for game asset discovery and native storage guards: managed backgrounds are visible to game runtime background selection, shallow bundled music paths produce scorer-compatible tags, text edit affordances match Rust storage, and native category roots cannot be deleted through command paths.

What changed

  • Added AssetService::manifest_with_backgrounds and routed game_assets_manifest / game_assets_rescan through it so data_dir/backgrounds files appear as backgrounds:user:* entries with __user_bg__/... paths.
  • Made shallow music paths such as music/combat/battle-epic.mp3 emit structured tags such as music:combat:custom:intense:battle-epic, while preserving already-structured tags.
  • Aligned Rust text asset read/write extensions with the client-visible text/code extensions and added the missing shared client constants for .markdown, .jsonl, .csv, and .log.
  • Added storage-layer guards that reject game asset root and native category folder deletion while keeping normal file deletion inside categories available.
  • Added focused Rust regression tests for background bridging, collision handling, shallow music tags, text extension parity, delete guards, and existing upload/symlink safety.

Refactor impact

Primary owner:

  • Rust storage / game mode asset pipeline

Impact areas reviewed:

  • src-tauri asset service and storage command routing
  • Game manifest consumers that expect backgrounds:user:*, __user_bg__/..., and structured music:<state>:<genre>:<intensity>:<name> tags
  • Shared game asset text extension constants used by the file browser

Boundary notes:

  • Product behavior remains in the native asset/storage layer; React callers continue using the existing shared API wrapper and command names.
  • No new dependencies, schema changes, release metadata changes, or prompt/generation pipeline changes.
  • Remote-capable behavior stays on the existing explicit command route because HTTP dispatch already calls the same storage command implementation.

Pressure points touched:

  • src-tauri/crates/assets/src/lib.rs
  • src-tauri/src/commands/storage/game_assets.rs
  • src/engine/contracts/constants/game-assets.ts

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 reproduced the issue by static parity checks: manifest routing skipped managed backgrounds, bundled music paths were shallow, Rust text extensions were narrower than client extensions, and native category deletion lacked a storage guard.
  • Codex ran cargo test -p marinara-assets --lib: 9 passed, covering background bridge, explicit tag collision preservation, shallow music tags, text extension parity, root/native delete guards, upload extension parity, and symlink escape safety.
  • Codex ran cargo check --manifest-path src-tauri/Cargo.toml: passed.
  • Codex ran pnpm typecheck: passed after installing locked dependencies in the clean worktree.
  • Codex ran pnpm check: passed after final diff, including line endings, architecture, frontend typecheck, Rust workspace check, docs, discovery, and knip unused check.
  • Codex ran node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json: passed.
  • Bunny review pass: passed against upstream/refactor with no blocking findings.
  • Manual UI screenshot evidence is not applicable; this is backend/static storage parity with command/test proof and no visible UI layout change.

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 existing game asset behavior; no new discoverable feature or user workflow is 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. No visible UI layout changed; proof is via focused Rust regression tests and full repo checks.

Summary by CodeRabbit

  • New Features

    • User backgrounds now integrated into game asset manifests
    • Additional file formats (markdown, JSONL, YAML, CSV, log) are now editable in the file browser
  • Bug Fixes

    • Asset deletion protection prevents accidental removal of core asset folders
  • Tests

    • Expanded test coverage for asset management and background integration operations

🔄 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/1833 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/1/2026 **Status:** ✅ Merged **Merged:** 6/1/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-1794-game-assets-parity` --- ### 📝 Commits (1) - [`46c284b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/46c284b87137d21b17c832677783bb8b812b0353) Fix game asset parity regressions ### 📊 Changes **3 files changed** (+274 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/crates/assets/src/lib.rs` (+264 -2) 📝 `src-tauri/src/commands/storage/game_assets.rs` (+6 -2) 📝 `src/engine/contracts/constants/game-assets.ts` (+4 -0) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #1794 ## Why this change - Restores refactor parity for game asset discovery and native storage guards: managed backgrounds are visible to game runtime background selection, shallow bundled music paths produce scorer-compatible tags, text edit affordances match Rust storage, and native category roots cannot be deleted through command paths. ## What changed - Added `AssetService::manifest_with_backgrounds` and routed `game_assets_manifest` / `game_assets_rescan` through it so `data_dir/backgrounds` files appear as `backgrounds:user:*` entries with `__user_bg__/...` paths. - Made shallow music paths such as `music/combat/battle-epic.mp3` emit structured tags such as `music:combat:custom:intense:battle-epic`, while preserving already-structured tags. - Aligned Rust text asset read/write extensions with the client-visible text/code extensions and added the missing shared client constants for `.markdown`, `.jsonl`, `.csv`, and `.log`. - Added storage-layer guards that reject game asset root and native category folder deletion while keeping normal file deletion inside categories available. - Added focused Rust regression tests for background bridging, collision handling, shallow music tags, text extension parity, delete guards, and existing upload/symlink safety. ## Refactor impact Primary owner: - Rust storage / game mode asset pipeline Impact areas reviewed: - `src-tauri` asset service and storage command routing - Game manifest consumers that expect `backgrounds:user:*`, `__user_bg__/...`, and structured `music:<state>:<genre>:<intensity>:<name>` tags - Shared game asset text extension constants used by the file browser Boundary notes: - Product behavior remains in the native asset/storage layer; React callers continue using the existing shared API wrapper and command names. - No new dependencies, schema changes, release metadata changes, or prompt/generation pipeline changes. - Remote-capable behavior stays on the existing explicit command route because HTTP dispatch already calls the same storage command implementation. Pressure points touched: - `src-tauri/crates/assets/src/lib.rs` - `src-tauri/src/commands/storage/game_assets.rs` - `src/engine/contracts/constants/game-assets.ts` ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> <!-- Do not submit *.test.ts or *.test.tsx files as PR proof; cite existing checks, command output, app/browser/Tauri verification, or manual notes instead. --> - [ ] 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 reproduced the issue by static parity checks: manifest routing skipped managed backgrounds, bundled music paths were shallow, Rust text extensions were narrower than client extensions, and native category deletion lacked a storage guard. - Codex ran `cargo test -p marinara-assets --lib`: 9 passed, covering background bridge, explicit tag collision preservation, shallow music tags, text extension parity, root/native delete guards, upload extension parity, and symlink escape safety. - Codex ran `cargo check --manifest-path src-tauri/Cargo.toml`: passed. - Codex ran `pnpm typecheck`: passed after installing locked dependencies in the clean worktree. - Codex ran `pnpm check`: passed after final diff, including line endings, architecture, frontend typecheck, Rust workspace check, docs, discovery, and knip unused check. - Codex ran `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json`: passed. - Bunny review pass: passed against `upstream/refactor` with no blocking findings. - Manual UI screenshot evidence is not applicable; this is backend/static storage parity with command/test proof and no visible UI layout change. ## 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 existing game asset behavior; no new discoverable feature or user workflow is 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. No visible UI layout changed; proof is via focused Rust regression tests and full repo checks. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * User backgrounds now integrated into game asset manifests * Additional file formats (markdown, JSONL, YAML, CSV, log) are now editable in the file browser * **Bug Fixes** * Asset deletion protection prevents accidental removal of core asset folders * **Tests** * Expanded test coverage for asset management and background integration operations <!-- 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:15:04 +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#5303
No description provided.