Prevent running models when input data is inside output dir - #1482
Merged
Conversation
AdrianDAlessandro
requested review from
dc2917 and
tsmbland
and
a lite review from Copilot
August 11, 2026 16:12
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1482 +/- ##
==========================================
+ Coverage 89.91% 90.02% +0.10%
==========================================
Files 60 60
Lines 8556 8558 +2
Branches 8556 8558 +2
==========================================
+ Hits 7693 7704 +11
+ Misses 543 535 -8
+ Partials 320 319 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a guard to the run CLI flow to prevent running a model when the model input directory is located inside the chosen output directory, reducing the risk of accidentally deleting inputs when overwriting outputs (Issue #1299).
Changes:
- Add an
ensure!check inhandle_run_commandto rejectmodel_pathvalues nested underoutput_path. - Add an integration test intended to assert the new failure mode and a helper to capture CLI stderr.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/common.rs | Adds a get_muse2_stderr helper for integration tests to inspect failure output. |
| tests/cli.rs | Adds a new CLI integration test intended to verify run fails when the model directory is inside the output directory. |
| src/cli.rs | Adds a runtime guard in handle_run_command to prevent using an input directory nested within the output directory. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
AdrianDAlessandro
force-pushed
the
no-model-within-output-dir
branch
from
August 13, 2026 13:29
4f68aee to
55ffab4
Compare
dc2917
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a check to ensure the model input data directory is not inside the output directory. It is quite simple, I am unsure if it is addressing the issue properly.
Fixes #1299
Type of change
Key checklist
$ cargo test$ cargo docpresent in the previous release
Further checks