[PR #1690] [MERGED] Reject non-image ST background imports #5216

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

📋 Pull Request Information

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

Base: refactor ← Head: bughunt/refactor-lane6-storage-20260531


📝 Commits (1)

  • 9de7da2 Reject non-image ST background imports

📊 Changes

1 file changed (+75 additions, -1 deletions)

View changed files

📝 src-tauri/src/commands/storage/imports/bulk_imports.rs (+75 -1)

📄 Description

Linked issue

N/A - multi-agent refactor bug-hunt lane 6.

Why this change

  • SillyTavern bulk background scan only advertises image files, but import_st_bulk_run could still accept a crafted or stale selected background ID for a non-image file and copy it into managed background storage.

What changed

  • Reused one allowed background extension list for scan and import-run behavior.
  • Added an import-run guard so background copying rejects non-image file extensions before writing managed storage.
  • Added a regression test covering a valid .png positive row and a .txt should-not-match negative control.

Refactor impact

Primary owner:

Rust storage/imports.

Impact areas reviewed:

  • SillyTavern bulk scan/run background import path
  • Managed background storage copy path
  • Path resolution for selected import IDs
  • Hostable import dispatch via the scratch repro harness

Boundary notes:

  • Fix stays in src-tauri storage/import code.
  • No client, shared API, engine, schema, dependency, version, auth, or prompt-pipeline changes.

Pressure points touched:

  • Import modules: src-tauri/src/commands/storage/imports/bulk_imports.rs
  • No command registration, UI, or remote-runtime wrapper changes.

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

  • Reproduced before fix with disposable copied data: node scratch\lane6-storage-bulk-background-repro.mjs
    • Evidence: scratch/lane6-storage-bulk-background/before-proof.json
    • Observed valid .png imported and crafted/stale .txt selected ID also copied into managed backgrounds.
  • Verified after fix: node scratch\lane6-storage-bulk-background-repro.mjs --after
    • Evidence: scratch/lane6-storage-bulk-background/after-proof.json
    • Observed valid .png imported, .txt returned Background import only supports image files, and no managed .txt file was created.
  • Targeted Rust test passed: cargo test --manifest-path src-tauri/Cargo.toml run_st_bulk_import_rejects_unscanned_non_image_background_selection --workspace
  • Rust storage check passed: cargo check --manifest-path src-tauri/Cargo.toml --workspace
  • Baseline passed: pnpm check
  • Proof gate passed: node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json
  • Bunny/proof review passed on the final diff: narrow PR boundary, no unrelated files, positive image row and realistic should-not-match non-image row covered, no manual blockers.

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 docs or release files changed.

UI evidence

N/A - non-UI storage/import bug. Raw hostable-runtime proof output is saved under scratch/lane6-storage-bulk-background/before-proof.json and scratch/lane6-storage-bulk-background/after-proof.json.


🔄 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/1690 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/31/2026 **Status:** ✅ Merged **Merged:** 5/31/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `bughunt/refactor-lane6-storage-20260531` --- ### 📝 Commits (1) - [`9de7da2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9de7da2726b8c42c82e73bd9e7884ae5ded88b61) Reject non-image ST background imports ### 📊 Changes **1 file changed** (+75 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/imports/bulk_imports.rs` (+75 -1) </details> ### 📄 Description ## Linked issue N/A - multi-agent refactor bug-hunt lane 6. ## Why this change - SillyTavern bulk background scan only advertises image files, but `import_st_bulk_run` could still accept a crafted or stale selected background ID for a non-image file and copy it into managed background storage. ## What changed - Reused one allowed background extension list for scan and import-run behavior. - Added an import-run guard so background copying rejects non-image file extensions before writing managed storage. - Added a regression test covering a valid `.png` positive row and a `.txt` should-not-match negative control. ## Refactor impact Primary owner: Rust storage/imports. Impact areas reviewed: - SillyTavern bulk scan/run background import path - Managed background storage copy path - Path resolution for selected import IDs - Hostable import dispatch via the scratch repro harness Boundary notes: - Fix stays in `src-tauri` storage/import code. - No client, shared API, engine, schema, dependency, version, auth, or prompt-pipeline changes. Pressure points touched: - Import modules: `src-tauri/src/commands/storage/imports/bulk_imports.rs` - No command registration, UI, or remote-runtime wrapper changes. ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> - [ ] `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 - Reproduced before fix with disposable copied data: `node scratch\lane6-storage-bulk-background-repro.mjs` - Evidence: `scratch/lane6-storage-bulk-background/before-proof.json` - Observed valid `.png` imported and crafted/stale `.txt` selected ID also copied into managed backgrounds. - Verified after fix: `node scratch\lane6-storage-bulk-background-repro.mjs --after` - Evidence: `scratch/lane6-storage-bulk-background/after-proof.json` - Observed valid `.png` imported, `.txt` returned `Background import only supports image files`, and no managed `.txt` file was created. - Targeted Rust test passed: `cargo test --manifest-path src-tauri/Cargo.toml run_st_bulk_import_rejects_unscanned_non_image_background_selection --workspace` - Rust storage check passed: `cargo check --manifest-path src-tauri/Cargo.toml --workspace` - Baseline passed: `pnpm check` - Proof gate passed: `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json` - Bunny/proof review passed on the final diff: narrow PR boundary, no unrelated files, positive image row and realistic should-not-match non-image row covered, no manual blockers. ## 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 docs or release files changed. ## UI evidence N/A - non-UI storage/import bug. Raw hostable-runtime proof output is saved under `scratch/lane6-storage-bulk-background/before-proof.json` and `scratch/lane6-storage-bulk-background/after-proof.json`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:14:19 +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#5216
No description provided.