feat(room-memory): 房间底账 room_events + 白板机械合并 + 新成员注入 (§4)#198
Open
raysonmeng wants to merge 1 commit into
Open
feat(room-memory): 房间底账 room_events + 白板机械合并 + 新成员注入 (§4)#198raysonmeng wants to merge 1 commit into
raysonmeng wants to merge 1 commit into
Conversation
v3 §4 / §11.1 bullet 10。broker 把每条房间事件落底账、机械蒸馏进结构化白板, 新成员 join 时把白板快照注入其会话,让它立刻有上下文(零 LLM)。 v3 §4 / §11.1 bullet 10. The broker now records every room event to the ledger, mechanically distils it into a structured whiteboard, and hands a new member the whiteboard snapshot on join so it has context immediately — zero LLM. - src/whiteboard.ts: mergeWhiteboard 纯函数(不可变)—— task_completed 入 recentMilestones,带 contract 再入 contractsReady;每槽位封顶 MAX_WHITEBOARD_SLOT=50 (保留最新);不可合并 kind 返回原引用(调用方据此跳过 Store 写)。 - src/broker.ts: publish 成功扇出后 best-effort appendEvent + updateWhiteboard (底账/白板写失败绝不回滚或阻断已完成的实时投递);presence 走 emitPresence 旁路,天然不入底账。subscribe 0→1 时 getWhiteboard → 仅发给 joiner 自己 (不广播,不与 drainPendingTo 离线补投重复)。 - src/broker-client.ts: onWhiteboard 处理器 + 分发 type:"whiteboard" 帧。 - src/room-bridge.ts: renderWhiteboard(快照→一行中文摘要:契约/进行中/阻塞计数 + 最近几条)→ 注入 Claude,接通 broker→edge 的新成员注入边路。 Tests: whiteboard 纯函数 (5: 合并/契约/不可合并返回原引用/不可变/槽位封顶) + broker-room-memory 集成 (3: append-on-publish 且 presence 不入底账 / 白板仅 0→1 注入一次 / 底账写失败不阻断实时投递) + renderWhiteboard 单测 + room-bridge 集成 (join 收到并注入白板) + broker-routing WsClient 过滤 whiteboard 帧。check 全绿 1815 pass。 Backlog(§4 推后): recentEvents 全量回放(白板注入已满足 §4.4,回放会与 pending 重叠)、abg whiteboard / abg note CLI、LLM 蒸馏、room_events 滚动归档剪枝。 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要 / Summary
v3 §4 / §11.1 bullet 10(stacked base =
feat/v3-resilience)。broker 把每条房间事件落底账、机械蒸馏进结构化白板,新成员 join 时把白板快照注入其会话,让它立刻有上下文(零 LLM)。改动
src/whiteboard.ts:mergeWhiteboard 纯函数(不可变)—— task_completed 入 recentMilestones,带 contract 再入 contractsReady;每槽位封顶 50;不可合并 kind 返回原引用(调用方据此跳过 Store 写)。src/broker.ts:publish 成功扇出后 best-effort appendEvent + updateWhiteboard(写失败绝不回滚/阻断已完成投递);presence 走 emitPresence 旁路天然不入底账;subscribe 0→1 时 getWhiteboard → 仅发给 joiner 自己(不广播,不与离线补投重复)。src/broker-client.ts+src/room-bridge.ts:onWhiteboard 处理器 + renderWhiteboard(快照→一行中文摘要)→ 注入 Claude,接通 broker→edge 新成员注入边路。测试 / Cross-review
whiteboard 纯函数(5) + broker-room-memory(3:append-on-publish 且 presence 不入底账 / 白板仅 0→1 一次 / 底账写失败不阻断投递) + renderWhiteboard + room-bridge 集成(join 收到并注入白板)。2 轮 4 reviewer 连续两轮 0 真实 issue。check 1815 pass。
🤖 Generated with Claude Code