agents-overview.html
9.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width,initial-scale=1" />
<title>六个 Agent 角色 · LemonBoss PRD</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,500;9..144,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="assets/shell.css" />
</head>
<body data-page="agents-overview.html">
<div class="shell">
<aside id="sidebar"></aside>
<main class="page">
<header class="page-head">
<div class="crumb"><span class="pill">03 · AGENTS</span><span class="sep">/</span><span>角色总览</span></div>
<h1>六个 Agent 角色</h1>
<p class="deck">系统由六个无状态 Agent 组成。每个 Agent 都符合「文档输入 → 思考 → 文档输出」的纯函数式约定。Agent 之间不直接通信,仅通过 DocStore / UnitRegistry 握手。</p>
</header>
<article class="body">
<section>
<h2>职责矩阵</h2>
<table>
<thead><tr><th>Agent</th><th>所属 Loop</th><th>触发条件</th><th>主要产物</th><th>专属页</th></tr></thead>
<tbody>
<tr><td><b>PM</b></td><td><span class="tag L3">L3</span></td><td>人类新需求</td><td><code>prd.html</code> (rev+1)</td><td><a href="agents-pm.html">→ 详情</a></td></tr>
<tr><td><b>Architect</b></td><td><span class="tag L3">L3</span> + <span class="tag L2">L2</span></td><td>PRD 改变 / L2 失败</td><td><code>sdd.html</code> + <code>units.json</code></td><td><a href="agents-architect.html">→ 详情</a></td></tr>
<tr><td><b>Coder</b></td><td><span class="tag L1">L1</span></td><td>Unit 进 coding 态</td><td><code>units/{id}/code/</code> + <code>contract.json</code></td><td><a href="agents-coder.html">→ 详情</a></td></tr>
<tr><td><b>Tester</b></td><td><span class="tag L1">L1</span></td><td>Coder 提交后</td><td><code>tests/</code> + <code>runs/result.json</code></td><td><a href="agents-tester.html">→ 详情</a></td></tr>
<tr><td><b>Integrator</b></td><td><span class="tag L2">L2</span></td><td>L2 闸门打开</td><td><code>integration/runs/{id}/result.json</code></td><td><a href="agents-integrator.html">→ 详情</a></td></tr>
<tr><td><b>BugTriager</b></td><td><span class="tag L2">L2</span></td><td>Integrator 失败</td><td><code>triage.json</code></td><td><a href="agents-triager.html">→ 详情</a></td></tr>
</tbody>
</table>
</section>
<section>
<h2>调用拓扑(谁调用谁)</h2>
<p>白色箭头是<b>直接调用</b>,虚线箭头是<b>通过文档触发</b>。LoopController 是唯一编排者,所有 Agent 之间永远不直接调用。</p>
<svg viewBox="0 0 1100 460" width="100%" role="img" aria-label="Agent 调用拓扑">
<defs><marker id="arr" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto"><path d="M0,0 L10,5 L0,10 Z" fill="#0E0E10"/></marker></defs>
<g font-family="JetBrains Mono" font-size="12">
<rect x="430" y="20" width="240" height="50" rx="6" fill="#FCE7E2" stroke="#C7341A" stroke-width="1.5"/>
<text x="550" y="50" text-anchor="middle" font-weight="700">LoopController</text>
<rect x="40" y="140" width="200" height="60" rx="6" fill="#ECE4FB" stroke="#6E48C3"/><text x="140" y="165" text-anchor="middle">PM Agent</text><text x="140" y="183" text-anchor="middle" font-size="10" fill="#3B3B40">L3</text>
<rect x="280" y="140" width="200" height="60" rx="6" fill="#ECE4FB" stroke="#6E48C3"/><text x="380" y="165" text-anchor="middle">Architect</text><text x="380" y="183" text-anchor="middle" font-size="10" fill="#3B3B40">L3 + L2</text>
<rect x="520" y="140" width="200" height="60" rx="6" fill="#E2F2EA" stroke="#0E8C5A"/><text x="620" y="165" text-anchor="middle">Coder</text><text x="620" y="183" text-anchor="middle" font-size="10" fill="#3B3B40">L1</text>
<rect x="760" y="140" width="200" height="60" rx="6" fill="#E2F2EA" stroke="#0E8C5A"/><text x="860" y="165" text-anchor="middle">Tester</text><text x="860" y="183" text-anchor="middle" font-size="10" fill="#3B3B40">L1</text>
<rect x="280" y="280" width="200" height="60" rx="6" fill="#F7E8D2" stroke="#C77C2C"/><text x="380" y="305" text-anchor="middle">Integrator</text><text x="380" y="323" text-anchor="middle" font-size="10" fill="#3B3B40">L2</text>
<rect x="520" y="280" width="200" height="60" rx="6" fill="#F7E8D2" stroke="#C77C2C"/><text x="620" y="305" text-anchor="middle">BugTriager</text><text x="620" y="323" text-anchor="middle" font-size="10" fill="#3B3B40">L2</text>
<rect x="380" y="400" width="340" height="40" rx="6" fill="#fff" stroke="#0E0E10"/><text x="550" y="425" text-anchor="middle">DocStore · UnitRegistry · 文件系统</text>
<!-- direct calls -->
<g stroke="#0E0E10" fill="none" marker-end="url(#arr)">
<line x1="500" y1="70" x2="160" y2="135"/>
<line x1="520" y1="70" x2="380" y2="135"/>
<line x1="570" y1="70" x2="620" y2="135"/>
<line x1="600" y1="70" x2="860" y2="135"/>
<line x1="540" y1="70" x2="400" y2="275"/>
<line x1="580" y1="70" x2="620" y2="275"/>
</g>
<!-- via docs -->
<g stroke="#6c6c6c" fill="none" stroke-dasharray="4 3" marker-end="url(#arr)">
<line x1="620" y1="200" x2="500" y2="395"/>
<line x1="380" y1="200" x2="520" y2="395"/>
<line x1="380" y1="340" x2="500" y2="395"/>
<line x1="620" y1="340" x2="600" y2="395"/>
<line x1="140" y1="200" x2="450" y2="395"/>
</g>
</g>
</svg>
<p class="sig">实线 = 直接 callAgent · 虚线 = 通过文档系统握手</p>
</section>
<section>
<h2>Agent 元数据模板</h2>
<p>所有六个 Agent 都在 <code>system/agents/_registry.json</code> 注册。模板结构对齐 LemonBoss 现有 <code>{id, name, type, ...}</code> 约定,新增 <code>devloop</code> 字段标识它属于本系统。</p>
<pre class="code"><span class="p">{</span>
<span class="n">"id"</span>: <span class="s">"devloop-coder"</span>,
<span class="n">"name"</span>: <span class="s">"Coder Agent"</span>,
<span class="n">"type"</span>: <span class="s">"executor"</span>,
<span class="n">"devloop"</span>: <span class="p">{</span>
<span class="n">"loop"</span>: <span class="s">"L1"</span>,
<span class="n">"role"</span>: <span class="s">"code"</span>,
<span class="n">"upstream"</span>: <span class="p">[</span><span class="s">"architect"</span><span class="p">]</span>,
<span class="n">"downstream"</span>: <span class="p">[</span><span class="s">"tester"</span><span class="p">]</span>
<span class="p">}</span>,
<span class="n">"cli"</span>: <span class="p">{</span>
<span class="n">"model"</span>: <span class="s">"claude-sonnet-4-6"</span>,
<span class="n">"toolPolicy"</span>: <span class="p">[</span><span class="s">"Read"</span>, <span class="s">"Edit"</span>, <span class="s">"Write"</span>, <span class="s">"Bash"</span><span class="p">]</span>,
<span class="n">"systemPromptFile"</span>: <span class="s">"system/agents/devloop-coder/prompt.md"</span>
<span class="p">}</span>,
<span class="n">"sandbox"</span>: <span class="p">{</span>
<span class="n">"cwd"</span>: <span class="s">"data/companies/{cid}/projects/{pid}/units/{unitId}/"</span>,
<span class="n">"writeAllowList"</span>: <span class="p">[</span><span class="s">"code/**"</span>, <span class="s">"contract.json"</span>, <span class="s">"coder.log"</span><span class="p">]</span>
<span class="p">}</span>
<span class="p">}</span></pre>
</section>
<section>
<h2>模型分级</h2>
<p>不同 Agent 对模型能力的需求差异很大。默认配置如下,可在每个项目的 <code>project.json</code> 覆盖。</p>
<table class="dense">
<thead><tr><th>Agent</th><th>默认模型</th><th>原因</th></tr></thead>
<tbody>
<tr><td>PM</td><td>Sonnet 4.6</td><td>对话场景多,Opus 不划算</td></tr>
<tr><td>Architect</td><td><b>Opus 4.7</b></td><td>需要架构判断 + 契约设计</td></tr>
<tr><td>Coder</td><td>Sonnet 4.6</td><td>代码生成主力,性价比最高</td></tr>
<tr><td>Tester</td><td>Sonnet 4.6</td><td>跑命令 Haiku 够用,但写好的 negative case 需要中等推理;Tester 调用次数有限,Sonnet 性价比可接受</td></tr>
<tr><td>Integrator</td><td>Sonnet 4.6</td><td>需要读多个 Unit 代码 + 跑命令</td></tr>
<tr><td>BugTriager</td><td><b>Opus 4.7</b></td><td>归因质量直接决定 L2 收敛性</td></tr>
</tbody>
</table>
</section>
</article>
<nav class="prev-next"></nav>
<footer class="site"><div><b>Section</b>03 · Agents</div><div><b>Page</b>agents-overview.html</div></footer>
</main>
</div>
<script src="assets/shell.js"></script>
</body>
</html>