Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e45faef8a2 |
+16
-3
@@ -1017,12 +1017,13 @@ bash hooks/tests/isep-presence-beacon.test.sh # ㉗–㉝ 那七條
|
||||
**真實跑(2026-09-07)**:信標不帶 fixture 打真 Gitea(匿名)→ 安靜(v0.24.0 tag+release 都在),
|
||||
留下 `.isep-chain-ok-v0.24.0` 快取;`release-check` 在本分支 → `v0.24.0 ✅✅✅ ←`、三個裁定不補的版本標 ⏭、exit 0。
|
||||
|
||||
### A39 — D20 閘判「push 到哪」看的是指令實際會推的那個 repo:26 條
|
||||
### A39 — D20 閘判「push 到哪」看的是指令實際會推的那個 repo,且 subagent 與總管同判:33 條
|
||||
```
|
||||
bash scripts/test-github-contact-guard.sh
|
||||
```
|
||||
**該看到**:`26/26 通過`。離線;後 12 條自己開兩顆 git repo(`shell` 的 origin=github.com、
|
||||
`body` 的 origin 是 Gitea 的形狀),payload 帶 `cwd`,跟 hook 真的會收到的一樣。
|
||||
**該看到**:`33/33 通過`。離線;中間 12 條自己開兩顆 git repo(`shell` 的 origin=github.com、
|
||||
`body` 的 origin 是 Gitea 的形狀),payload 帶 `cwd`,跟 hook 真的會收到的一樣;
|
||||
最後 7 條(`inkstone/ISEP#119`)把同一條指令帶 `agent_id`(subagent)與不帶(總管)各跑一次,兩者判決必須相同。
|
||||
|
||||
**它在守什麼**(`inkstone/ISEP#109` → comment 6629,2026-09-07 實撞):雲端薄殼的 cwd 是 GitHub 那份,
|
||||
總管站在那裡 `git -C <InkStoneCo> push origin x`(InkStoneCo 的 origin=Gitea),舊版拿 **hook 收到的 cwd**
|
||||
@@ -1036,6 +1037,18 @@ bash scripts/test-github-contact-guard.sh
|
||||
- 「該擋」5 條任一紅 ⇒ D20 有洞:`-C`/`cd` 指到 GitHub 那份的 push 沒被攔
|
||||
- `(cd body && true); git push` 那條紅 ⇒ 子殼的 cd 外洩了(08-11 穿透的形狀)
|
||||
- 前 14 條紅 ⇒ 舊有判準(heredoc/引號裡的散文/讀取放行)被改壞
|
||||
- subagent 那 7 條任一「subagent≠總管」⇒ 這支閘開始讀 `agent_id`/`agent_type` 分身分了:
|
||||
D20 對 subagent 與總管本該一視同仁(`inkstone/ISEP#119`),一旦分了岔就是 09-01 那種「一端有效一端失效」的破口回來了
|
||||
|
||||
🔴 **已知殘留破口(`inkstone/ISEP#119` 查出、實測+雲端實跑驗過,待裁)**:push 目標若用
|
||||
**未展開的 shell 變數**表示(`git -C "$VAR" push`/`cd "$VAR" && git push`),PreToolUse hook 收到的是
|
||||
**展開前**的字串,`push_target_dir.py` 對 `$VAR` 一律回「不確定」⇒ 退回 **session 的 cwd** 解 remote。
|
||||
`main-and-prod-push-guard` 遇到「不確定」是退回「要有戳記」=**擋**(fail-safe);
|
||||
但 `github-contact-guard` 的預設方向相反——「證明不了是 github 就放行」⇒ cwd 是 Gitea 時,
|
||||
一個真的推 GitHub 的 `-C "$VAR"` 會**漏擋**。這個不對稱就是殘留的同形狀破口。
|
||||
上面測試用的都是**字面絕對路徑**(解得出來 ⇒ 擋),所以測試全綠**不代表**這個變數形狀已補。
|
||||
雲端有 git proxy 當後手(未授權的 github repo 一律 403),本機沒有 ⇒ 本機風險較高。
|
||||
修法有代價(fail-closed 會誤攔「用變數推 Gitea」,需配「改用字面路徑」的出路),屬 `誤攔比漏擋` 的取捨,另票裁。
|
||||
|
||||
### A37 — 雲端第一則 prompt 的主線就是現在這條,不是兩週前的舊線:31 條
|
||||
```
|
||||
|
||||
@@ -71,6 +71,34 @@ runc 0 "$W/body/sub" 'git push origin x'
|
||||
runc 0 "$W/shell" "cd $W && git -C body push origin x"
|
||||
runc 0 "$W/body" "(cd $W/shell && true); git push origin x"
|
||||
|
||||
echo "── subagent 走同一條判斷:payload 帶 agent_id/agent_type 拿到跟總管一模一樣的判決(inkstone/ISEP#119)──"
|
||||
# 為什麼這群非有不可(inkstone/ISEP#119):2026-09-01 一個 subagent 把分支推上 GitHub
|
||||
# 沒經過解保險,同時總管這端擋得住——表面像「subagent 端失效」。但官方文件講明:
|
||||
# subagent 的 tool 呼叫照樣觸發同一批 PreToolUse hook,只是 input 多帶 agent_id/agent_type
|
||||
# (https://code.claude.com/docs/en/hooks)。這支閘從頭到尾不讀那兩個欄位 ⇒ 它**無從**
|
||||
# 只擋總管或只擋 subagent。當天真正的洞是同一族的 cwd 病(上面 ISEP#109 那組):
|
||||
# subagent 站在薄殼、靠 cd/-C 推它自己那顆 origin=github 的 repo,舊版在錯的目錄解 origin
|
||||
# ⇒ 放行。這群把「帶 agent_id 的 payload 判決 == 不帶的判決」釘死,證明沒有 subagent 專屬破口。
|
||||
runsub(){ # $1=want $2=cwd $3=cmd —— 同一條指令跑兩次:帶 agent_id(subagent)與不帶(總管),
|
||||
# 兩次都必須等於 want,才算「subagent 與總管走同一條判斷、拿同一個結果」。
|
||||
local want="$1" cwd="$2" cmd="$3" a b
|
||||
a=$(printf '%s' "{\"tool_name\":\"Bash\",\"cwd\":$(python3 -c 'import json,sys;print(json.dumps(sys.argv[1]))' "$cwd"),\"agent_id\":\"agt_119\",\"agent_type\":\"isep-hand\",\"tool_input\":{\"command\":$(python3 -c 'import json,sys;print(json.dumps(sys.argv[1]))' "$cmd")}}" \
|
||||
| bash "$H" >/dev/null 2>&1; echo $?)
|
||||
b=$(printf '%s' "{\"tool_name\":\"Bash\",\"cwd\":$(python3 -c 'import json,sys;print(json.dumps(sys.argv[1]))' "$cwd"),\"tool_input\":{\"command\":$(python3 -c 'import json,sys;print(json.dumps(sys.argv[1]))' "$cmd")}}" \
|
||||
| bash "$H" >/dev/null 2>&1; echo $?)
|
||||
if [ "$a" = "$want" ] && [ "$b" = "$want" ]; then PASS=$((PASS+1)); printf ' ✅ '; else FAIL=$((FAIL+1)); printf ' ❌ '; fi
|
||||
printf 'want=%s subagent=%s 總管=%s cwd=%s %.48s\n' "$want" "$a" "$b" "${cwd#$W/}" "$cmd"
|
||||
}
|
||||
echo " · subagent 推 GitHub(含 09-01 的 cd/-C 原形狀)→ 擋,且與總管同判"
|
||||
runsub 2 "$W/shell" 'git push origin x'
|
||||
runsub 2 "$W/body" "cd $W/shell && git push origin x"
|
||||
runsub 2 "$W/body" "git -C $W/shell push origin x"
|
||||
runsub 2 "$W/shell" 'gh api repos/example/example/issues'
|
||||
echo " · subagent 推 Gitea/讀取 → 放行,且與總管同判(沒有為了擋 subagent 而擋過頭)"
|
||||
runsub 0 "$W/body" 'git push origin x'
|
||||
runsub 0 "$W/shell" "git -C $W/body push origin x"
|
||||
runsub 0 "$W/shell" 'git clone https://github.com/example/example.git'
|
||||
|
||||
echo
|
||||
echo "$PASS/$((PASS+FAIL)) 通過"
|
||||
[ "$FAIL" -eq 0 ]
|
||||
|
||||
Reference in New Issue
Block a user