Commit Graph

37 Commits

Author SHA1 Message Date
uncle6me-web f336fb2fca chore(release): cli 1.3.7 版本檔同步 2026-06-13 13:40:34 +08:00
uncle6me-web b44adda6d2 feat(self-hosted): acr update 內容指紋跳過未變動 worker(22 個沒變的不再白跑)+ --force 強制全部重部
壓測 2026-06-12:22/23 成功後重跑仍全部 pnpm install + wrangler deploy。
manifest 存 ~/.arcrun/deploy-manifest.json,指紋含注入後內容+accountId(換帳號/KV 自動重部),
只在成功後記錄(失敗者下次必重試)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 13:35:15 +08:00
uncle6me-web 5a8d27673b chore(release): cli 1.3.6 版本檔同步
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 23:30:25 +08:00
uncle6me-web 6e92ca0372 fix(self-hosted): acr update 10/23 部署失敗根因——pnpm 目錄補 commit pnpm-workspace.yaml(ERR_PNPM_IGNORED_BUILDS)+ CLI 失敗帶 stderr 尾段
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 23:25:46 +08:00
uncle6me-web 38a3cccbee chore(release): cli package-lock 1.3.5 版本同步
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 21:45:39 +08:00
uncle6me-web b17d0080ee chore(release): cli 1.3.5 + local-deploy.sh 全形字緊鄰 $VAR 的 set -u crash 修復(同 8346596 根因)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 20:19:52 +08:00
uncle6me-web 35cdda7061 fix(cli): acr update 假綠與沉默修復——部署部分失敗必須印出、deploy 迴圈逐 worker 進度、migrate 錯誤印 server 回應
- update.ts: result.message 含失敗清單時不再被「✓ 部署完成」蓋掉(404 重跑 3 次找不到根因的元兇)
- update.ts: migrate-cron-index 非 2xx 印 response body 前 200 字 + 404/500 含義提示
- deploy.ts: downloadAndDeploy 逐 worker 印 [i/N] 進度(原本 20+ worker 靜默部署像當機)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 08:04:22 +08:00
uncle6me-web 1af7655ac6 fix(mcp-self-hosted): KBDB binding 指向不存在的 service + kbdb worker 未部署
self-hosted MCP failed 根因(壓測 2026-06-10):
1. mcp/wrangler.toml: KBDB service binding 綁 'inkstone-kbdb-api'(全 repo 僅此一處,
   不存在的舊名)→ 改成實際 worker 名 'arcrun-kbdb'(官方+self-hosted 共用)。
2. deploy.ts: self-hosted 部署清單漏了 kbdb worker(只有 cypher/registry/mcp)→
   D1 arcrun-kbdb 有建但 worker 本體沒部署 → KBDB binding 指向不存在 service →
   partnerAuthMiddleware 每個 MCP 認證請求都 throw。加 'kbdb' 進部署清單。
