Buckets:
| # 模块二:TDD开发流程 | |
| ## 前置 | |
| 用户已确认《需求规格说明书》。节点门2已通过。 | |
| 模块二是 TDD 执行阶段,不是继续讨论需求的阶段。需求、功能、规则、红线、边界已经在模块一确定。模块二只能执行 `execution-manifest.json`;如果发现需求或边界未决,必须停止并回到模块一修复产物,不能在实现阶段自行发散或改方向。 | |
| ## 流程 | |
| ### Step -1: 构建当前角色提示词 | |
| 模块二任何角色启动前,先根据项目类型和任务切片生成提示词: | |
| ```powershell | |
| python scripts/build_agent_prompt.py --task-dir <任务目录> --role developer --task-id <任务ID> | |
| python scripts/build_agent_prompt.py --task-dir <任务目录> --role code-qa | |
| python scripts/build_agent_prompt.py --task-dir <任务目录> --role func-qa | |
| python scripts/build_agent_prompt.py --task-dir <任务目录> --role user-acceptance | |
| ``` | |
| 提示词必须包含:项目类型、当前任务边界、验收标准、角色不知道什么、项目特定关注点。 | |
| 提示词还必须包含:不得重新讨论产品方向;不得扩展 manifest 之外的功能;发现未决边界时停止并上报。 | |
| ### Step 0: 节点门3验证 | |
| 运行 `python scripts/validate_execution_manifest.py <执行清单JSON路径>` | |
| - tasks非空 ✓ | |
| - spec_checksum匹配 ✓ | |
| - 不通过 → 拒绝执行,回模块一修复 | |
| 加载 [step-2-0-manifest.md](../step-guides/step-2-0-manifest.md) | |
| ### Step 1: 开发(开发Agent,只知本任务) | |
| 创建开发Agent → 完成当前任务: | |
| - 写测试(测试先行) | |
| - 写代码 | |
| - 验证产出 | |
| 开发Agent加载 [step-2-1-develop.md](../step-guides/step-2-1-develop.md),不知道后面有code-qa和func-qa。 | |
| ### Step 1.5: 测试闸门(C27) | |
| Codex Harness 在Step 1完成后强制检查: | |
| 运行 `python scripts/run_test_suite.py <项目目录>` | |
| - 每个源文件必须有对应 test_*.py 或 *_test.py | |
| - 不通过 → Step 1 打回,创建整改任务(开发Agent不知道整改原因) | |
| ### Step 2: 代码技术验收(code-qa Agent,只知验收) | |
| code-qa Agent执行: | |
| 1. 集成测试(实际执行并记录结果) | |
| 2. 静态检查(运行lint并记录) | |
| 3. 安全扫描 | |
| 4. 产出《代码技术验收报告》(C30: 包含执行证据) | |
| code-qa Agent加载 [step-2-2-code-qa.md](../step-guides/step-2-2-code-qa.md),不知道func-qa存在。 | |
| ### Step 3: 功能业务验收(func-qa Agent,Codex Browser + GPT-5.5/Codex 视觉,只知验收) | |
| func-qa Agent执行: | |
| 1. e2e测试 | |
| 2. 浏览器实操(截图与 GPT-5.5/Codex 视觉分析) | |
| 3. 功能比对 | |
| 4. 产出《功能业务验收报告》(C30: 包含验收通过数/失败数) | |
| func-qa Agent加载 [step-2-3-func-qa.md](../step-guides/step-2-3-func-qa.md),只知道code-qa已通过。 | |
| ### Step 4: 用户侧验收(user-acceptance) | |
| 像真实用户一样从入口执行核心场景,而不是只看代码或单元测试。 | |
| 不同项目使用不同验收方式: | |
| - web/mobile:用 Browser 点击 UI,覆盖桌面/移动视口,记录截图和用户流程。 | |
| - cli:像终端用户一样运行命令,记录 command、exit code、stdout/stderr。 | |
| - data-pipeline:使用样例 input 跑完整流程,记录 output/schema/行数。 | |
| - quant-trading:使用模拟或回测场景,记录 risk、position、drawdown;不得宣称实盘安全。 | |
| - video/design:打开导出物或渲染帧,记录 screenshot/frame/layout/format。 | |
| 产出 `user-acceptance-report.md`,然后运行: | |
| ```powershell | |
| python scripts/check_user_acceptance.py <任务目录> | |
| ``` | |
| 不通过 → 回到对应实现或验收步骤整改。 | |
| ### Step 5: 审计闸门 | |
| 运行 `python scripts/harness_auditor.py --pipeline <l1|l2|l3> <项目目录> <harness根目录>` | |
| - 通过 → 交付用户 | |
| - 失败 → 打回整改 | |
| 加载 [step-2-4-audit.md](../step-guides/step-2-4-audit.md) | |
| ## 整改流程 | |
| 如果Step 1.5/Step 2/Step 3/Step 4失败: | |
| 1. 创建整改分析角色/代理 → 分析根因 → 产出整改指令 | |
| 2. 主Agent将整改作为新任务 → 回到Step 1(开发Agent不知道这是整改) | |
| ## 步骤隔离原则 | |
| - 每个角色/子Agent只做当前步骤 | |
| - 不知道下一步是什么 | |
| - 整改后的任务作为新任务派发 | |
| ## Context lifecycle | |
| Module 2 must not carry a long hidden conversation from developer to QA. For | |
| each developer, code-qa, func-qa, and user-acceptance role run: | |
| 1. build the role prompt with `scripts/build_agent_prompt.py`; | |
| 2. load only the current manifest task slice and needed artifacts; | |
| 3. write the required output artifact; | |
| 4. record the run with `scripts/record_agent_result.py`; | |
| 5. close or discard the role context. | |
| Later roles may read `.harness/context-ledger.json` and named artifacts only. | |
| They must not rely on the previous role's private scratch context. | |
Xet Storage Details
- Size:
- 4.88 kB
- Xet hash:
- 62977c21b4207d8eb381120df73c951e9cd0ec395307ac3b36c5fc371bb77af7
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.