fix(ai): align engine-issued action contracts - #7084
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 (4)
📝 WalkthroughWalkthroughThe client now uses ChangesClient action typing
AI tactical validation
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Search
participant TacticalGate
participant TargetedExchange
Search->>TacticalGate: evaluate candidate action
TacticalGate->>TargetedExchange: classify root and evaluate verdict
TargetedExchange-->>TacticalGate: verdict
TacticalGate-->>Search: reject only proven Reject roots
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/phase-ai/src/tactical_gate.rs`:
- Around line 208-225: Restore the demanded-color validation for TapLandForMana
candidates, preferably in mana_payment_actions so each engine-issued candidate
remains rules-correct and composable; otherwise add equivalent rejection in
assess_pre_cast. Ensure a dual U/R source cannot be selected for {R} while {U}
remains pending in a {2}{U} cost, and add a regression test covering that
ManaPayment path and preventing the fallback panic.
- Around line 213-225: Extend the targeted-exchange handling in assess_pre_cast
and targeted_exchange_verdict to recognize every spell-cast root, including
CastSpellForFree, CastSpellAsSneak, CastSpellAsWebSlinging, CastSpellAsMiracle,
and CastSpellAsMadness, while preserving ActivateAbility behavior. Ensure each
variant is bound and dispatched through the same verdict path, and add coverage
for every supported cast family.
🪄 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: df5210a2-d7c1-4964-8b10-c6a61be79382
⛔ Files ignored due to path filters (1)
client/src/wasm/engine_wasm.d.tsis excluded by!client/src/wasm/**,!**/*.d.ts
📒 Files selected for processing (3)
client/src/viewmodel/cardActionChoice.tscrates/phase-ai/src/mana_colors.rscrates/phase-ai/src/tactical_gate.rs
|
Generated for head Parse changes introduced by this PR✓ No card-parse changes detected. |
Summary by CodeRabbit