1d: 三形态 E2E(审查 DAG / 有限协商 / 配额制闲聊)接 live 通道 - #53
Merged
Merged
Conversation
MebularMessageStore:协商/闲聊消息以独立节点类型落既有已授权 tasks 分区(幂等 messageId);线格式未变。 runtime/planner:TaskPlanner/mapPlanner/childTaskId(确定性派生)。 worker:planner 派生子任务(created+causedBy/chain,assertAcyclicParent 守卫,成环父任务 DAG_CYCLE 失败);negotiation(轮替 counter→accept,超限 NEGOTIATION_LIMIT)。 node:waitForDagCompletion/summarizeDag(dagCompletion)+ applyNegotiationPolicy。 collab:FleetChatter(本地配额 accepted/queued/rejected)+ 消息存储工厂与类型常量。
夹具先行:protocol/collab.example.json(协商/闲聊消息、DAG 计划)。 collab-e2e:两门面真实记忆同步——DAG 完成/汇总/恰好一次/禁环负例;协商 counter→accept→done 与 NEGOTIATION_LIMIT;闲聊配额/账本守恒/幂等。anti-entropy 兜底消除 push 合并抖动。 message-store:过滤/去重/默认 namespace/幂等 append。
12/12:DAG 完成+汇总+恰好一次+禁环、协商完成+超限、闲聊配额/账本/同步收件。verify:fleet:all 126/126。
PROTOCOL-INVARIANTS §7(DAG/协商/闲聊 live 行→测试);DESIGN §3/§5 更新;ONBOARDING §14 用法与限制。
负例任务在较慢 runner 上未在循环结束前处理;iterations 3000→20000、waitForDag 30s→45s。本机 3× 12/12。
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.
1d · 三形态 E2E:审查 DAG / 有限协商 / 配额制闲聊(接 live 通道)
把 M4 的三种协作形态从纯模型接到真实节点(任务协议/worker 接线)。范围仅 fleet 层:
git diff origin/main...HEAD -- src/为空(零 core 改动)。线格式未变:协商/闲聊消息是既有已授权tasks分区内的独立节点类型(negotiation_message/chatter_message),DAG 子任务用既有created+trace。实现
MebularMessageStore<T>:落既有分区、按messageId幂等、过滤(namespace/形状)、确定序。runtime/planner.ts:TaskPlanner/mapPlanner/childTaskId(确定性)。created+causedBy/chain),禁环守卫在真实提交路径生效(成环 → 父任务failed,原因DAG_CYCLE: p→c);② 有限协商:轮替counter,超maxRounds→failed(NEGOTIATION_LIMIT: r>N),accept→ 执行。waitForDagCompletion(dagCompletion:全部可达终态才完成)+summarizeDag(确定序汇总)+applyNegotiationPolicy(accept/counter)。FleetChatter:发送对from.device走LocalQuota(accepted/queued/rejected,无全局协调)。主张 → 证据
1d-a DAG 完成/汇总(jest)+verify:fleet:collab1d-a 每任务恰好一次 {executed:3}1d-a 负例 DAG_CYCLE(jest + CLI)1d-b 协商 …done(jest + CLI,libp2p)1d-b 超限 NEGOTIATION_LIMIT: 2>11d-b messageId 幂等·夹具/单测1d-c reject/queue…账本守恒+ CLIverify:fleet:collab12/12verify:fleet:all126/126、src/diff 空红 → 绿(断言原文)
assertAcyclicParent守卫1d-a …禁环负例✕ Expected "failed" Received "done"→ 还原 ✓quota.decide恒accepted1d-c …超额 reject✕ Expected "rejected" Received "accepted"→ 还原 ✓npm run build)verify:fleet:collab负例FAIL 1d-a 负例(12→11)→ 还原 12/12三形态 E2E 原始输出(
verify:fleet:collab,真实 libp2p loopback,12/12)verify:fleet:all= 126/126(local/remote/agents/onboard/grant/service/membership/handoff/rejoin/collab)。夹具/矩阵 diff 要点
packages/fleet/protocol/collab.example.json(协商/闲聊消息、DAG 计划)→tests/fleet/collab-fixtures.test.ts先验证。PROTOCOL-INVARIANTS.md §7:三形态 live 行 → 测试名(派生/禁环/完成判定/恰好一次;消息/轮次;配额/幂等;live E2E)。DESIGN.md §3/§5:三形态由「M4 目标」改为已接 live;ONBOARDING §14用法与限制。未做项 / 风险
EchoExecutor);真实 Hermes/OpenChamber 执行器沿用既有适配器,本轮未新增真实 Agent 验收。accept/counter两种策略);更丰富的多方协商留后续。summarizeDag);复杂归约策略留后续。tasks分区同步(受既有成员/授权闸门约束)。测试方式
npm ci && npm run build npm run test:coverage npm run verify:fleet:all node scripts/verify-fleet-collab.mjs