3e65e22775
壓測四橫向問題修正(docs 壓測報告):
① 薄殼原則成鐵律:能力長在 API,CLI/MCP/lib 只暴露
- seed 下沉成 API 行為:cypher-executor POST /init/seed(一次灌 API+auth recipe),
種子資料移到 server src/lib/api-recipe-seeds.ts,CLI 改薄殼一次呼叫
- 解除 deployFullyOk 連坐 + init 補 seed auth recipe + update 補 seed/全 KV
- registry SUBMISSIONS_KV 補進 REQUIRED_KV_NAMESPACES(修 20/21)
② MCP 統一帳號來源(單一 remote MCP + .env 切 MCP URL)
- MCP 從 sibling repo 搬進 arcrun/mcp/(remote Worker,route 改 mcp.arcrun.dev)
- config 加 mcp_url 三層解析 + getMcpUrl + DEFAULT_MCP_URL
- 新增 acr mcp-setup:依 config 寫專案 .mcp.json(接案切資料夾自動切 MCP)
- acr --version 改動態讀 package.json(根治漂移)
③ Deploy 一致性
- tests/release.feature + scripts/check-release.sh
- local-deploy.sh:CLI npm publish + auto patch bump + CHANGELOG
- local-deploy.sh bash 3.2 相容修正(mapfile / 空陣列 set -u)
- builtins/pnpm-lock.yaml
④ README self-hosted 同步現況(移除 R2 殘留、加 flag/env、多帳號)
CLI bump → 1.3.0
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
72 lines
3.9 KiB
Gherkin
72 lines
3.9 KiB
Gherkin
# language: zh-TW
|
||
# release.feature — 「推送 = 全部 publish target 到位」的可驗證規格
|
||
#
|
||
# 來源:docs/壓測報告.md 第 3 點(開發者「只推 GitHub,沒把 wrangler / npm 都 deploy」,
|
||
# 壓測時有些可用有些不可用,浪費壓測時間)。
|
||
#
|
||
# 用途:每次「完成推送」時,必須確認下列每個 publish target 都已到位。
|
||
# 這不是單元測試,是 release 把關清單(Gherkin = 人讀得懂的契約)。
|
||
# 對應驗證腳本:scripts/check-release.sh(列出每個 target 的目前版本/部署狀態)。
|
||
#
|
||
# ⚠️ 實際部署機制(誠實,mindset §7):GH Actions 於 2026-05-16 配額爆掉後停用,
|
||
# 且公開 repo 的 .github/ 已於 037cf9b 移除(對外只留)。**現行 deploy 走本機
|
||
# `scripts/local-deploy.sh`**(wrangler deploy worker + 本輪新增 CLI npm publish)。
|
||
# 本檔描述「該到位什麼」;real 動作由 local-deploy.sh 執行。
|
||
# `.github/workflows/publish-cli.yml` 是「若哪天重啟 GH Actions」的預備檔(目前 gitignored、不跑)。
|
||
|
||
功能: Release — 一次推送,所有對外 publish target 同步到位
|
||
作為 arcrun 維護者
|
||
我希望每次推送變動後,所有對外介面(CF workers / landing / npm CLI / MCP)都是同一版
|
||
以避免壓測者 / 用戶踩到「有些新有些舊」的不一致狀態
|
||
|
||
背景:
|
||
假設 變動已 commit
|
||
並且 維護者已 wrangler login(worker 部署)+ npm login(CLI 發版)
|
||
|
||
# ── 由 scripts/local-deploy.sh 執行(現行機制)─────────────────
|
||
|
||
場景: cypher-executor(API 本體)部署到最新
|
||
當 cypher-executor/ 有變動
|
||
那麼 local-deploy.sh 應 wrangler deploy arcrun-cypher-executor
|
||
並且 https://cypher.arcrun.dev/health 應回 200
|
||
|
||
場景: 所有零件 Worker 部署到最新
|
||
當 .component-builds/*/ 或 registry/components/*/ 有變動
|
||
那麼 local-deploy.sh 應 rebuild WASM 並 wrangler deploy 對應的 arcrun-{name} Worker
|
||
並且 每個零件的 workers.dev URL(arcrun-{kebab}.{subdomain}.workers.dev)應回 200
|
||
|
||
場景: registry / builtins Worker 部署到最新
|
||
當 registry/ 或 builtins/ 有變動
|
||
那麼 local-deploy.sh tier2 應 wrangler deploy 對應 Worker
|
||
|
||
場景: landing(arcrun.dev)部署到最新
|
||
當 landing/ 有變動
|
||
那麼 應 next build + wrangler pages deploy 到 arcrun-landing
|
||
|
||
場景: CLI(npm 套件 arcrun)發佈到最新
|
||
當 cli/ 有變動且 cli/package.json 的 version 已 bump
|
||
那麼 local-deploy.sh 第 6 段應 npm publish arcrun@{新版本}
|
||
並且 npm view arcrun version 應等於 cli/package.json 的 version
|
||
# 壓測 §2.6:曾發生 GitHub main 1.2.0 但 npm 仍 1.1.0 → 此場景就是要防這個。
|
||
# 根因:舊 local-deploy.sh 只 wrangler deploy worker,從不 npm publish CLI。本輪補上。
|
||
|
||
場景: MCP server 部署到最新
|
||
當 arcrun-mcp/src/ 有變動(arcrun-mcp repo)
|
||
那麼 arcrun-mcp 應 wrangler deploy MCP Worker
|
||
並且 MCP 的工具集應與 cypher-executor 最新 API 對齊(薄殼,rule 07)
|
||
|
||
# ── 需人為動作(不假裝自動)────────────────────────────────────
|
||
|
||
@manual
|
||
場景: CLI 版本未 bump 時不會發版(誠實:改了 cli 但忘了 bump → npm 不會更新)
|
||
假設 cli/ 有變動但 cli/package.json 的 version 未改
|
||
那麼 local-deploy.sh 會「跳過 publish」(version 與 npm 相同)
|
||
並且 維護者必須記得 bump version 才會發版
|
||
# check-release.sh 會把「cli/src 變動晚於 package.json」標為 ⚠️ 提醒
|
||
|
||
@manual
|
||
場景: 新 publish target 加入時必須補進本清單
|
||
假設 新增了一個對外介面(如 python-sdk / js-sdk)
|
||
那麼 必須在本檔新增對應場景
|
||
並且 必須在 scripts/check-release.sh + scripts/local-deploy.sh 加對應檢查/發佈步驟
|