-- execution_log template seed — KV 額度事故修復(總管交辦,2026-08-07) -- SDD:無專屬 SDD(事故修復任務)。root cause:cypher-executor/src/actions/execution-logger.ts -- 舊版每跑完一次 workflow 就 ANALYTICS_KV.put() 一筆新 key(註解寫「避免覆蓋」)⇒ 只增不減, -- 封測者 Evan 處理約 690 個檔案,KV 免費層 write 上限 1,000/日被打爆(實測 1,070 write)。 -- -- KBDB 鐵律(leo 2026-06-14):三張表打天下,永遠不加新 table,新資料類型一律用 template。 -- 本檔**零 schema 異動**——只 INSERT OR IGNORE 一列 template 定義,手法與本檔同目錄 -- 0001_base.sql §3(seed tpl-recipe-stat)完全相同。 -- -- 儲存精神比照既有 recipe_stat(kbdb/src/actions/recipe-stat.ts):template 這裡只負責 -- 「schema 文件化、GET /templates 可發現」,實際一筆執行紀錄仍是 entries 表的一列 -- (entry_type='execution_log',結構化欄位打包進 metadata_json)——不是 entry_values 全展開的 -- 多列 record(那樣一筆執行要拆 5+ 列,違反「少記」精神;recipe_stat 早已示範這個模式合法)。 -- 實作見 kbdb/src/actions/execution-log.ts。 INSERT OR IGNORE INTO templates (id, name, description, slots_json, created_by) VALUES ( 'tpl-execution-log', 'execution_log', 'workflow 執行紀錄(KV 額度事故修復;欄位收斂=少記,成功記最少/失敗記多一點,見 execution-log.ts)', '["workflow_id","verdict","duration_ms","message","target","api_key"]', 'system' );