feat(tracker): 完善诫厉观看阶段目标通知适配#39
Conversation
同步 3483 Params 中的牌堆顶与目标手牌片段,handCount 恰好整手时 fullHand;补充交换序列协议文档并暂不挂上 decorateJieLi。
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughChanges诫厉协议与牌面同步
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant RoleOptTargetNtf
participant TrackerRoom
participant revealTrackerCards
RoleOptTargetNtf->>TrackerRoom: 写入 expectedPileCount
RoleOptTargetNtf->>TrackerRoom: 检查 observedHandCount 或手牌快照
RoleOptTargetNtf->>revealTrackerCards: 公开牌堆顶
RoleOptTargetNtf->>revealTrackerCards: 公开目标手牌片段或整手牌
Possibly related PRs
🚥 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: 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 `@tests/tracker/roleOptTargetNtf.test.ts`:
- Line 32: TypeScript 无法识别 Vitest mock 方法及 skillState 对象属性。更新
tests/tracker/roleOptTargetNtf.test.ts#L32 的 tracker.getReadyTrackerRoom,使用
vi.mocked 后再调用 mockReset;在 `#L128-L133`、#L164-L169 和 `#L191-L193` 为 skillState 明确声明
Record<string, any> 类型,并使用 vi.mocked 包装相关 mock 返回值,确保 mockReset 与
expectedPileCount 等属性通过 tsc 检查。
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0f4abfae-d7f9-4a11-9cb8-f449bdab031f
📒 Files selected for processing (8)
docs/agents/card_tracker.mddocs/protocols/GsCRoleOptTargetNtf-3483.mddocs/protocols/GsCRoleOptTargetNtf-7011.mddocs/protocols/GsCRoleOptTargetNtf-987.mddocs/protocols/PubGsCMoveCard-spell-121-hand-exchange.mdsrc/handler/GsCRoleOptTargetNtf.jssrc/tracker/skill/JieLi.tstests/tracker/roleOptTargetNtf.test.ts
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 1 file(s) based on 1 unresolved review comment. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
新增 docs/protocols/README.md 作为 className/SpellID 定位入口,并将 PubGsCMoveCard-spell-121-hand-exchange.md 重命名为 hand-exchange.md,同步更新引用。
Summary
SpellID=3483观看阶段GsCRoleOptTargetNtf适配:按[pileCount, handCount, ...pileTop, ...handPartial]同步牌堆顶与目标手牌片段,并写入expectedPileCount。handCount恰好等于目标整手数(优先观测手牌数,否则本地手牌实体数)时升级为fullHand。MoveType=11交换序列;明确观看 top-first(如81为顶)与交换CardIDs可能逆序/重排。decorateJieLi暂不挂上;PILE_SAME_ZONE_SHOW_SPELL_IDS不因 3483 扩展。Why
实战协议已给出诫厉观看与交换消息语义;观看阶段可先安全接入目标通知,交换阶段旧装饰假设与实战不一致,避免误挂。
Test plan
pnpm exec vitest run tests/tracker/roleOptTargetNtf.test.ts(7/7)1->10/ 部分5->10/10->1/10->5)Summary by CodeRabbit
功能改进
文档
测试