docs(integration): spell out the limits of HM display_status judging (§6.6)

Answer "how does HM know AM output is real/valid": honestly, it does not — HM
has no AI and never reads/runs code. It only checks structural signals
(non-fallback, non-summary, delivery-type artifact with file changes), which
rules out fake/empty completions but does NOT guarantee correctness and can be
gamed by AM mislabeling. To upgrade "has something" to "really valid" needs:
(1) AM reports a verification block (build/tests/lint) that HM folds into the
verdict, (2) acceptance_criteria self-check, (3) final user review. Added the
verification block to the AM TODO as the key missing signal.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-02 22:16:13 +08:00
co-authored by Claude Opus 4.8
parent c19d04555c
commit 201a64cf35
@@ -333,6 +333,26 @@
### 6.5 成功判据(客户端用)
> **`display_status == "completed"` 且 artifacts 非空 = 真成功**;其余都不是成功(各有不同处理)。
### 6.6 ⚠️ HM 判断的边界:它"知道"什么、"不知道"什么(三方必读,别误解)
**HM 没有 AI、不读代码、不跑代码**,所以它对"内容真不真、对不对"的判断**是有边界的**:
| HM **能**判断 | HM **判断不了** |
|---|---|
| 有没有 artifact(空/有) | 代码**能不能编译、能不能跑** |
| 是不是 AM 的兜底占位(`metadata.synthesized`) | 代码**逻辑对不对、有没有 bug** |
| 是不是纯总结 / 交付类型 | 是否**满足用户的真实需求** |
| 有没有"改了 N 个文件"的结构信号 | 文件里是不是**有效代码还是垃圾** |
> **诚实结论**:当前 `display_status=completed` 只保证 **"AM 真的产出了一个非兜底、非纯总结的交付物"**——**它防的是"假成功/空交付",不是"代码正确性"的担保**。而且当前判断**依赖 AM 老实打标**(`synthesized` / `artifact_type`),理论上**可被糊弄**(标成 code_patch + 给几个文件就算 completed,哪怕代码是错的)。
**怎么把"有东西"升级成"真实有效"——分三层,越往下越硬(目标态):**
1. **🔴 验证信号(最该补)**:AM 在回调里带 **`verification` 块**——`build_passed` / `tests_total` / `tests_passed` / `tests_failed` / `lint_passed`。**HM 把"编译通过 + 测试全过"作为 `completed` 的强条件**;编译失败/测试挂 → 降级为 `needs_codegen`(带原因)。这是"真实有效"最实在的证据。
2. **🔴 验收对照**:AM 对照需求包 `acceptance_criteria` 逐条自检并回传结果,HM 记录 + 纳入裁决参考。
3. **🟢 用户终裁**:HM 永远无法替用户判断"是不是我要的"。`completed` 之后,**用户在客户端 review 产物**(看代码 / 跑起来 / git diff),满意才算真完;不满意 → 改/重做(§3.7)。这是设计上的最后一道、也是最权威的一道闸。
> 一句话回答"HM 怎么知道 AM 完成的是真实有效的":**严格说,HM 现在只能确认"有真东西、不是空/兜底",确认不了"对不对"。要确认"有效",必须 AM 把编译/测试结果回传给 HM 裁决;而"是不是用户要的",最终只能用户 review 拍板。**
---
## 7. Git 仓库与分支 / 合并模型 ❓
@@ -439,6 +459,8 @@
**agent_management(runtime)**
- 🔴 真正 git 入库 + 多 agent 分支 + 合并成交付分支
- 🔴 **回传 `verification` 块**(`build_passed` / `tests_total` / `tests_passed` / `tests_failed` / `lint_passed`)——**这是 HM 把"完成"判成"真实有效"的关键证据**(§6.6)
- 🔴 对照 `acceptance_criteria` 自检并回传结果
- 🔴 per-agent 指标上报(tokens/tools/elapsed/当前动作)
- 🔴 artifact 带 `source_agent_role` + `git_ref`
- 🔴 phases[] 阶段细分上报