fix(parser): recognize "transformed" as a filter quality (Mutagen Connoisseur)#5440
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements the Transformed property filter across the engine and parser to support transformed permanents (with their back face up). The changes include updating FilterProp matching, adding parser support for the "transformed" adjective, and introducing corresponding unit tests. The review feedback correctly identifies multiple outdated Comprehensive Rules (CR) annotations referencing CR 711.4 instead of CR 701.28g, which violates the repository's strict rule-fidelity guidelines. These references should be updated to ensure accurate documentation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Parse changes introduced by this PR · 4 card(s), 5 signature(s) (baseline: main
|
Mutagen Connoisseur — "This creature gets +1/+0 for each transformed
permanent you control." — parsed to a flat +1/+0: the "for each transformed
permanent you control" scaling was silently dropped (the swallow-audit flags
a DynamicQty SwallowedClause), because "transformed" was not recognized as a
filter quality. Every other qualifier — tapped, face-down, artifact,
creature — scales correctly; only "transformed" was missing.
Adds `FilterProp::Transformed`, the symmetric sibling of `FilterProp::FaceDown`:
a per-object battlefield state read from `GameObject::transformed` (which
already existed). It is recognized as a type-phrase adjective prefix
("transformed permanent"/"transformed creature") via `parse_property_filter`
and the `parse_combat_status_prefix` whitelist, and matched at runtime in
`filter.rs`. No runtime state change — the object flag was already tracked.
CR 701.27g.
9b8c61d to
5d6eb90
Compare
|
Good catch on the CR reference — fixed. One correction to the suggestion: the bot proposed
I've updated all six citations (code + tests + commit message) to CR 701.27g, which also matches the existing convention in the repo — |
matthewevans
left a comment
There was a problem hiding this comment.
Implementation review remains clean at ac6cd6427541e0e65d3d1365d9534a81809f70e6. The change is at the shared FilterProp/typed-filter parser seam, uses the existing nom property combinator path, carries the verified CR 701.27g citation, and the refreshed parse-diff shows only the expected transformed-permanent class expansion.
Closes #5439.
The bug
Mutagen Connoisseur — "This creature gets +1/+0 for each transformed permanent you control." — parsed to a flat
AddPower{1}/AddToughness{0}. The "for each transformed permanent you control" scaling was silently dropped, so the card always gets +1/+0 instead of +N/+0. The parser's own swallow-audit flags aDynamicQtySwallowedClauseon the line.Root cause
Isolation shows only the transformed quality is affected —
tapped,face-down,artifact,creatureall scale correctly:for each tapped permanent you controlfor each artifact you controlfor each transformed permanent you controlFilterProphas boolean battlefield-state qualities (Tapped,FaceDown,Suspected,IsSaddled, …) recognized as type-phrase adjective prefixes, but noTransformedvariant — even thoughGameObject::transformedalready exists.Fix
Adds
FilterProp::Transformed, the symmetric sibling ofFilterProp::FaceDown— a per-object battlefield state read fromGameObject::transformed:transformed permanent/transformed creature) viaparse_property_filter+ theparse_combat_status_prefixwhitelist;filter.rs(FilterProp::Transformed => obj.transformed);FaceDown.No runtime state change — the object flag was already tracked; this only lets the parser build the count/selector that reads it. Consistent with the existing individual-variant design for boolean state qualities (
Suspected,Renowned,IsSaddledwere all added the same way), so no parameterization refactor is implied.Tests
test_parse_property_filter_transformed—"transformed permanent"→FilterProp::Transformed.transformed_property_matches_only_transformed— the filter matches a transformed permanent and rejects a normal one.Verification
cargo fmt --all✓ · engine lib suite 15,904 pass / 0 fail + 2 new ✓ ·clippy -p engine --all-targets -D warningsclean ✓CR 711.4.