票上回碼解的保險寫回專案根,出貨線讀得到(inkstone/ISEP#156) #157
Reference in New Issue
Block a user
Delete Branch "fix/156-armed-lands-in-project"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes inkstone/ISEP#156
改了什麼
scripts/gitea-arm-to-github-armed.sh的.github-armed原本寫在「腳本所在的上一層」。plugin 發佈後,這個位置變成~/.claude/plugins/cache/inkstone/isep/<ver>/,出貨線讀不到(09-17 在 inkstone/arcrun-rag#202 c7598 實際撞到)。現在改寫到
gitea_arm_proj_dir,也就是${CLAUDE_PROJECT_DIR:-$(pwd)}:InkStoneCo/.github-armed也在這裡gitea-arm-check.sh讀 token 和待核請求的位置同樣在這裡。專案根猜錯時,check 會先 fail-closed,不會寫到錯的地方另外,擋下時印出的
gitea-arm-request.sh改成絕對路徑,並多印一行保險實際寫到哪裡。驗收(實跑)
bash hooks/tests/gitea-arm-to-github-armed.test.sh .→ 通過 18 條,失敗 0 條;用修之前的腳本跑有 11 條紅d20-guard.mjs的checkArmed(專案根)讀得到,並回傳mission=測試出貨 ISEP#156;讀 plugin 快取則失敗(對照組)。兩支閘在有保險時放行、沒有保險時擋下(對照組)CLAUDE_PROJECT_DIR時,退回 cwd,和閘的規則一致鄰近測試
hooks/tests/gitea-arm-check.test.sh .跑了 16 條,全部通過,沒有退步。沒驗的
ship.mjs --target prod不帶--confirm的預演「不查保險」(ship.mjs:745),所以預演輸出無法證明它認得保險。我改成直接呼叫 preflight 實際用的checkArmed版本
待總管定版(改到 plugin 會載入的 scripts/)。
🤖 Generated with Claude Code
gitea-arm-to-github-armed.sh 原本用腳本自己的上一層決定 .github-armed 寫在哪; plugin 發佈後那是 ~/.claude/plugins/cache/inkstone/isep/<ver>/, 於是保險寫進快取、印「已解」、ship.mjs 與各閘讀不到(arcrun-rag#202 c7598)。 改寫到 gitea_arm_proj_dir(${CLAUDE_PROJECT_DIR:-$(pwd)}),與 main-and-prod-push-guard/github-contact-guard/stage-before-prod-guard 讀的位置、 以及 check 自己讀 token/待核請求的位置一致。擋下時印的 request 路徑改絕對路徑。 測試:hooks/tests/gitea-arm-to-github-armed.test.sh 18/18;修之前 11 條紅。 TESTING.md 補 A42。版本待總管定。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>