fix/6435 mosswort bridge hideaway playfromexile - #6784
Conversation
|
Warning Review limit reached
Next review available in: 12 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 (1)
📝 WalkthroughWalkthroughCastFromZone resolution now supports controller-scoped private look-then-cast selections, frozen cast constraints, corrected fallback handling, and linked-exile target materialization. Play-mode casts without alternative costs grant ChangesCastFromZone look and play permissions
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Player
participant CastFromZone
participant GameState
participant HiddenCard
Player->>CastFromZone: Activate Hideaway ability
CastFromZone->>GameState: Resolve private look window
GameState-->>CastFromZone: Return eligible linked exile card
CastFromZone->>HiddenCard: Grant ExileWithAltCost and PlayFromExile
Player->>HiddenCard: Cast spell or play land from exile
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
A play-mode CastFromZone (e.g. hideaway) must grant face-down exile look/play authority via CastingPermission::PlayFromExile. This fixes Mosswort Bridge and adds integration coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
8a44f59 to
1e57da1
Compare
Parse changes introduced by this PR✓ No card-parse changes detected. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
crates/engine/tests/integration/issue_6435_mosswort_bridge_hideaway_play.rs (1)
162-196: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the "advance to P0's next main phase" boilerplate into one helper.
The same ~35-line block (end step → upkeep → main, optional
DeclareAttackersescape, repeat if priority isn't P0) is copy-pasted in all three tests. A singleadvance_to_next_p0_main(&mut runner)helper next tofund_greenkeeps the tests readable and keeps the turn-advance semantics in one place.As per coding guidelines, "Build reusable building blocks and test the building block across its parameter range rather than implementing or testing one-card special cases."
Also applies to: 303-334, 395-426
🤖 Prompt for 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. In `@crates/engine/tests/integration/issue_6435_mosswort_bridge_hideaway_play.rs` around lines 162 - 196, The repeated end-step-to-P0-main progression should be centralized. Add an advance_to_next_p0_main helper near fund_green that performs the phase advances, handles an optional DeclareAttackers action, and repeats the sequence when priority_player is not P0; replace the duplicated blocks in all three affected tests with calls to this helper.Source: Coding guidelines
🤖 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/tests/integration/issue_6435_mosswort_bridge_hideaway_play.rs`:
- Line 230: Update the matches! expression in the test to bind and match the
card_filter’s None shape directly in its pattern, removing the *card_filter ==
None guard. Preserve the existing matching behavior while satisfying clippy’s -D
warnings gate.
---
Nitpick comments:
In `@crates/engine/tests/integration/issue_6435_mosswort_bridge_hideaway_play.rs`:
- Around line 162-196: The repeated end-step-to-P0-main progression should be
centralized. Add an advance_to_next_p0_main helper near fund_green that performs
the phase advances, handles an optional DeclareAttackers action, and repeats the
sequence when priority_player is not P0; replace the duplicated blocks in all
three affected tests with calls to this helper.
🪄 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: 01c25a3d-50d6-4218-bf49-7088a69c9729
📒 Files selected for processing (4)
crates/engine/src/game/effects/cast_from_zone.rscrates/engine/tests/integration/issue_3246_windbrisk_heights_hideaway_exiled_by_source.rscrates/engine/tests/integration/issue_6435_mosswort_bridge_hideaway_play.rscrates/engine/tests/integration/main.rs
🚧 Files skipped from review as they are similar to previous changes (2)
- crates/engine/tests/integration/main.rs
- crates/engine/src/game/effects/cast_from_zone.rs
| .. | ||
| } if *granted_to == P0 | ||
| && *exiled_by_ability_controller == Some(P0) | ||
| && *card_filter == None |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
CI blocker: *card_filter == None fails the clippy -D warnings gate.
Inside a matches! pattern you can bind the shape directly instead of comparing to None in the guard.
🔧 Proposed fix
CastingPermission::PlayFromExile {
granted_to,
exiled_by_ability_controller,
- card_filter,
+ card_filter: None,
source_id: Some(src),
..
} if *granted_to == P0
&& *exiled_by_ability_controller == Some(P0)
- && *card_filter == None
&& *src == mosswort📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| && *card_filter == None | |
| CastingPermission::PlayFromExile { | |
| granted_to, | |
| exiled_by_ability_controller, | |
| card_filter: None, | |
| source_id: Some(src), | |
| .. | |
| } if *granted_to == P0 | |
| && *exiled_by_ability_controller == Some(P0) | |
| && *src == mosswort |
🧰 Tools
🪛 GitHub Check: Rust lint (fmt, clippy, parser gate)
[failure] 230-230:
binary comparison to literal Option::None
🤖 Prompt for 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.
In `@crates/engine/tests/integration/issue_6435_mosswort_bridge_hideaway_play.rs`
at line 230, Update the matches! expression in the test to bind and match the
card_filter’s None shape directly in its pattern, removing the *card_filter ==
None guard. Preserve the existing matching behavior while satisfying clippy’s -D
warnings gate.
Source: Linters/SAST tools
|
Maintainer update — current head The terminal Rust-lint failure was limited to two |
Co-authored-by: Clayton <claytonlin1110@users.noreply.github.com>
|
Maintainer update — current head
|
matthewevans
left a comment
There was a problem hiding this comment.
Approved — current head verified.
The CastFromZone authority now supplies the required play-from-exile permission for play-mode grants, with production-pipeline spell, land, and threshold tests. The maintainer port retained both integration registrations; parse diff is unchanged and required checks are green.
Summary by CodeRabbit
Bug Fixes
Tests