ENGINE: Fix Foray amassed Army damage#5102
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements support for referencing 'the amassed Army' (such as 'the amassed Army's power') in reflexive abilities per CR 701.47c. It introduces a new GameEvent::ArmyAmassed event, updates the parser and importer to handle demonstrative power and toughness quantities, and adds integration tests. The feedback suggests robustly handling multiple amass events by retrieving the most recent event using events.iter().rev().find_map rather than a strict uniqueness check, and notes a missing mandatory CR annotation on the event dispatch in amass.rs.
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.
|
Holding review until the parser evidence is available. This PR changes engine/parser surfaces, so the sweep needs the |
b5f2349 to
fd81136
Compare
Parse changes introduced by this PR · 3 card(s), 3 signature(s) (baseline: main
|
matthewevans
left a comment
There was a problem hiding this comment.
Findings:
- The current proof only covers the Foray of Orcs damage path, but the live
coverage-parse-difffor this head shows this change also alters Grishnákh, Brash Instigator's target filter and Surrounded by Orcs' mill count. The parser/import change is intentionally class-wide (the amassed Army's powernow maps toObjectScope::Demonstrative), and the new integration tests atcrates/engine/tests/integration/mauhur_swarming_of_moria.rsonly assert theDealDamage.amountconsumer. Please add runtime coverage for the other surfaced consumers before we land this: one test proving Grishnákh's target eligibility is bounded by the amassed Army's current power, and one test proving Surrounded by Orcs mills using that same amassed Army referent. Those paths exercise target-filter quantity resolution and mill-count quantity resolution, not just damage amount resolution.
The event/context plumbing direction looks reasonable, and the multi-amass case is a useful addition. I just need the proof boundary to match the actual card-level blast radius from the current parse-diff.
fd81136 to
52095ef
Compare
|
Updated this PR with the repo-local
Review items addressed:
Verification run locally:
|
matthewevans
left a comment
There was a problem hiding this comment.
Backend/parser re-review at 52095ef95e0321d904d8e335fe911b0a50e86f60: I do not have additional blocking findings from the automation sweep. The current parse-diff sticky is present for this head and shows the expected three-card amassed-Army blast radius, and the new runtime tests cover Foray of Orcs, Grishnakh, Surrounded by Orcs, token replacement, counter replacement, and generic demonstrative non-leakage.
I added defer-fe because this PR also changes client/src/adapter/types.ts; final client-surface acceptance is deferred to Matt under the current sweep policy, so I am not approving/enqueuing this from automation.
Summary
Fixes amassed Army referents so Foray of Orcs, Grishnakh, Brash Instigator, and Surrounded by Orcs use the Army selected by the current amass instruction. The resolver now records that Army after amass finalization, carries it through chained/reflexive abilities and target selection, and covers token/counter replacement pauses.
Implementation method (required)
How was the engine/parser logic in this PR produced? Check exactly one:
/engine-implementerpipeline (plan -> review-plan -> implement -> review-impl -> commit)/engine-implementer— explain why belowIf you did not use
/engine-implementer, state why (e.g. frontend-onlychange, docs/CI/tooling change, release chore, or a fix too small to warrant
the pipeline):
Note
Any change to
crates/engine/game logic — parser, effects, resolver,targeting, rules behavior — is expected to go through
/engine-implementer.The "not used" box is for changes that genuinely fall outside that scope.
CR references
Verification
cargo fmt --all— passedcargo test -p engine --test integration mauhur_swarming_of_moria— passed, 9 testscargo clippy --all-targets -- -D warnings— passedcargo test -p engine— passed./scripts/check-parser-combinators.sh— passedcargo engine-inventory— passedgit diff --check— passedgit diff --name-only | rg '^(mtgish/|crates/mtgish-import/|data/mtgish-)'— no matchesphase-rs/main269e98b5e:cargo test -p engine --test integration mauhur_swarming_of_moria— passed, 9 tests