Fix Black Bolt, Inhuman King - #7011
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe PR normalizes relative census paths to forward slashes. It also parses becomes-target triggers as references to the triggering player and adds parser and integration regression tests for related target selection and resolution. ChangesCensus path normalization
Becomes-target trigger resolution
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Generated for head Parse changes introduced by this PR · 2 card(s), 1 signature(s) (baseline: main
|
matthewevans
left a comment
There was a problem hiding this comment.
[MED] Snapshot the targeting spell or ability's controller in GameEvent::BecomesTarget. Evidence: crates/engine/src/parser/oracle_trigger.rs:1045-1055,1219-1227 maps the targeter to ControllerRef::TriggeringPlayer, while crates/engine/src/game/targeting.rs:1662-1665 later derives that player from the current state.objects[source_id].controller; the event emitted at crates/engine/src/game/casting.rs:621-636 carries only source_id despite already receiving controller. Why it matters: if an activated ability targets Black Bolt and its source changes controllers before Lethal Voice resolves, the trigger can select the new controller's permanent instead of the player who activated the targeting ability. CR 602.2a and CR 115.1c (verified in docs/MagicCompRules.txt) establish that the activated ability's controller and targets are set during activation. Suggested fix: capture the controller in GameEvent::BecomesTarget at emit_targeting_events, resolve this anaphor from that snapshot, and add a runtime regression test for an activated ability followed by source control change; the existing test covers only a spell without control change.
Summary
Fixes a parse-fidelity defect on Black Bolt, Inhuman King.
Issue: Lethal Voice: destroy target's controller parsed as You instead of the triggering opponent; "that player controls" (the opponent controlling the spell/ability) anaphor defaulted to ControllerRef::You, so it targets your own nonland permanent rather than the opponent's.
Files changed
CR references
Track
Developer
LLM
Model: claude-opus-4-8
Thinking: high
Tier: Frontier
Verification
cargo fmt --all— clean (exit 0)./scripts/check-parser-combinators.sh— clean - Gate G PASS + Gate A PASS. WindowsApps python3 stub falsely hard-fails D0 pre-check; re-ran with working msys64 python3 on PATH so Family D actually ran and passed (10/10 detector tests). Not merely skipped.cargo clippy-strict— clean (exit 0, -D warnings); re-verified after the census-test editcargo test -p phase-engine— clean (exit 0) after in-loop fix: lib 18483 passed/0 failed, integration 4489 passed/0 failed. Fixed a Windows path-separator artifact in the unrelated CR-603.5 census pin test (test-only .replace('\','/') in game/engine.rs; no-op on Linux CI, pins untouched).cargo export-cards data --stats --output client/public/card-data.json --sidecar-dir client/public + cp to data/card-data.json— clean (exit 0). Used --output because the literal recipe (no --output) streams main export to stdout and --sidecar-dir writes only localized card-data..json; the cp would have copied the stale sidecar. Fresh card-data.json regenerated against this branch's engine.cargo coverage— clean (exit 0); Black Bolt, Inhuman King supported:true gap_count:0cargo semantic-audit— clean (exit 0); Black Bolt, Inhuman King absent from all 295 flagged_cards -> 0 findingsScope Expansion
Also updated the Bonecrusher Giant IR snapshot (metadata-only relative_player_scope, another becomes-target trigger; effect unchanged); card-data.json not hand-regenerated (gitignored, Tilt-owned).
Validation Failures
None.
CI Failures
None.
Summary by CodeRabbit
Bug Fixes
Tests