Some checks failed
CD Pipeline / deploy (push) Has been cancelled
- Add ElephantService, AutonomousEngine, Orchestrator, DecisionRouter (EA 4-file stack) - Fix 10 bugs: URL typo, SQL schema mismatches (price_records JOIN), enum mapping, metadata_json, NemoTron PriceThreat dispatch, async/await mismatch, broken imports - Wire ADR-012 Agent Action Ladder: EventRouter L2 → EA first + AIOrch fallback; all decisions dual-write DB + triaged_alert Telegram; momo: callback prefix - Wire ADR-013 AutoHeal: resource_optimization trigger → AutoHealService - Add W3 guards: connection cache 300s TTL, $5/hr cost hard limit - Add W4 persistence: routing decisions + agent performance snapshots → ai_insights - Add Migration 015: confidence + created_by columns on ai_insights - Fix run_scheduler.py broken imports (DecisionTracker service didn't exist) - Fix verify_elephant_integration.py: check_status() → check_connection() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
1.3 KiB
SQL
30 lines
1.3 KiB
SQL
-- =============================================================================
|
||
-- Migration 015: Elephant Alpha ai_insights 補齊欄位
|
||
-- MOMO PRO — Elephant Alpha Super Orchestrator
|
||
-- 2026-04-20 台北
|
||
-- =============================================================================
|
||
-- 說明:
|
||
-- Elephant Alpha (_log_decision / _escalate_to_human) 需要兩個欄位:
|
||
-- - confidence : API 回應信心分(0.0~1.0),語意不同於 avg_quality(時間衰減分)
|
||
-- - created_by : 發起 Agent 名稱 ('elephant_alpha' / 'hermes' / ...)
|
||
-- 語意不同於 ai_model(模型字串),混用會破壞 RAG 查詢
|
||
--
|
||
-- 執行方式:
|
||
-- psql -U momo -d momo_pro -f migrations/015_ai_insights_elephant_alpha.sql
|
||
-- =============================================================================
|
||
|
||
ALTER TABLE ai_insights
|
||
ADD COLUMN IF NOT EXISTS confidence FLOAT DEFAULT 0.5,
|
||
ADD COLUMN IF NOT EXISTS created_by VARCHAR(50) DEFAULT 'system';
|
||
|
||
CREATE INDEX IF NOT EXISTS idx_ai_insights_created_by
|
||
ON ai_insights(created_by);
|
||
|
||
CREATE INDEX IF NOT EXISTS idx_ai_insights_confidence
|
||
ON ai_insights(confidence);
|
||
|
||
DO $$
|
||
BEGIN
|
||
RAISE NOTICE '✅ Migration 015 完成 — ai_insights 已新增 confidence / created_by 欄位';
|
||
END $$;
|