Some checks failed
CD Pipeline / deploy (push) Failing after 59s
- 建立 Gitea Actions CD pipeline (.gitea/workflows/cd.yaml) - 部署模式: rsync Python 檔案至 188 → docker restart (volume mount) - Dockerfile/requirements 變動時自動重建 Docker image - 部署通知: Telegram (開始/成功/失敗) - 健康檢查: https://mo.wooo.work/health (最多 5 次重試) - 同步最新 CLAUDE.md / ADR-008 / memory (2026-04-19) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
24 lines
1.2 KiB
SQL
24 lines
1.2 KiB
SQL
-- ADR-005 + ADR-007: ai_insights 補齊品質分數時間衰減所需欄位
|
||
-- 日期: 2026-04-19
|
||
-- 相容性: PostgreSQL / SQLite(ALTER ADD COLUMN IF NOT EXISTS 僅 PG 9.6+;SQLite 需另處理)
|
||
|
||
-- 1. 品質分數(時間衰減公式的 Base_Score,0.0~1.0)
|
||
ALTER TABLE ai_insights ADD COLUMN IF NOT EXISTS avg_quality FLOAT DEFAULT 0.5;
|
||
|
||
-- 2. 審核狀態(approved / pending / rejected / archived)
|
||
ALTER TABLE ai_insights ADD COLUMN IF NOT EXISTS status VARCHAR(20) DEFAULT 'approved';
|
||
|
||
-- 3. 時間衰減豁免(structural / constitutional 類設 TRUE)
|
||
ALTER TABLE ai_insights ADD COLUMN IF NOT EXISTS decay_exempt BOOLEAN DEFAULT FALSE;
|
||
|
||
-- 4. AI 來源模型(hermes3 / llama-3.1-8b / gemini-2.0-flash)
|
||
ALTER TABLE ai_insights ADD COLUMN IF NOT EXISTS ai_model VARCHAR(50);
|
||
|
||
-- 5. 回饋統計
|
||
ALTER TABLE ai_insights ADD COLUMN IF NOT EXISTS feedback_up INTEGER DEFAULT 0;
|
||
ALTER TABLE ai_insights ADD COLUMN IF NOT EXISTS feedback_down INTEGER DEFAULT 0;
|
||
|
||
-- 6. 索引支援 RAG 查詢(status + insight_type 複合)
|
||
CREATE INDEX IF NOT EXISTS idx_ai_insights_status_type ON ai_insights(status, insight_type);
|
||
CREATE INDEX IF NOT EXISTS idx_ai_insights_decay_exempt ON ai_insights(decay_exempt);
|