feat(guide): 角色泳道图 + 编排图落到模块 + iframe 嵌入与 Pages 入口

改了什么
- 新增 team-workflow-guide/flow.html:角色 × 阶段泳道图(JointJS),3 条打回边、3 道人工闸门。
  dev-build 用单节点 + 框内四步清单(实现 → 自测 → UI 对照 → 代码评审),
  overnight-runner 用卡片堆表示可一直追加的队列(只收已确认 Plan)
- index.html 首屏 #lane 段用 iframe 嵌入泳道图,导航与 lead 指向锚点;
  flow.html「返回指南」加 target="_top",从 iframe 里也能跳出
- 编排图从 .agents/plan/iteration-to-test.html 移到 agents-workflow-engine/graph.html
  (git mv 保留历史);标题由「版本到提测」改为「迭代编排图」(图早已到「可上线」)
- 预设延伸到交付与上线:accepted 里程碑 → ba-gen-facts → dev-release-plan → shipped,
  单元测试同步;QA 用例与技术高阶并行、E2E 回路补齐
- README / AGENTS.md 补 L3 vs L4 两种协作模式;两个模块 README 给出 GitHub Pages 链接

为什么
- 图是模块产物,不该留在计划目录;读者也不该为了看一眼图跳出主文档
- L3(人编排)与 L4(人决策)共用同一套 26 个 skill,差异只在谁调度,需要一张对照表说清

怎么验证
- ./.agents/verify.sh 全部通过(68 项;163 条相对链接有效;engine 25/25,runner 44/44 + 13/13)
- 浏览器实测:index.html 的 iframe 内 58 个 cell / 18 个实心节点,0 console 报错,无横向溢出;
  flow.html 18 节点 / 21 连线 / 0 重叠 / 0 文字溢出 / 0 连线穿框;graph.html 92 cell 正常出图
- Pages 从 main 构建,推送后两条链接生效

文档同步检查
- 已更新:根 README、AGENTS.md §1/§3/§8/§13、agents-workflow-engine/README、team-workflow-guide/{README,index.html}
- 占位符与 catalog.json:不涉及
This commit is contained in:
ning-inspire
2026-11-19 21:27:46 +08:00
parent bf0dd95c54
commit 8d51331b45
14 changed files with 1340 additions and 38 deletions

View File

@@ -1,14 +1,23 @@
# agents-workflow-engine
一个人用主会话把一条迭代从启动调度到人工补测。图是 YAML。人、graph-master、子 agent 分三道泳道。子 agent 调用 skill,并且可以绑不同模型做对抗验证。
一个人用主会话把一条迭代从启动调度到可上线。图是 YAML。人、graph-master、子 agent 分三道泳道。子 agent 调用 skill,并且可以绑不同模型做对抗验证。
预设的主线:
## 图
三行泳道(人 / graph-master / 子 agent)× 五个阶段,从「开始版本」到「可上线」。节点与连线由 `presets/iteration-to-test.yaml` 渲染,**图不手改**。
- **在线交互版**(缩放 / 拖拽 / 适应窗口):<https://inspirechina.github.io/ai4se-harness-suite/agents-workflow-engine/graph.html>
- **本地打开**:[`graph.html`](graph.html)(双击即可,需联网加载 JointJS CDN)
改完 YAML 后 `render` 只出 Mermaid;`graph.html` 是这张预设的**人读版**,改预设时要顺手把图对齐。
## 预设的主线
```
需求规格 → 需求质量门 → 需求决策 ─┬─ 编写 QA 用例(并行侧分支)────────┐
需求规格 → 需求质量门 → 需求决策 ─┬─ 编写 QA 用例(并行侧分支)────────────┐
└─ 技术高阶 → 迭代 HLD → 详细规划 → 开发 → 提测
│
人工补测 ← 测试决策 ← 编写并运行 E2E ←┘
│
准备上线 ← 刷新事实文档 ← 人工补测 ← 测试决策 ← 编写并运行 E2E ←────────┘
```
## 用法
@@ -35,7 +44,7 @@ PYTHONPATH=agents-workflow-engine python -m agents_workflow_engine run \
| 字段 | 用在哪 | 含义 |
|---|---|---|
| `kind: milestone` | 主会话节点 | 里程碑,只记一条日志,不调子 agent(预设里的「提测」) |
| `kind: milestone` | 主会话节点 | 里程碑,只记一条日志,不调子 agent(预设里的「提测」「人工补测」) |
| `join: true` | 节点 | 等所有向前入边都到过再执行;打回边直接放行 |
| `parallel: true` | 决策的出边 | 与同选项的主出边并行,成为一个独立分支 |
| `batch: true` | 子 agent 节点 | 输出 `TASK:` 清单,交给后续节点逐条消费 |
@@ -69,4 +78,4 @@ PYTHONPATH=agents-workflow-engine python -m agents_workflow_engine run \
## 维护
预设在 `presets/iteration-to-test.yaml`。形状说明在 `schema/graph.schema.json`。泳道预览在仓库 `.agents/plan/iteration-to-test.html`。
预设在 `presets/iteration-to-test.yaml`。形状说明在 `schema/graph.schema.json`。泳道预览在 [`graph.html`](graph.html),与预设手工保持同步。

File diff suppressed because it is too large Load Diff

View File

