feat(tracker): 落地匿名牌堆阶段 1 并记录 G1 收缩决策#44
Conversation
将牌堆初始化为匿名槽,通过 unlocatedIdentities/deckIdentities 与 materialize 按需绑定真实身份;删除牌堆 recover/占位插入路径,并保留 阶段 1 旧手牌 interop。根据对照报告与三段回放数据,G1 决定 NO-GO/收缩, 阶段 2-7 不执行,并退役 G0/G1 活跃回放采集说明。
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough阶段 1 引入匿名牌堆槽位、身份集合和首次揭示物化,更新移动与揭示路径及测试;同时移除长生命周期遍历统计会话、浏览器控制入口和相关全局类型,并归档验证结论。 Changes匿名牌堆身份解耦
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Protocol
participant TrackerController
participant Room
participant CardCounter
Protocol->>TrackerController: 发送牌堆或公共区揭示信息
TrackerController->>Room: resolveKnownCards 指定目标端点
Room->>Room: materializeAtPublicEndpoint 绑定匿名槽位
Room->>CardCounter: 更新身份与 UNKNOWN 索引
Room-->>TrackerController: 返回已物化卡牌
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 `@src/tracker/roomMovement.ts`:
- Around line 157-175: Update the public-zone branch in the room movement logic
around getPublicEndpointCards and materialize so every knownID missing from
cardIndex is handled when no anonymous endpoint slot is available. Create the
same external entity used by the outside/exile paths, or explicitly report the
failure, instead of allowing filter(Boolean) to silently drop the card; preserve
the requirement that knownCards covers all knownIDs.
🪄 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: 265a63f2-63e6-472d-b6a3-405b0424d96b
📒 Files selected for processing (29)
docs/agents/card_tracker.mddocs/agents/testing.mddocs/anonymous-slot-identity-decoupling-plan.mddocs/anonymous-slot-stage-0-conflict-baseline.mddocs/anonymous-slot-stage-1-comparison.mdsrc/dom.jssrc/tracker/Card.tssrc/tracker/CardCounter.tssrc/tracker/Room.tssrc/tracker/roomMovement.tssrc/tracker/roomMovement/candidates.tssrc/tracker/roomMovement/sources.tssrc/tracker/runtime/browser.tssrc/tracker/runtime/trackerController.tssrc/tracker/runtime/traversalStatsBrowser.tssrc/tracker/traversalStats.tssrc/types/global.d.tstests/tracker/anonymousIdentity.test.tstests/tracker/anonymousPileSpike.test.tstests/tracker/anonymousSlotBaseline.test.tstests/tracker/cardCounter.test.tstests/tracker/handExchange.test.tstests/tracker/helpers/room.tstests/tracker/pileDisplayOrder.test.tstests/tracker/publicCandidates.test.tstests/tracker/trackerController.test.tstests/tracker/traversalBaseline.test.tstests/tracker/traversalStatsBrowser.test.tstests/tracker/traversalStatsSession.test.ts
💤 Files with no reviewable changes (6)
- tests/tracker/anonymousSlotBaseline.test.ts
- tests/tracker/traversalStatsBrowser.test.ts
- tests/tracker/traversalStatsSession.test.ts
- src/tracker/runtime/traversalStatsBrowser.ts
- src/tracker/runtime/browser.ts
- src/types/global.d.ts
公共区 resolveKnownMoveCards 在端点无匿名槽可物化时,按协议正 ID 补建外部实体,避免 knownCards 被静默截短。
变更内容
Room.initDeck改为匿名牌堆槽,新增unlocatedIdentities/deckIdentities,揭示时通过materialize原地绑定真实身份。recoverPlayerOccupiedIdentityForPublicReveal与insertUnknownPlaceholderIntoPile运行时路径;阶段 1 保留旧式暗手牌 interop。docs/agents/*。验证
pnpm lintpnpm test:tracker(34 文件 / 254 测试)pnpm typecheck:trackerpnpm buildpnpm build:prodgit diff --check风险与备注
Summary by CodeRabbit
新功能
改进
测试与文档