Leo
495857aebd
fix(cypher-executor): 移除已刪 ai_transform 的 service binding(修 deploy 失敗)
...
Phase 2 刪了 ai_transform_compile/run 零件 + wrangler delete 對應 worker,但 cypher-executor
wrangler.toml 仍有 SVC_AI_TRANSFORM_COMPILE/RUN service binding,導致 deploy 報
"referenced Worker not found"(code 10143),data-exfil-warning 的 A 一直沒生效。
- wrangler.toml 移除兩個失效 [[services]]
- types.ts 移除對應 Bindings 型別宣告
deploy 成功後線上驗證:recipe push 無 consent → 403(A 生效);kbdb_get 回歸 200。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-05-30 15:15:50 +08:00
Leo
8c1dedaa2f
chore(cypher-executor): 清除 KBDB-specific TS 邏輯與 WASM 白名單違規項
...
- 刪除 src/lib/kbdb-partner.ts(整檔)
- routes/auth.ts:移除 kbdb-partner import + 3 處 ensureKbdbPartner/revokeKbdbPartner 呼叫
- wrangler.toml:刪除 KBDB_BASE_URL 與 KBDB_INTERNAL_TOKEN 註解
- lib/component-loader.ts:WASM_HTTP_RUNNER_IDS 移除 claude_api + 6 個 kbdb_*;
doc comment / wasmWorkerUrl 範例 / 第 7 步註解全部清掉 Phase 3 與 kbdb 字樣
- types.ts:Bindings 移除 KBDB_BASE_URL 宣告
- graph-executor.ts:註解範例改為非 kbdb 等效描述
同捎(分開議題,一起進):
- .gitignore 刪除
- webhooks-named.ts:resumable-workflow ?async=1 分支(waitUntil + 202)
tsc --noEmit 通過。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-26 19:39:01 +08:00
Leo
9560485937
feat(cypher): add scheduled() handler — arcrun-native cron 排程基建
...
對應 arcrun.md 三-A P1 #3。
緣由:cron 零件存在但只做 expression validation,沒有真正的排程跑。leo 指出
「邊用 arcrun 邊修,不要 workaround」— 撤回前一輪的 /mira/wiki-from-raw
mira-specific route(違反 mira CLAUDE.md §1.5 一律 arcrun-native),改補
真正的 cron infra。
加入:
- src/lib/cron-match.ts — 5 欄位 cron matcher(* / N / */N / a-b / a,b 組合)
- src/scheduled.ts — handler:掃 KV cron-idx: prefix,比對 controller.scheduledTime
→ executeWebhookGraph 背景跑
- routes/webhooks-named.ts — acr push 時偵測首節點 cron → 存 cron_expr 到 record
+ 額外寫 cron-idx:{api_key}:{name} 輕量索引;DELETE 一併清理
- src/index.ts — export default 改 { fetch, scheduled }
- wrangler.toml — [triggers] crons = ["* * * * *"](每分鐘 tick)
- wrangler.toml — workers_dev = true 供 self-fetch self-trigger 用
- tests/arcrun-test/cron_heartbeat.yaml — 健康監控 workflow(每分鐘 fire + set 節點)
撤回:
- 刪 src/routes/mira.ts(mira-specific workaround)
- types.ts 拿掉 MIRA_CONFIG
- index.ts 拿掉 miraRouter wire
- landing/app/mira/feed/page.tsx 拿掉 triggerWikiSynthesis 呼叫
下一輪:mira_feed_watcher.yaml(mira side),可能要先補 kbdb_get filter +
CALLS_SUBFLOW wire(arcrun.md 列為跟進)。
2026-05-14 14:04:57 +08:00
Leo
6f6e31dbee
fix(cypher): deploy P0 #9/#10/#10衍生 fixes (workers.dev URL + nested FOREACH + propagateCtx)
...
arcrun.md 一直標 ✅ 已解決但 fix 在 working tree 沒推。今天 mira 7B.3f 端對端
跑不通才發現 production 還是舊版(fetch *.arcrun.dev 同 zone 自循環 → 522)。
涵蓋:
- P0 #9 : wasmWorkerUrl() 從 *.arcrun.dev 改 arcrun-{kebab}.{WORKER_SUBDOMAIN}.workers.dev
+ types.ts/wrangler.toml 加 WORKER_SUBDOMAIN binding (uncle6-me)
+ auth-dispatcher.ts 用新 signature
- P0 #10A: interpolateData() 拆 interpolateString + interpolateValue 遞迴 nested
- P0 #10B: propagateCtx() helper 把上游 output spread + 用 node id namespace 存
讓下游能 {{node_id.data.text}} 永不被覆蓋。5 個 edge type 全用此 helper
- P0 #10C: FOREACH 找 iterable 先看 result 沒有再看 ctx + 掃 nested object 一層
解雙重 FOREACH(paragraph→triplets)內層跑 0 次
rules/01-tech-stack.md + rules/03-component-architecture.md 同步補 workers.dev 慣例說明。
未推 5 個 worker 改動,今晚才發現實際沒部署過。
2026-05-14 11:02:44 +08:00
Leo
519423cb0d
feat(arcrun): mira wiki page with tag filter + accumulated WIP
...
- landing/app/mira/wiki: tag=mira-wiki list now shows all wiki paragraphs
(depends on KBDB tag filter exposed in matrix/kbdb commit, separate repo)
- landing: app/mira hub + feed split + various WIP from prior sessions
- registry/components: claude_api / kbdb_create_block / kbdb_get / km_writer /
platform_crypto / auth_oauth2 contracts + main.go (accumulated)
- .component-builds: pkg-lock updates + index.ts adjustments (WIP)
- .agents/specs/arcrun/frontend-redesign: design notes
- docs/test_credentials, docs/user_requirements/arcrun-landing-page: WIP docs
- cypher-executor: auth-dispatcher / wasi-shim adjustments (WIP)
Includes accumulated work from prior sessions plus the wiki UI tag-filter
update that surfaces the AI-generated wiki paragraphs at /mira/wiki.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-07 16:52:01 +08:00
Leo
500d796573
feat: 15 logic component Workers + cypher-executor auth/credentials routing
...
Component Workers:
- Deploys if_control, switch, filter, merge, try_catch, wait, set,
array_ops, string_ops, number_ops, date_ops, validate_json,
ai_transform_compile, ai_transform_run, foreach_control as
independent Workers, backing cypher-executor's SVC_* service
bindings (fast internal RPC for logic components).
cypher-executor routing:
- New routes: /auth (recipe resolution), /credentials (CRUD),
/webhooks/named (user-friendly alias for cmp_/rec_ hashes).
- auth-recipe-seeds.ts: 20 pre-built platform auth recipes
(Google Sheets, Gmail, Telegram, etc.) seeded into RECIPES KV.
- graph-executor + cypher-handlers + search-nodes updated for
the new resolution chain.
- scripts/seed-auth-recipes.ts: one-shot tool to push seeds to KV.
- wrangler.toml: 15 SVC_* bindings wired to the new logic Workers.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-04-20 17:40:02 +08:00
Leo
60d3e41905
feat: component hash IDs + dynamic KV recipe system
...
Hash system:
- cmp_xxxxxxxx: stable ID for logic components (SHA-256 of canonical_id)
- rec_xxxxxxxx: stable ID for API recipe components
- Pre-seeded 15 cmp_ + 6 rec_ hash indexes in KV
RECIPES KV (id: 9cf9db905c6241f78503199e58b2ffe0):
- POST/GET/DELETE /recipes — CRUD for API recipe definitions
- recipe stored as: recipe:{canonical_id} + idx:{rec_hash}
- template interpolation: {{key}} replaced from context
component-loader resolution order:
builtin → external URL → cmp_ hash → rec_ hash →
logic canonical_id → KV recipe → builtin API fallback → error
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 18:36:51 +08:00
Leo
d8e6964088
feat: use CF Service Bindings for logic components (no public network)
...
- Add 15 [[services]] bindings in cypher-executor wrangler.toml
- component-loader now calls logic Workers via Service Binding (svc.fetch)
instead of public URL fetch (which caused 522 timeout within same zone)
- Fallback to public URL if binding not available (dev/testing)
- Add ServiceBinding type to Bindings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 17:01:42 +08:00
Leo
9168253357
chore: fill wrangler.toml KV/R2 IDs and routes for production deploy
...
cypher-executor: EXEC_CONTEXT, WEBHOOKS, CREDENTIALS_KV, ANALYTICS_KV KV IDs,
arcrun-wasm R2, route cypher.arcrun.dev/*
registry: SUBMISSIONS_KV, ANALYTICS_KV KV IDs, arcrun-wasm R2,
route registry.arcrun.dev/*
credentials: CREDENTIALS_KV KV ID
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 15:36:26 +08:00
Leo
e630fca2df
fix(arcrun): address PR #2 review findings
...
Security:
- init.ts: remove cf_api_token from POST /register (only email sent to arcrun.dev)
- cf-api.ts: remove base64 fallback in encryptCredential, throw clear error if key missing
Correctness:
- submitComponent.ts: replace KBDB dependency with SUBMISSIONS_KV + R2 (standalone)
- registry/types.ts: remove KBDB_URL/KBDB_INTERNAL_TOKEN, add SUBMISSIONS_KV/ANALYTICS_KV
- webhooks.ts: add waitUntil(writeExecutionVerdict) for fire-and-forget analytics
- execution-logger.ts: create missing module (was imported but didn't exist)
- cypher-executor/types.ts + wrangler.toml: add ANALYTICS_KV binding
- gmail/telegram/google_sheets/line_notify/http_request: no_network_syscall false (api category)
- init.ts: replace require() with await import() for ES module compatibility
Cleanup:
- Remove arcrun/builtins/ (dead code — initComponents used old HTTP endpoint model,
all 21 components now in TinyGo WASM under registry/components/)
Docs:
- tasks.md: update to reflect completed work and remaining items
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-16 13:07:28 +08:00
Claude
2707fca32b
feat(arcrun): implement arcrun MVP — open-source AI workflow engine
...
Phase 1-5 complete per .agents/specs/u6u-core-mvp/:
**Phase 1 — Cherry-pick & cleanup**
- Create arcrun/ from cypher-executor, credentials, builtins, registry
- Remove 9 InkStone Service Bindings (KBDB, REGISTRY, CLINIC_*, AICEO, MINI_ME)
- Rewrite component-loader: 3-layer (builtin → WASM_BUCKET R2 → error)
- Remove autoPublishMissing.ts, proxy.ts (AICEO), execution-logger.ts (KBDB)
- Clean all KV namespace IDs and InkStone internal URLs from config files
**Phase 2 — contract.yaml completeness**
- Add credentials_required to gmail, google_sheets, telegram, line_notify
- Add config_example to all 21 components with annotated field descriptions
**Phase 3 — Credential injection**
- Add credential-injector.ts: AES-GCM decrypt from CREDENTIALS_KV
- Integrate into GraphExecutor before WASM execution
- Structured errors with repair instructions when credential missing
**Phase 4 — CLI (acr)**
- cli/package.json: arcrun package, bin: acr, deps: commander/js-yaml/chalk/ora
- 8 commands: init, creds push, push, run, validate, parts, list, logs
- Standard mode: writes directly to user's CF KV via CF REST API
- acr init: interactive setup with arcrun.dev API Key registration
**Phase 5 — Open source release prep**
- README.md: 5-minute quickstart, component table, workflow YAML syntax
- CONTRIBUTING.md: TinyGo dev env, component scaffolding, submission flow
- Security audit: no InkStone internal URLs/IDs in committed files
- .gitignore: exclude credentials.yaml, .wrangler, *.wasm
https://claude.ai/code/session_01BnCdSLVH8tUed9VrrPavgT
2026-04-16 04:06:25 +00:00