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>
This commit is contained in:
uncle6me-web
2026-06-03 15:52:38 +08:00
commit 922a57fe34
485 changed files with 89356 additions and 0 deletions
+79
View File
@@ -0,0 +1,79 @@
# SDD 協議(每次啟動必讀)
## 第零原則:沒讀 SDD 不准動 code
任何 `.go` / `.ts` / `.tsx` / `.wasm` 相關變動,**必須**按以下順序執行。**不得簡化,不得跳過**。
### 步驟 1:讀總進度
先讀 `.agents/specs/arcrun/arcrun.md`,了解當前 Phase。
### 步驟 2:定位對應 SDD
根據任務性質找對應 SDD
| 任務類型 | 對應 SDD |
|---------|---------|
| Auth primitive WASM 零件(static_key/oauth2/service_account/mtls | `.agents/specs/arcrun/credential-primitives-wasm/` |
| 清除 cypher-executor 裡的 TS 業務邏輯 | `.agents/specs/arcrun/credential-primitives-wasm/` |
| WASI shim host functionskv_get / crypto_decrypt / crypto_sign_rs256 | `.agents/specs/arcrun/credential-primitives-wasm/` |
| Auth Recipe 系統(recipe schema、KV 格式) | `.agents/specs/arcrun/auth-recipe.md` |
| Landing Page | `.agents/specs/arcrun/landing-page.md` |
| CLI / SDKPython/JS | `.agents/specs/arcrun/sdk-and-website/` |
| arcrun-core-mvp 整體架構 | `.agents/specs/arcrun-core-mvp/` |
| Platform Evolution | `.agents/specs/arcrun-platform-evolution/` |
| Credential 長期規格(需求源) | `docs/user_requirements/credential_parts.md` |
`design.md``tasks.md` 兩份。
### 步驟 3:宣告(強制格式)
開始動手前,在回覆開頭**逐字**貼出以下宣告:
```
📋 已讀 SDD
- .agents/specs/arcrun/arcrun.md(當前 Phase<phase 名稱>
- <對應 SDD 的 design.md 路徑>
- <對應 SDD 的 tasks.md 路徑>
🎯 本次對應 task<task 編號,例如 "Phase 1.3 實作 auth_static_key main.go">
📐 本次 task 的 SDD 規範摘要:
- <重點 1>
- <重點 2>
- <重點 3>
🚧 執行範圍:
- 會修改:<檔案清單>
- 會建立:<檔案清單>
- 會刪除:<檔案清單>
```
**不做這個宣告 = 違反 SDD 協議 = 停手等 richblack**
### 步驟 4check tasks.md 狀態
動手前:在 tasks.md 把對應 task 的 `- [ ]` 改成 `- [🔄]`(進行中標記)。
完成後:改成 `- [x]`,不批次更新,每完成一個就立刻改。
## 什麼算「任務超出 SDD 範圍」?
以下情況屬於 **change**,不是 **modify****必須停手並與 richblack 確認**
- SDD 沒寫到的新功能
- 新增頂層目錄
- 新增新的 Worker(不管是 cypher-executor / registry / 零件 worker
- 修改架構決策(例如「改用 xxx 取代 yyy」)
- 跨多個子系統的連鎖修改
**停手不是怯懦,是專業**。猜錯方向比慢一小時更糟。
## 發現 SDD 本身有問題怎麼辦?
- SDD 和實作不一致 → 停手,列出矛盾點,與 richblack 確認哪一邊是對的
- SDD 規範之間互相矛盾(例如禁令 A 和設計 B 衝突)→ 停手,引用矛盾原文,與 richblack 確認
- **不可以自行猜哪個是對的**。CC 之前兩天就是這樣走錯的。
## 為什麼這個協議存在
arcrun 規範已經足夠細緻,CC 之前出錯不是因為不懂,而是因為**沒讀**或**讀了覺得「大概是這個意思」就動手**。SDD 協議強制把「先讀 → 定位 → 宣告 → 執行 → 更新」做成一條死規矩,沒有繞過去的路徑。