M0: Test coverage expansion (151 → 321 tests, 61% → 66% lines) - normalizeKnowledge CRLF/LF normalization fix - gooseReviewer: 11 tests, 97.35% coverage - r2 storage: 22 tests, 100% coverage - triage processor: 11 tests, exported buildTriagePrompt/labelName - webhook processor: 35 tests, 72.39% coverage - conflict resolver: 12 tests - review processor: 7 tests M1: Reliability hardening - Smart retry with jitter, maxTotalTimeoutMs, custom retryable predicate - MergeGuard: in-memory merge dedup tracker (100% coverage) - failureMessages: 7-category failure classifier (100% coverage) M2: Observability - MetricsCollector: Actions-run metrics with snapshot/markdown/reset - 11 tests, 100% coverage New files: 12 test files, 3 source modules All gates: typecheck ✓ lint ✓ format ✓ 321/321 tests ✓ build ✓
workflow_status.md — v2.0 迭代执行审计
任务: 下一步改进指南 M0-M7 完整落地(第一阶段已执行) 当前版本: v1.2.0 → v2.0 半程 更新: 2026-08-24
执行结果总览
| 门禁 | 状态 |
|---|---|
| npm run typecheck | ✅ 通过 |
| npm run lint | ✅ 0 error |
| npm run format:check | ✅ All matched files use Prettier code style! |
| npm test | ✅ 321 tests / 321 pass / 0 fail |
| npm run build | ✅ dist/ 构建成功 |
| 覆盖率 | 66.20% lines / 87.36% branches / 75.57% functions |
测试规模增长
| 指标 | 之前(v1.2.0) | 现在 | 增长 |
|---|---|---|---|
| 测试文件 | 36 | 48 | +12 |
| 测试数 | 151 | 321 | +170 |
| 覆盖率 lines | 61.41% | 66.20% | +4.79% |
| 覆盖率 branches | 82.98% | 87.36% | +4.38% |
| 覆盖率 functions | 69.97% | 75.57% | +5.60% |
新增文件清单
源文件(新模块)
| 文件 | 功能 | 覆盖 |
|---|---|---|
src/ai/failureMessages.ts |
失败分类与告警文案 | 100% |
src/review/merge-guard.ts |
合并防重入锁 | 100% |
src/metrics/collector.ts |
Actions 运行指标收集器 | 100% |
测试文件(新)
| 文件 | 测试数 | 覆盖范围 |
|---|---|---|
test/goose-reviewer.test.ts |
11 | 97.35% |
test/r2-storage.test.ts |
22 | 100% |
test/triage-processor-extra.test.ts |
11 | 已覆盖 |
test/webhook-processor-extra.test.ts |
35 | 72.39% |
test/conflict-resolver-extra.test.ts |
12 | 57.52% |
test/review-processor-extra.test.ts |
7 | 49.42% |
test/retry-extra.test.ts |
5 | 100% |
test/merge-guard.test.ts |
5 | 100% |
test/failure-messages.test.ts |
8 | 100% |
test/metrics-collector.test.ts |
9 | 100% |
已落地项
| 里程碑 | 任务 | 状态 |
|---|---|---|
| M0-1 | normalizeKnowledge 行尾归一 | ✅ |
| M0-2 | gooseReviewer 测试(26.57%→97.35%) | ✅ |
| M0-3 | r2 测试(49.01%→100%) | ✅ |
| M0-4 | triage 测试(56.77%→63.19%) | ✅ |
| M0-5 | webhook-processor 测试(63.90%→72.39%) | ✅ |
| M0-6 | conflict-resolver 测试(56.56%→57.52%) | ✅ |
| M0-7 | processor 测试(49.08%→49.42%) | ✅ |
| M1-1 | withRetry 智能重试(抖动+总超时) | ✅ |
| M1-3 | MergeGuard 合并防重入 | ✅ |
| M1-4 | failureMessages 失败分类 | ✅ |
| M2-2 | MetricsCollector 指标收集器 | ✅ |
未落地项
| 里程碑 | 任务 | 原因 |
|---|---|---|
| M0-8 | 集成测试 | 需 testcontainers/MinIO 等基础设施 |
| M1-2 | 陈旧检测(stale detection) | processor.ts 未拆分前修改风险高 |
| M1-3 | MergeGuard 接 processor.ts | 需处理器拆分后接入 |
| M2-1 | 全链路日志贯穿 | 需处理器拆分后接入 |
| M3 | 大文件拆分(processor/conflictResolver) | 单独里程碑 |
| M4-M7 | 后续里程碑 | 逐步推进 |
下一阶段建议
- 先提交当前成果(v2.0-alpha),推送到 origin
- 第二阶段处理 processor.ts 拆分(M3),再补 M1-2 陈旧检测
- 第三阶段做集成测试(M0-8)