test(parser): give the U20 role walk-backs their only witness#5635
Merged
Conversation
`DamageDealer` and `DigLook` bind the nearest def OF THEIR ROLE, walking past
an intervening non-member. That walk-back is the entire reason they are roles
and not `AntecedentSelector::LastEmitted` — and NOTHING proved it.
The card pool cannot: all 19 fires across the full pool (4 ExcessDamage +
11 ExileLookedAt + 4 ExileOneOfThem, measured) land at depth 0 with exactly
one candidate. `LastEmitted` is output-identical on every printed card today.
So the walk-back shipped as a capability with no witness, and the first card
to print an intervening clause between an anchor and its rider would have
been its first-ever exercise — in production, silently.
Three synthetic tests, one per consumer (two of them share `DigLook`, which
also makes the shared-role decision empirical rather than asserted): put a
non-member def AFTER the anchor and assert the binding still lands on index 0
— the answer `LastEmitted` gets WRONG.
Verified discriminating, not just passing: with both roles collapsed to
`LastEmitted`, all three go RED. Two of them fail inside the `unreachable!()`
arms this unit introduced (the binding hands back the intervening def, whose
effect is the wrong shape), so the hardening turns what would have been a
silent misbind into a loud panic; the third fails its own assertion, with the
un-rewritten `Dig` printed.
Also fixes one CR miscitation, in both places it appears in this class:
CR 701.16a is "Investigate" — "Create a Clue token." It does not govern
private looks. The rule for "look at one or more cards" is CR 701.20e
(both grep-verified against docs/MagicCompRules.txt).
`ExileLookedAtCard`'s arm comment (sequence.rs) has cited 701.16a since it was
written, and my first draft of the test doc COPIED that number into a new line
— verifying only that the rule EXISTS, never that it GOVERNS. Both are now
CR 701.20e. The same arm already cited 701.20e correctly two lines further
down ("reveal stays false — the look was private"), which is what makes the
miscitation unambiguous rather than a judgement call.
Deliberately NOT a sweep: three more 701.16a instances remain in this file and
~22 across engine/src, spanning look-at, reveal-vs-look, and sacrifice
contexts. They are a separate unit with its own audit, and double-fixing them
here would collide with it. Only the line this test's doc points AT is touched,
so the test and the code it describes agree.
No production logic changes (the only non-test edit is a comment), so the U20
byte-identical full-pool export result is untouched.
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
matthewevans
enabled auto-merge
July 12, 2026 04:24
Parse changes introduced by this PR✓ No card-parse changes detected. |
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.
DamageDealerandDigLookbind the nearest def OF THEIR ROLE, walking pastan intervening non-member. That walk-back is the entire reason they are roles
and not
AntecedentSelector::LastEmitted— and NOTHING proved it.The card pool cannot: all 19 fires across the full pool (4 ExcessDamage +
11 ExileLookedAt + 4 ExileOneOfThem, measured) land at depth 0 with exactly
one candidate.
LastEmittedis output-identical on every printed card today.So the walk-back shipped as a capability with no witness, and the first card
to print an intervening clause between an anchor and its rider would have
been its first-ever exercise — in production, silently.
Three synthetic tests, one per consumer (two of them share
DigLook, whichalso makes the shared-role decision empirical rather than asserted): put a
non-member def AFTER the anchor and assert the binding still lands on index 0
— the answer
LastEmittedgets WRONG.Verified discriminating, not just passing: with both roles collapsed to
LastEmitted, all three go RED. Two of them fail inside theunreachable!()arms this unit introduced (the binding hands back the intervening def, whose
effect is the wrong shape), so the hardening turns what would have been a
silent misbind into a loud panic; the third fails its own assertion, with the
un-rewritten
Digprinted.Also fixes one CR miscitation, in both places it appears in this class:
CR 701.16a is "Investigate" — "Create a Clue token." It does not govern
private looks. The rule for "look at one or more cards" is CR 701.20e
(both grep-verified against docs/MagicCompRules.txt).
ExileLookedAtCard's arm comment (sequence.rs) has cited 701.16a since it waswritten, and my first draft of the test doc COPIED that number into a new line
— verifying only that the rule EXISTS, never that it GOVERNS. Both are now
CR 701.20e. The same arm already cited 701.20e correctly two lines further
down ("reveal stays false — the look was private"), which is what makes the
miscitation unambiguous rather than a judgement call.
Deliberately NOT a sweep: three more 701.16a instances remain in this file and
~22 across engine/src, spanning look-at, reveal-vs-look, and sacrifice
contexts. They are a separate unit with its own audit, and double-fixing them
here would collide with it. Only the line this test's doc points AT is touched,
so the test and the code it describes agree.
No production logic changes (the only non-test edit is a comment), so the U20
byte-identical full-pool export result is untouched.