Skip to content

fix(parser): bind Aura token creators to attached player - #7326

Merged
matthewevans merged 1 commit into
mainfrom
ship/5271-aura-token-creator
Aug 13, 2026
Merged

fix(parser): bind Aura token creators to attached player#7326
matthewevans merged 1 commit into
mainfrom
ship/5271-aura-token-creator

Conversation

@matthewevans

@matthewevans matthewevans commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Fixed token creation effects so chained tokens correctly inherit ownership from the enchanted player or opponent.
    • Corrected handling of “enchanted opponent” effects for shared token sequences.
    • Ensured chained Clue, Food, and Junk tokens are assigned to the correct owner.
    • Prevented ownership propagation from continuing beyond the end of a token sequence.
    • Added coverage for chained token effects triggered by entering the battlefield.

@matthewevans
matthewevans enabled auto-merge August 13, 2026 04:21
@coderabbitai

coderabbitai Bot commented Aug 13, 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: 21 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: f8f5a3ec-747d-4393-90b9-046489a7e62f

📥 Commits

Reviewing files that changed from the base of the PR and between 73aedcf and 1ac3dbf.

📒 Files selected for processing (2)
  • crates/engine/src/parser/oracle_effect/mod.rs
  • crates/engine/src/parser/oracle_tests.rs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 079e2034-e666-4a05-99ec-420ff690dbde

📥 Commits

Reviewing files that changed from the base of the PR and between 1989fbd and 73aedcf.

📒 Files selected for processing (1)
  • crates/engine/src/parser/oracle_tests.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/engine/src/parser/oracle_tests.rs

📝 Walkthrough

Walkthrough

Oracle effect parsing recognizes enchanted opponents as attached subjects and propagates that subject through contiguous shared token effects. Regression tests cover chained Clue, Food, and Junk token creation.

Changes

Oracle subject binding

Layer / File(s) Summary
Enchanted opponent subject recognition
crates/engine/src/parser/oracle_effect/subject.rs
parse_subject_application maps “enchanted opponent” to TargetFilter::AttachedTo.
Shared token propagation and regression coverage
crates/engine/src/parser/oracle_effect/mod.rs, crates/engine/src/parser/oracle_effect/subject.rs, crates/engine/src/parser/oracle_tests.rs
Token-rooted clauses propagate the subject through contiguous linked token effects. Tests verify ownership and the Clue/Food/Junk chain termination.

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

Mergeability Score: ⚪ Minimal · up to 73aed

No actionable merge-blocking risk is identified for the current change; it is merge-ready after normal checks.

Possibly related PRs

  • phase-rs/phase#6220: Both modify oracle effect subject-binding logic, but this PR targets chained token ownership.
  • phase-rs/phase#6324: Both modify parse_subject_application and use TargetFilter::AttachedTo for enchanted subjects.
  • phase-rs/phase#6528: Both modify context-aware target binding in the oracle-effect parser.

Suggested labels: bug

Sequence Diagram(s)

sequenceDiagram
  participant OracleParser
  participant SubjectApplication
  participant TokenEffects
  OracleParser->>SubjectApplication: parse enchanted opponent subject
  SubjectApplication->>TokenEffects: apply TargetFilter::AttachedTo
  TokenEffects->>TokenEffects: propagate subject through Clue, Food, and Junk
  TokenEffects-->>OracleParser: end chain after Junk
Loading
🚥 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 describes the parser fix that binds Aura-created tokens to the attached player.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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/5271-aura-token-creator

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.

@matthewevans
matthewevans force-pushed the ship/5271-aura-token-creator branch from 1989fbd to 63a15b1 Compare August 13, 2026 04:30
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

Generated for head 1ac3dbf411231b114b8ceeb2d55f077e4954c7bd.

Parse changes introduced by this PR · 1 card(s), 2 signature(s) (baseline: main 1c9343a8890a)

🟢 Added (1 signature)

  • 1 card · ➕ ability/Token · added: Token (token=Clue (Artifact Clue))
    • Affected (first 3): Overencumbered

🔴 Removed (1 signature)

  • 1 card · ➖ ability/unbound_subject · removed: unbound_subject
    • Affected (first 3): Overencumbered

@matthewevans
matthewevans force-pushed the ship/5271-aura-token-creator branch 2 times, most recently from 73aedcf to 1ac3dbf Compare August 13, 2026 05:00
@matthewevans
matthewevans added this pull request to the merge queue Aug 13, 2026
Merged via the queue into main with commit e78f9c5 Aug 13, 2026
15 checks passed
@matthewevans
matthewevans deleted the ship/5271-aura-token-creator branch August 13, 2026 05:36
JacobWoodson added a commit to JacobWoodson/phase that referenced this pull request Aug 13, 2026
One conflict, in the import list of oracle_effect/subject.rs: this branch
added EffectScope for the broadcast ForceAttack arm while phase-rs#7326 / phase-rs#7322 /
phase-rs#7333 added ObjectScope. Both are needed; kept both.
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