Skip to content

cr733(p2): journal resolution-frame continuation transitions - #6532

Merged
matthewevans merged 1 commit into
mainfrom
ship/cr733-p2-continuation-frames
Jul 23, 2026
Merged

cr733(p2): journal resolution-frame continuation transitions#6532
matthewevans merged 1 commit into
mainfrom
ship/cr733-p2-continuation-frames

Conversation

@matthewevans

@matthewevans matthewevans commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Added journaled resolution-frame transitions for pushing, inserting, removing, and replacing active frames.
    • Added replay validation to ensure transitions match the current resolution state.
    • Added serialization and deserialization support for frame-transition commands.
  • Bug Fixes

    • Invalid transitions now fail safely without modifying the resolution state.
    • Improved handling of ability continuations and post-replacement draws.
  • Tests

    • Added comprehensive coverage for replay validation, journal integrity, state round-tripping, and transition error handling.

@matthewevans
matthewevans enabled auto-merge July 23, 2026 04:15
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: d00f0fd0-32e5-4af0-b111-45d75f651cfa

📥 Commits

Reviewing files that changed from the base of the PR and between a5574c3 and 3cc4772.

📒 Files selected for processing (6)
  • crates/engine/src/types/game_state.rs
  • crates/engine/src/types/mod.rs
  • crates/engine/src/types/resolved_commands.rs
  • crates/engine/tests/integration/cr733_resolved_commands_p2.rs
  • crates/engine/tests/integration/cr733_resolved_frame_transition.rs
  • crates/engine/tests/integration/main.rs

📝 Walkthrough

Walkthrough

Adds journaled, replayable resolution-frame transition commands. Game-state stack mutations now apply atomically through a shared helper, validate replay invariants, record causal journal entries, and cover push, insertion, pop, replacement, serialization, and failure cases with integration tests.

Changes

Resolved frame transition flow

Layer / File(s) Summary
Transition command and journal contracts
crates/engine/src/types/resolved_commands.rs, crates/engine/src/types/mod.rs
Adds bounded frame-transition commands, replay errors, journal recording, causal validation, and corresponding public re-exports.
Atomic stack application and production wiring
crates/engine/src/types/game_state.rs
Applies transitions to cloned resolution stacks, validates waiting_for, commits successful changes, journals live transitions, and routes parent insertions through the helper.
Replay integration and transition coverage
crates/engine/tests/integration/cr733_resolved_commands_p2.rs, crates/engine/tests/integration/cr733_resolved_frame_transition.rs, crates/engine/tests/integration/main.rs
Adds replay dispatch and integration coverage for transition operations, serialization, invariant failures, journal causes, production insertion paths, and resolution-state round trips.

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

Sequence Diagram(s)

sequenceDiagram
  participant GameState
  participant ResolutionStack
  participant ResolvedRulesJournal
  participant ReplayHarness
  GameState->>ResolutionStack: apply transition to cloned stack
  ResolutionStack-->>GameState: validate and commit stack
  GameState->>ResolvedRulesJournal: record frame transition
  ReplayHarness->>GameState: replay journaled command
  GameState->>ResolutionStack: apply resolved transition
Loading

Possibly related PRs

  • phase-rs/phase#6521: Extends the same resolved-command, journal, replay, and validation machinery with other command variants.

Suggested reviewers: andriypolanski, parthmishra

🚥 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 matches the core change: journaling resolution-frame transitions, even if it narrows it to continuation transitions.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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/cr733-p2-continuation-frames

Comment @coderabbitai help to get the list of available commands.

@matthewevans
matthewevans added this pull request to the merge queue Jul 23, 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 659ddf7 Jul 23, 2026
15 checks passed
@matthewevans
matthewevans deleted the ship/cr733-p2-continuation-frames branch July 23, 2026 04:48
jsdevninja pushed a commit to jsdevninja/phase that referenced this pull request Jul 24, 2026
…s#6532)

Co-authored-by: matthewevans <matthewevans@users.noreply.github.com>
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