feat: 薄殼原則落地 + seed 下沉 API + MCP 進主庫 + 部署一致性

壓測四橫向問題修正(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>
This commit is contained in:
uncle6me-web
2026-06-06 15:45:35 +08:00
parent 5f381a44a6
commit 3e65e22775
58 changed files with 8608 additions and 74 deletions
+71
View File
@@ -0,0 +1,71 @@
# 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 loginworker + npm loginCLI
# ── 由 scripts/local-deploy.sh 執行(現行機制)─────────────────
場景: cypher-executorAPI 本體)部署到最新
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 URLarcrun-{kebab}.{subdomain}.workers.dev 200
場景: registry / builtins Worker 部署到最新
registry/ builtins/
那麼 local-deploy.sh tier2 wrangler deploy Worker
場景: landingarcrun.dev)部署到最新
landing/
那麼 next build + wrangler pages deploy arcrun-landing
場景: CLInpm 套件 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 publishversion 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 /