feat: allow applying patches on hash mismatch with explicit override#32
Merged
Conversation
Hash checks (BPS/UPS CRC32s, RUP MD5s, APS-N64 cart id/CRC, PMSR CRC, and --verify-* specs) can now be downgraded to warnings instead of aborting the apply. The override must be explicit: the CLI requires --force (and hints at it when a mismatch aborts), and the GUI shows a confirmation dialog offering "Apply anyway" before retrying. Structural checks (sizes, offsets, encoding) still fail hard. RUP patches whose source MD5 matches no file scope fall back to the first scope in lenient mode. Bypassed mismatches are reported via ApplyOutcome::hash_warnings, printed by the CLI, and surfaced as a warning toast in the GUI. Co-Authored-By: Claude
GregTheGreek
marked this pull request as ready for review
July 6, 2026 13:15
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.
Summary
Hash mismatches (patch-embedded CRC32/MD5 checks and
--verify-*specs) no longer dead-end an apply: the CLI accepts--force(and hints at it on failure), and the GUI asks for confirmation with an "Apply anyway" dialog before retrying with the override. Bypassed checks surface as warnings (stderr / warning toast); structural checks (sizes, offsets, encoding) still fail hard.Notable details:
NoMatchingFileinstead ofTruncated(top-level EOF now treated as end of scopes).ApplyOptions.ignore_hash_mismatchusesserde(default), so stored library records and older frontends stay compatible.Test plan
cargo test --workspace --all-targets --exclude rompatch-gui(new lenient tests for BPS/UPS/RUP + apply pipeline)cargo fmt/cargo clippy(workspace and GUI) cleantsc --noEmit+ vite build clean--forceapplies with warnings and correct output bytes