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 ✓
RIPER-5 任务执行记录 — ghbot v1.1.0 第二轮迭代
任务ID: riper5_20260823_ghbot_v110 创建时间: 2026-08-23 用户需求: 继续《下一步改进指南.md》剩余项落地,真实验证、推送、发行版
1. 研究分析(已完成)
v1.0.0 后指南中仍未落地项盘点:
- D-02(三处 listPullRequestFiles 重复)
- D-09(redactProcessArgs 脆弱索引)、D-13(运行时目录硬编码)
- 6.1(审查输出排版)、6.3(命令 ack 反馈)、8.4(错误输出脱敏接线)
2/3. 方案与计划
按「低风险重构 → 新功能 → 安全接线」顺序推进,每步 TDD + 原子提交。
4. 执行日志(全部完成 ✅)
| 提交 | 指南项 | 内容 | 验证 |
|---|---|---|---|
941e1d2 |
D-02 | 三处重复函数统一到 src/github/pulls.ts |
test 134 全绿 |
d9666c9 |
D-13 | GHBOT_RUNTIME_DIR + src/runtimePaths.ts 集中目录;cacheStore/gooseCli/chat/conflictResolver/cache 五处接入;+3 测试 |
test 137 全绿 |
a35587e |
6.1 | 状态横幅 + <details> 折叠 + 加粗计数;format 测试扩展断言 |
test 137 全绿 |
3408c9d |
6.3 | formatCommandAckMessage 统一 ack 文案;processor 接线;+2 测试 |
test 139 全绿 |
cd30a49+65907f4 |
D-09 | 显式哨兵参数替代标签匹配;新旧测试同步更新 | test 139 全绿 |
31ff19e+8304c98 |
8.4 | commandFailureOutput 输出经 redactSecrets 掩码后进入 prompt/评论/日志;+3 测试 |
test 142 全绿 |
4.3 最终门禁(实测输出)
npm run typecheck → 通过
npm run lint → 通过
npm run format:check → All matched files use Prettier code style!
npm test → tests 142 / pass 142 / fail 0
覆盖率 → all files 62.51% / branches 82.65% / functions 69.34%
npm run build → dist/ 可加载
E2E 回归(生产构建真实 HTTP)
GET /healthz → {"ok":true,"webhook":true}
POST 合法签名 → {"ok":true}
GET /metrics → ghbot_webhook_deliveries_total{event="issue_comment",result="accepted"} 1
远端 CI 与交付
CI run 32617043840 (push main): typecheck-lint-test → success (35s)
推送: 5a2e902..8304c98 main → lza6/ghbot-Nodeloc
标签: v1.1.0 已推送
发行版: https://github.com/lza6/ghbot-Nodeloc/releases/tag/v1.1.0
5. 回顾总结
成果
- 指南缺陷表 D-02/D-09/D-13 全部关闭;6.1/6.3/8.4 三项体验与安全项落地
- 测试 134 → 142;总体覆盖率 61.64% → 62.51%
经验
- node -e 内联脚本做跨文件批量替换时,正则转义极易失配——复杂替换改用 Edit 工具更可靠(8.4 第一次替换静默失败即为教训)
- 改共享函数签名时必须同轮 grep 所有测试调用点,否则出现"实现绿、旧测试红"
- Windows 下后台启动服务后立即 curl 可能撞上启动窗口,sleep 2 重试即可,不必重启
剩余建议(下一轮候选)
- 7.1 事件路由器解耦(processor.ts 编排覆盖率的根本解法)
- 6.4 语言字典(BOT_REPLY_LANGUAGE)
- 8.5 goose CLI 校验和固定下载
- 4.4 审查期 head 变化的追加段落合并审查