fix(worklog): Stop hook 補上 --use-system-ca,刪除已改寫完成的 worklog.sh

實測 worklog.mjs 全流程(含真的呼叫 claude -p 濃縮並寫入 Gitea wiki 週頁)
時發現 hooks.json 的 Stop command 漏加 --use-system-ca:本環境的 TLS
攔截代理會讓 Node fetch 預設信任鏈驗證失敗(HTTP 0),造成 wiki_api.mjs
誤判兩個 token 來源都失效而寫入失敗;shared/code/persona 的
version-guard hook 都有這個旗標,只有 doc 的 worklog Stop hook 漏掉。
加上後於既有 knowledges/Plan wiki 建立測試週頁重測通過(七欄格式正確、
兩次呼叫的 marker 各自附加不互相覆蓋),驗證後已刪除該測試頁。

worklog.sh 已確認可被 worklog.mjs 完全取代,直接刪除、不保留 bash
fallback;grep -rn 'worklog.sh' doc/ 回傳零筆。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-17 15:22:29 +08:00
co-authored by Claude Sonnet 5
parent d31aa53fc3
commit 3193cce249
2 changed files with 1 additions and 295 deletions
+1 -1
View File
@@ -18,7 +18,7 @@
"hooks": [
{
"type": "command",
"command": "rel='scripts/worklog/worklog.mjs'; own='doc'; plug='jsc-doc'; root=\"${CLAUDE_PLUGIN_ROOT:-}\"; if [ -n \"$root\" ] && [ -f \"$root/$rel\" ]; then exec node \"$root/$rel\"; fi; for base in \"$HOME/.claude/plugins/cache\" \"$HOME/.codex/plugins/cache\" \"$HOME/.copilot/installed-plugins\"; do for dir in \"$base/$own/$plug\" \"$base\"; do s=$(find \"$dir\" -path \"*/$plug/*/$rel\" -type f 2>/dev/null | sort -V | tail -n 1); if [ -n \"$s\" ]; then exec node \"$s\"; fi; done; done; exit 0",
"command": "rel='scripts/worklog/worklog.mjs'; own='doc'; plug='jsc-doc'; root=\"${CLAUDE_PLUGIN_ROOT:-}\"; if [ -n \"$root\" ] && [ -f \"$root/$rel\" ]; then exec node --use-system-ca \"$root/$rel\"; fi; for base in \"$HOME/.claude/plugins/cache\" \"$HOME/.codex/plugins/cache\" \"$HOME/.copilot/installed-plugins\"; do for dir in \"$base/$own/$plug\" \"$base\"; do s=$(find \"$dir\" -path \"*/$plug/*/$rel\" -type f 2>/dev/null | sort -V | tail -n 1); if [ -n \"$s\" ]; then exec node --use-system-ca \"$s\"; fi; done; done; exit 0",
"timeout": 60
}
]