OoO
|
abd722986e
|
fix(autoheal): preflight + shell || true 結合性 — 解 24h 100% no-op
CD Pipeline / deploy (push) Successful in 2m23s
Debugger 五階段方法論 root cause(2026-05-03):
ADR-020 政策層 100% 達成(reasoning 全 auto_fix=enabled),但 AiderHeal
執行層 24 小時 0 次 push 成功,全部 silent fail。
兩根因疊加:
#1 (config) AIDER_REPO_PATH=/home/wooo/ewoooc 在 110 主機不存在
→ 寫 SOP docs/runbooks/aider-heal-110-setup-sop.md 給統帥手動執行
#2 (code) setup_cmds 結尾 `git stash 2>&1 || true` 因 shell 結合性等同
`(A && B && C && D) || true`,cd 失敗整 chain rc=0 被吞,
line 261 if rc != 0 永不觸發 → setup_failed 從未被 log
#4 (code) 缺 preflight,環境壞掉時靜默走完整 pipeline 印 no_diff
本次程式碼修復:
• execute_code_fix 開頭加 L0 preflight(test -d $REPO/.git)
失敗 fail-fast + Telegram 嚴重告警 + 指向 SOP
• setup_cmds 改 `A && B && C && (D || true)` 用 subshell 限縮 || true
• 全檔 5 處 `cd $REPO_PATH` 統一改 `cd shlex.quote(REPO_PATH)`
避免下次有人複製 cd chain 又踩同類 shell quoting bug
SOP 同步處理 critic High-2 + Medium-6:
• 步驟 2 改用 SSH clone(git clone gitea-autoheal:...)
避免 HTTP clone 在 private repo 卡帳密 + 跟步驟 1 部署的 key 不關聯
• 步驟 4b 修引號嵌套(heredoc + 單引號保護),原版永遠 false positive
Critic 審過 Approve to commit;Medium-2/3/4(速率限制 / log 加 stderr /
新增 preflight unit test)排 follow-up,不阻擋本次。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-03 01:55:34 +08:00 |
|