ship/fix ai validate restored and target continuations - #7104
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughRestoration and multiplayer resume now require card-database rehydration. AI target candidates now use current prompts and reducer validation. Fallback actions consume issued decision-contract candidates. WASM tests cover restoration, payment legality, legacy states, replay invalidation, and RNG continuity. ChangesState restoration
Validated AI target actions
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant phase_ai_search
participant AiDecisionContract
participant legal_actions_full
participant FilterPipeline
phase_ai_search->>AiDecisionContract: request target decision
AiDecisionContract->>legal_actions_full: enumerate current target actions
legal_actions_full->>FilterPipeline: validate candidates
FilterPipeline-->>AiDecisionContract: return legal candidates
AiDecisionContract-->>phase_ai_search: issue ChooseTarget or CancelCast
sequenceDiagram
participant Restore
participant Rehydration
participant CardDatabase
participant GameState
Restore->>Rehydration: restore state
Rehydration->>CardDatabase: load card definitions
CardDatabase-->>Rehydration: definitions or error
Rehydration->>GameState: install rehydrated state
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
5a8196f to
f3307e7
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/engine-wasm/src/lib.rs`:
- Around line 1842-1844: In crates/engine-wasm/src/lib.rs#L1842-L1844, call
rehydrate_restored_state_from_card_db before rehydrate_rng and the debug_mode
assignment; in crates/engine-wasm/src/lib.rs#L1905-L1910, perform the same
card-database restoration before assigning the fresh RNG state. Ensure both
restoration paths validate required resources before any GameState mutation.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 6648a541-38ea-490c-bceb-3c4d69e58426
📒 Files selected for processing (5)
crates/engine-wasm/src/lib.rscrates/engine/src/ai_support/candidates.rscrates/engine/src/ai_support/context.rscrates/engine/src/ai_support/mod.rscrates/phase-ai/src/search.rs
|
Generated for head Parse changes introduced by this PR✓ No card-parse changes detected. |
c42f488 to
72f9d43
Compare
Summary by CodeRabbit