Skip to content

fix(parser): recognize "enter(s) the battlefield untapped" long-form external entry#4991

Open
jaso0n0818 wants to merge 1 commit into
phase-rs:mainfrom
jaso0n0818:fix-vigorous-farming-enters-battlefield-untapped
Open

fix(parser): recognize "enter(s) the battlefield untapped" long-form external entry#4991
jaso0n0818 wants to merge 1 commit into
phase-rs:mainfrom
jaso0n0818:fix-vigorous-farming-enters-battlefield-untapped

Conversation

@jaso0n0818

Copy link
Copy Markdown
Contributor

Summary

Fixes Vigorous Farming ("Lands you control enter the battlefield untapped.") falling through to Unimplemented.

Root cause: the untapped-entry counterpart of the gap fixed in #4988 (tapped-entry). CR 614.1c external-entry replacement effects are templated by WotC in both a short form ("enter untapped") and the fully-spelled long form ("enter the battlefield untapped"). Only the short form was recognized, so Vigorous Farming's Oracle text fell through to Unimplemented.

Mirrors the tapped-side fix in the same two gates, this time for the untapped state:

  • oracle_classifier::is_replacement_pattern: added the long-form untapped suffix.
  • oracle_replacement::parse_external_entry_suffix: added long-form " enter(s) the battlefield untapped" arms, mirroring the existing short-form arms.

This PR is independent of #4988 (different insertion points in the same functions; cherry-picked cleanly onto current main with no overlap).

Changes

  • crates/engine/src/parser/oracle_classifier.rs: classify the long-form untapped suffix as a replacement pattern.
  • crates/engine/src/parser/oracle_replacement.rs: peel the long-form untapped suffix in parse_external_entry_suffix. Added parser tests for the real card (Vigorous Farming, single-type subject) and the controller-scoped Or-filter subject shape.

Test plan

  • New parser tests: vigorous_farming_enters_the_battlefield_untapped_long_form, opponents_control_enters_the_battlefield_untapped_long_form
  • Regression: spelunking_lands_you_control_enter_untapped, archelos_untapped_other_permanents_enter_untapped still pass
  • clippy -D warnings clean
  • Full engine test suite green (14714 lib + 1721 integration tests, 0 failures)

Model: claude-sonnet-5 (Claude Code)

…external entry

Vigorous Farming ("Lands you control enter the battlefield untapped.")
fell through to Unimplemented for the same reason Frozen Aether did before
the previous fix: CR 614.1c external-entry replacement effects are
templated by WotC in both a short form ("enter untapped") and the
fully-spelled long form ("enter the battlefield untapped"), and only the
short form was recognized.

Mirrors the tapped-side fix in the same two gates:
- `oracle_classifier::is_replacement_pattern` — added the long-form
  untapped suffix alongside the existing short-form and tapped-long-form
  checks.
- `oracle_replacement::parse_external_entry_suffix` — added long-form
  "enter(s) the battlefield untapped" arms alongside the existing
  short-form and tapped-long-form arms.

Added parser tests for both the real card (Vigorous Farming, single-type
subject) and the controller-scoped Or-filter subject shape.

clippy -D warnings clean; full engine test green (14714 lib + 1721
integration, 0 failures).

Model: claude-sonnet-5 (Claude Code)
@jaso0n0818 jaso0n0818 requested a review from matthewevans as a code owner July 3, 2026 06:22
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@matthewevans matthewevans left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused fix. I’m requesting one test/evidence change before this can be approved.

[MED] The new tests bypass the classifier path that caused the bug. Evidence: crates/engine/src/parser/oracle_classifier.rs:727 adds the long-form replacement classifier, but the added tests at crates/engine/src/parser/oracle_replacement.rs:12246 call parse_replacement_line(...) directly. Why it matters: reverting only the classifier change would still leave these tests passing, so they do not prove the original full-Oracle fallthrough is fixed. Suggested fix: add a full parse_oracle_text/card-data coverage test for Lands you control enter the battlefield untapped. that fails if the line does not route through is_replacement_pattern, and wait for the current-head coverage-parse-diff sticky before requesting re-review.

For first-time engine/parser PRs, please also make sure the PR evidence follows docs/AI-CONTRIBUTOR.md so the review can verify the production route, not just the helper parser.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

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

1 card(s) · replacement/ChangeZone · added: ChangeZone

Examples: Vigorous Farming

1 card(s) · ability/unknown · removed: unknown

Examples: Vigorous Farming

2 card(s) had Oracle-text changes (errata/reprint) — excluded as non-parser.

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.

2 participants