-
-
Notifications
You must be signed in to change notification settings - Fork 153
fix(mtgish-import): two converter bugs found by reviving the crate's dead test suite #7230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
matthewevans
merged 7 commits into
phase-rs:main
from
JacobWoodson:claude/wonderful-northcutt-227f91
Aug 11, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
80884ed
fix(mtgish-import): keep bound selection targets under Targeted wrapper
JacobWoodson 1c1dd95
fix(mtgish-import): convert bare CombatDamageWouldBeDealt replacements
JacobWoodson e8cef27
test(mtgish-import): refresh stale goldens, complete ordering manifest
JacobWoodson 0356328
Merge branch 'main' into claude/wonderful-northcutt-227f91
JacobWoodson 3aa27ae
test(mtgish-import): pin the combat-damage event mapping
JacobWoodson 9118ee2
Merge branch 'claude/wonderful-northcutt-227f91' of https://github.co…
JacobWoodson 400d683
Merge branch 'main' into claude/wonderful-northcutt-227f91
JacobWoodson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Handle
ChangeZoneAllhand-exile continuations.When a
RevealHandcontinuation lowers toEffect::ChangeZoneAll, Line 5680 callsis_selected_hand_exile_continuation, but that helper matches onlyEffect::ChangeZone. The suppliedThought Distortionregression path incrates/engine/src/database/synthesis.rsLines 10786-10926 usesChangeZoneAllwith an exile destination and a structuralTargetFilter::Any. The predicate therefore returnsfalse, soVariableBindings::rewrite_target_filtersrewrites the structural target instead of preserving the target-player binding. Extend the shared predicate to cover this shape, including the multi-zoneorigin: Nonecase, and retain theControllerRef::TargetPlayerregression assertion.Proposed fix
fn is_selected_hand_exile_continuation(effect: &Effect) -> bool { matches!( effect, Effect::ChangeZone { origin: Some(Zone::Hand), destination: Zone::Exile, target: TargetFilter::Any, .. } + | Effect::ChangeZoneAll { + destination: Zone::Exile, + target: TargetFilter::Any, + .. + } ) }🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declining this one — I think it conflates two different producers.
is_selected_hand_exile_continuationonly ever sees effect vectors built by this converter: it is reached fromapply_player_target_chainandVariableBindings::rewrite_target_filters, both of which operate on theVec<Effect>thatconvert_list_with_bindingsjust constructed. The cited Thought Distortion path incrates/engine/src/database/synthesis.rsis the native parser's synthesis output, which never flows through either function.The mtgish converter never constructs
Effect::ChangeZoneAll. The only reference to it anywhere in the crate is an or-pattern arm in the rewrite consumer atcrates/mtgish-import/src/convert/action.rs:648:Zero constructions. The
RevealHandAndPlayerChoosesACardToExilearm — the only producer of a hand-exile continuation here — emitsEffect::ChangeZone { origin: Some(Zone::Hand), destination: Zone::Exile, .. }, which the existing predicate already matches.There is also no Thought Distortion regression in this crate (
rg -n 'Thought Distortion' crates/mtgish-import/is empty), so theControllerRef::TargetPlayerassertion the comment asks to keep passing does not exist here.Applying the proposed diff would add an unreachable match arm. Happy to revisit if someone can point at a converter path that actually emits
ChangeZoneAllafter aRevealHand— that would be a real gap and I would want it covered.The other finding on this PR (assert the
CombatDamageWouldBeDealtmapping, also raised by @matthewevans) was valid and is fixed in 3aa27ae.