fix(tracker): centralize hidden mark placeholder reconciliation#55
Conversation
|
Warning Review limit reached
Next review available in: 31 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough本次变更统一了暗置标记空间的匿名占位回收逻辑,接入整手完整揭示流程,并新增覆盖确认绑定、容器牌、幂等性、不同 spellID 隔离和完整揭示场景的测试。 Changes暗置标记空间守恒
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Room as Room.moveCards
participant HiddenMarks as HiddenMarkMethods
participant Ledger as Mark ledger
participant Hand as 来源手牌
Room->>HiddenMarks: 解析完整手牌揭示候选
HiddenMarks->>HiddenMarks: reconcileMarkSpace(record, reason)
HiddenMarks->>Ledger: 移除溢出占位和约束记录
HiddenMarks->>Hand: 挤回匿名占位
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 `@src/tracker/roomMovement/hiddenMarks.ts`:
- Around line 783-837: Update reconcileMarkSpace so that when overflow is
positive but evictCount is zero, it logs a dedicated warning for the mark-space
quota/invariant violation and returns false before the recycling loop and normal
recovery log. Preserve the existing recycling behavior and true return only when
at least one placeholder is actually removed and rebound.
🪄 Autofix (Beta)
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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 35ce9527-0b62-4c0b-910a-e9c33824afb7
📒 Files selected for processing (4)
docs/agents/card_tracker.mdsrc/tracker/roomMovement.tssrc/tracker/roomMovement/hiddenMarks.tstests/tracker/markSpaceReconcile.test.ts
变更
reconcileMarkSpace,集中维护暗置标记正 ID 与匿名占位之间的物理名额守恒。outside。card_tracker运行时契约。原因
暗置标记弱候选同时由正 ID 候选和匿名实体占位表达。此前确认路径各自维护占位回收,且容器分支会把实际来自来源手牌的占位移到
outside,导致手牌物理槽丢失,后续已知牌物化可能退化为createExternal。本次只收口确认产生的溢出回收;完整揭示前置时序和全明容器快照的孤儿清理职责保持不变。
验证
pnpm test:tracker(40 个测试文件,289 项通过)pnpm typecheck:trackerpnpm lintpnpm exec prettier --check ...pnpm buildpnpm build:prodserena memories checkSummary by CodeRabbit
Bug 修复
文档