feat: integrate Elephant Alpha ecosystem with full ADR-012/013 compliance
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>
This commit is contained in:
ogt
2026-04-20 04:28:26 +08:00
parent f5faf478bb
commit ba86f98514
15 changed files with 2453 additions and 29 deletions

View File

@@ -53,3 +53,36 @@ USE_HTTPS=false
# Token 檔案位置config/google_token.pickle首次認證後自動產生
GDRIVE_FOLDER_PATH=業績報表/當日業績
GDRIVE_FILE_PATTERN=即時業績_當日
# ==========================================
# Elephant Alpha AI Agent Super Orchestrator Settings
# ==========================================
# Description: Elephant Alpha (100B parameter model) for autonomous AI agent coordination
# Provider: OpenRouter AI
# Documentation: https://openrouter.ai/docs/quick-start
# OpenRouter API Configuration
OPENROUTER_API_KEY=sk-or-v1-your-openrouter-api-key-here
ELEPHANT_ALPHA_MODEL=openrouter/elephant-alpha
# Elephant Alpha Behavior Configuration
ELEPHANT_ALPHA_CONFIDENCE_THRESHOLD=0.7
ELEPHANT_ALPHA_MAX_AUTONOMOUS_DECISIONS_PER_HOUR=10
ELEPHANT_ALPHA_TIMEOUT_SECONDS=180
ELEPHANT_ALPHA_CONTEXT_WINDOW=256000
# Autonomous Engine Settings
ELEPHANTANTH_ALPHA_LEARNING_RATE=0.1
ELEPHANT_ALPHA_PERFORMANCE_TRACKING=true
ELEPHANT_ALPHA_AUTO_ESCALATION_ENABLED=true
# Integration Settings
ELEPHANT_ALPHA_HERMES_URL=http://192.168.0.111:11434
ELEPHANT_ALPHA_HERMES_MODEL=hermes3:latest
ELEPHANT_ALPHA_NEMOTRON_NIM_ENDPOINT=https://integrate.api.nvidia.com/v1
ELEPHANT_ALPHA_OPENCLAW_GEMINI_ENDPOINT=https://generativelanguage.googleapis.com/v1beta
# Debug and Monitoring
ELEPHANT_ALPHA_DEBUG_MODE=false
ELEPHANT_ALPHA_METRICS_ENABLED=true
ELEPHANT_ALPHA_AUDIT_LOGGING=true