D1 id 注入已涵蓋(injectWranglerConfig 跑 tier2,kbdb 現在在 tier2)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 00:08:25 +08:00
uncle6me-web eba87b9ea9 fix(deploy): release-check 全形括號 set-u crash + pnpm allowBuilds 範本未填
- check-release.sh: 5 處 $VAR( → ${VAR}(,修 set -u unbound var crash
  (全形括號 U+FF09 緊貼變數名被 bash 併入變數名 → 非零退出 → 誤判 git 未同步擋 deploy)
- cypher-executor/ + auth_static_key/ pnpm-workspace.yaml: allowBuilds 改真布林
  (原 'set this to true or false' 範本 → pnpm install 拒絕 → deploy 掛)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 23:14:57 +08:00
uncle6me-web 8346596ceb fix(release-check): brace-delimit $VAR before full-width parens (set -u unbound var crash)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 17:31:28 +08:00
uncle6me-web 2ff51f00ca chore(cli): acr update 下載/解壓進度提示(chalk gray)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 16:46:58 +08:00
uncle6me-web da84425d25 feat(credential-injection): {{credential.X}} 用戶面語法(credential-primitives §8)
壓測 401 根因:{{credential.X}} 系統沒實裝,三條 template 展開路徑都不認
credential. namespace → 注入空值 → 目標 API 401(test_arcrun/5 Haiku 實證)。

修法(design §8,richblack 確認方向 B「讓 {{credential.X}} 真的能用」):
- auth_static_key 加 resolve_credentials action:給 names → WASM 內 kv_get +
  crypto_decrypt → 回明文 map(不查 recipe、缺則誠實報錯)
- auth-dispatcher 加 resolveCredentialRefs:遞迴偵測 {{credential.X}} → 交 WASM
  解密 → 回填(無 ref 則零開銷不打 WASM)
- graph-executor 在 node.data interpolate 後呼叫,不碰 ENCRYPTION_KEY(rule 02 §2.2)

解密全程在 WASM,TS 只偵測+回填。tinygo build OK + tsc 0 + §2.2 自檢綠。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 13:55:31 +08:00
uncle6me-web 465c505000 fix(execution-truth): 修系統對 401 假綠根因 + acr run self-hosted + D1-in-update
Haiku 自主壓測(test_arcrun/5)暴露的真 bug,逐一修復:

1. 假綠根因:http_request host function 丟掉 HTTP status code(main.go:112 架構債)
   → 非 2xx(如 Notion 401)被判 success → 引擎自己對失敗報成功。
   修:host fn 非 2xx 回 {error,status,body} envelope,既有判定鏈正確識別。
   http_request/claude_api/kbdb_upsert_block/km_writer 已修(4 worker deploy);
   auth_service_account 自有 OAuth 判定不套。

2. acr run self-hosted:原一律走 /webhooks/<name>(需先 push)→ 沒 push 回 404 純文字
   → res.json() 爆假錯誤。修:本機有 YAML 走玩法一 /cypher/execute 直接執行(三模式一致)
   + res.ok 擋非 2xx + findWorkflowYaml 容忍 .yaml 副檔名。

3. D1-in-update:D1 只在 init 建一次,update 漏建 → token 補權限後無冪等補建路徑。
   修:update 也 ensureD1Database(已驗證 D1 建起 count:1)。

4. CF token 教學漏 D1:llms.txt/.env.example 加「Account/D1/Edit」必勾 + init/preflight
   訊息指明 token 缺 D1 權限的修法。

CLI 1.3.4 publish。Haiku 壓測結論:onboarding 治好(裝+init 沒跳過、建 recipe 不建零件),
但仍會假綠(curl 繞過/D1 沒建謊報)→ 印證執行真相要系統能驗、不信 AI 自報。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 22:12:09 +08:00
uncle6me-web c152f5fc1d feat(onboarding+kbdb): 8.P0 cron 止血 + §7.8 onboarding + .env.example 範本
kbdb-base 8.P0:scheduled.ts cron 每分鐘 KV list → 單一 key get(lib/cron-index.ts);
  webhooks-named 維護單 key + 一次性 migrate-cron-index;acr update 自動遷移。1440 list/日 → 0。

self-hosted-init §7.8 onboarding:
  P0 init 偵測+裝完驗收(lib/preflight.ts,pip 式,冪等)
  P1 acr whoami(+--json)+ MCP arcrun_whoami(AI 不繞 CLI 猜帳號)
  P2 mcp-setup 寫完印「請重啟 client」
  P3(部分)repo .env.example 範本(每格白話說明、值留空)+ llms.txt 教 AI 幫用戶 cp 建 .env

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 19:15:51 +08:00
uncle6me-web c5d8924fb2 feat(harness): 冷啟動環境強制檢查(exit 2 擋住)
- pre-cold-startup-check.sh:5 項環境檢查(config / api_key / .mcp.json / acr / D1)
- init.ts:init 末尾調用 hook,失敗直接 exit 2
- 機制強制,不靠提醒 — 環境檢查失敗用戶必須修復後重跑 acr init

解決 Haiku 假綠問題(mistakes.md §11 對應修復)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-08 15:40:04 +08:00
uncle6me-web 9438d1f351 chore: 完整 wiki 系統 + docs 文件遷移 + test_arcrun/4 任務框架
- docs/ 6 層分類結構建立(vision/architecture/specs/guides/records/user)
- .agents/specs/ 遷移到 docs/3-specs/,已清空原位置
- .claude/wiki/ 核心文檔:mistakes.md / decisions-summary.md / status.md / INDEX.md
- CLAUDE.md 更新:SDD 路徑改為 docs/3-specs/,加 wiki 讀取順序表
- test_arcrun/4/ 新建任務框架(TASK/PROMPT/異常記錄模板)
- 長期記憶系統就緒,防止 LLM 遺忘決策和重複錯誤

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-08 15:36:22 +08:00
uncle6me-web d617793325 chore(cli): bump 1.3.3 (MCP self-hosted discovery) 2026-06-08 13:45:05 +08:00
uncle6me-web d84d6fc0ec fix(mcp): POST /mcp route (not /mcp/mcp)
basePath = '/mcp' + app.post("/") = POST /mcp
之前是 app.post("/mcp") 導致 /mcp/mcp 雙層,發請求到 /mcp 只得 404。

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-08 13:44:33 +08:00
uncle6me-web 2b46bea764 fix(cli): MCP self-hosted discovery + config setup
- deploy.ts: discoverWorkerDirs 掃 mcp worker + 回傳 mcpUrl(對內 /mcp 端點)
- init.ts: initSelfHosted 寫入 config.mcp_url + 重跑 cmdMcpSetup
- config.ts: DEFAULT_MCP_URL 補 /mcp 後綴

Fixes mcp-account-source §3:self-hosted .mcp.json 必須指自己的 mcp worker,避免連官方失敗。

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-08 13:23:02 +08:00
uncle6me-web 5daeede45f chore(cli): package-lock 版本同步 1.3.2
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 16:34:51 +08:00
uncle6me-web 36d7492464 fix(kbdb): 填官方 prod D1 database_id(arcrun-kbdb)+ cli bump 1.3.2
kbdb/wrangler.toml placeholder → 官方 D1 id(self-hosted deploy.ts 注入會覆蓋,安全)。
deploy --all 時 cli 自動 bump 1.3.1→1.3.2 + CHANGELOG。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 16:34:30 +08:00
uncle6me-web ad5a83d3d8 merge: kbdb recipe 公庫/私庫雙向機制 + UUID 身份(壓測前)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 16:21:01 +08:00
uncle6me-web 6a75117ba3 feat(kbdb): recipe 公庫/私庫雙向機制 + UUID 身份 + KBDB Base + 市場數據
kbdb-base SDD §7.5(公庫/私庫雙向機制,richblack 2026-06-07 拍板)。

## KBDB Base worker(新)
- kbdb/:D1-only 核心三表(entries/templates/entry_values)+ CRUD + LIKE search
  + recipe-stats 端點(市場數據)+ 0001_base.sql migration(含 recipe_stat seed)

## Phase 2.3:init 建 D1 + 套 migration
- cli cf-api.ts 加 listD1Databases/ensureD1Database;init 建 arcrun-kbdb D1
- deploy.ts 部署後對 D1 套 0001_base.sql(CF /d1/query API,idempotent)+ 注入 database_id

## Phase 5.1:recipe 成功記錄(市場數據來源)
- GraphExecutor 收集本次用到的 recipe uuid(usedRecipeKeys)
- executeWebhookGraph 執行結束一次性記 per-uuid 成功/失敗到 KBDB(fire-and-forget)

## Phase 7.5:recipe UUID 身份 + app-store 模型
- recipe 領 uuid=唯一身份;canonical_id/author/公私=屬性(§7.5.5)
- recipe:{uuid} + idx:canonical/installed/hash;resolveRecipe 向後相容不破執行鏈
- POST /recipes/submit=領新 uuid 新增作者版本(非覆蓋,app-store)
- GET /public-recipes 搜尋(多作者+per-uuid 市場星數)/ :id pull(選市場最佳)
- 落空→found:false 創作引導(§7.5.6 閉環)
- POST /recipes/migrate-uuid 一次性轉舊 key(增量寫不刪舊、冪等)
- init-seed 用 UUID(author=system)

## 薄殼(rule 07 §5:CLI + MCP 覆蓋同組能力)
- CLI: acr recipe search/pull/submit-p(config 加 DEFAULT_PUBLIC_LIBRARY_URL)
- MCP: arcrun_recipe_search/pull/submit_p/push/list/delete(補齊漂移)

## 壓測修正
- api-recipe-seeds: google_sheets_append PUT→POST(:append 正確動詞,階段12)

四 worker tsc 全綠(cypher/cli/kbdb/mcp)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 16:18:10 +08:00
uncle6me-web 95a1462b65 fix(cypher): 改用 global_fetch_strictly_public flag 解 same-zone 1042(revert service binding)
richblack 拍板:service binding(前一 commit)靜態、加/改要重 deploy cypher,廢。
改用 global_fetch_strictly_public compatibility flag——cypher wrangler.toml 加一行,
讓 fetch() 走公網前門,self-hosted 的 same-zone fetch(cypher 與 auth 同在
{sub}.workers.dev zone)也能通。

- wrangler.toml:compatibility_flags 加 global_fetch_strictly_public(移除 SVC_AUTH_*)
- auth-dispatcher.ts / types.ts:還原到 service binding 之前(單純 fetch workers.dev)
- 安全(官方 docs):唯一副作用 self-loop 僅在 fetch 自己 hostname;cypher 不 self-loop
- 官方/self-host 共用同一份 toml:官方本就跨 zone 行為不變,self-host 被修好
- 規範還原:rule 02/03/CLAUDE.md/pre-bash-guard 的 service binding 禁令維持原狀

SDD: credential-primitives-wasm Phase 7(A→廢→B)。tsc exit 0。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 21:44:13 +08:00
uncle6me-web 62f1d1d390 merge: guard hook 展示/執行區分 + auth primitive service binding(壓測 §9.5 + §11) 2026-06-06 21:11:44 +08:00
uncle6me-web d2048e26a7 fix(cypher): auth primitive 改走 service binding(解 self-hosted CF 1042)
壓測階段 11:self-hosted 帳號 cypher 用 fetch(workers.dev) 打同帳號
auth worker 被 CF 子請求限制回 1042,service account token 換不到 →
表單寫不進 Google Sheets。token/解密鏈本身正常(直打 auth worker 回真 ya29)。

架構演化(richblack 2026-06-06 拍板):用戶產生的是 recipe(KV 資料,不 deploy),
primitive 是平台固定基礎設施、用戶不新增 → 解除「auth primitive 禁 service binding」
舊禁令。service binding 是 CF 內部 RPC,繞開同 zone 522 + 同帳號 workers.dev 1042。

- wrangler.toml:加 SVC_AUTH_STATIC_KEY/SERVICE_ACCOUNT/OAUTH2(已部署者;mtls 未部署留註解)
- auth-dispatcher.ts:binding 優先 svc.fetch(),無 binding fallback fetch(workers.dev)
- types.ts:4 個 optional SVC_AUTH_*
- deploy.ts 無需改:stripOfficialOnlyBindings 不碰 services,tier1 auth 先於 tier2 cypher
- 已驗證 self-hosted(leo21c)13 邏輯零件 binding 實綁成功,auth binding 走同路

規範同步:rule 02 / 03 / CLAUDE.md / pre-bash-guard 例外。SDD: Phase 7。tsc exit 0。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 21:09:49 +08:00
uncle6me-web 68da769c1b fix(harness): guard hook 區分「執行 acr push」vs「展示指令」(壓測 §9.5)
舊版 grep "acr push" 連「在 echo/heredoc 裡提到 push 字串」都擋,
導致 CC 連「把可貼上的指令印給使用者看」都做不到 → 反而違反
user-cc-harness §0.5「擋下必須印出正路」自身鐵則(連選②都印不出)。

修法(啟發式,誠實標明非完美,mindset §7):
- awk 抽掉 heredoc 主體 → 剩下「實際執行命令列」才看 push 是否在命令位置
  (行首 / ; & | && ||)。真執行擋、純展示放行。
- block 訊息補上選②可貼指令(符合 §0.5)。
- shell 層無法 100% 區分執行/展示,偷渡(bash<<EOF / $(...))由上游安全分類器擋。

驗證:8/8 案例正確(真執行全 BLOCK、純展示全 ALLOW)+ 邊角;bash -n OK。
SDD: .agents/specs/user-cc-harness/tasks.md A6 + C9。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 19:11:28 +08:00
uncle6me-web 99c3454ce8 feat(recipes): auth recipe help_url 一律必填(不分冷熱門)
每個 required_secret 必須有 help_url(官方文件連結 http(s)://),POST /auth-recipes
驗證缺則 400。讓 AI/使用者設定 credential 時直接讀官方來源,不必猜/不會搜錯。
薄殼原則:驗證在 API,CLI/MCP 等介面 push auth recipe 自動受約束。
種子 23/23 已含 help_url。SDD: auth-recipe.md「help_url 一律必填」。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 17:41:38 +08:00
uncle6me-web 0620fb5601 chore(release): local-deploy.sh CLI publish 優先用 .env NPM_API_TOKEN
互動 npm login 常因 publish 安全政策 403;改優先讀 .env 的 NPM_API_TOKEN
(authToken 方式)publish,無 token 才退回 npm whoami。token 不入 log。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 17:33:14 +08:00
uncle6me-web 44b915554b fix(self-hosted): 身份改明碼 namespace(.env)+ path-based webhook trigger
壓測 §7.2:seed 通了但 creds push/push/runtime 全卡「缺少 api_key」——
self-hosted init 從不發 api_key,但三條路徑都建在多租戶 {api_key}:cred 模型上。

richblack 拍板:self-hosted 不需祕密 api_key,只需 namespace(分區標籤):
- config:ENV_MAP 加 NAMESPACE/ENCRYPTION_KEY + .env 自動載入(無 dotenv 依賴)
- namespace 明碼用戶自填(.env NAMESPACE=leo),沿用 api_key 路徑 → 零分叉
- encryption_key 用戶 .env 自填(工具不生成不 hash),須與 worker secret 一致
- creds/push/init:缺值改引導設 .env,不再叫去 register
- runtime:cypher 加 POST /webhooks/named/:ns/:name/trigger(namespace 走 path,
  公開表單免 header);與 header 路徑共用 triggerNamed,不分叉
- push:self-hosted 顯示 path-based 公開 webhook URL

誠實限制:namespace 明碼非密碼;防外部呼叫靠 webhook 保護(mindset §6)。
CLI 1.3.0 → 1.3.1。SDD: self-hosted-init.md §7.7。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 17:30:16 +08:00
uncle6me-web 772e4a12ff docs: 對外文件同步現況(mcp-setup / MCP 進主庫 / 移除 R2 殘留指引)
- README:CLI 指令補 acr mcp-setup + acr config --where;新增「讓 AI 連到對的 arcrun」MCP 章節
- mcp/README:更新連線設定(acr mcp-setup 為主)、URL studio/finally.click → mcp.arcrun.dev、
  移除 pk_live 邀請制框架、inspector URL 更新
- mcp/GUIDE:標題 u6u → Arcrun,註明 u6u_/arcrun_ 工具現況
- llms.txt:token 權限三組 → 兩組(移除已廢的 R2 Edit);init 流程補「寫 .mcp.json」

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 16:02:54 +08:00
uncle6me-web 3d3de8b917 chore(release): deploy-from-committed 防呆流程(git 閘 + 清單)
壓測階段 6 抓到漂移新形態:cypher 改了但沒推 main → acr init 從 origin/main
codeload 抓到舊 worker → 薄殼打不存在的 /init/seed → 404。根因是「deploy 前沒先 push」。

防呆(沒 GH Actions,deploy 分開推,靠清單+閘不漏):
- scripts/check-release.sh 加「0. Git 同步」段:工作目錄髒 / 領先 origin/main 未 push → exit 1
- scripts/local-deploy.sh 實際 deploy 前強制跑 git 閘(未過拒絕 deploy;SKIP_GIT_CHECK=true 可強推)
- RELEASE-CHECKLIST.md:正確順序(先 commit+push main → 再 deploy → 線上打新端點驗證)

核心鐵則:self-hosted acr init 從 origin/main 抓 worker 源,故 git push 必須在 deploy 之前。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 15:51:51 +08:00
uncle6me-web 3e65e22775 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>
2026-06-06 15:45:35 +08:00
uncle6me-web 5f381a44a6 fix(self-hosted): 修壓測四阻斷項 + 設定分層 + init 非互動
壓測(docs/壓測報告.md)發現 acr init --self-hosted 對任何非官方 CF
帳號都裝不起來,且設定寫死全域單檔 + 強制 TTY。本次一併修:

R2 dead storage 全清(#3#4,registry-canon Phase 1.5 補完):
- cypher-executor wrangler.toml/test.toml/types.ts 移除 WASM_BUCKET binding
- CLI deploy.ts/init.ts/cf-api.ts/config.ts 移除 R2 建立邏輯與 wasm_bucket
- R2 綁信用卡違背「開源免費自架」核心;bucket 名 WASM_BUCKET 本就非法
  → self-hosted 改為只需 Workers + KV(皆免費額度、不綁卡)

fork 帳號部署阻斷(#1#2):
- deploy.ts 新增 stripOfficialOnlyBindings(),注入暫存副本時移除
  [[routes]]/zone_name/[[r2_buckets]]/[ai](fork 沒有 arcrun.dev zone)
- 不刪 repo 內 toml(官方 prod CI 部署仍需 routes),只在 CLI self-hosted 路徑 strip

設定分層 + 非互動(#7#8):
- config.ts loadConfig 改三層:env > 專案層 .arcrun.yaml(就近往上找)> 全域
- init 支援 --account-id/--api-token flag + CLOUDFLARE_* env,缺才互動
- 新增 acr config --where 顯示每個值的來源層(token 自動遮罩)
- gitignore 一併排除 .arcrun.yaml

驗收:tsc 全綠;三層 merge 端對端測試 8/8;strip 對真實 toml 驗證
routes/R2/AI 移除而 name/workers_dev/KV 保留。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 07:22:37 +08:00
uncle6me-web 1d79ae038c 修正 readme 2026-06-04 12:08:25 +08:00
uncle6me-web 037cf9b6a4 feat(harness): 用戶 CC harness(acr install-harness)+ 公開 repo 只留對外
讓「用 arcrun 開發」的用戶,他的 CC 自動載入 arcrun 防護、不退回自寫 Python。

新增 user-cc-harness(SDD: .agents/specs/user-cc-harness,本機):
- acr install-harness:冪等裝進用戶當前專案(新/舊專案皆可),acr init 末尾也順便裝
  - CLAUDE.md arcrun 區塊(標記包夾,append 不破壞既有)
  - .claude/skills/arcrun-mindset(世界觀 + 資源去哪取 acr parts/auth-recipe)
  - .claude/commands/arcrun.md(/arcrun slash command)
  - .claude/hooks/arcrun-guard.sh(python→提醒不硬擋、暴露→exit 2、每條含正路)
  - settings.json 合併 hook(不覆蓋用戶既有 hooks/設定)
- llms.txt + README「給 AI」段:第一接觸點(用戶丟連結,CC 讀了知道第一步 install-harness)
  含 CF 憑證白話照抄式引導(不對用戶講 KV/Worker/R2 術語)
- harness 素材內嵌 npm 套件(cli/harness/,files 帶上),不依賴用戶有 arcrun repo
- 實測:空目錄/冪等/既有檔合併皆通過,tsc exit 0,npm pack 含 harness 5 檔

公開 repo 清理(richblack:用戶要用不要開發 arcrun):
- git rm --cached 移除開發痕跡 + 思考過程出公開 repo(本機保留供 richblack 開發):
  .claude/CLAUDE.md/AGENTS.md/.agents/docs/DECISIONS/BACKLOG/landing/.github
- .gitignore 防回流;補 MIT LICENSE

MCP(P7)納入 install-harness/update 的接點已設計,實作待 MCP 對齊(BACKLOG 另一條線)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 20:02:44 +08:00
uncle6me-web 922a57fe34 arcrun — AI workflow execution engine (clean history)
Self-hosted 開源:WASM 零件 + recipe + cypher-executor,跑在你自己的 Cloudflare。

此為重建的乾淨歷史起點(移除曾誤 commit 的 GCP SA 金鑰,舊歷史保留在
richblack/arcrun 與本地 backup 分支)。含:
- acr init --self-hosted installer(建 KV/R2 + codeload 拉預編譯 wasm + wrangler deploy + seed recipe)
- recipe push 把關(資料外流提醒 + 打通檢查)
- 19 個正當零件預編譯 wasm(claude_api/km_writer/kbdb_upsert_block 排除:違反 DECISIONS §1)
- CLI / cypher-executor / registry / 完整 SDD

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 15:52:38 +08:00