雲端對 stage 的寫入有正門:scripts/stage(secret/api)只寫 youlin,白名單放固定形狀(inkstone/ISEP#137) #138

Merged
claude-code merged 1 commits from feat/137-stage-secret-put into main 2026-09-07 02:35:43 +00:00
Member

【身份】isep-hand/inkstone/ISEP/feat/137-stage-secret-put

票:inkstone/ISEP#137(雲端對 stage 的寫入要有正門;comment 6490 把範圍從 secret 加寬到三種寫入)

改了什麼

09-07 被分類器擋的形狀 正門 只寫 stage 的判準 測試
printf … | npx wrangler secret put … scripts/stage secret put|list|delete(直接打 CF API,不經 npx) GET /accounts 看這把 token 打得到誰,1129efd7… 不在裡面就拒絕並印出它打得到誰;URL 永遠只帶 stage ID scripts/test-stage.sh A/B/C
curl -X POST …arcrun-yuga3bse.workers.dev/… scripts/stage api <METHOD> <worker>/<path>(curl;標頭與 body 走 stdin 設定檔+管線,不走 argv) 主機只會長在 *.arcrun-yuga3bse.workers.dev,給別的主機拒絕、零請求 D
python3 scripts/stage-deploy-artifacts.py all --confirm Arcrun 自己那支(已寫死只認 youlin 帳號 ID、憑證只從 CLOUDFLARE_API_TOKEN_YOULIN_CC_USE 讀、不收 --account--token)——不重造,白名單放它從 Arcrun 根目錄跑的相對形狀 它自己 E1/E2
  • 值只從環境變數名讀(--from-env--bearer-env--header-env--data-env);--value--bearer--header 一律拒收。
  • docs/permissions-allow.jsonstage 四種形狀(快取路徑/$CLAUDE_PLUGIN_ROOT 兩種引號/相對路徑)+ stage-deploy-artifacts.py 一條。不放 Bash(npx *)Bash(wrangler *)Bash(curl *)
  • ISEP 掛在 Bash 上的 17 支閘對三種真實呼叫形狀(含 CF_SECRETS_API_TOKEN 字樣、POST--confirm)一支都不擋——E2 清單當場從 hooks.json 讀。

測過的

  • bash scripts/test-stage.sh45/45(全離線;假 CF 對 secret PUT 回 201——第一次實跑 CF 真的回 201、工具把它講成失敗,獨立列表證明其實種進去了;修掉並把假伺服器改成照真的回)
  • bash scripts/test-settings-allow-sync.sh19/19(A1 現在要求六個正門工具在場)
  • bash scripts/check-version-consistency.sh 0.23.0;claude plugin validate . → ✔
  • 真跑(本雲端 session)stage secret put 把隨機值 ISEP_137_PROBE 種進 youlin arcrun-cypher-executor → 不經工具用 CF API 列到 ["ISEP_137_PROBE","KBDB_INTERNAL_TOKEN"]stage secret delete → 再列剩 ["KBDB_INTERNAL_TOKEN"](stage 恢復原狀)。stage api GET arcrun-cypher-executor/health → HTTP 200;POST arcrun-kbdb/map/recompute… 不帶 Bearer → HTTP 401、離開碼 1;完整網址指到 leo21c → 拒絕、離開碼 2、零請求。

沒驗的(標明,不當交付)

  • 帶 Bearer 真的寫進 stage KBDB:雲端 Cloud environment 沒有 KBDB_INTERNAL_TOKEN(只住在安裝器中心側 KV,Arcrun#176 comment 6487 步驟 0)。工具的這條路只在假伺服器上驗過。
  • CF_SECRETS_API_TOKEN 的真值是主線 B-3(Arcrun#86)的東西,本票沒有編一個假的塞進 stage;總管拿到值後 stage secret put --worker arcrun-cypher-executor --secret CF_SECRETS_API_TOKEN --from-env <值所在的變數> 即可。
  • **「分類器真的不擋」**與 A33 同款:要這版裝進雲端、下一趟 run 看 permission_denials。本 session 裝的是 0.21.0,三次真跑走的是相對路徑形狀。

盤點(本樹實數)

ls hooks/*.sh | wc -l=61、grep -c '"command":' hooks/hooks.json=85(都沒動)、ls -p scripts | grep -v / | wc -l56(+stage、+test-stage.sh)。README/plugin.json 的 54→56 已改;docs/TESTING.md 新增 A36 與狀態列;docs/hooks-inventory.md settings-allow-sync 那列改成六個正門;docs/cloud-session-bootstrap.md「要 Mac」表:打 youlin 那列改為已回到雲端;system-dev/wiki/mistakes.md 記兩條(前綴比對 vs 複合指令/假伺服器要照真 API 回)。

版本:待總管定版(改了會被載入的東西:scripts/docs/permissions-allow.json)。不推 main。

🤖 Generated with Claude Code

https://claude.ai/code/session_01DTZ9QtvjY7MNxjfQbexAm7

【身份】isep-hand/inkstone/ISEP/feat/137-stage-secret-put 票:inkstone/ISEP#137(雲端對 stage 的寫入要有正門;comment 6490 把範圍從 secret 加寬到三種寫入) ## 改了什麼 | 09-07 被分類器擋的形狀 | 正門 | 只寫 stage 的判準 | 測試 | |---|---|---|---| | `printf … \| npx wrangler secret put …` | `scripts/stage secret put\|list\|delete`(直接打 CF API,不經 npx) | 先 `GET /accounts` 看這把 token 打得到誰,`1129efd7…` 不在裡面就拒絕並印出它打得到誰;URL 永遠只帶 stage ID | `scripts/test-stage.sh` A/B/C | | `curl -X POST …arcrun-yuga3bse.workers.dev/…` | `scripts/stage api <METHOD> <worker>/<path>`(curl;標頭與 body 走 stdin 設定檔+管線,不走 argv) | 主機只會長在 `*.arcrun-yuga3bse.workers.dev`,給別的主機拒絕、零請求 | D | | `python3 scripts/stage-deploy-artifacts.py all --confirm` | Arcrun 自己那支(已寫死只認 youlin 帳號 ID、憑證只從 `CLOUDFLARE_API_TOKEN_YOULIN_CC_USE` 讀、不收 `--account`/`--token`)——**不重造**,白名單放它從 Arcrun 根目錄跑的相對形狀 | 它自己 | E1/E2 | - 值只從環境變數名讀(`--from-env`/`--bearer-env`/`--header-env`/`--data-env`);`--value`/`--bearer`/`--header` 一律拒收。 - `docs/permissions-allow.json`:`stage` 四種形狀(快取路徑/`$CLAUDE_PLUGIN_ROOT` 兩種引號/相對路徑)+ `stage-deploy-artifacts.py` 一條。不放 `Bash(npx *)`/`Bash(wrangler *)`/`Bash(curl *)`。 - ISEP 掛在 Bash 上的 17 支閘對三種真實呼叫形狀(含 `CF_SECRETS_API_TOKEN` 字樣、`POST`、`--confirm`)一支都不擋——E2 清單當場從 `hooks.json` 讀。 ## 測過的 - `bash scripts/test-stage.sh` → **45/45**(全離線;假 CF 對 secret PUT 回 **201**——第一次實跑 CF 真的回 201、工具把它講成失敗,獨立列表證明其實種進去了;修掉並把假伺服器改成照真的回) - `bash scripts/test-settings-allow-sync.sh` → **19/19**(A1 現在要求六個正門工具在場) - `bash scripts/check-version-consistency.sh` → ✅ 0.23.0;`claude plugin validate .` → ✔ - **真跑(本雲端 session)**:`stage secret put` 把隨機值 `ISEP_137_PROBE` 種進 youlin `arcrun-cypher-executor` → 不經工具用 CF API 列到 `["ISEP_137_PROBE","KBDB_INTERNAL_TOKEN"]` → `stage secret delete` → 再列剩 `["KBDB_INTERNAL_TOKEN"]`(stage 恢復原狀)。`stage api GET arcrun-cypher-executor/health` → HTTP 200;`POST arcrun-kbdb/map/recompute…` 不帶 Bearer → HTTP 401、離開碼 1;完整網址指到 leo21c → 拒絕、離開碼 2、零請求。 ## 沒驗的(標明,不當交付) - **帶 Bearer 真的寫進 stage KBDB**:雲端 Cloud environment 沒有 `KBDB_INTERNAL_TOKEN`(只住在安裝器中心側 KV,Arcrun#176 comment 6487 步驟 0)。工具的這條路只在假伺服器上驗過。 - **`CF_SECRETS_API_TOKEN` 的真值**是主線 B-3(Arcrun#86)的東西,本票沒有編一個假的塞進 stage;總管拿到值後 `stage secret put --worker arcrun-cypher-executor --secret CF_SECRETS_API_TOKEN --from-env <值所在的變數>` 即可。 - **「分類器真的不擋」**與 A33 同款:要這版裝進雲端、下一趟 run 看 `permission_denials`。本 session 裝的是 0.21.0,三次真跑走的是相對路徑形狀。 ## 盤點(本樹實數) `ls hooks/*.sh | wc -l`=61、`grep -c '"command":' hooks/hooks.json`=85(都沒動)、`ls -p scripts | grep -v / | wc -l`=**56**(+`stage`、+`test-stage.sh`)。README/plugin.json 的 54→56 已改;`docs/TESTING.md` 新增 A36 與狀態列;`docs/hooks-inventory.md` settings-allow-sync 那列改成六個正門;`docs/cloud-session-bootstrap.md`「要 Mac」表:打 youlin 那列改為已回到雲端;`system-dev/wiki/mistakes.md` 記兩條(前綴比對 vs 複合指令/假伺服器要照真 API 回)。 **版本:待總管定版**(改了會被載入的東西:`scripts/`、`docs/permissions-allow.json`)。不推 main。 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DTZ9QtvjY7MNxjfQbexAm7
claude-code added 1 commit 2026-09-07 02:32:13 +00:00
09-07 三種寫入在雲端全被 auto mode 分類器擋:npx wrangler secret put、
stage-deploy-artifacts.py --confirm、curl POST 到 arcrun-yuga3bse——
白名單是逐條比前綴,複合指令與任意 curl 永遠對不上;放整類又是紅線。

- scripts/stage secret put|list|delete:直接打 CF API(不經 npx);先 GET /accounts
  看這把 token 打得到誰,stage 的 ID 不在裡面就拒絕並印出它打得到誰;URL 永遠只帶
  1129efd7…;值只從 --from-env 讀,--value 拒收。
- scripts/stage api <METHOD> <worker>/<path>:curl 打實例,主機只會是
  *.arcrun-yuga3bse.workers.dev,別的主機拒絕;標頭與 body 走 stdin 設定檔+管線,
  不走 argv;--bearer-env/--header-env/--data-env 從環境變數讀。
- docs/permissions-allow.json:stage 四種形狀+Arcrun 自己那支 stage-deploy-artifacts.py
  的相對形狀(它已寫死只認 youlin 帳號 ID、不收 --account/--token,不重造)。
- scripts/test-stage.sh 45 條(假 CF 對 PUT 回 201——第一次實跑 CF 回 201 被講成失敗,
  就是這格抓的);test-settings-allow-sync 仍 19/19。
- 真跑:探針種進 youlin arcrun-cypher-executor、CF API 獨立列到、刪掉恢復原狀;
  api GET health 200、無 Bearer POST 401、leo21c 主機拒絕零請求。
  「帶 Bearer 真寫 KBDB」缺 KBDB_INTERNAL_TOKEN 沒跑(TESTING A36 標明)。

盤點在本樹實數:hooks 61、註冊 85(都沒動)、scripts 56(+stage、+test-stage.sh)。
版本待總管定版。

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DTZ9QtvjY7MNxjfQbexAm7
claude-code merged commit 06a4dd5b7b into main 2026-09-07 02:35:43 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: inkstone/ISEP#138