requirement.html
8.05 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
127
128
129
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width,initial-scale=1" />
<title>原始需求 · 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="requirement.html">
<div class="shell">
<aside id="sidebar"></aside>
<main class="page">
<header class="page-head">
<div class="crumb"><span class="pill">01 · OVERVIEW</span><span class="sep">/</span><span>原始需求</span></div>
<h1>原始需求</h1>
<p class="deck">用户提出的需求原话照搬,再做结构化解析。本页是后续所有设计决策的「源头」。</p>
</header>
<article class="body">
<section>
<h2>Verbatim · 人类原话</h2>
<div class="callout">
<p style="margin:0;color:var(--ink)">
「我需要一个能实现自动化对代码进行需求整理成 HTML 格式的 PRD、SDD,然后按照 docs 的分解的功能列表,挨个 Unit 开发完成前后端代码,并实现 Unit Test,形成 Unit Loop。当所有 Unit 开发完成,则实现 Integration Test 集成测试。如果集成测试有 Bug,则修改最早期的 PRD、SDD 文档,然后再开发各自的 Unit,实现 Unit 开发测试,然后再集成测试。实现一个小 Loop (Unit) 和一个大 Loop (Integration) 两层的 Loop 的自动化开发流程。然后人类的需求和反馈形成第三层 Loop——人类发送一个新的需求,更新到 PRD 文档中,然后依据 PRD 修改 SDD,再增量 Unit、Integration 开发,直至功能开发完成。」
</p>
</div>
</section>
<section>
<h2>结构化解析 · 6 条硬约束</h2>
<table>
<thead><tr><th>ID</th><th>约束</th><th>系统侧承诺</th><th>对应 Agent / 组件</th></tr></thead>
<tbody>
<tr><td>R1</td><td>PRD / SDD 必须是 <b>HTML</b> 格式</td><td>新 <code>DocStore</code>:HTML 模板 + section 级补丁</td><td>PM · Architect</td></tr>
<tr><td>R2</td><td>SDD 含可机读「功能列表」</td><td>SDD 同步产 <code>units.json</code>(DAG 索引)</td><td>Architect</td></tr>
<tr><td>R3</td><td>Unit 级前后端代码 + Unit Test</td><td>每 Unit 触发 Coder → Tester</td><td>Coder · Tester</td></tr>
<tr><td>R4</td><td>全部 Unit 通过 → 集成测试</td><td>LoopController L2 闸门</td><td>LoopController · Integrator</td></tr>
<tr><td>R5</td><td>集成失败 → 回写 PRD/SDD → 再跑 Unit</td><td>BugTriager 归因 → Architect 应用 patch → 受影响 Unit reset</td><td>BugTriager · Architect</td></tr>
<tr><td>R6</td><td>人类新需求 → 增量重跑</td><td><code>POST /api/devloop/requirement</code>,PM 增量更新 PRD</td><td>PM</td></tr>
</tbody>
</table>
</section>
<section>
<h2>三个隐含约束(用户没说但必须有)</h2>
<div class="grid-3">
<div class="card"><h4>H1 · 收敛性</h4><p>无论哪一层 Loop,都必须有「全局 retry 预算」,避免死循环。</p></div>
<div class="card"><h4>H2 · 可观测性</h4><p>人类要能随时看到「现在卡在哪一步、哪个 Agent、哪个 Unit」。否则 L3 反馈失去意义。</p></div>
<div class="card"><h4>H3 · 文档可追溯</h4><p>每个 rev 的 PRD/SDD 都要归档,能 diff 出本轮反馈引入了什么变化。</p></div>
</div>
</section>
<section>
<h2>用户原话 → 设计映射</h2>
<p>把上面这段话从左到右画成「需求 → 设计」对照流:</p>
<svg viewBox="0 0 1100 320" width="100%" role="img" aria-label="需求 → 设计映射">
<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="11" fill="#0E0E10">
<rect x="20" y="40" width="200" height="50" rx="4" fill="#ECE4FB" stroke="#6E48C3"/>
<text x="120" y="60" text-anchor="middle" font-weight="700">人类自然语言需求</text>
<text x="120" y="78" text-anchor="middle" font-size="10">"再加 OAuth..."</text>
<rect x="280" y="40" width="200" height="50" rx="4" fill="#fff" stroke="#0E0E10"/>
<text x="380" y="60" text-anchor="middle">PM Agent</text>
<text x="380" y="78" text-anchor="middle" font-size="10">产出 prd.html</text>
<rect x="540" y="40" width="200" height="50" rx="4" fill="#fff" stroke="#0E0E10"/>
<text x="640" y="60" text-anchor="middle">Architect</text>
<text x="640" y="78" text-anchor="middle" font-size="10">产出 sdd.html + units.json</text>
<rect x="800" y="40" width="280" height="50" rx="4" fill="#E2F2EA" stroke="#0E8C5A"/>
<text x="940" y="60" text-anchor="middle">LoopController → L1</text>
<text x="940" y="78" text-anchor="middle" font-size="10">Coder · Tester per unit</text>
<rect x="20" y="130" width="200" height="50" rx="4" fill="#F7E8D2" stroke="#C77C2C"/>
<text x="120" y="150" text-anchor="middle" font-weight="700">L2 集成测试</text>
<text x="120" y="168" text-anchor="middle" font-size="10">Integrator</text>
<rect x="280" y="130" width="200" height="50" rx="4" fill="#FCE7E2" stroke="#C7341A"/>
<text x="380" y="150" text-anchor="middle">失败 → 归因</text>
<text x="380" y="168" text-anchor="middle" font-size="10">BugTriager</text>
<rect x="540" y="130" width="200" height="50" rx="4" fill="#fff" stroke="#0E0E10"/>
<text x="640" y="150" text-anchor="middle">patch SDD</text>
<text x="640" y="168" text-anchor="middle" font-size="10">Architect</text>
<rect x="800" y="130" width="280" height="50" rx="4" fill="#E2F2EA" stroke="#0E8C5A"/>
<text x="940" y="150" text-anchor="middle">reset 受影响 Unit → 回 L1</text>
<rect x="20" y="220" width="200" height="50" rx="4" fill="#ECE4FB" stroke="#6E48C3"/>
<text x="120" y="240" text-anchor="middle" font-weight="700">人类新反馈 (L3)</text>
<text x="120" y="258" text-anchor="middle" font-size="10">POST /requirement</text>
<rect x="280" y="220" width="200" height="50" rx="4" fill="#fff" stroke="#0E0E10"/>
<text x="380" y="240" text-anchor="middle">PM 增量补 PRD</text>
<rect x="540" y="220" width="200" height="50" rx="4" fill="#fff" stroke="#0E0E10"/>
<text x="640" y="240" text-anchor="middle">Architect diff SDD</text>
<rect x="800" y="220" width="280" height="50" rx="4" fill="#E2F2EA" stroke="#0E8C5A"/>
<text x="940" y="240" text-anchor="middle">增量 Unit + L2</text>
<g stroke="#0E0E10" fill="none" marker-end="url(#arr)">
<line x1="220" y1="65" x2="275" y2="65"/>
<line x1="480" y1="65" x2="535" y2="65"/>
<line x1="740" y1="65" x2="795" y2="65"/>
<line x1="220" y1="155" x2="275" y2="155"/>
<line x1="480" y1="155" x2="535" y2="155"/>
<line x1="740" y1="155" x2="795" y2="155"/>
<line x1="220" y1="245" x2="275" y2="245"/>
<line x1="480" y1="245" x2="535" y2="245"/>
<line x1="740" y1="245" x2="795" y2="245"/>
</g>
</g>
</svg>
</section>
</article>
<nav class="prev-next"></nav>
<footer class="site"><div><b>Section</b>01 · Overview</div><div><b>Page</b>requirement.html</div></footer>
</main>
</div>
<script src="assets/shell.js"></script>
</body>
</html>