fix: parse coordinated damage targets - #6833
Conversation
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
|
Warning Review limit reached
Next review available in: 23 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe target parser now supports coordinated phrases with an explicit player or opponent followed by object alternatives. Parser tests and an All Will Be One integration test validate opponent-controlled target selection and damage behavior. ChangesCoordinated target parsing
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/engine/src/parser/oracle_target.rs`:
- Around line 996-1000: Update the initial separator `alt` in the coordinated
target parser to accept `", and "` alongside the existing separator forms. Keep
it consistent with the continuation separator used by the surrounding loop so
two-leg coordinated targets retain the object leg.
- Around line 1004-1034: Update the coordinated-leg loop in the parser around
parse_type_phrase_with_ctx so a TargetFilter::Any result after earlier legs have
been merged returns the accumulated combined filter, with the remainder based on
the unconsumed leg_text, instead of falling through to the bare player_filter
return. Preserve the existing initial-leg fallback behavior when no leg has been
merged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 62fce449-d75c-4aca-bdb0-171d865dfe7e
📒 Files selected for processing (2)
crates/engine/src/parser/oracle_target.rscrates/engine/tests/integration/l02_bbfu2_batched_counter_triggers.rs
Parse changes introduced by this PR · 4 card(s), 3 signature(s) (baseline: main
|
matthewevans
left a comment
There was a problem hiding this comment.
Blocked — the coordinated player/object grammar drops the object leg for the ordinary , and connector.
🔴 Blocker
[MED] The first player→object separator omits , and . Evidence: crates/engine/src/parser/oracle_target.rs:996-1000 accepts only , and/or , , or , and , ; the continuation separator at :1014-1019 already accepts , and . Consequently target player, and creature you control falls through to the bare Player return at :1030-1034 and silently drops the object leg. Why it matters: one normal connector changes the legal target domain. Suggested fix: add tag(", and ") to the initial longest-first separator alt, then add a parser regression asserting the two-leg form lowers to Player ∨ Typed(Creature, controller You).
✅ Clean
The All Will Be One runtime test is discriminating for the supported opponent/object behavior, but it does not cover this , and connector sibling.
Recommendation: request changes — cover the missing initial connector and verify the complete two-leg filter before another review.
40fade9 to
dae9317
Compare
matthewevans
left a comment
There was a problem hiding this comment.
Maintainer completion verified on dae9317: current CI is green, parser artifact contains the intended coordinated-targeting deltas, and there are no unresolved review threads.
Summary
targetFixes #5237.
Root cause
The target parser stopped after
target opponentin:The exported effect therefore contained only an empty-type opponent filter. The fix parses each coordinated object alternative independently, preserving its controller qualifier, and merges all alternatives into the existing
TargetFilter::Orrepresentation.Validation
cargo fmt --all./scripts/check-parser-combinators.sh./scripts/check-skill-doc.shcargo test -p phase-engine target_opponent_with_elided_coordinated_object_alternatives -- --nocapturecargo test -p phase-engine coordinated_player_and_object_target_preserves_plain_player_behavior -- --nocapturecargo test -p phase-engine awbo_can_target_opponent_controlled_creature_instead_of_opponent -- --nocapturecargo run -p phase-engine --features cli --bin oracle-gen -- data --filter "All Will Be One"cargo clippy -p phase-engine --all-targets --features cli -- -D warningsSummary by CodeRabbit
Bug Fixes
Tests