Skip to content

Fix Mishra, Claimed by Gix and attacking Meld resolution#5772

Merged
matthewevans merged 5 commits into
phase-rs:mainfrom
parthmishra:codex/fix-mishra-meld-5693
Jul 15, 2026
Merged

Fix Mishra, Claimed by Gix and attacking Meld resolution#5772
matthewevans merged 5 commits into
phase-rs:mainfrom
parthmishra:codex/fix-mishra-meld-5693

Conversation

@parthmishra

Copy link
Copy Markdown
Contributor

Summary

Fixes Mishra, Claimed by Gix by preserving its resolution-time attacking-pair condition, selecting the canonical physical Meld pair, and carrying the resulting permanent through the ordinary zone-change, replacement, as-enters, and combat-entry pipelines. The implementation generalizes to every current Meld instigator, including replacement pauses, copy-as-enters choices, commander redirects, final-controller attack destinations, AI decisions, protocol transport, and frontend choice handling.

The prior path represented Meld primarily by printed names and completed it through a bespoke entry path. That lost Mishra's inline condition and could not correctly model physical-card validation after exile, replacement provenance, deferred entry characteristics, or the CR 508.4 attacking destination. This PR moves those responsibilities to typed engine state and the existing authoritative seams.

WebSocket protocol version advances from 14 to 15 and P2P wire protocol from 7 to 8 for the two new typed choices.

Closes #5693

