Merge pull request 'fix: 系统性的分析和反思今天的开发历程 - Closes #79' (#80) from dev/issue-79-fix-quality-gate-process into main
CI / test (push) Successful in 10s
CI / test (push) Successful in 10s
This commit was merged in pull request #80.
This commit is contained in:
+40
-10
@@ -122,15 +122,26 @@ python scripts/agent_poller.py --action get --issue N
|
||||
|
||||
### 3. 开发 / 修复
|
||||
|
||||
**第零步:判断修复类型。** 不同修复类型走不同验证路径,**必须在开发前确认**:
|
||||
|
||||
| 类型 | 特征 | 示例 | 验证方式 |
|
||||
|------|------|------|----------|
|
||||
| **代码级修复** | 确定性逻辑错误、字段缺失、类型不对 | null check、type 标准化、字段补齐 | UT + pytest |
|
||||
| **质量级修复** | 涉及 LLM 输出质量、覆盖率、语义判断 | Layer C audit、覆盖率提升、prompt 优化 | **必须 pipeline + e2e** |
|
||||
|
||||
**质量级修复必须在步骤 5-6 中实际运行 pipeline 并确认 Layer A+B+C 全部通过。**
|
||||
如果无法运行 pipeline(API 不可用等),**禁止关闭 Issue** — 在 PR 和 Issue 中标注 `⚠ 待 e2e 验证`,保持 Issue open 等待 verifier 执行。
|
||||
|
||||
```
|
||||
1. git pull origin main
|
||||
2. git checkout -b dev/issue-N-<slug>
|
||||
3. 修改功能代码 + 更新/补充 UT 和接口集成测试
|
||||
4. python -m pytest -v # 本地全量 UT/集成测试
|
||||
5. python scripts/run_pipeline.py --input "input/<文档>.docx" # 运行完整 pipeline
|
||||
6. python -m pytest tests/acceptance/ -v --run-acceptance # e2e 验收 (Layer A+B+C)
|
||||
7. git commit -m "fix: <描述> - Closes #N"
|
||||
8. git push origin dev/issue-N-<slug>
|
||||
1. [判定] 是代码级修复还是质量级修复?
|
||||
2. git pull origin main
|
||||
3. git checkout -b dev/issue-N-<slug>
|
||||
4. 修改功能代码 + 更新/补充 UT 和接口集成测试
|
||||
5. python -m pytest -v # 本地全量 UT/集成测试
|
||||
6. [仅质量级修复] python scripts/run_pipeline.py --input "input/<文档>.docx"
|
||||
7. [仅质量级修复] python -m pytest tests/acceptance/ -v --run-acceptance
|
||||
8. git commit -m "fix: <描述> - Closes #N"
|
||||
9. git push origin dev/issue-N-<slug>
|
||||
```
|
||||
|
||||
**开发原则:**
|
||||
@@ -138,8 +149,21 @@ python scripts/agent_poller.py --action get --issue N
|
||||
- 新增功能必须有对应的测试覆盖
|
||||
- 关注 IR 一致性:对同一输入的多次运行结果应尽量稳定
|
||||
- 关注功能覆盖率:确保 IR 覆盖了输入文档中的功能点
|
||||
- **验证是实际功能验证,不是 dry-run**:`pytest` 通过只是门槛,必须用真实输入文档实际运行 pipeline 确认功能生效
|
||||
- **PR 前必须通过 e2e 验收 (Layer A+B+C)**:防止修复引入回归。若无法运行完整 pipeline(API 不可用等),至少在 PR 描述中注明
|
||||
- **代码级修复**:UT 通过即可关闭 Issue
|
||||
- **质量级修复**:必须 pipeline + e2e 全部通过才能关闭 Issue。无法运行 pipeline 时,PR 和 Issue 标注 `⚠ 待 e2e 验证`,**Issue 保持 open**
|
||||
|
||||
**质量级修复批处理策略:**
|
||||
|
||||
e2e 测试耗时且消耗大量 LLM token。对于质量级修复(Layer C audit、覆盖率、prompt 优化),**单个小改动看不出效果** — 只有 pytest 是无效测试。
|
||||
|
||||
| 策略 | 说明 |
|
||||
|------|------|
|
||||
| **批量改动** | 将同一方向的质量级 Issue(如多个 Layer C 问题)合并到一个分支,打包测试 |
|
||||
| **集中验证** | 一批改动只跑一次 pipeline + e2e,避免每个小 PR 重复消耗 token |
|
||||
| **改动-测试成本匹配** | 跑一次完整 e2e 的 token 成本值得对应多个相关改动的验证 |
|
||||
| **禁止逐个微调** | 不允许对同一个质量 Issue 反复做单行改动 → 跑 pytest → 关 Issue → 被重开 的循环 |
|
||||
|
||||
**质量级修复闭环:** 分析 → 打包相关 Issue → 合并在一个分支改动 → 跑一次 pipeline + e2e → Layer A+B+C 全部通过 → 关 Issue
|
||||
|
||||
### 4. 提交 PR
|
||||
|
||||
@@ -151,9 +175,15 @@ python scripts/agent_poller.py --action create-pr \
|
||||
--body "## Summary
|
||||
- <改动摘要>
|
||||
|
||||
## 修复类型
|
||||
- [ ] 代码级修复(UT 可验证)
|
||||
- [ ] 质量级修复(需 pipeline + e2e 验证)
|
||||
|
||||
## Test
|
||||
- [x] pytest 全量通过 (XX passed, Y skipped)
|
||||
- [x] UT / 集成测试已更新
|
||||
- [ ] pipeline 运行通过(仅质量级修复)
|
||||
- [ ] e2e 验收 Layer A+B+C 通过(仅质量级修复)
|
||||
|
||||
Closes #N"
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user