Files
Arcrun/cli/harness
uncle6me-web 68da769c1b fix(harness): guard hook 區分「執行 acr push」vs「展示指令」(壓測 §9.5)
舊版 grep "acr push" 連「在 echo/heredoc 裡提到 push 字串」都擋,
導致 CC 連「把可貼上的指令印給使用者看」都做不到 → 反而違反
user-cc-harness §0.5「擋下必須印出正路」自身鐵則(連選②都印不出)。

修法(啟發式,誠實標明非完美,mindset §7):
- awk 抽掉 heredoc 主體 → 剩下「實際執行命令列」才看 push 是否在命令位置
  (行首 / ; & | && ||)。真執行擋、純展示放行。
- block 訊息補上選②可貼指令(符合 §0.5)。
- shell 層無法 100% 區分執行/展示,偷渡(bash<<EOF / $(...))由上游安全分類器擋。

驗證:8/8 案例正確(真執行全 BLOCK、純展示全 ALLOW)+ 邊角;bash -n OK。
SDD: .agents/specs/user-cc-harness/tasks.md A6 + C9。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 19:11:28 +08:00
..