Skip to content

fix(engine): stabilize blocker prompt ordering - #5771

Merged
matthewevans merged 2 commits into
phase-rs:mainfrom
nishu-builder:fix/deterministic-blocker-prompt-order
Jul 14, 2026
Merged

fix(engine): stabilize blocker prompt ordering#5771
matthewevans merged 2 commits into
phase-rs:mainfrom
nishu-builder:fix/deterministic-blocker-prompt-order

Conversation

@nishu-builder

Copy link
Copy Markdown
Contributor

Summary

Sorts the blocker IDs carried by every DeclareBlockers prompt. The initial prompt, multiplayer handoff, and live refresh now use the same numeric ObjectId order without changing blocker legality or the serialized shape.

Files changed

  • crates/engine/src/game/combat.rs
  • crates/engine/src/game/engine_combat.rs
  • crates/engine/src/game/turns.rs
  • crates/engine/tests/integration/deterministic_blocker_prompt_order.rs
  • crates/engine/tests/integration/main.rs

CR references

  • CR 509.1a — legal blocker choices are unchanged.
  • CR 802.4a — multiplayer blocking remains scoped to each defending player.

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 for the workspace and all targets.

  • cargo test -p engine --test integration deterministic_blocker_prompt_order -- --nocapture — 3 passed, 0 failed.

  • cargo test -p engine — 16,539 unit tests and 3,001 integration tests passed; 10 repository doc/integration tests ignored.

  • ./scripts/gen-card-data.sh — generated and validated 35,397 card faces; 31,851 of 34,626 cards fully implemented.

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

  • cargo semantic-audit — 32,417 cards audited; 294 existing findings.

  • Tilt was unavailable in this checkout, so the documented direct Developer-track fallback was used.

Gate A

Gate A PASS head=1fd319524bc3091a7670691c5ce6f0b3445e76b5 base=efe74096ba6c2185446b5ef319bbdd0e46c7f5e5

Anchored on

  • crates/engine/src/game/combat.rs:3306 — existing numeric ObjectId ordering for blocker assignments.
  • crates/engine/src/game/combat.rs:3575 — existing authority for rebuilding declaration waiting-state snapshots.

Final review-impl

Final review-impl PASS head=1fd319524bc3091a7670691c5ce6f0b3445e76b5

Claimed parse impact

None.

Validation Failures

Initial ./scripts/setup.sh --agent did not complete its optional WASM bootstrap when the shared disk filled. The required Developer-track fallback checks above all completed successfully.

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!

@github-actions github-actions Bot added the needs-maintainer AI-contribution PR requires human triage (Non-dev track or unresolved gaps) label Jul 14, 2026
@github-actions

Copy link
Copy Markdown

Parse changes introduced by this PR

✓ No card-parse changes detected.

@matthewevans matthewevans self-assigned this Jul 14, 2026

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

Approved

🔴 Blocker

  • None.

🟡 Non-blocking

  • None.

✅ Clean

  • The shared ordering helper is used by all three DeclareBlockers producers: initial combat entry, the multiplayer defender handoff, and mid-prompt refresh.
  • The new integration coverage exercises each producer and confirms both ordered IDs and unchanged player-scoped legal targets; CI is green and the parse-diff job reports no card-parse changes.

Recommendation: approve and enqueue as a bug fix.

@matthewevans matthewevans added the bug Bug fix label Jul 14, 2026
@matthewevans
matthewevans added this pull request to the merge queue Jul 14, 2026
@matthewevans matthewevans removed their assignment Jul 14, 2026
Merged via the queue into phase-rs:main with commit 8e42458 Jul 14, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug fix needs-maintainer AI-contribution PR requires human triage (Non-dev track or unresolved gaps)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants