Skip to content

test(parser): snapshot CastingRestriction, SolveCondition, and StriveCost item variants#5477

Merged
matthewevans merged 1 commit into
mainfrom
ship/parity-oracle-item-variant-snapshots
Jul 10, 2026
Merged

test(parser): snapshot CastingRestriction, SolveCondition, and StriveCost item variants#5477
matthewevans merged 1 commit into
mainfrom
ship/parity-oracle-item-variant-snapshots

Conversation

@matthewevans

Copy link
Copy Markdown
Member

CastingRestriction, SolveCondition, and StriveCost are producible
OracleItemIr variants that no lowered snapshot in this crate populated.
Across every *_lowered.snap here and every ParsedAbilities snapshot in
parser/snapshots/, casting_restrictions was always empty and
solve_condition / strive_cost were always null.

That is a hole in the parity oracle exactly where upcoming work lands: the
source-order document builder rewrites the OracleItemIr -> ParsedAbilities
fold, so without these three the fold could silently drop any of them and every
existing snapshot would still pass.

result.strive_cost is additionally re-read as a skip guard in the main line
loop (oracle.rs:4267), so dropping it would change control flow, not just a
serialized field.

Fixtures use verbatim Oracle text:

  • Champion's Victory - casting restriction + bounce
  • Case of the Crimson Pulse - solve condition (CR 719.1)
  • Aerial Formation - strive cost

Tests only; no production code touched.

…Cost item variants

`CastingRestriction`, `SolveCondition`, and `StriveCost` are producible
`OracleItemIr` variants that no lowered snapshot in this crate populated.
Across every `*_lowered.snap` here and every `ParsedAbilities` snapshot in
`parser/snapshots/`, `casting_restrictions` was always empty and
`solve_condition` / `strive_cost` were always null.

That is a hole in the parity oracle exactly where upcoming work lands: the
source-order document builder rewrites the `OracleItemIr` -> `ParsedAbilities`
fold, so without these three the fold could silently drop any of them and every
existing snapshot would still pass.

`result.strive_cost` is additionally re-read as a skip guard in the main line
loop (`oracle.rs:4267`), so dropping it would change control flow, not just a
serialized field.

Fixtures use verbatim Oracle text:

- Champion's Victory        - casting restriction + bounce
- Case of the Crimson Pulse - solve condition (CR 719.1)
- Aerial Formation          - strive cost

Tests only; no production code touched.
@matthewevans
matthewevans enabled auto-merge July 10, 2026 04:08

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds three new snapshot tests (champions_victory, case_of_the_crimson_pulse, and aerial_formation) to crates/engine/src/parser/oracle_ir/snapshot_tests.rs to improve parity-oracle coverage for otherwise-unsnapshotted document item variants (CastingRestriction, SolveCondition, and StriveCost). There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@matthewevans
matthewevans added this pull request to the merge queue Jul 10, 2026
@github-actions

Copy link
Copy Markdown

Parse changes introduced by this PR

✓ No card-parse changes detected.

Merged via the queue into main with commit 9234ea6 Jul 10, 2026
13 checks passed
@matthewevans
matthewevans deleted the ship/parity-oracle-item-variant-snapshots branch July 10, 2026 04:30
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