@@ -60,7 +60,10 @@ nodes:
- { id: handoff, actor: master, kind: milestone, title: 提测 }
- { id: qa-run-e2e, actor: subagent, kind: action, skill: qa-run-e2e, title: 编写并运行 E2E 测试, join: true, model: writer }
- { id: test-decision, actor: human, kind: decision, title: 测试决策, options: [修订, 通过, 打回开发] }
- { id: accepted, actor: master, kind: end, title: 人工补测 }
- { id: accepted, actor: master, kind: milestone, title: 人工补测 }
- { id: ba-gen-facts, actor: subagent, kind: action, skill: ba-gen-facts, title: 刷新事实文档, model: writer }
- { id: dev-release-plan, actor: subagent, kind: action, skill: dev-release-plan, title: 准备上线, model: writer }
- { id: shipped, actor: master, kind: end, title: 可上线 }
edges:
- { id: e0, from: graph-start, to: start-version }
- { id: e1, from: start-version, to: pm-start-iteration }
@@ -93,4 +96,7 @@ edges:
- { id: e2e-to-decision, from: qa-run-e2e, to: test-decision }
- { id: e2e-revise, from: test-decision, to: qa-run-e2e, when: 修订, back: true }
- { id: e2e-pass, from: test-decision, to: accepted, when: 通过 }
- { id: e2e-reject, from: test-decision, to: amend-input, when: 打回开发, back: true }
- { id: e2e-reject, from: test-decision, to: amend-input, when: 打回开发, back: true }
- { id: accepted-to-facts, from: accepted, to: ba-gen-facts }
- { id: facts-to-release, from: ba-gen-facts, to: dev-release-plan }
- { id: release-to-shipped, from: dev-release-plan, to: shipped }

View File

@@ -78,7 +78,10 @@ class PresetTest(unittest.TestCase):
self.assertIn("start-version[/开始版本/]", text)
self.assertIn("requirement-decision{需求决策}", text)
self.assertIn("handoff([提测 · 里程碑])", text)
self.assertIn("accepted([人工补测])", text)
self.assertIn("accepted([人工补测 · 里程碑])", text)
self.assertIn("ba-gen-facts(刷新事实文档)", text)
self.assertIn("dev-release-plan(准备上线)", text)
self.assertIn("shipped([可上线])", text)
self.assertIn("graph-start{{会话启动}}", text)
self.assertIn("后端 TDD", text)
self.assertIn("-.->|不满意|", text)
@@ -106,7 +109,7 @@ class PresetTest(unittest.TestCase):
self.assertEqual(errors, [])
calls = []
end = Runner(graph, happy_answers(), fake_agent(calls), "master", []).run()
self.assertEqual(end, "accepted")
self.assertEqual(end, "shipped")
self.assertNotIn("qa-write-cases", [item[0] for item in calls])
def test_edge_into_sealed_step_fails(self):
@@ -180,7 +183,7 @@ class RunTest(unittest.TestCase):
calls = []
log = []
end = Runner(load_preset(), happy_answers(), fake_agent(calls), "master", log).run()
self.assertEqual(end, "accepted")
self.assertEqual(end, "shipped")
build_calls = [item for item in calls if item[0] == "dev-build"]
self.assertEqual([item[2] for item in build_calls], ["a", "b"])
self.assertTrue(any(item.get("event") == "batch" for item in log))
@@ -189,7 +192,7 @@ class RunTest(unittest.TestCase):
calls = []
log = []
end = Runner(load_preset(), happy_answers(), fake_agent(calls), "master", log).run()
self.assertEqual(end, "accepted")
self.assertEqual(end, "shipped")
order = [item[0] for item in calls]
self.assertLess(order.index("qa-write-cases"), order.index("tl-high-level-design"))
self.assertEqual(order.count("qa-write-cases"), 1)
@@ -206,17 +209,29 @@ class RunTest(unittest.TestCase):
answers["write-spec"] = ["第一稿", "第二稿"]
answers["requirement-decision"] = ["不满意", "满意"]
end = Runner(load_preset(), answers, fake_agent(calls), "master", []).run()
self.assertEqual(end, "accepted")
self.assertEqual(end, "shipped")
self.assertEqual(sum(1 for item in calls if item[0] == "ba-write-spec"), 2)
self.assertEqual(sum(1 for item in calls if item[0] == "ba-write-prototype"), 1)
self.assertEqual(sum(1 for item in calls if item[0] == "qa-write-cases"), 1)
def test_tail_runs_facts_then_release(self):
calls = []
log = []
end = Runner(load_preset(), happy_answers(), fake_agent(calls), "master", log).run()
self.assertEqual(end, "shipped")
order = [item[0] for item in calls]
self.assertLess(order.index("qa-run-e2e"), order.index("ba-gen-facts"))
self.assertLess(order.index("ba-gen-facts"), order.index("dev-release-plan"))
self.assertEqual(order[-1], "dev-release-plan")
milestones = [item["title"] for item in log if item.get("event") == "milestone"]
self.assertEqual(milestones, ["提测", "人工补测"])
def test_e2e_revise_then_pass(self):
answers = happy_answers()
answers["test-decision"] = ["修订", "通过"]
calls = []
end = Runner(load_preset(), answers, fake_agent(calls), "master", []).run()
self.assertEqual(end, "accepted")
self.assertEqual(end, "shipped")
self.assertEqual(sum(1 for item in calls if item[0] == "qa-run-e2e"), 2)
def test_e2e_reject_returns_to_dev(self):
@@ -228,7 +243,7 @@ class RunTest(unittest.TestCase):
answers["test-decision"] = ["打回开发", "通过"]
calls = []
end = Runner(load_preset(), answers, fake_agent(calls), "master", []).run()
self.assertEqual(end, "accepted")
self.assertEqual(end, "shipped")
self.assertEqual(sum(1 for item in calls if item[0] == "dev-plan"), 2)
self.assertEqual(sum(1 for item in calls if item[0] == "dev-plan-amend"), 1)
self.assertEqual(sum(1 for item in calls if item[0] == "dev-build"), 4)