Skip to content

fix: dispatch search landfall before priority - #7089

Merged
matthewevans merged 3 commits into
mainfrom
ship/fix-dispatch-search-landfall-before-priority
Aug 8, 2026
Merged

fix: dispatch search landfall before priority#7089
matthewevans merged 3 commits into
mainfrom
ship/fix-dispatch-search-landfall-before-priority

Conversation

@matthewevans

@matthewevans matthewevans commented Aug 8, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Search-triggered effects are now collected and delivered immediately after searches, before the next priority decision.
    • Added coverage for Escape Tunnel interactions, landfall life gain, fetchlands, and multi-card searches.
  • Bug Fixes

    • Improved handling and deduplication of search-triggered effects.
    • Corrected search selection behavior in Nature’s Lore scenarios.
  • Tests

    • Expanded integration tests for search delivery, trigger ordering, and occurrence tracking.

@matthewevans
matthewevans enabled auto-merge August 8, 2026 01:34
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@matthewevans, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 11 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d9c5c616-715d-4841-b740-e75b50b0a48b

📥 Commits

Reviewing files that changed from the base of the PR and between e35395e and cb1cb31.

📒 Files selected for processing (2)
  • crates/engine/src/game/engine.rs
  • crates/engine/tests/integration/search_delivery_observer_dedup.rs
📝 Walkthrough

Walkthrough

Search observer triggers are now collected and dispatched inline before priority. The parked-observer outcome and deferred-drain skip path were removed. Integration tests now verify immediate delivery, deduplication, occurrence indices, and Escape Tunnel landfall behavior.

Changes

Search observer dispatch

Layer / File(s) Summary
Inline observer collection
crates/engine/src/game/engine_resolution_choices.rs, crates/engine/src/game/engine.rs, crates/engine/src/game/triggers.rs, crates/engine/src/game/effects/pay.rs
Search completion paths now collect observer triggers inline and return WaitingForWithInlineTriggers. The parked-observer outcome and related continuation matches were removed.
Immediate dispatch regression coverage
crates/engine/tests/integration/search_delivery_observer_dedup.rs
Search tests now use explicit selections and verify immediate stack dispatch, empty deferred queues, no-trigger cases, deduplication, and distinct occurrence indices.
Search behavior scenarios
crates/engine/tests/integration/escape_tunnel_landfall.rs, crates/engine/tests/integration/main.rs, crates/engine/tests/integration/issue_5336_kodama_mana_value_filter.rs
Added Escape Tunnel landfall coverage, registered the test module, and changed Nature’s Lore to select its seeded Forest explicitly.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SearchResolution
  participant ObserverCollector
  participant TriggeredAbilityStack
  participant Priority
  SearchResolution->>ObserverCollector: collect search observer triggers
  ObserverCollector->>TriggeredAbilityStack: dispatch triggered abilities
  SearchResolution-->>Priority: return WaitingForWithInlineTriggers
Loading

Possibly related PRs

  • phase-rs/phase#6661: Modifies search and scry observer-trigger handling in the same engine and integration-test areas.
  • phase-rs/phase#6881: Updates search-observer collection and tests for duplicate landfall and ETB triggers.
  • phase-rs/phase#7058: Changes the search-observer parking and delivery flow covered by these tests.

Suggested labels: bug

Suggested reviewers: andriypolanski, lgray

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: dispatching search landfall triggers before priority.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ship/fix-dispatch-search-landfall-before-priority

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

Generated for head cb1cb3115d50a3d0d62afee64e9e95f2b4baa205.

Parse changes introduced by this PR

✓ No card-parse changes detected.

@matthewevans
matthewevans added this pull request to the merge queue Aug 8, 2026
Merged via the queue into main with commit aa970cc Aug 8, 2026
13 checks passed
@matthewevans
matthewevans deleted the ship/fix-dispatch-search-landfall-before-priority branch August 8, 2026 03:01
@coderabbitai coderabbitai Bot mentioned this pull request Aug 10, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant