Commit Graph

4 Commits

Author SHA1 Message Date
Leo a7d36933e6 feat(cypher-executor): trigger_workflow status paused_awaiting_resume → running_async (LI roadmap 自評)
第一份 arcrun-roadmap (block e924c231) 提的建議:
  「paused_awaiting_resume 容易被誤讀成掛起出問題,
    考慮改成更清楚的 status(如 completed_with_checkpoint)」

我採折衷命名:running_async — 強調「workflow 已接受,正在背景跑」,
不像 completed_with_checkpoint 容易被誤讀為已完成。

範圍:
- trigger_workflow component-loader.ts status field rename
- AGENTS.md §6 common errors table 同步
- arcrun-mcp arcrun_run_workflow tool 回傳 status 同步
- error_code (telemetry classification) 仍保留 paused_awaiting_resume
  (SDD §1.4 error_code enum '可加不可刪' 承諾)

向下相容性:status 是 user-facing field,前面 dogfood 只有 weekly_review
一個 consumer 用 trigger_workflow,已同步更新。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 21:54:41 +08:00
Leo 8e985684f9 feat(cypher-executor): magic vars {{_today}} / {{_iso_week}} / {{_now}} 等
對應 LI SDD M2.x improvement,源自 Claude (我) 透過 arcrun_report_feedback
寫的 feedback block c47bf70b 提的「需要內建變數展開」需求。完整閉環:

  AI 用 MCP tool 報 bug → KBDB 收 feedback → AI 自己看 → 自己修補 → deploy

新增 cypher-executor/src/lib/magic-vars.ts:
  - _today / _yesterday / _now / _now_unix / _now_unix_s
  - _iso_week (2026-W20) / _iso_week_num / _iso_year
  - _yyyymm / _yyyymmdd
  - _year / _month / _day / _hour / _minute / _second(zero-padded)
  - _weekday (0-6, 0=日) / _iso_weekday (1-7, 1=一)
  全部 UTC,避免 worker 跨時區誤判

GraphExecutor.execute() 入口注入:
  ctxWithMagic = { ...initialContext, ...buildMagicVars() }
  順序確保 magic vars 永遠 win(防 user 不小心用 _ prefix)

不違反 §2.2(cypher-executor TS 禁實作 secret/JWT 業務邏輯):
  magic vars 是公開時間常數,跟既有 interpolateString 的 ctx 變數展開
  同層,純 orchestrator routing 職責。

AGENTS.md §10.5 加 magic vars 完整表 + weekly archive 範例。

實測(commit 後 deploy + 觸發 weekly_review):
  - KBDB 新建 roadmap-2026-W20 block 正確展開 page_name
  - roadmap-latest 同步更新(雙寫 pattern)
  - 證明 weekly archive 從此真能累積歷史,不再固定 latest 覆蓋

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 21:20:52 +08:00
Leo 3892dc3a9b docs(AGENTS): 更新 LI M2.2 + M3 新 tool / examples / skills 引用
對應 LI SDD M2.2 + M3.3 + M3.1 完成。

- Step 1 加 arcrun_search_examples / arcrun_list_skills 用法
- Step 3/4/5/6 改用 arcrun_* tool prefix
- 新增 Step 7:報 feedback
- §7「不確定的時候」全部更新成 arcrun_* tool 名
- 新增「過渡期 tool 命名注意」說明:arcrun_* 主用、u6u_* 舊規範保留、
  u6u_deploy_workflow 壞掉建議改 arcrun_push_workflow
2026-05-16 16:41:35 +08:00
Leo 56973558e2 docs(arcrun): AGENTS.md v1 — AI onboarding (LI SDD M1.1)
對應 SDD .agents/specs/llm-interface/ M1.1。

LI (LLM Interface) 第一份文件:任何 AI agent 載入這份就能用 arcrun,
不用讀 SDD 內部架構、不用 grep codebase、不用問人。

包含:
- 30 秒「what is arcrun」
- MCP 連線配置(Claude Desktop / Cursor / 自製 agent 通用)
- 5 個核心概念(Component / Cypher binding / FOREACH / Paused-resume / api_key)
- 你的第一個 workflow(list → validate → push → run → trace 5 步)
- URL 慣例 + CF self-fetch 死鎖警示
- 常見錯誤 + error_code → 下一步 mapping
- 「不確定的時候」標準流程
- report_feedback 規範(**必做**)
- KBDB 速覽 + cron watcher 範例
- meta-規範:寫 workflow 的 AI 自己的習慣

901 words / 263 lines(控制在 5-8K tokens 內),純繁體中文。

CI 自動同步 KBDB block (type=agent-onboarding) 之後再做(M1.1 另一個 subtask)。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 15:28:05 +08:00