ogt
d8d1f3dee8
fix: create ADR-012 agent tables migration + fix telegram_models import
...
CD Pipeline / deploy (push) Successful in 1m19s
Migration 017:
- CREATE TABLE IF NOT EXISTS agent_context, action_plans, action_outcomes,
agent_strategy_weights (all four ADR-012 tables were missing from production DB)
- These tables are required by ElephantAlpha AutonomousEngine coordination loop
telegram_templates.py:
- Fix: from database.telegram_models → database.trend_models (TelegramUser
has always lived in trend_models; telegram_models module does not exist)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-20 05:21:17 +08:00
ogt
47cfd79513
fix: add Migration 016 — playbooks.description column missing from DB schema
...
Playbook SQLAlchemy model has description column but production DB table
does not, causing seed_playbooks() to fail with UndefinedColumn error.
ADD COLUMN IF NOT EXISTS is idempotent — safe to re-run.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-20 05:01:01 +08:00
ogt
ba86f98514
feat: integrate Elephant Alpha ecosystem with full ADR-012/013 compliance
...
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 >
2026-04-20 04:28:26 +08:00
ogt
15c899915a
feat(db): migration 014 — telegram_users 表
...
EventRouter 改走 DB 路徑查 admin chat_id,
取代 .env TELEGRAM_CHAT_IDS 硬編碼。
種子: -1003940688311 (EwoooC_Admin_Group, is_admin=true)
已在 188 momo_analytics 執行建表 + 種子植入。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-19 16:40:56 +08:00
ogt
77d3a1da48
feat(ai-ops): ADR-013 AIOps 自動修復閉環完整實作
...
CD Pipeline / deploy (push) Failing after 3m24s
架構(Exception → Incident → PlayBook → Heal → KM → Telegram):
新增元件:
- database/autoheal_models.py: Incident/Playbook/HealLog 三張表 + 7 條種子 PlayBook
- migrations/013_autoheal.sql: 建表 DDL + 種子資料(冪等 INSERT)
- services/auto_heal_service.py: 核心引擎 7 步閉環
- _classify_error: 8 類錯誤自動分類 (DNS_FAIL/DB_UNREACHABLE/OOM/...)
- _match_playbook: error_type + keyword + 冷卻 + max_retries 保護
- _execute_playbook: DOCKER_RESTART/SSH_CMD/ALERT_ONLY/WAIT_RETRY
- _sink_to_km: 修復知識寫入 ai_insights (auto_heal_playbook)
- SSH 白名單:僅允許 docker restart / compose restart / docker start
修改元件:
- database/manager.py: _init_autoheal_tables() 啟動時建表+種子 PlayBook
- scheduler.py: 3 個核心任務植入 handle_exception
(run_auto_import_task / run_icaim_analysis_task / run_weekly_strategy_task)
- requirements.txt: paramiko(SSH 跳板;不可用時降級 subprocess+CLI ssh)
安全設計: CMD 白名單 + cooldown + max_retries escalation + DB 冪等 migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-19 16:03:49 +08:00
ogt
676c711e7a
feat: AI 治理完備 V10.3 — 技術債清零 + DB 備份機制 + 備份 AI 監控
...
CD Pipeline / deploy (push) Waiting to run
技術債清零 (2026-04-19):
- migrations/010: ai_insights 補 decay_exempt/avg_quality/status/ai_model/feedback 欄位
- migrations/011: embedding_retry_queue 持久化表 (ADR-009)
- migrations/012: backup_log 備份記錄表
- services/openclaw_learning_service: 記憶體 Queue → DB retry queue,時間衰減 RAG
- services/nemoton_dispatcher_service: 三個 tool 強制雙寫 ai_insights (_sink_insight_to_km)
- services/import_service: Excel 前置欄位防禦(商品名稱類 + 業績金額類)
- services/ollama_service: generate_embedding 新增 EMBEDDING_HOST env,embedding 永遠走 192.168.0.111
- SYSTEM_VERSION: V9.4 → V10.3
DB 備份機制:
- scripts/pg_backup.sh: host-level pg_dump 備份腳本,cron 每日 02:00,保留 7 天,Telegram 通知
- services/db_backup_service.py: Python 備份 service,寫入 backup_log
- scheduler: run_db_backup_task (02:00) + run_backup_monitor_task (每 6h AI Agent 監控)
- Dockerfile: 加入 postgresql-client
文件:
- CLAUDE.md: 環境架構依 ADR-008 實地重寫,含完整 SSH/Docker 部署 SOP
- PROJECT_CONSTITUTION.md: 內容已整合入 CLAUDE.md,刪除重複檔案
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-19 02:03:45 +08:00
ogt
1b4f3a7bbe
feat: EwoooC 初始化 — 完整專案推版至 Gitea
...
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 >
2026-04-19 01:21:13 +08:00