Files
ghbot/计划与指南/riper5_20260823_ghbot_v110.md
lezi-fun 9e47ab339e feat: sync ghbot-Nodeloc v1.2.0 capabilities into upstream
Merges all 33 commits from lza6/ghbot-Nodeloc (v1.0.0 through v1.2.0)
while keeping both sides' features in every conflicted file:

- EventRouter dispatch extracted from runReview.ts (7.1), with the
  runtime environment block preserved on the review-start comment
- Unified command ack messages (6.3) combined with the collapsed
  runtime environment block and bot signature on /recheck replies
- Status banner and collapsible unposted findings in review bodies (6.1)
- Centralized runtime directories behind GHBOT_RUNTIME_DIR (D-13);
  webhook knowledge cache now lives under tempRootDirectory()
- Production hardening for merge races, timeouts, webhook ops;
  atomic temp-file rename for R2 cache restores kept from upstream
- Webhook parity retained: triage events gated by WEBHOOK_TRIAGE_ENABLED,
  read-only command guidance, repository knowledge injection,
  runtime environment block on webhook chat replies
- Sanitization/secret redaction centralization, error-aware retry,
  duplicate merge prevention, in-process webhook retries, /metrics
- Infra: eslint/prettier gates with CI verify workflow, docs archives

typecheck, eslint, prettier format:check, and 164 tests all pass.
2026-08-24 11:47:28 +08:00

79 lines
3.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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 最终门禁(实测输出)
```text
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)
```text
GET /healthz → {"ok":true,"webhook":true}
POST 合法签名 → {"ok":true}
GET /metrics → ghbot_webhook_deliveries_total{event="issue_comment",result="accepted"} 1
```
### 远端 CI 与交付
```text
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%
### 经验
1. node -e 内联脚本做跨文件批量替换时,正则转义极易失配——复杂替换改用 Edit 工具更可靠(8.4 第一次替换静默失败即为教训)
2. 改共享函数签名时必须同轮 grep 所有测试调用点,否则出现"实现绿、旧测试红"
3. Windows 下后台启动服务后立即 curl 可能撞上启动窗口,sleep 2 重试即可,不必重启
### 剩余建议(下一轮候选)
- 7.1 事件路由器解耦(processor.ts 编排覆盖率的根本解法)
- 6.4 语言字典(BOT_REPLY_LANGUAGE)
- 8.5 goose CLI 校验和固定下载
- 4.4 审查期 head 变化的追加段落合并审查