Leo
|
621cb8d948
|
feat(cli): code 零件接進 acr init/update 部署流程(自足 Worker 進部署清單 + vendored wasm 進 repo)
動機(Arcrun#4 後續,leo 批准):code 零件只有原始碼(registry/components/code),
downloadAndDeploy 完全沒涵蓋它——tier1 只掃 .component-builds/*(TinyGo 家族,要求
component.wasm),tier2 寫死四個引擎。merge 後用戶跑 acr update 應真的裝上 code。
接法(實查後裁定):
- code 是自足 Worker(quickjs-emscripten wasmfile variant,非 TinyGo;見其 index.ts 頭註),
「缺 wasm」的真相是「這一類根本不在部署清單」+「vendored quickjs.wasm 是 gitignored
build 產物、不進 archive」。
- deploy.ts 新增 SELF_CONTAINED_COMPONENT_WORKERS(目錄 + 必要產物 gate,比照 tier1
component.wasm gate 的誠實跳過精神),discoverWorkerDirs 將其排進 tier1(零件先於引擎)。
- vendored quickjs.wasm(491KB)commit 進 repo:.gitignore 放行(完全比照
!.component-builds/**/component.wasm 的「部署物 wasm 例外」先例)→ acr update 從
Gitea archive 直接拿到,更新不需 npm build 工具鏈。
- 共享依賴抽成 SHARED_DEPLOY_DEPS 並補 quickjs-emscripten-core + wasmfile variant
(版本對齊零件 package.json,測試看守 drift)→ root 裝一次、esbuild 往上 resolve。
- 注入零改動:既有 stripOfficialOnlyBindings 剝掉 code.arcrun.dev 官方 route、
workers_dev=true 保留 → self-hosted 自動落 arcrun-code.<sub>.workers.dev。
- parts.ts BUILTIN_COMPONENTS 加 code 條目(issue #13 W3:零件=靜態清單)→ acr parts 可見。
實查:init 本來就不對 registry 註冊任何零件(registry index 是官方 backfill 腳本的事),
故「比照其他零件」=進 BUILTIN_COMPONENTS 即對齊。
測試:cli/tests/deploy-code-component.test.ts 9 顆全綠(node --test,零新依賴):
部署清單含 code / 缺產物誠實跳過 / wasm 已 git 追蹤(會進 archive)/ SHARED_DEPLOY_DEPS
涵蓋零件全部 runtime deps + 版本一致 / route 剝除與 [vars] 保留 / parts 清單含 code。
tsc --noEmit 綠;零件自身 12 顆 vitest 綠(沙箱行為未動)。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015d5jDbuqT5Htwv3Q88XXKk
|
2026-07-07 09:01:11 +00:00 |
|
Leo
|
794e3eba3a
|
fix(cli): acr update/deploy 下載源由 GitHub codeload 改指 Gitea archive(Arcrun#4)
動機:D20 防 flag 鐵律下 self-hosted 用戶(如 Mira)不能碰 GitHub,
而「init 之後才新增的零件」(如 code 零件)唯一重裝管道 acr update 綁死
GitHub codeload → 沒有乾淨重裝路徑。
改動(只碰 CLI 下載邏輯,不動 README/cypher/mcp/tools):
- deploy.ts:ARCRUN_REPO 預設 uncle6me-web/Arcrun → Leo/Arcrun;
新增 ARCRUN_GITEA_BASE(預設 https://git.uncle6.me)與 giteaToken()
(ARCRUN_GITEA_TOKEN > GITEA_TOKEN,不寫死)。
- 抽出純函式 buildArchiveUrl / buildDownloadHeaders 走 Gitea archive API
GET {base}/api/v1/repos/{owner}/{repo}/archive/{ref}.tar.gz,保留 #13 P2
cache-buster + no-cache 防 stale;private repo 帶 Authorization: token。
- downloadRepoTarball 改用上述;401/403 給「設 GITEA_TOKEN」提示。
- update.ts docstring 對齊(GitHub release → Gitea archive;標註 install≈update)。
install≈update:init 與 update 共用 downloadAndDeploy,其內容指紋 manifest
天然「新零件補、內容未變者略過」,故用戶跑 acr update 即補裝新零件。
測試:cli/tests/deploy-url.test.ts(Node 內建 test runner,零新依賴)8 顆全綠,
涵蓋 URL 組裝、repo/base 覆蓋、token→header、public 無 token、env 優先序。
真正打 Gitea 下載/部署是 leo 的閘,不在本 PR。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015d5jDbuqT5Htwv3Q88XXKk
|
2026-07-07 08:13:05 +00:00 |
|
Leo
|
9a609c4a04
|
Merge branch 'main' into feat/mcp-tool-rename-arcrun
|
2026-07-07 06:02:07 +00:00 |
|
Claude
|
5fc7277c3c
|
refactor(mcp): u6u_* tool 全面 rename 為 arcrun_* + 前綴收斂單一來源
零 u6u 洩漏(leo 要求 1):connector tool 清單只剩 arcrun_*,並移除壞掉/
重複的 u6u_ workflow tool(deploy/execute/get/list_workflows 由 arcrun_
push/run/get/list_workflows 取代);MCP server name 也由 u6u-mcp-server
改 arcrun-mcp-server。
前綴單一真相源(leo 要求 2):新增 mcp/src/brand.ts(TOOL_PREFIX + toolName()
helper),所有 server.tool() 註冊一律走 toolName("suffix"),前綴不再明碼散寫。
未來 rebrand 只改 brand.ts 一行。
- 12 個獨有能力 tool rename(component/tag/gui/search_workflows)
- 4 個重複/壞掉 tool 移除
- inter-tool hint、描述字串、註解內 u6u_ 名字全數更新
- tsc exit 0;vitest 19/19 綠
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015d5jDbuqT5Htwv3Q88XXKk
|
2026-07-07 05:21:34 +00:00 |
|
Claude
|
92cfb9c59f
|
fix(mcp): address PR #15 review — aud validation, OAUTH_KV auto-inject, TTL/sunset docs, drift test
leo review 5 條逐條處理:
1. RFC 8707 aud 驗證(真缺口):partner-auth OAuth 路徑補「at.aud === resourceUri(originOf(url))」,
不符回 401 invalid_token(防別的 arcrun-mcp 部署簽的 token passthrough)。加 aud 不符→401 測試。
2. deploy.ts injectWranglerConfig 涵蓋 OAUTH_KV(在 PR 內補):OAUTH_KV 納入 REQUIRED_KV_NAMESPACES →
acr init/update 自動建 namespace + 注入用戶帳號真 id(比照 SUBMISSIONS_KV 家族)。wrangler.toml 註解
更新(CLI 路徑自動、手動直推才需手建)。注入 regex 已驗證命中。
3. MCP_TOKEN_TTL 預設維持 30 天(leo 拍板不改):OAUTH.md 明寫為有意取捨(無 refresh token → 到期重走
OAuth=再輸 owner secret),MCP_TOKEN_TTL 可調、7 天為更保守選項。per-owner 可調另開 issue #19(非阻塞)。
4. ALLOW_PLAINTEXT_NAMESPACE 逃生門標 SUNSET(code + wrangler.toml + OAUTH.md),開 issue #18 追蹤
「遷移完成後移除整段 code path + Env 欄位」。
5. 防 drift 測試:spy KV 攔所有 put,斷言對 OAUTH_KV 的每一次 put 都帶 expirationTtl>0(完整流程 +
store 層兩道),防未來往這顆短效 KV 塞長效資料。
驗證:mcp tsc exit 0、vitest 45/45(+aud +drift×2);cli tsc exit 0。
Refs #15 #18 #19
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015d5jDbuqT5Htwv3Q88XXKk
|
2026-07-07 04:56:59 +00:00 |
|
kbdb-cc
|
befc63cfe0
|
fix(kbdb/embed): 語意查詢 metadata 過濾根因修復(Arcrun#11)
根因:Vectorize index 建了卻從沒建 metadata index。CF Vectorize v2 要對某
metadata 欄位下 filter,必須先為該欄建 metadata index,否則帶 owner_id/
entry_type/source 過濾的語意查詢一律回 0 命中(app 端 filter 接線本來就對)。
且 metadata index 只索引「建立後 upsert」的向量 → 既有向量須重推才會被收錄。
- deploy.ts:加 ensureVectorizeMetadataIndexes(),隨部署冪等建 owner_id/
entry_type/source(string)三個 metadata index(self-host/官方帳號皆自動)。
- embed.ts / routes/embed.ts:backfillEmbeddings 加 reindex+offset,重推「所有
embeddable(含 is_embedded=1)」既有向量,讓事後建立的 metadata index 收錄;
POST /embed/backfill {"reindex":true} 觸發,offset 分頁到 remaining=0。
- wrangler.toml:註解補 create-metadata-index 手動步驟 + reindex 提示。
- tests:mock DB 對齊 LIMIT?/OFFSET? 與 reindex predicate;補 reindex 測試。
leo21c 已驗:owner_id=leo / entry_type 過濾修前 0→修後命中,不帶過濾不變。
已知後續(非本 bug 症狀):source 值 89-91 bytes 超過 Vectorize string
metadata index 的 64-byte 索引上限 → source 過濾對長值失效,另案。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJiLCRUU2o3aSpPEzVCt2o
|
2026-07-06 06:03:43 +00:00 |
|
Claude
|
1d19d46161
|
feat(credentials): T8 回填端點 + T9 治理端點/CLI (credential-store-migration)
- POST /credentials/migrate-to-workers-secrets:舊 KV credential 逐筆解密回填 D1+Workers
Secrets,冪等可審,重用 wasi-shim 唯一合法 crypto_decrypt 呼叫點
- GET /credentials 改讀 D1(與既有 /credentials/catalog 共用查詢);DELETE 改為新家優先、
舊 KV fallback,避免孤兒資料
- acr creds list/replace/delete 三支 CLI 薄殼指令;順手修好過期的 acr creds push(舊
client 端加密格式已被 T5 取代)
- 新增 cypher-executor/tests/credentials.test.ts + D1 test fixture
T6/T7(讀取/注入路徑、雙讀 fallback)需要重新編譯 registry/components/auth_static_key
的 TinyGo WASM,本環境無 tinygo 且 proxy 擋 github.com 下載,卡在工具鏈缺口,詳細分析
記錄在 credential-store-migration.md。
端到端驗證:部署到 leo21c 帳號真實跑過 GET/POST/DELETE 三分支 + migrate 端點(對真實
既存的兩筆 credential 跑,發現 cypher-executor 自己的 ENCRYPTION_KEY secret 疑似為空,
誠實記錄為待 leo/總管裁決的不可逆風險項,未擅自重設)。
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
2026-07-04 23:00:07 +00:00 |
|
Claude
|
05333b8fe6
|
feat(credential-store-migration): T3 best-effort — secrets 設定就緒 + 誠實缺口 closure
acr init 加印手動指令 wrangler secret put CF_SECRETS_API_TOKEN
(比照既有 ENCRYPTION_KEY 模式,不發明新模式);CF_ACCOUNT_ID 已在
T5 的 deploy.ts 改動中自動注入(同 WORKER_SUBDOMAIN 機制)。
誠實缺口 closure:對本次真實改動過的 committed code(leo21c
arcrun-cypher-executor)做第二次 wrangler deploy,確認
CF_SECRETS_API_TOKEN/ENCRYPTION_KEY 兩個 secret 存活 + 寫入路徑
redeploy 後仍正常運作(真實 curl 驗證),比 T1.5 spike 對 throwaway
worker 的舊證據更貼近本次改動。
刻意不跑 acr update:mistakes #23 已知限制(硬綁 GitHub codeload
舊碼,會拉回覆蓋剛部署的 T4/T5 成果),跑了只會摧毀測試環境又
證明不了新東西,SDD 本身允許此替代路徑。此結構性衝突留 leo 裁決。
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018D6QoC5waFkcjc2N7csJBB
|
2026-07-03 23:07:42 +00:00 |
|
Claude
|
c24edbbdb6
|
feat(credential-store-migration): T5 寫入路徑改走 Workers Secrets + D1 ref
POST/PUT /credentials 改寫:密文值 PUT 進 CF Workers per-script Secrets
(唯寫,D19 不持有內容物),D1 credentials 表只存目錄(不含密文)。
secret_ref = CRED_<NAME>_<sha256(api_key)[:8]>,避免跨租戶撞名。
DELETE/GET /credentials 本次不動(仍走舊 KV,T9 範圍),已誠實標注。
新增 CREDENTIALS_DB D1 binding(與 KBDB base 共用同一顆 arcrun-kbdb,
沿用既有 database_id 注入機制)+ CF_SECRETS_API_TOKEN/CF_ACCOUNT_ID
env vars(CF_ACCOUNT_ID 由 deploy.ts 自動注入,同 WORKER_SUBDOMAIN 模式)。
§2.4 選項甲落地:client 不再加密,明文值經 TLS 傳輸,cypher 短暫經手
明文不落地不持金鑰——與舊版 01-tech-stack.md 傳輸格式不同,是本 SDD
對舊格式的刻意取代(§6 Q-b 仍需 leo 明確接受)。
驗證:tsc --noEmit exit 0;vitest 26/27(1 pre-existing 無關失敗)。
端到端:真實部署 leo21c arcrun-cypher-executor,POST/PUT /credentials
成功寫入 Workers Secrets + D1 row(CF API + D1 query 雙重確認),
清理測試資料後 restore wrangler.toml(無帳號專屬 id 殘留 git)。
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018D6QoC5waFkcjc2N7csJBB
|
2026-07-03 23:04:59 +00:00 |
|
Claude
|
f9dad311ff
|
feat(credential-store-migration): T2 D1 migration 0002_credentials.sql
新增 credentials 目錄表(api_key/name/service/sensitivity/secret_ref/
created_at/last_used_at,PRIMARY KEY(api_key,name) + idx_cred_apikey),
D19:只存目錄不存密文,密文本體改住 CF Workers per-script Secrets(T5)。
deploy.ts 重用既有 applyD1Migration,緊接 0001_base.sql 之後套用同一顆 D1,
機制完全一致(同一支 CF D1 query API)。
驗證:cli tsc --noEmit exit 0;leo21c arcrun-kbdb D1
(1099d0f3-d062-4202-984c-5a57b0a8c031)實際套用,
sqlite_master 確認 table+index 存在,重跑驗證冪等。
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018D6QoC5waFkcjc2N7csJBB
|
2026-07-03 22:52:09 +00:00 |
|
uncle6me-web
|
2a51d67da0
|
fix(deploy): cache-bust codeload tarball 下載,修 seed 假綠根因 (Arcrun#13 P2)
根因:acr update / init 從 codeload.github.com/.../tar.gz/main 抓部署源,該 branch
tarball 由 GitHub CDN 快取,push 後可 stale 數分鐘。「push→立刻 acr update」抓到舊
tarball → wrangler deploy 仍回 ✓ 但 ship 舊 code → /init/seed 只灌 23(舊種子數,
不含 telegram/line_notify/kbdb)。「deploy 成功」≠「部到修好的版本」= 假綠同一類。
實證:leo21c GET /auth-recipes 部署後仍持久回 23、無 telegram(非傳播延遲);
source main 已含 27 個種子(git show main 核實),但部署的是舊 bundle。
修:downloadRepoTarball 加 no-cache header + cache: 'no-store' + 唯一 _cb query
param,強制繞過 CDN stale entry,每次抓 ref 的最新內容。
待 leo21c 驗:push 此修 + acr update → /auth-recipes 應變 26+(含 telegram)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-29 21:04:52 +08:00 |
|
uncle6me-web
|
c1a06df68f
|
feat(exposure): 完全移除 acr push 暴露 consent 閘 (Arcrun#13 P1)
leo 2026-06-29 拍板:arcrun 是給 AI 用的系統,push/暴露不再需要人類確認。
- 刪 cypher-executor/src/lib/exposure-consent.ts(server 閘,MCP push 的真正擋點)
- 刪 cli/src/lib/exposure-warning.ts(CLI 互動 + 非 TTY 拒絕)
- recipes.ts / webhooks-named.ts:移除 checkExposureConsent 403 閘,直接放行
- recipe.ts / push.ts:移除 obtainExposureConsent 呼叫,不再 prompt/拒絕
- init-seed / seed-api-recipes:移除種子層級 consent
- exposure_consent 欄位降為向後相容(讀舊 record 不報錯,不再寫入/檢查)
不補審計線索、不做替代防護(leo:先拿掉,出問題再設置)。
tsc 全綠(cypher-executor + cli)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-29 20:58:32 +08:00 |
|
uncle6me-web
|
2aa26a5bdd
|
feat(cli): acr search 跨類統一搜尋 + acr parts 去 hardcode recipe(issue #13 根治)
leo 2026-06-29 重構根因:「telegram 與 google 不一致」其實是查錯表——舊世界要找一個能力
必須先決定它是 component/recipe/workflow 才查對清單,但查到答案前根本不知道屬哪類 →
「先知道分類」成了查詢前置,倒因為果(leo:連我都會查錯表)。這是搜尋設計缺陷,非粗心。
兩部分互補修法:
1. acr parts 清理(W3.1/W3.3):移除 5 個 hardcode 的 recipe(gmail_send/google_sheets_append/
telegram_send/line_notify_send/notion)——它們是 recipe(動態,存 store)不是零件(component)。
只留真 WASM 零件。檔頭寫死分流原則 + 移除處留註解防再 hardcode。footer 改指向動態清單 + acr search。
2. acr search <term> 新增(W3.2,正向修法):cli/src/commands/search.ts。fan-out 4 來源——
component(靜態 BUILTIN_COMPONENTS) + recipe(GET /recipes) + auth-recipe(GET /auth-recipes)
+ workflow(GET /webhooks/named),依類別回 counts+命中。各來源獨立 try(離線降級指路、不連坐)。
查的人不必先選表 → 結構性消除「查錯表」。
薄殼合規(rule 07 §2):search 只 fan-out 既有清單端點 + 過濾 + 分組 + 印出(介面層暴露/格式化),
不在介面層拼裝能力。component 靜態(PR-only)、recipe/auth/workflow 動態(store) 分流明確、不再 conflate。
實證(對 leo21c 跑,read-only GET):
- acr search telegram → component:0 recipe:1 auth-recipe:0 workflow:1(一眼看出 telegram 是 recipe)
- acr parts → 只剩 http_request 等真零件,5 個 recipe 已不在
- tsc 全綠、build 通過
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-29 13:08:11 +08:00 |
|
uncle6me-web
|
225aa9f9e7
|
清 parts.ts 降級零件殘留:telegram/gmail/sheets/line 改走 recipe、移除已刪的 ai_transform(issue #13 步驟2)
telegram/gmail/google_sheets/line_notify 已於 2026-05-29 Phase 2 降級為 recipe,
但 acr parts 仍列舊 component: 形態誤導 CC。參照 notion 樣板改成「走 recipe」描述 +
canonical_id 對齊 api-recipe-seeds.ts(telegram_send/gmail_send/google_sheets_append/line_notify_send)。
ai_transform_compile/run 已刪除(mindset §2),整段移除。
canonical_id 均已核實存在於 cypher-executor/src/lib/api-recipe-seeds.ts。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-28 16:05:39 +08:00 |
|
uncle6me-web
|
5d38b599fd
|
feat(#11): CLI/MCP 薄殼對齊 — P0 run 死端點修 + P1 list 同源 + R4 防複發機制
P0 CLI run 改打 /webhooks/named/:name/trigger 真端點(原打 /webhooks/<name> 死端點 404)。
P1 CLI/MCP list 收斂到 GET /webhooks/named(KV 同源):
- CLI list 停 CfKvClient 直連 KV,順手修 key 前綴 bug(原讀 workflow: 對不上部署的 {apiKey}:wf:)
+ self-hosted 不再需 CF API token。
- MCP u6u_list_workflows 從讀 KBDB record 改讀 GET /webhooks/named(registry 簽名加 partnerToken)。
R4 防複發機制:
- cli-mcp-capability-matrix.md(13 能力對照,docs/ gitignored 不進此 commit,僅本機)
- thin-shell-smoke.sh(對真端點斷言非 404,本機手動跑非 CI/cron)
- 機制自驗:注入故意死端點當場攔下、exit 1。
依賴關係:本批依賴 #8(webhooks-named GET 補 description/created_at 欄位、search/backfill 端點),
故疊在 feat/issue-8 branch 上、作獨立 commit。
⚠️ tsc 綠 = code done 非完成。端到端待 leo21c(CLI/MCP 真打通 200 非 404、smoke 對已部署 prod
全綠——目前 smoke 揭 #8 search/backfill 在 prod 仍 404=未部署)。P2 validate 收斂待 #10、
tag resource_id 語意債待方向①。#11 留 open。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-27 19:36:58 +08:00 |
|
uncle6me-web
|
934b9265d9
|
feat: KBDB self-hosted 查詢 + embed 模組 + thin-shell 收窄 + search_workflow(code done 待端到端)
按 issue 分段標明(檔 #5/#8 改動交疊處無法乾淨拆檔,故併一個 commit):
#4 thin-shell §3.1 自力救濟階梯 + code-node 規則(純文檔/規則,code-node 零件未實作)
#5 KBDB source filter(json_extract metadata_json 零建表)+ 能力對照;documents 聚合與
DELETE proxy 部分擱置等頂層 T8
#7 base embed 模組(kbdb/src/embed.ts)+ vectorize 開關(deploy/config/wrangler.toml 註解範本)
+ 語義查詢降級閉環(mode=semantic 未開→LIKE+capability_hint)
#8 部分(workflow-discovery):
- KBDB /entries/search 加 base 通用 entry_type filter(entry-crud/embed/route/kbdb-proxy 透傳)
- /webhooks/named 強制 description(空→400,訊息要求操盤 AI 據實寫一句)
- 部署雙寫 entry_type=workflow embeddable entry(waitUntil 非阻塞,供 search)
- cypher GET /workflows/search + MCP u6u_search_workflows(優先語意、降級 hint)
- cypher POST /workflows/backfill-search-entries(無 desc 列出不編造)
- GET /webhooks/named 補回 description/created_at 欄位(為 list 來源收斂備)
⚠️ tsc 綠 = code done,非完成(mindset §7 禁假綠):
- #7/#8 端到端待 leo21c 部署驗(Vectorize 需官方憑證、CC 跑不了)
- #8 ①-a(MCP deploy 改打 /webhooks/named)未做、MCP deploy 那半仍 404
- #8 端到端(強制填擋空/語義命中/租戶隔離/降級 hint)未驗
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-27 17:52:52 +08:00 |
|
uncle6me-web
|
9c4333defb
|
fix(cli): self-hosted 注入 cypher KBDB_BASE_URL 指向用戶自己的 kbdb(issue #2)
injectWranglerConfig 的 self-hosted 分支原本只注 database_id / MULTI_TENANT,
漏了 KBDB_BASE_URL → cypher /kbdb/* 一律指向官方 arcrun-kbdb.uncle6-me,
self-hosted 用戶資料默默寫進官方庫(隔離破損)。
比照既有注入模式,用 ctx.workerSubdomain 把 KBDB_BASE_URL 就地改寫成
arcrun-kbdb.<subdomain>.workers.dev。init 與 update 共用此注入點,一處修兩條路。
驗證:tsc --noEmit 通過;真實 cypher toml 注入 subdomain=leo21c →
KBDB_BASE_URL = "https://arcrun-kbdb.leo21c.workers.dev"。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-24 12:26:36 +08:00 |
|
uncle6me-web
|
642b61dc9f
|
fix(cli): deploy 注入 MULTI_TENANT=false 到 self-hosted worker(修 MCP 401 注入缺口)
根因(非 code bug):partner-auth.ts MULTI_TENANT 分支邏輯對,但部署沒注入
→ worker c.env.MULTI_TENANT===undefined → 走 partner-key → self-hosted 401。
mcp/wrangler.toml 的 MULTI_TENANT 原是註解掉的,injectWranglerConfig 注了
KV/WORKER_SUBDOMAIN/D1 卻漏 MULTI_TENANT。只取消註解不夠(只修手動 fork,
沒修 acr update 自動部署這條 mira 走的路)。
修法(方案①,注 vars 非 secret,self-hosted 零填寫):
- deploy.ts:DeployContext 加 selfHosted;新增 injectMultiTenant(active/註解/無行三態
→ 加進 [vars]);injectWranglerConfig 在 selfHosted 時呼叫。
- init.ts:deployCtx selfHosted:true(本就是 --self-hosted 分支)。
- update.ts:ctx selfHosted = mode==='self-hosted' || multi_tenant===false(mira 走這條)。
- mcp/wrangler.toml:# [vars] 改 active [vars](官方不含 MULTI_TENANT=多租戶;
注入加行在 [vars] 下,結構正確)。
本地驗注入(真實 export 函式 dry-run):mcp/cypher 注入後各 1 行 active
MULTI_TENANT="false" 在 active [vars] 下 → PASS。cli tsc exit 0。
端到端交棒 mira:leo21c 重跑 acr update → curl Bearer leo /mcp 應 200。
SDD: mcp-account-source.md §5.5.1。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-14 22:45:48 +08:00 |
|
uncle6me-web
|
886a8e31d0
|
feat(kbdb,mcp): KBDB 資料層薄殼 + self-hosted MCP 認證 + cypher KBDB proxy
三件一條鏈(HANDOFF §2/§3b,kbdb-base Phase 9):
A. KBDB MCP 薄殼(9.1):mcp/src/tools/kbdb_data.ts 6 工具
template/record/query/search,調基本盤 API。鐵律:不給建表/SQL,只 template+slot。
B. MCP self-hosted 認證 401(mcp-account-source §5.5):
- partner-auth.ts:MULTI_TENANT=false 時 Bearer 明碼直接當 org_namespace,
繞 KBDB partner 驗證(對齊 cypher 的 opaque-key 模型)。官方 SaaS 行為不變、共用同碼。
- mcp-setup.ts:把 namespace/api_key 寫進 .mcp.json headers.Authorization。
- 新增 self-hosted vs SaaS 分支單測(9 tests 綠)。
C. cypher KBDB proxy(9.5)+ CLI 薄殼(9.2):
- routes/kbdb-proxy.ts 純轉發 /kbdb/* → KBDB 基本盤(KBDB_BASE_URL HTTP fetch,
不新增 service binding)。讓 CLI(只認證到 cypher)能達獨立 KBDB worker。
- 租戶隔離:X-Arcrun-API-Key 自動當 owner_id 注入 records/entries(強制覆寫防跨租戶);
templates 全域共享(虛擬表定義是 schema 非資料)。
- cli/src/commands/kbdb.ts:acr kbdb template/record/query/search,與 MCP kbdb_* 同能力。
- kbdb base:entries 加 page_name 過濾(9.3)。
cypher + cli + mcp tsc exit 0。未驗收:端到端需 deploy + KBDB_BASE_URL 可達後實測。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-14 22:12:32 +08:00 |
|
uncle6me-web
|
b778086f4a
|
perf(self-hosted): acr update 共享一次 install 取代 23 個 worker 各裝 324MB
壓測 2026-06-12 真因:每個 worker 各 pnpm install ~324MB node_modules(23× 重複,
全是 hono+wrangler)→ 好幾分鐘。改成 tarball root 裝一次(hono+wrangler+tier2 額外
zod/mcp-sdk/yaml),各 worker 靠 node 往上 resolve(dry-run 驗證 tier1+tier2 都 bundle 成功)。
207MB×1 取代 324MB×23。疊加 manifest 跳過 → 第二次 update 近乎瞬間。
共享失敗自動退回各 worker 自裝(不破壞既有路徑)。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
2026-06-13 14:45:30 +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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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 |
|