9560485937
對應 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 列為跟進)。
24 lines
703 B
YAML
24 lines
703 B
YAML
name: cron_heartbeat
|
|
description: |
|
|
arcrun cron infra 健康監控 — 每分鐘觸發一次,set 節點輸出 message。
|
|
用 wrangler tail arcrun-cypher-executor 看:每分鐘應出現 `[scheduled] trigger cron_heartbeat ...`
|
|
跟 `[scheduled] done cron_heartbeat true {ms}ms`。
|
|
|
|
對應 SDD: matrix/arcrun/.agents/specs/arcrun/arcrun.md 三-A P1 #3。
|
|
|
|
flow:
|
|
- "heartbeat_cron >> ON_SUCCESS >> log_heartbeat"
|
|
|
|
config:
|
|
heartbeat_cron:
|
|
component: cron
|
|
cron_expr: "* * * * *"
|
|
description: "每分鐘 cron infra heartbeat"
|
|
|
|
log_heartbeat:
|
|
component: set
|
|
values:
|
|
message: "alive at {{_scheduled_at}}"
|
|
cron_triggered: true
|
|
api_key_prefix: "{{api_key}}"
|