gongzhiyong and Claude Opus 4.8
207e027fbb
feat( #56 ): 补 azkv SECRET_RESOLVER —— 用 Pod workload identity 从 heicode-vault 读模型 key
...
#56 缺口:`_resolve_secret_ref` 此前只读 dev 环境映射 `HEICODE_SECRET_<name>`,
没有生产从 Azure Key Vault 取 key 的实现(原注释写"适配器在仓外",实际缺)。
本次在仓内补上,走刚建好的 Pod workload identity:
- `_resolve_from_keyvault`:`DefaultAzureCredential` + `SecretClient` 读 azkv:// ref;
**lazy import** azure SDK,任何失败(未启用/不可解析/SDK 缺/无凭证/网络/secret 不存在)
返回 None —— 不伪造、不抛。
- `_azkv_enabled`:**仅当** Pod 注入了 workload identity(`AZURE_FEDERATED_TOKEN_FILE`)
或显式 `SECRET_RESOLVER=azkv` 才真连 KV —— dev/CI/测试保持 hermetic、不碰网络。
- `_parse_azkv_ref`:解析 `azkv://<vault>/secrets/<name>[/<ver>]`(裸名→`https://<name>.vault.azure.net`,
全 host 保留,兼容短形式)。
- `_resolve_secret_ref` 顺序:dev 环境映射 → KV(workload identity),保持既有 dev 行为不变。
- requirements:加 `azure-keyvault-secrets`(lazy import;`azure-identity` 已在)。
测试 `test-agent-launcher.py` 新增:azkv 解析、gating(默认关、两种开关)、disabled→None。
`test-agent-launcher` / `test-key-injection-contract` 全绿。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-14 19:17:29 +08:00
gongzhiyong
a117c02e3f
docs( #56 ): 更正模型 key 库名 heicode-kv → heicode-vault(HM 实测口径)
...
agent_swarm#56 评论:模型 key 的真实 Key Vault 库名是 `heicode-vault`
(`https://heicode-vault.vault.azure.net `),早期契约文档误写为 `heicode-kv`;
且生产 `SECRET_RESOLVER` 须指向 `heicode-vault`。
- runtime-contract.md §3.3.1 A.3:库名更正 + 标注 SECRET_RESOLVER 指向 heicode-vault
+ 明确 Swarm 需提供 Pod 身份的 clientId+objectId 给 HM 授权(只读、限 swarm-model-key-*)。
- security-boundary.md:secret_ref 示例 host 同步更正。
- test-key-injection-contract.py:模型 key fixture host 同步更正(resolver 仅取末段名,
功能不变;测试仍全绿)。
纯文档/fixture 更名,无事件 schema/契约字段改动。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-14 17:12:27 +08:00
gongzhiyong and Claude Opus 4.8
9aadc802df
fix( #56 ): surface why a swarm run produces nothing (no silent black box)
...
#56 : a created run only seeds the task; if no expert agent connects, the run hangs
at `running` forever with no `agent.*` events and an empty /result — and the cause
(P-guard already detects NO_AGENTS_CONNECTED) was only in run.metadata["health"] /
/diagnostics, never on the surfaces HM/cockpit actually poll (/events, /result).
This makes a stuck run explain itself (no new Manager event type, no contract change):
- launch_swarm_agents now records run.metadata["agent_launch"]
{backend, planned, launched, launched_ids, model_key_resolved, note}. The note
pinpoints WHY there are 0 agents — e.g. AGENT_LAUNCH_BACKEND=none (no auto-launch),
k8s launch failed (kubectl/RBAC + Pod Workload Identity, #16/#60 A.3), or the model
key didn't resolve. No secret recorded — only a model_key_resolved bool.
- /result and /diagnostics now carry `health` (P-guard blockers) + `agent_launch`.
- assess_swarm_health emits ONE `timeline.updated` per distinct blocker-set (registered
event; dedup by summary, reset when healthy) so /events and the cockpit (#39 ) show
"swarm blocked: no_agents_connected" instead of silence. Still NO unregistered
swarm.health event.
Scope: this surfaces the diagnosis. Actually executing a run still requires the
deployment to set AGENT_LAUNCH_BACKEND=kubernetes AND the #16/#60 A.3 Pod Workload
Identity / KV grant (infra, cross-team) — called out in the launch note.
Tests (scripts/test-swarm-guard.py): blocked run emits timeline.updated exactly once
(dedup) + still no swarm.health; /result + /diagnostics carry health w/ no_agents_connected;
launch_swarm_agents records the backend=none note. test-contract-freeze + test-agent-launcher
still green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-14 16:52:44 +08:00
zsbgnw12 and GitHub
019e404a77
Merge pull request #47 from xmindlab-heicode/feat/benchmark-selfcert-collector
...
feat(benchmark): 自证采集器(阶段0+1) + 真实 run 数据采集落库(阶段2)
2026-06-12 18:20:35 +08:00
Fasthei and Claude Opus 4.8
27739af446
feat(benchmark): 导出器接入 Cosmos NoSQL + Blob 存储账户(可组合多 target)
...
阶段3 数据落库:BENCHMARK_EXPORT_TARGET 支持逗号组合 cosmos,blob(默认 none)。
- CosmosExporter:Cosmos DB for NoSQL,一 run 一文档(id=swarm_id,分区键 /swarm_id)。
- BlobExporter:存储账户归档 <scenario>/<swarm_id>.json。
- get_exporters() 解析多 target;某 target 缺凭据/未知则跳过+告警,不影响其它与 run。
- capture 对每个 exporter 独立 to_thread 导出,互不影响。
- orchestrator/requirements:加 azure-cosmos/azure-storage-blob/azure-identity(懒导入)。
安全:所有连接串/AccountKey 仅从环境读(经 Secret/secret_ref 注入),
绝不写进代码/日志/提交(组织安全规则)。
验证:新增 test-benchmark-export.py(target 解析/隔离/doc 成形) + capture/selfcert/
collector 回归全 PASS。
影响范围:agent_swarm benchmark 导出层 + 依赖;运行时只读钩子不变;导出默认关、无密钥落地。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-12 18:12:46 +08:00
Fasthei and Claude Opus 4.8
94ef894ace
feat(benchmark): 阶段2 数据采集 — 真实 run 终态自动采集 SwarmMetrics 并落库(+可选导出)
...
把采集器接进真实运行,让数据自己累积,为后续【经验标定】O/系数/S_gain 攒真实
用户数据(这些量只能由真实运行事后标定,不能先验写死)。本阶段不编任何公式。
- orchestrator/main.py:run 终态(completed/failed)在终态事件后调 capture_run_metrics。
只读 run 状态、try/except 包裹绝不失败 run;默认开,BENCHMARK_CAPTURE=0 可关。
- orchestrator/swarm_runtime.py:record_benchmark_metrics → 落 run.metadata['benchmark']。
- benchmark/collectors/capture.py:collect(run_collector) → 持久化 → 可选导出(to_thread)。
- benchmark/export/:MetricsExporter;默认 NoopExporter(无依赖/无凭据);
BENCHMARK_EXPORT_TARGET=blob 启用 Azure Blob(连接串或 Workload/Managed Identity,
凭据经环境注入,绝不写进代码),归档 <scenario>/<swarm_id>.json。
诚实:缺项指标 NaN→null,不伪造(规则#9)。
验证:新增 test-benchmark-capture.py + 现有 collector/selfcert + 契约冒烟(runtime/
merge/freeze)全 PASS。
影响范围:agent_swarm。运行时新增**只读**终态钩子(不改派发/执行/契约/计费/审计字段);
导出默认关,无密钥落地。Client/Manager/Agnet/CodeGW/发布链路不涉及。
依赖:benchmark/ 需在镜像内(quality.py 早已 import benchmark;由 #44 Dockerfile 修复覆盖)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-12 17:57:59 +08:00
Fasthei and Claude Opus 4.8
b5cc68c977
feat(benchmark): 落地自证采集器(阶段0+1)— S_gain≡G_E 接通 S_swarm + leaderboard
...
阶段0(定口径,docs/benchmark/emergence-evaluation.md §6 v2.1-impl):
- S_gain ≡ G_E(差值,不强制归一 [0,100],与标准「见涌现增益」字面一致)。
- 聚合 S_gain 取对最强基线(Q_base 最大)的 G_E(最保守,避免挑弱基线虚高)。
- Q ≡ Q_quality;swarm_valid 仍要求对全部基线 G_E>0 且 G_E,c>0。
阶段1(采集器):
- 新增 benchmark/collectors/selfcert_collector.py:把套件 5 份 BenchmarkRunRecord
(swarm+4基线)+ 可选活体 SwarmMetrics 合流,经 baselines.compare 算 G_E/G_E,c,
补全 run_collector 无法自算的 s_gain/g_e/g_e_cost/s_swarm,可能时产出 Benchmark_Agent。
- benchmark/leaderboard:实现排行榜聚合+渲染(标准 §11 字段)。
- run-benchmark-suite.py 接入自证 + leaderboard 输出。
诚实纪律(组织规则 #9):缺真实输入一律 NaN+coverage False,不伪造。
- O(可观测性)标准无公式 → 恒 NaN;Gov 计数器未实现 → 无活体治理则 NaN。
- 故完整 Benchmark_Agent 数字仍待 O 公式 + Gov 计数器(阶段2),采集器明列缺口。
验证:新增 test-benchmark-selfcert.py(17 项)+ 现有 benchmark 测试(metrics/
collector/comparison/runners)+ offline suite + 契约冒烟(runtime/merge/freeze)全 PASS。
影响范围:仅 agent_swarm benchmark 模块 + docs;不改 Manager↔Swarm 契约/计费/审计/密钥/发布链路。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-12 17:38:19 +08:00
Fasthei and Claude Opus 4.8
35aab3a643
feat(redis): 加 REDIS_CLUSTER 支持 OSS Cluster 端点(heicode-rd 必需)
...
heicode-rd(Azure Redis Enterprise)database clusteringPolicy=OSSCluster,
裸 redis.Redis 客户端在多分片下 keys()/跨 slot 操作会误路由/抛 MOVED。
- REDIS_CLUSTER truthy → 用 redis.asyncio.cluster.RedisCluster(URL 或
host/port 两种入参,密码/TLS 同样支持)。cluster 模式无 DB select,
REDIS_DB 被忽略(仅逻辑 DB0)。
- 不设时维持 standalone 行为,完全向后兼容。
- 测试加 cluster 用例;manifest/DELIVERY 补 REDIS_CLUSTER 说明。
验证:连接配置单测 4 项 + REDIS_FAKE 回退 + test-runtime-contract /
test-contract-freeze / test-merge-smoke 全 PASS。
影响范围:仅 agent_swarm orchestrator 连接层;不改契约/计费/审计/密钥落地。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-12 17:00:37 +08:00
Fasthei and Claude Opus 4.8
aa498fc318
feat(redis): 支持 TLS + 密码 + REDIS_URL(接托管 Redis,如 heicode-rd)
...
orchestrator/redis_client.py 之前只支持裸 redis.Redis(host,port,db)
明文连接,无法连 Azure Redis Enterprise(强制 TLS + access key)。
改动:
- 新增 REDIS_URL(优先),rediss:// 自动启用 TLS,凭据写在 URL;
否则用离散 REDIS_HOST/PORT/DB + 可选 REDIS_PASSWORD / REDIS_SSL。
- 完全向后兼容:都不设时维持现有明文 redis-service:6379 行为。
- 凭据只读 env(经 Secret/secret_ref 注入),日志只打脱敏目标,
绝不输出 URL / 密码。
- 新增 scripts/test-redis-connection-config.py(无需真实 redis)。
- k8s manifest 补 Secret 引用示例;DELIVERY.md 补环境变量表。
验证:新单测 3 项 + REDIS_FAKE 回退 + test-runtime-contract /
test-contract-freeze / test-merge-smoke 全 PASS。
影响范围:仅 agent_swarm(orchestrator 连接层)。
不改 Manager↔Swarm 契约 / 计费 / 审计字段 / 发布链路。
涉及密钥:仅新增「从环境读取」路径,无任何密钥写入代码或日志。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-12 16:50:27 +08:00
Fasthei and GitHub
d7c9cd64b6
Merge branch 'main' into feat/agent-launcher-k8s-backend
2026-06-11 23:05:02 +08:00
Songhaoz666 and Claude Opus 4.8
0cbab3f750
模型 key 注入对接:定死 HM #60 参数(KV value JSON + per-user 吊销握手)(Refs #16 #60)
...
回应 HM「#60 落地前需 Swarm 定死的参数清单」。Swarm 侧逐条定死并落实现:
- A.2 KV secret value 格式:JSON {"openai_api_key":"sk-..."}(对齐 callback 签名密钥
约定),解析字段 openai_api_key;裸 sk- 串兼容;解析不到/字段缺失不伪造。实现
agent_launcher._extract_model_key + _resolve_secret_ref。
- A.5 吊销信号(事件驱动):sk- per-user 长存;stop 为唯一终态(completed/failed 经
…/input 可重开故保 key)。某用户全部 run 被 stop(retained 集清空)时,运行时发
恰好一次 swarm.pool_terminated{user_id, secret_ref},HM 据此吊销 sk- + 清 KV。
单 run swarm.stopped 不触发吊销。实现 swarm_runtime.retain_run_for_user /
release_run_and_maybe_terminate_pool(per-user retained 集 + 一次性 flag)。
- A.1 粒度:每用户一把、跨 run 复用;KV 命名 swarm-model-key-<user_id>(文档)。
- A.4 OPENAI_API_BASE:Swarm 部署常量(已实现),不经 create 下发(文档确认)。
- A.3 KV 读 RBAC:⚠ 待定(联调阻塞前置)——如实标注归属未敲定,不伪造已就绪。
- B.1:CLIENT_GUIDE §9 /events 游标改 after=<next_after>(HM 不透明游标,非 sequence)。
swarm.pool_terminated 为 HM 控制面生命周期事件,不入 FROZEN_CLIENT_EVENT_TYPES、
不渲染驾驶舱;payload secret_ref 为 azkv:// 引用(非明文 key)。
文档:runtime-contract §3.3.1(参数表)、event-schema(注册 + 说明)、
security-boundary §6(吊销握手 + RBAC 待定)。测试 scripts/test-key-injection-contract.py
(KV 格式解析 + 吊销握手:单 run/多 run 保留/不重复吊销/teardown 后重新武装)+ CI 步。
不动 Manager 面接口、HMAC 回调、审批链、计费/审计字段语义。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 17:57:15 +08:00
Songhaoz666 and Claude Opus 4.8
af26455a8b
agent_launcher:新增一等 kubernetes 后端(每 agent 一 Pod,key 经 Secret 引用不内联)(Refs #16)
...
回应「我们跑在 k8s pods 上」——此前 launcher 只有 dev 的 subprocess + 通用 command hook,
未把 k8s 作为一等后端,且把 OPENAI_API_KEY 内联进 env(在 k8s 会落 etcd)。本次:
- 新增 AGENT_LAUNCH_BACKEND=kubernetes:每 agent 一个 Pod(build_pod_manifest)——资源
requests/limits、标签 heicode-swarm-id/heicode-user-id(GC/teardown)、restartPolicy OnFailure、
serviceAccountName;非敏感 env 内联,**OPENAI_API_KEY 经 secretKeyRef 引用每-swarm k8s Secret
(build_secret_manifest,via kubectl apply -f - stdin),绝不内联进 PodSpec(不落 etcd/argv)**。
- stop_launched:k8s 按标签 kubectl delete pod,secret;subprocess 仍 terminate。
- config:AGENT_POD_IMAGE/NAMESPACE/SERVICE_ACCOUNT/CPU|MEM_REQUEST|LIMIT;ORCHESTRATOR_URL=
集群内 Service DNS。文档注明前置(kubectl + 最小 RBAC ServiceAccount + NetworkPolicy)与
硬化替代(azkv CSI SecretProviderClass,编排器全程不碰明文)。
文档:runtime-contract §3.3 后端列表加 kubernetes(含密钥/RBAC/Service DNS/CSI);
security-boundary §6 增 K8s pod 边界(Secret 引用不内联、最小 RBAC、NetworkPolicy、CSI 硬化)。
测试:test-agent-launcher 增 k8s manifest 断言(标签、secretKeyRef 非内联、原文不在 Pod manifest、
资源限额、无 secret 则省略 key)。
影响范围:仅 agent_swarm(launcher + 文档 + 测试)。默认仍 backend=none,CI/e2e 不变。
Refs #16
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 17:19:35 +08:00
观风听雪 and GitHub
ad343e6404
Merge pull request #36 from xmindlab-heicode/feat/review-timeline-events
...
评审/返工时间线对客户端可见:review/rework 4 类脱敏事件纳入冻结集(Refs #34)
2026-06-11 17:15:50 +08:00
Songhaoz666 and Claude Opus 4.8
a7d2bb2870
评审/返工时间线对客户端可见:review/rework 4 类脱敏事件纳入冻结集(Refs #34)
...
文档:event-schema §4 增 4 类(标 ⭐ + 脱敏说明)、header 13→17;frontend-event-api 评审/返工时间线行推进为已定义 + header 注明部分推进 + 剩余跨仓项(HM 注册、cockpit 渲染、仅脱敏摘要);review-loop-protocol §3.2 由"事件不进 Manager 流"更正为"已脱敏外发"。
测试:新增 scripts/test-review-timeline-events.py(单元投影脱敏 + run_cross_review 真实站点发出 + 断言无 evidence/summary 泄漏 + 4 类在冻结集);test-contract-freeze 的 13-精确断言改为"13 核心为子集"(因 #34 扩到 17)。接入 CI。本地全绿(含 e2e/cross-review 回归)。
影响范围:仅 agent_swarm(orchestrator + docs + 测试 + CI)。Manager:回调新增 4 类(向后兼容;HM agent_callback.go 需登记方可对客户端暴露)。密钥/内容:脱敏投影不含 evidence/summary/原文/密钥。不改契约鉴权/计费/审批链。
Refs #34
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 17:10:57 +08:00
Fasthei and GitHub
02b8b08ab3
Merge branch 'main' into feat/swarm-io
2026-06-11 17:03:58 +08:00
Fasthei and GitHub
282df74f94
Merge pull request #37 from xmindlab-heicode/feat/usage-cost-phase
...
用量按 review-retry 成本归属:usage 事件标 cost_phase(Refs #16)
2026-06-11 16:49:37 +08:00
Songhaoz666 and Claude Opus 4.8
dd96b73b2d
Swarm I/O:接收用户 prompt(追加输入)+ 返回结果(/result + swarm.completed 带答案)(Refs #40)
...
补齐「客户端如何把 prompt 给我们 + 如何拿到结果」的端到端路径。
输入:
- POST /api/swarms/{id}/input(+别名):接收用户后续 prompt,注入 source=user_append 任务进共享池
(终态 run 自动 reopen 为 running;stopped 拒绝 RUN_STOPPED)。指令原文作任务描述下发给 agent,
**不回显进事件流**——仅产一条 task.created(user_append) 类别 message。(初始 prompt 仍走 create
的 requirement.objective)
输出:
- GET /api/swarms/{id}/result(+别名):返回 {summary, deliverable, artifacts[], termination_reason,
status}(build_run_result)。产物内容在 artifact.uri(git/runtime),result 给摘要+定位。
- swarm.completed 事件 payload 增带 summary + deliverable,客户端看一条终态事件即得答案。
文档:runtime-contract §3 增 input/result 行;event-schema swarm.completed 标注带 summary/deliverable;
CLIENT_GUIDE §3.5/§3.6(input/result)+ §3.2 表 + 修正 §5「Agent 平台拉起」为「Swarm 拉起 + 从
secret_ref 解析 key」(对齐 team 决议)+ 新增 §9 完整工作流地图(client→HM→Swarm→output→client)。
测试 scripts/test-swarm-io.py(TestClient:input 注入 + 原文不入事件流 + 终态 reopen + stopped 拒绝 +
result 形状)接入 CI。e2e/contract 回归通过。
影响范围:仅 agent_swarm(新增 2 只读/写端点 + 终态事件增字段 + 文档 + 测试 + CI)。
追加输入原文不入事件流/回调/日志;不改鉴权/计费账本/审批链。SSE 实时流仍归 HM Phase2(#46)。
Refs #40
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 16:28:37 +08:00
Songhaoz666 and Claude Opus 4.8
9516b5c696
Swarm 负责拉起 agent + 执行限额(team 决议,反转 AM 拉起)(Refs #16)
...
团队决议:由 Swarm 运行时(非 AM)拉起专家 agent 池并执行每用户限额。
代码:
- orchestrator/agent_launcher.py(新):plan_launch_specs(纯,按 min(池大小, MAX_AGENTS_PER_USER
−已连) 限额 + 组装每 agent env)、resolve_model_key(override→azkv secret_ref 解析(部署
SecretResolver/dev HEICODE_SECRET_<name>)→OPENAI_API_KEY 兜底,解析不到不伪造)、可插拔后端
launch()(none 默认/subprocess/command 模板,fail-soft)、stop_launched。
- orchestrator/main.py:create 播种后调 launch_swarm_agents(仅去中心化、非 Manager 显式 agent;
从 create x-user-id 取 user_id;key 服务端解析,不入 create 体);stop_swarm_run 调 stop_launched。
文档:runtime-contract §3.3 由「AM 拉起(提案待确认)」改为「Swarm 拉起 + 限额(已定)」,
更新 env 来源列(key=Swarm 从 secret_ref 解析、AGENT_ID/CAPABILITIES=Swarm launcher、
HEICODE_USER_ID=从 create 透传)+ 后端/限额/解析约束;security-boundary §6 增 Swarm 拉起 +
服务端解析 key(不上 argv/日志)说明。
测试:scripts/test-agent-launcher.py(限额封顶、env 组装、key 解析优先级、command 模板、
none no-op)接入 CI。e2e/contract 回归通过(默认 backend=none,行为不变)。
影响范围:仅 agent_swarm(orchestrator + docs + 测试 + CI)。默认 backend=none 不自动拉起、
向后兼容;密钥仅服务端 env 注入、不入 create 体/回调/日志/argv(满足 §3.1 + security-boundary)。
不改 Manager↔Swarm 契约鉴权/计费账本/审批链。
Refs #16
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 15:07:23 +08:00
Songhaoz666 and Claude Opus 4.8
e4a120b715
/metrics 暴露 run 级 cost_by_phase{initial,review_retry}(Refs #16 #37)
...
回应 @Mem0ried 在 PR #37 的对接问题:除逐条 budget.alert 事件的 cost_phase 外,详情
聚合也需能拆 initial/review_retry。build_runtime_metrics 新增 cost_by_phase 滚动汇总
(按 swarm_id,从各任务 usage.model_cost_usd/model_tokens 按 rework_attributions 归类),
GET …/{id}/metrics 返回 {initial,review_retry}:{cost_usd,model_tokens}。HM 详情聚合 /
客户端 08 用量抽屉可直接展示拆分,无需从事件推导。
测试 test-usage-cost-phase.py 增 /metrics 断言(reworked→review_retry、非 reworked→initial);
usage-billing §5 记录该字段。
Refs #16
Refs #37
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 14:36:07 +08:00
Songhaoz666 and Claude Opus 4.8
56e080bfa1
用量按 review-retry 成本归属:usage 事件标 cost_phase(Refs #16)
...
emit_usage_event 给每条 budget.alert 用量事件加 cost_phase:任务进入
run.metadata["rework_attributions"](cross-review 已 reopen)后的再执行标 review_retry,
否则 initial;并带 attempt(retry_count)。初次执行先于任何 attribution → initial,redo 在
run_cross_review 记录 attribution 之后 → review_retry,时序天然正确。计费/采集侧按 swarm_id
聚合时可用 cost_phase 拆分 initial vs review_retry 成本,满足「review retry 成本可归属」。
usage-billing-schema §4.2/§5/§6 同步:payload 加 cost_phase/attempt,§5 改为已打标,§6 缺口表
review_retry 标 ✅ 。测试 scripts/test-usage-cost-phase.py 接入 CI。
影响范围:仅 agent_swarm(usage 事件加字段 + 文档 + 测试);向后兼容;不改鉴权/契约/审批链/密钥。
Refs #16
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 09:44:36 +08:00
Fasthei and GitHub
5e29618bf5
Merge pull request #32 from xmindlab-heicode/feat/max-agents-per-user
...
每用户并发 Agent 上限:MAX_AGENTS_PER_USER 默认 10
2026-06-10 22:44:39 +08:00
Songhaoz666 and Claude Opus 4.8
56bff469c1
每用户并发 Agent 上限:MAX_AGENTS_PER_USER 默认 10
...
需求:限制每个用户在 swarm 中并发的 Agent 数为 10。按「并发 WS 连接数/用户」口径实现,env 可调(默认 10)。
orchestrator/main.py:ConnectionManager 新增 per-user 记账(agent_user / user_agents + user_agent_count / can_bind_user / bind_user / unbind);max_agents_per_user() 读 MAX_AGENTS_PER_USER(默认 10)。WS register 携带 user_id 且该用户已达上限时回 registration_rejected(reason,limit) 并 close(1008),不注册;同 agent_id 重连放行;断开 unbind 释放名额。未带 user_id 的 Agent 为 unbound、不受限。
agent/main.py:新增 user_id 构造参数 + HEICODE_USER_ID 环境回退,并在 register 载荷中带上(仅在设置时)。
测试 scripts/test-max-agents-per-user.py:单元 + WS 集成(MAX_AGENTS_PER_USER=3)。接入 CI。docs/integration/security-boundary.md §6 记录该配额。
影响范围:仅 agent_swarm;不改 Manager↔Swarm 契约、计费、审批链、密钥处理。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 22:01:22 +08:00
Fasthei and GitHub
eb643c9b02
Merge branch 'main' into feat/audit-trace-freeze
2026-06-10 21:39:22 +08:00
Songhaoz666 and Claude Opus 4.8
3411daf00b
复审整改(PR #30 ):审计接口读取完整事件流,消除 >500 事件静默截断
...
Fasthei 复审阻塞点:build_audit_trace_for_run 只调用一次 list_events(limit=500),
而 list_events 把 limit 钳到 500 并用 next_cursor 暴露下一页——501+ 事件的 run 只返回
前 500 条审计记录,无报错/无 truncated 标记,违背 #17「每步 trace 可回放」核心 DoD。
修复:build_audit_trace_for_run 改为循环跟随 next_cursor 读到为空,拼出完整事件流再
装配审计记录(main.py)。
测试:test-audit-trace.py 新增 test_pagination_no_truncation——存 612 条事件(>500 且非
500 整数倍),断言 audit count == 完整事件数(613,含创建事件)、replay 行数 == count 不截断、
audit_id 连续到末条(aud_000613)。本地全绿。
影响范围:仅 agent_swarm(orchestrator 只读审计装配 + 测试);无契约/计费/审批/密钥改动。
Refs #17
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 21:14:50 +08:00
Fasthei and GitHub
5a3296e7d1
Merge pull request #28 from xmindlab-heicode/feat/contract-freeze
...
契约冻结 v1:Manager/客户端 Swarm Run 查询契约(Refs #2 #14 #15)
2026-06-10 18:36:38 +08:00
Fasthei and GitHub
4bc98cf177
Merge pull request #31 from xmindlab-heicode/feat/security-boundary-freeze
...
安全边界强制点:可验证边界 FROZEN v1 + 契约测试(Refs #19)
2026-06-10 18:26:46 +08:00
Songhaoz666 and Claude Opus 4.8
727737dd9b
安全边界强制点:可验证边界 FROZEN v1 + 契约测试(Refs #19)
...
issue #19 要求「secret 仅 ref/不落明文;workspace/tool/MCP/tenant 沙箱强制;边界可验证 + 测试」。
本仓**已强制**的三类边界此前散落、缺统一验证;本 PR 把它们合为一套可验证测试并冻结文档。
测试:scripts/test-security-boundary.py(hermetic,19 断言)覆盖本仓强制边界:
- secret:billing_context.secret_ref 非 azkv:// 入口拒绝;明文 password/access_token 等字段
在任意层级拒绝;非 azkv 的 *_ref 拒绝(validate_create_request / _reject_plaintext_secrets)。
- 脱敏:明文凭据 → [redacted];azkv secret_ref 透传(HM 对客户端再脱敏)(_redact_sensitive)。
- workspace:绝对路径 / `..` 逃逸 / 空路径拒绝,合法相对路径落在 workspace 根内
(task_executor._resolve_workspace_path)。
- 沙箱 fail-closed:未确认隔离时 assert_isolated 抛 SandboxIsolationError,确认后放行。
文档:docs/integration/security-boundary.md → FROZEN v1:§9 覆盖表标注「✅ ✔ 已实现+测试」
三类强制边界;其余按规则 #9 据实标 ⏸「本次不做」并给理由——tool/MCP 权限引擎(无工具层可治理)、
allowed_paths 按 grant 强制(待资源授权链)、Pod 强化沙箱(Infra)、租户隔离(有意不引入,
按 user/channelId 归因)。CI 新增该测试步。
影响范围:仅 agent_swarm(新增测试 + 文档冻结 + CI)。无运行时逻辑改动;不改 Manager↔Swarm
契约、计费、审批链、密钥处理(仅为既有强制点补可验证测试)。
Refs #19
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 18:11:25 +08:00
Songhaoz666 and Claude Opus 4.8
af4ace4340
审计/链路追踪落地(可回放审计记录 FROZEN v1)(Refs #17)
...
issue #17 要求「每步 trace 可回放(谁/何模型/何工具/何审批)+ schema 冻结 + 测试」。
本仓已持久化事件流 + 任务谱系 + 每任务 usage(model_id) + 审批;本 PR 把它们规整为
统一、有序、可回放的审计记录并冻结 schema。
代码:
- orchestrator/audit.py(新,纯模块,无 Redis/WS/FastAPI/模型):build_audit_trace(
events, task_facts, approvals, lineage) 逐事件产审计记录(who/when/model_id/tool_count/
approval{id,decision}/result/lineage),audit_id 由序位确定(非随机,可字节级复现);
replay(records) 产人读步骤行。无内容、无密钥、缺信号不伪造(model/tool 缺则 null)。
- orchestrator/main.py:build_audit_trace_for_run(装配器,从 list_events + 任务 usage +
run.approvals 取数)+ 读接口 GET …/{id}/audit(三别名路由,复用既有鉴权)。
文档:docs/integration/audit-trace-schema.md → FROZEN v1:§3.1 回放装配、§5 冻结记录形;
诚实标注**有意排除**(prompt/代码原文、model 请求响应体刻意不留痕——无内容原则;
无 SK/MCP 工具层故无工具名谱系),按规则 #9 不伪造、不在本次扩展。
测试:scripts/test-audit-trace.py(纯模块 + 集成):逐步 who/model/tool/approval 重建、
result 归类、有序回放、**断言无 secret_ref/azkv/明文泄漏**;接入 CI。
影响范围:仅 agent_swarm(orchestrator 新增只读审计接口 + 纯模块 + 文档 + 测试 + CI)。
- Manager:新增只读 GET …/{id}/audit;不改回调/契约/计费/审批链。
- 密钥/审计:审计记录只含非内容元数据 + secret_ref 永不写入;归因按 user/channelId,不引入 tenant。
Refs #17
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 18:06:50 +08:00
Songhaoz666 and Claude Opus 4.8
baa67350e6
benchmark Group C:基线运行器 + 统一 BenchmarkRunRecord + 报告/回放(Closes #21)
...
在去中心化重构之上落地 benchmark 对比管线:5 个系统(single/strong/chain/sub_agent/swarm)
跑同一任务集、同一执行后端,产出统一 BenchmarkRunRecord → 评估器算 G_E/G_E,c → 报告 + 回放。
- benchmark/runners/:backend(Offline 确定性 / OpenAI 真实)+ base + 5 个 runner。各 runner
用 held-out fixture 测试在 Group B 沙箱里评分得 TestPassRate(权威,非自评)。
- benchmark/tasksets/:统一任务集 + 加载器(coding-set-1,1 个 fixture)。
- benchmark/reports/、benchmark/replay/:G_E/G_E,c/coverage/confidence + 归档。
- benchmark/baselines/comparison.py:BenchmarkRunRecord 的 CodeReview/UserAcceptance 改为
Optional(掩码归一,未采集即 None,规则 #9)。
- scripts/run-benchmark-suite.py harness + scripts/test-benchmark-runners.py。
与去中心化重构对齐:swarm runner 拓扑已**重指向去中心化流程**(种子→自选→自主分解→竞争→
同伴交叉评审→收敛,calls=6/review=1),非旧 Master「分解→派发→单评审」。仍用同一离线后端
建模以保证公平对比(驱动活体编排器会换后端→记录不可比;活体全流程由 test-workflow-e2e 验证)。
沙箱适配:runner 评分走 fail-closed 沙箱(#24),故 test + CI 步骤设 HEICODE_SANDBOX_ISOLATED=1
(仅 CI/隔离 Pod)。
影响范围:agent_swarm(benchmark 层 + 测试 + docs + CI)。不碰 orchestrator 编排逻辑、
不改 Manager↔Swarm 契约、不影响 Client/计费/密钥/审计/发布链路。
诚实边界:
- **离线后端只验证管线**:所有系统拿同一参考解 → quality 相同 → G_E=0、swarm_valid=False,
刻意不显示蜂群优势(反造假)。真实 G_E>0 需 --backend openai + 足量冻结任务集 + 多次运行。
- 故 Closes #21(运行器 + 统一记录已落地并产出合规非 NaN 记录);Refs #20(仅 1/5 场景)、
Refs #22(评估器/报告/回放已建,但 Quality 仅 TestPassRate,CodeReview/UserAcceptance 缺)、
Refs #13(验收 EPIC,需真实 run 证明 Swarm>baselines,未满足)。
Closes #21
Refs #20
Refs #22
Refs #13
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 17:44:34 +08:00
Songhaoz666 and Claude Opus 4.8
15fe5d379b
契约冻结 v1:Manager/客户端 Swarm Run 查询契约(Refs #2 #14 #15)
...
回应 HM 驾驶舱(heicode-mananger #28/#45/#46)经 agent_swarm#14(runtime-contract)
+ #15(event-schema)提出的消费需求。HM 只读查询已落地(HM PR #53),唯一前置是本
仓契约冻结。本 PR 把回调契约冻结为 v1 并落代码 + 测试。
代码(orchestrator/):
- swarm_runtime.emit_event:回调 envelope 新增 **per-swarm 严格递增 `sequence`**
(INCR 计数键 swarm_event_seq:{swarm_id},从 1、无空洞,供客户端 events?after= 去重/续传)。
- 新增冻结的客户端 13 类事件(FROZEN_CLIENT_EVENT_TYPES)中此前缺的 6 类,均**附加**发出
(不动既有 deployment.status_changed,HM 仍用其更新 AgentDeployment.Status):
· swarm.completed/failed(refresh_swarm_run_status 终态)、swarm.stopped(stop_run);
· approval.approved/rejected(record_approval_decision 决定落地);
· handoff.created(child 任务建立时)。
- artifact.created envelope 补扁平字段:created_at(默认 occurred_at)、task_id(回填)、
size_bytes 透传(未知则省略,不伪造,规则 #9)。
- redis_client 新增原子 incr(真实 + 两处 fake stub)。
文档(docs/integration/,FROZEN v1):
- event-schema.md:envelope sequence、artifact 扁平字段、事件注册表标注 ⭐ 13 类 + 新增 6 类、
对齐状态更新(title/threshold_pct/sequence/artifact 已在 emit 统一处理)。
- runtime-contract.md:冻结 stop 端点 + ID 映射;§4.1 新增**状态机映射表**——运行时不臆造
preparing/degraded/verifying(规则 #9),由 HM/客户端按表映射真实状态
(blocked→degraded、评审期→verifying 等);终态另发 swarm.* 事件。
测试:
- 新增 scripts/test-contract-freeze.py(hermetic):sequence 单调/每-swarm/无空洞、13 类
round-trip、artifact 形状(含未知 size 不伪造)、approval.*/swarm.stopped 真实发出、
明文凭据脱敏而 azkv secret_ref 透传。接入 CI + CLAUDE.md 提交前清单。
- test-workflow-e2e.py:全流程 e2e 额外断言 swarm.completed + sequence 无空洞。
- 两处 FakeRedis stub 补 incr。
影响范围:仅 agent_swarm(orchestrator + docs/integration + 测试 + CI + CLAUDE.md)。
- Manager:回调**新增** sequence 字段与 6 类事件——向后兼容(旧消费方忽略新字段/新类型即可);
HM 注册表需登记新 6 类方能对外暴露(agent_swarm#15.2,已在 doc 列为剩余项)。
- 计费/审计:不涉及(查询面不计费由 HM 保证;本仓未改计费/审计字段)。
- 密钥:envelope 不含明文凭据;secret_ref 仍为 azkv 引用,HM 对客户端再脱敏。
Refs #2
Refs #14
Refs #15
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 17:35:04 +08:00
Songhaoz666 and Claude Opus 4.8
f2662e4268
复审整改(PR #26 ):删死开关 helper、文档对齐"无条件"、swarm.health 改内部、#6 降为 Refs
...
回应 Fasthei 终审三点:
1) [P1 文档/代码冲突 + 死代码] 删除从不被调用的 *_enabled() helper(autonomous_tasks.proposals_enabled
/ task_competition.task_competition_enabled / convergence.convergence_report_enabled)及其
import os;模块 docstring 与四份协议文档(autonomous-task-generation / task-competition-protocol
/ review-loop-protocol / convergence-protocol)从"默认关/未接入/待 PR/cutover 转无条件"全部改为
"无条件接入(无开关)",删除引用死 helper 的过时集成代码样例;同步删除三个模块单测里的
"flag default OFF" 断言。
2) [P1 验收] #6 "Closes" 降为 "Refs":#6 DoD 需 ARB 决策记录链接,当前只有 owner 指示断言、无链接。
product-positioning.md 改为如实记录决策来源(owner 指示 + 本 PR + 文档)并把"补 ARB 记录链接(或
owner 明确接受断言)"列为关闭 #6 的前置;纠正其"flag 门控、默认行为不变"的过时表述(重构已无条件)。
3) [P2 契约卫生] assess_swarm_health 不再 emit_event("swarm.health")(避免向订阅全部的 Manager 回调
投递未注册事件);改为存 run.metadata["health"] + 内部 health_log。test-swarm-guard 相应断言
"无 swarm.health 外发 + 内部 health_log 已记"。
本地受影响 11 套全绿。影响范围:agent_swarm(orchestrator 模块/文档/测试);不改 Manager↔Swarm 契约。
Refs #6
Refs #7
Refs #8
Refs #11
Refs #12
Refs #18
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 16:48:27 +08:00
Songhaoz666 and Claude Opus 4.8
f281370209
去中心化蜂群重构:从 Master 中心化切换为播种+自组织(唯一行为)
...
把本仓从「Master 分解→派发→单评审」重构为去中心化自组织蜂群,并设为唯一行为
(本仓即 swarm 运行时,模式选择在仓外,无 ENABLE_swarm 开关)。依据:heicodeDocs 弱中心
定义 + 蜂群文章(stigmergy)+ OpenAI Swarm(handoff)。
流程(全部无条件生效):
- 播种 build_seed_task_specs(不主控分解)→ 自选 swarm_dispatch(能力+τ+负载+预算,唯一派发)
→ 自主分解 task_proposal(autonomous_tasks)→ 竞争/接管 task_bid/yield/takeover(task_competition)
→ 同伴交叉评审 ≥2 评审者(cross_review,取代单 critic)→ 收敛 ConvergenceReport+termination_reason
(convergence)→ 守卫 guard.diagnose(检测无法运作并列原因)。
删除:planner 主控分解、贪心/ACO/scored 派发与 scored_matchmake、单 critic 评审环、
全部 ENABLE_* swarm 构建开关。master_agent.synthesize 作为汇总工具保留。
测试:test-workflow-e2e 改写为真实 swarm 全流程;test-merge-smoke 改为 seeder/cross-review;
新增 test-swarm-{seed,dispatch,autonomous,competition,cross-review,convergence,guard} + 模块单测;
CI 同步。本地 18 套全绿。
影响范围:agent_swarm(orchestrator + 新模块 + 测试 + docs + CI)。不改 Manager↔Swarm 事件契约
(新事件均为运行时内部状态/遥测,不进 HM 注册表);不影响 Client/计费/密钥/审计/发布链路。
无新增长期开关。
诚实边界:不动 benchmark 验收(G_E 仍需真实 run,#13);convergence 暂为解释性(不强制覆盖
run.status);前端可见状态为跨端(#18);「去中心化是否更优」未证(需 Group C)。
#6 的 DoD(Path B 决策 + 定位文档)本 PR 已满足并实现 Path B → 关闭 #6。
#7/#8/#11/#12 的运行时机制已落地(事件 + e2e),但其 DoD 含前端可见状态(跨端 #18)与
多 Agent 回放,故以 Refs 链接、不自动关闭,留维护者在前端/验收就绪后关闭。
Closes #6
Refs #7
Refs #8
Refs #11
Refs #12
Refs #18
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 16:11:47 +08:00
Songhaoz666 and Claude Opus 4.8
62610a7e3f
调度评分:多维可解释打分匹配 + dispatch.decision_made(Closes #9)
...
把派发从「能力子集 + 空闲」升级为任务为中心的多维可解释打分匹配。
新增/改动:
- orchestrator/dispatch_score.py(新):DispatchCandidate/DispatchScore + 加权掩码归一
打分(score_candidate/rank_candidates)+ build_dispatch_decision_event。
- orchestrator/main.py:抽出三模式共用的 finalize_dispatch;新增 scored_matchmake
(ENABLE_DISPATCH_SCORE,默认关,与 ACO 择一)——为每个就绪任务在有能力的空闲 Agent
间按 capability/历史成功(τ)/负载/预算压力/权限择优,记录可解释决策;_run_budget_pressure
计算真实预算占比。
- orchestrator/swarm_runtime.py:SwarmRun.dispatch_decisions + record_dispatch_decision
(内部状态,非 Manager 事件)。
- 测试:scripts/test-dispatch-score.py(公式 24 项)+ scripts/test-dispatch-scored.py
(集成 11 项:按 τ/负载多 Agent 择优 + 排除原因 + 可回放记录);CI 纳入两者。
- docs/scheduling/dispatch-score-schema.md、CLAUDE.md 同步。
诚实边界:risk_score/estimated_cost/estimated_time 本仓无来源 → None 并在 payload
uncollected_dimensions 披露(不伪造,规则 #9);dispatch.decision_made 暂为 Swarm 内部
记录,未进 Manager 事件契约(需 event-schema 注册,跨端)。flag 关闭时贪心/ACO 路径逐字节不变。
Closes #9
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 14:08:08 +08:00
Songhaoz666 and Claude Opus 4.8
a289495823
复审整改(PR #24 ):沙箱 fail-closed 隔离门控 + 可回放 DecisionTrace
...
回应 Fasthei 的 Request changes 两个阻塞项:
1) 安全 / fail-closed 沙箱隔离(原仅靠 ENABLE_QUALITY_EVAL + 运维约定):
- 新增第二道显式确认 HEICODE_SANDBOX_ISOLATED(断言运行在隔离 Pod 内)。
- sandbox.run_tests() 与 quality.evaluate_run_quality() 执行任何代码前调用
assert_isolated(),未确认即抛 SandboxIsolationError——不写文件、不起子进程。
- 启动期 assert_quality_eval_safe():ENABLE_QUALITY_EVAL 开但隔离未确认 → 拒绝启动
(平台级硬失败,非运维口头约定)。
- 文档(security-boundary §8.1/§9、CLAUDE.md)与测试同步:test-sandbox/test-quality
先断言未确认时硬失败,再显式确认后继续。
2) #10 DecisionTrace 可回放(原仅存被选中任务的标量):
- Decision 现记录完整重放上下文:整个候选集(每候选 tau/eta/weight/p_norm/dependents)、
alpha/beta/epsilon、seed、free_slots、total_weight、explore_draw、select_pick、
select_index、explored 分支。
- 新增 DecisionEngine.replay_decision(trace):仅凭一条 trace(无 RNG/活体状态)复现被选任务;
test-decision-engine 断言「重放==实选」跨 50 次决策(探索+利用)成立。
- decision-engine.md §3.3 更新为可回放 DecisionTrace。
附:新增 docs/TESTING.md(reviewer 速查:依赖安装 + 每套测试命令,复审者此前因缺 fakeredis
未能跑到断言)。本地 11 项 gate 全绿。
影响范围:Swarm(orchestrator + 测试 + 文档)。不改 Manager↔Swarm 契约;新增开关
HEICODE_SANDBOX_ISOLATED(默认未设=拒绝执行)。仍非验收:gain/Benchmark_Agent 仍 NaN。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 13:22:54 +08:00
Songhaoz666 and Claude Opus 4.8
d487923646
benchmark: 落地决策层(τ/η/P)、质量(Q_quality)、通信遥测;关闭 #10 #23
...
四块互相交织的 benchmark 覆盖增量,统一提交:
1) 通信遥测(#23):orchestrator 路由 peer 消息时按 correlation_id 计请求/应答到
SwarmRun.collaboration(内部状态,不进 Manager 事件流);collector 算 s_communication。
治理计数由 run.approvals 派生(合规/总数)→ s_governance。
2) Q_quality 掩码归一(v2.1 裁定):metrics.quality_score 改为对 present 输入加权归一,
非编码任务自动忽略 TestPassRate,全缺 → NaN(不伪造)。
3) 质量插桩 / Group B:新增 Pod 内代码测试沙箱(orchestrator/sandbox.py,环境清洗 +
超时强杀 + 资源限额 + 路径越界校验,门控 ENABLE_QUALITY_EVAL)与 held-out fixture
(benchmark/fixtures/);run 完成时用留出测试评分得 TestPassRate → Q_quality →
collector 合成 reward。安全边界见 docs/integration/security-boundary.md §8.1。
4) 决策引擎 / Group A(#10,Option A score-at-pull):新增 orchestrator/decision_engine.py
—— 信息素 τ(Redis 持久、(role,agent) 键控、冷启动 0.5、ρ 蒸发、夹紧、学习常开)+
η 启发式评分 + ε-greedy 概率采样;每次 dispatch 产一条 DecisionTrace →
SwarmRun.decisions;collector 算 tau/eta/p_decision。概率选择门控 ENABLE_ACO_DISPATCH
(默认关,CI 用 ACO_SEED 固定)。
覆盖:单次 run 真实可算字段由 4 提升至最多 10/15(新增 communication/reward/tau/eta/
p_decision,外加 governance 有条件)。
测试:新增 test-sandbox / test-quality / test-decision-engine;扩充 collector/metrics 用例;
CI 纳入全部 benchmark 套件 + flag-on 的 ACO e2e。本地 11 项 gate 全绿。
诚实边界(未越界声称):
- Group A 为单边匹配(Option B 待 Group C);概率派发优于贪心未证;默认关闭。
- reward 的 CodeReview/UserAcceptance 未采集(掩码忽略);P_risk 为审批派生低估。
- s_gain/s_swarm/g_e/g_e_cost/benchmark 仍 NaN —— 需基线(#21/#13),本 PR 不动验收。
影响范围:Swarm(orchestrator + benchmark + docs + CI)。不改 Manager↔Swarm 事件契约
(遥测均为运行时内部状态);不影响 Client/计费/密钥/发布链路。新增 ENABLE_QUALITY_EVAL /
ENABLE_ACO_DISPATCH 两个开关,默认关闭。
Closes #10
Closes #23
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-10 12:51:32 +08:00
Songhaoz666 and Claude Opus 4.8
6e0eca4da7
CI: 将全部 7 套测试纳入 gate;修复 e2e 退出竞态
...
回应事后审计:此前 CI 只跑 3 套(contract/merge-smoke/workflow-e2e),新增的 4 套
(contract-events/benchmark-metrics/benchmark-collector/baseline-comparison)未进入 gate,
PR 描述「七套全绿」与 CI 实跑不符。本提交把 4 套补入 ci.yml。
同时修复 test-workflow-e2e:进程退出时 uvicorn 守护线程仍在写 stderr,导致解释器收尾
出现 Fatal Python error(exit 127,CI 偶发失败)。改为 join 服务线程 + os._exit(code),
退出码确定(本地 e2e 连跑 3 次均 exit 0、断言全过)。
注意:本 PR 仅修 CI 门禁与 e2e 稳定性,**不构成 Benchmark/主链路验收**;Issue #2 保持 open。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-09 17:33:05 +08:00
Songhaoz666 and Claude Opus 4.8
54cb327348
Agent Swarm v6:基准 v2.1、主控 Agent、实质性对等回复、客户端指南
...
- 基准标准 v2.1:SwarmMetrics(15 字段)、τ/η/P_decision/reward 公式、对称 G_E,c(修正 C_base=1.0 退化)、Σλ=1.0 校验;新增基线对比与运行记录 schema;指标覆盖缺口分析;参考系数暂留为元数据(待量化)。
- 主控 Agent 实体(分解 / 评审决策 / 汇总);事件契约修正(timeline.title、budget.threshold_pct、handoff 角色、task.released)+ 契约校验脚本。
- 实质性 LLM 对等回复(含降级回退);集成契约(runtime / event / usage / audit / frontend / capability / security);CLIENT_GUIDE 客户端指南;CI 工作流;治理与交付文档。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-09 16:21:18 +08:00