Files changed

  • crates/engine/src/parser/oracle_effect/
  • crates/engine/src/types/
  • crates/engine/src/game/
  • crates/engine/src/database/
  • crates/engine/src/ai_support/
  • crates/engine/tests/integration/vanille_meld_optional_cost.rs
  • crates/phase-ai/src/
  • crates/server-core/src/
  • crates/lobby-broker/src/protocol.rs
  • crates/manabrew-compat/src/lib.rs
  • client/src/adapter/
  • client/src/game/waitingForRegistry.ts
  • client/src/network/
  • client/src/pages/GamePage.tsx
  • client/src/i18n/locales/*/game.json

CR references

  • CR 701.42, CR 701.42a, CR 701.42b, CR 701.42c, CR 712.4 — Meld instruction, physical-pair validation, and combined result.
  • CR 400.2, CR 400.6, CR 400.7j — public-zone tracking and zone-change identity.
  • CR 508.4, CR 508.4a, CR 508.4c — entering tapped and attacking and selecting a defending destination.
  • CR 603.4, CR 608.2c, CR 608.2d — resolution-time conditions and exact choices.
  • CR 614.1c, CR 614.5, CR 614.12, CR 614.12a, CR 616.1 — entry replacement projection, provenance, and ordering pauses.
  • CR 611.3, CR 613.1b, CR 707.9 — final continuous/copy characteristics before combat entry.
  • CR 306.5b, CR 903.9a, CR 903.9b — intrinsic loyalty counters and per-component commander choices.

Implementation method (required)

Method: /engine-implementer

Track

Developer

LLM

Model: codex-5
Thinking: high
Tier: Standard

Verification

  • Required checks ran clean, or the exact CI-owned alternative is stated below.

  • Gate A output below is for the current committed head.

  • Final review-impl below is clean for the current committed head.

  • Both anchors cite existing analogous code at the same seam.

  • cargo fmt --all -- --check — passed.

  • cargo clippy-strict — passed on the final tree.

  • cargo test -p engine — passed after the upstream rebase: 16,560 unit tests and 2,998 integration tests, with zero failures.

  • cargo test -p engine meld — final-tree focused pass: 45 unit tests and 4 integration tests, with zero failures.

  • cargo test -p phase-ai meld_pair — 2 passed.

  • cargo test -p manabrew-compat meld — 1 passed.

  • cargo test -p server-core meld — 2 passed.

  • cargo test -p lobby-broker protocol_version_tracks_meld_wire_additions — 1 passed.

  • ./scripts/gen-card-data.sh — passed; both target cards are supported: true with gap_count: 0.

  • cargo coverage — passed; 31,346/35,397 cards supported (88.6%).

  • cargo semantic-audit — completed across 32,417 cards; neither target card has a finding.

  • pnpm run type-check — passed, including protocol parity.

  • pnpm exec vitest run src/i18n/resources.test.ts src/adapter/__tests__/waiting-for-handler-parity.test.ts src/network/__tests__/protocol.test.ts — 3 files and 102 tests passed.

  • git diff --check origin/main...HEAD — passed.

Gate A

Gate A PASS head=89490ffddffd8f70c645cdb1a0b13307bd73b5dc base=efe74096ba6c2185446b5ef319bbdd0e46c7f5e5

Anchored on

  • crates/engine/src/parser/oracle_effect/meld.rs:140 — existing nom-based Meld ownership-gate authority.
  • crates/engine/src/game/zone_pipeline.rs:891 — existing simultaneous zone-move and typed completion seam.
  • crates/engine/src/game/engine_replacement.rs:1086 — existing liminal as-enters copy-choice resume seam.

Final review-impl

Final review-impl PASS head=89490ffddffd8f70c645cdb1a0b13307bd73b5dc

Claimed parse impact

  • Mishra, Claimed by Gix
  • Phyrexian Dragon Engine

Validation Failures

None.

CI Failures

None.

@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

Copy link
Copy Markdown
Member

Closed without implementation-diff review. This PR enters protected architecture scope because it touches crates/server-core/src/game_action_payload_guard.rs, crates/server-core/src/protocol.rs and/or spans engine, frontend, server. AI-contributor PRs may enter this scope only after an explicit prior maintainer appointment or when the PR closes an issue labeled accepted. Tier, contributor standing, the quality label, prior praise, and frontend permission do not waive this gate. Open a fresh PR from current main only after one of those authorizations exists, and rerun /engine-implementer, the final review-impl, and Gate A against its committed head.

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

Parse changes introduced by this PR · 3 card(s), 6 signature(s) (baseline: main 273a9e7842e1)

1 card(s) · ability/ChangeZone · removed: ChangeZone (kind=activated, target=parent target, timing=sorcery speed, to=exile)

Examples: Urza, Lord Protector

1 card(s) · ability/ChangeZone · removed: ChangeZone (kind=activated, target=parent target, to=exile)

Examples: Hanweir Battlements

1 card(s) · ability/Meld · added: Meld (conditional=source is self + attacking you control and you control named "Phyrexian Dragon Engine" you control attacking scoped player controls creature)

Examples: Mishra, Claimed by Gix

1 card(s) · ability/Meld · added: Meld (conditional=source is self + you control you and you control named "Hanweir Garrison" you control you control creature, kind=activated)

Examples: Hanweir Battlements

1 card(s) · ability/Meld · added: Meld (conditional=source is self + you control you and you control named "The Mightstone and Weakstone" you control you control artifact, kind=activated, timin…

Examples: Urza, Lord Protector

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

Examples: Mishra, Claimed by Gix

@matthewevans matthewevans reopened this Jul 15, 2026
@matthewevans matthewevans added the accepted Architecture-scope work authorized by the maintainer; unblocks broad-span PRs closing this issue. label Jul 15, 2026
@matthewevans matthewevans self-assigned this Jul 15, 2026
@matthewevans matthewevans added the enhancement New feature or request label Jul 15, 2026
@parthmishra
parthmishra marked this pull request as ready for review July 15, 2026 02:40
@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 force-pushed the codex/fix-mishra-meld-5693 branch from c8cad74 to 41eabce Compare July 15, 2026 05:01
parthmishra and others added 5 commits July 14, 2026 22:33
Preserve the complete WebSocket wire-version history after aligning the Meld port with main's prior mana-payment protocol bump.

Co-authored-by: parth.mishra <parth.mishra@accenture.com>
Main added the state-based-action request constructor after the Meld port added replacement provenance. Initialize the new constructor so the common request invariant remains total.

Co-authored-by: parth.mishra <parth.mishra@accenture.com>
Update the shrink-only migration census after the rebased Meld port.\n\nCo-authored-by: parth.mishra <parth.mishra@accenture.com>
@matthewevans
matthewevans force-pushed the codex/fix-mishra-meld-5693 branch from 84aebc2 to b876b8a Compare July 15, 2026 05:34

@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.

Verdict: approved — the rebased Meld port is clean at the engine/transport seam and its discriminating runtime coverage matches the intended card class.

🔴 Blocker

  • None.

🟡 Non-blocking

  • None.

✅ Clean

  • crates/engine/src/game/meld.rs: the resolution path keeps both the source/partner selection and the zone-pipeline/replacement contracts.
  • crates/engine/src/game/meld_tests.rs: the runtime cases cover acceptance/decline, stale and singleton destinations, copy behavior, and final control.
  • Current parse-diff is scoped to Mishra plus the two existing Meld migrations; current GitHub CI is green.

Recommendation: approve and enqueue.

@matthewevans
matthewevans added this pull request to the merge queue Jul 15, 2026
@matthewevans matthewevans removed their assignment Jul 15, 2026
Merged via the queue into phase-rs:main with commit 23f9118 Jul 15, 2026
17 checks passed
@parthmishra
parthmishra deleted the codex/fix-mishra-meld-5693 branch July 16, 2026 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted Architecture-scope work authorized by the maintainer; unblocks broad-span PRs closing this issue. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Card Bug] Meld doesn't trigger when "Phyrexian Dragon Engine" and "Mishra, Claimed by Gix" attack

2 participants