OoO
56cd883148
fix: gate elephant price decisions to HITL
CD Pipeline / deploy (push) Successful in 2m11s
2026-06-18 10:14:46 +08:00
OoO
5e1428c887
V10.535 優化 ElephantAlpha 價格 trigger 查詢
2026-06-01 02:24:23 +08:00
OoO
f3c37c471d
V10.533 補 OpenClaw 動態定價 advisory 相容
CD Pipeline / deploy (push) Successful in 1m15s
2026-06-01 02:06:22 +08:00
OoO
291cdf019f
補齊 OpenClaw 市場策略 action 相容
2026-05-31 12:26:17 +08:00
OoO
0f7ad3e036
Tighten chart guards and EA envelopes
CD Pipeline / deploy (push) Successful in 1m4s
2026-05-24 23:56:17 +08:00
OoO
b6de73a4a1
V10.387 improve EA price alert evidence
CD Pipeline / deploy (push) Successful in 1m3s
2026-05-21 20:25:40 +08:00
OoO
3cfc82925e
[V10.325] 收斂 Gemini 為 Ollama 備援
CD Pipeline / deploy (push) Has been cancelled
2026-05-20 12:54:49 +08:00
OoO
2e5ff091fa
專業化資源壓力告警語意
CD Pipeline / deploy (push) Has been cancelled
2026-05-19 22:40:19 +08:00
OoO
e3b4ed9d1e
[V10.276] 修正 EA 價格觸發 DB 實證 prefetch | elephant_alpha_autonomous_engine.py
CD Pipeline / deploy (push) Successful in 1m5s
2026-05-19 21:41:21 +08:00
OoO
aaebd6b86d
清理 EA 過期行動隊列
CD Pipeline / deploy (push) Successful in 1m3s
2026-05-19 21:01:44 +08:00
OoO
32013ae3b2
專業化 EA 資源壓力告警
CD Pipeline / deploy (push) Successful in 1m2s
2026-05-19 20:47:46 +08:00
OoO
75390f8495
收緊 PChome 同款比對門檻
CD Pipeline / deploy (push) Successful in 1m19s
2026-05-19 15:53:09 +08:00
OoO
dafde7e1a7
強化 MOMO PChome 比價可信鏈路
CD Pipeline / deploy (push) Successful in 1m45s
2026-05-19 15:26:10 +08:00
OoO
6788379d10
抑制 EA 無實證空告警
CD Pipeline / deploy (push) Successful in 1m2s
2026-05-19 13:04:01 +08:00
OoO
f49413e78a
記錄 EA short-circuit 遙測失敗
CD Pipeline / deploy (push) Successful in 56s
2026-05-13 10:01:46 +08:00
OoO
153e4c9734
fix(observability): revert unrelated quick review commit files
CD Pipeline / deploy (push) Successful in 58s
2026-05-06 19:50:52 +08:00
OoO
308efdce25
chore(observability): clarify quick review completion copy
CD Pipeline / deploy (push) Successful in 1m4s
2026-05-06 19:49:28 +08:00
OG T
0904a60237
fix(scheduler): quiet cold-start noise gates
CD Pipeline / deploy (push) Successful in 1m29s
2026-05-06 00:31:30 +08:00
OG T
f6a2a05e3f
fix(aiops): treat openclaw strategy actions as advisory
CD Pipeline / deploy (push) Has been cancelled
2026-05-05 13:49:36 +08:00
OoO
56504ed7c1
fix(ea): Hermes-first short-circuit + 消除 EA escalation LLM 幻覺訊息
...
CD Pipeline / deploy (push) Has started running
統帥 2026-05-03 23:30 反饋:「EA escalation 訊息空洞、浪費 Gemini API」
根因:
1. 燒錢:每個 trigger 先跑 Gemini orchestration,再 prefetch Hermes
Hermes 0 threats 時 → Gemini 已燒,訊息卻空泛幻覺
2. 空泛:fallback 路徑灌 OpenClaw plan 文字 + decision.reasoning
全是「312 SKU / 23% / 14 項任務」LLM 自由發揮,無 DB 鉤住
修補:
A. _execute_autonomous_decision 加 Hermes-first short-circuit
- 價格類 trigger 先跑 Hermes (5s timeout, 免費 Ollama)
- 0 threats → 直接 return,不燒 Gemini orchestration
- 預期 >70% trigger 在此階段攔截,月省 ~3-5M Gemini tokens
- prefetch 結果存入 trigger.conditions 給 orchestrator 用
(避免 orchestrator 又自己編 SKU 數字)
- log_ai_call 記 short_circuit=true 供 token report 統計
B. _escalate_to_human fallback 路徑改極簡訊息
- concrete=Hermes 實證 vs concrete=None 兩條路徑徹底分離
- 有實證 → 完整訊息(含 SKU 流失金額)
- 無實證 → 極簡訊息「⚠️ Hermes 即時數據不可用」+ SQL 查詢指引
不再灌 OpenClaw plan 文字 / decision.reasoning(幻覺源頭)
Operation Ollama-First v5.0 / Phase 6.5 hotfix / ADR-021 遵循收尾
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-03 23:26:18 +08:00
OoO
5daa1a45d8
fix(strategist): plug stale gate gaps in daily/monthly + psutil dep + complete stale shape (critic post-review)
...
critic post-review 對 commit 9158bbe 找到 3 個 BLOCKER,本 patch 補完。
#1 daily/monthly 路徑沒套 stale gate(Critical)
- generate_daily_report() 在 _fetch_sales_summary(7) 後立刻檢查 sales.get("stale"),
避免 daily_sales_snapshot 過期時每天 09:00 復發 NT$0 偽日報
- generate_monthly_report() 在 _fetch_monthly_sales_summary 後檢查
revenue==0 and sku_count==0(_fetch_monthly_sales_summary 沒內建 stale 機制,
以「無資料」當訊號),避免月初產出 NT$0 偽月報
- 抽出 _send_data_stale_alert(report_type, last_date, period) 統一三條路徑共用,
以 ai_insights 表查近 24h 同 report_type 的 data_stale_alert 紀錄做 dedupe,
避免每天 daily/weekly 三份報告同時觸發 → 一天送多次告警噪音
- weekly stale 分支改用 _send_data_stale_alert(return shape 維持 status="error"
不動,保 9158bbe weekly dedupe/cache 機制下游語意)
- daily/monthly 採 critic 建議的 status="skipped";scheduler 既有 task 不檢查
status 也不 raise,EventRouter 不會被誤觸
#2 psutil 沒在 requirements.txt(Critical)
- requirements.txt 加 psutil>=5.9(ADR-019 Phase 2 要求 production 必裝)
- elephant_alpha_autonomous_engine._get_system_load_percentage 加註解:
ImportError fallback 是 queue-based 估算(pending=14→70%、≥18→90%),
與真實 CPU 無關,僅 dev defensive;prod 觸發即代表容器映像漏裝
#9 _fetch_sales_summary stale 分支 return shape 不完整(High)
- stale 分支補完 daily/current_7d_revenue/prev_7d_revenue/wow_pct/sku_count
- 數值欄位用 None(非 0):未套 stale gate 的上游 caller 在 prompt template
`:,.0f` 會 raise TypeError,比靜默 0 明顯,迫使呼叫端必須 stale gate
三問自審:
- 方案正確:daily 不再發 NT$0(_fetch_sales_summary 後立刻 gate);psutil 會被
pip install;stale shape None 在所有 caller 路徑要嘛被 gate 擋下要嘛 raise
- 影響完整:grep 確認 _fetch_sales_summary 三 caller(weekly/daily/monthly via
_fetch_monthly_sales_summary)皆已加 gate;無下游依賴 data_stale return 字串
- Regression 風險:stale shape 改 None 為純擴充無 caller 取數值欄位;scheduler
只讀 period/chart_count/action_count 不檢查 status;monthly revenue=0 gate
在實務 P0 異常時告警,比靜默產 NT$0 月報可接受
不在本 patch scope(critic 任務描述明示禁動):
- 9158bbe weekly dedupe/cache 機制(_acquire_weekly_strategy_send_lock 等)
- elephant_alpha Phase 1 已修部分(trigger/dispatch/method raise)
- run_scheduler.py 排程設定
- tests/ 內任何測試
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-03 01:54:21 +08:00
OoO
00591c5489
feat(ea-hitl): ADR-021 EA 升級審核 pre-fetch + 競價告警金額影響量化
...
根治 2026-05-02 統帥反映的三層 EA escalation 訊息空泛問題:
1. _escalate_to_human 對 price_drop_alert / market_opportunity /
threat_escalation 三類觸發,送 Telegram 前先 await Hermes 取具體
SKU 清單覆蓋 plan 元流程文字(5s 短超時,失敗 fallback 原 plan)
2. NemoTron 競價告警新增 _compute_business_impact helper:
過去 7 日營收流失(gap_pct>0 才算)+ 跟進競品建議價,
dispatch 主路徑 / 防線二 / Hermes rule fallback 三條全部 Python
獨裁注入,告警含「📉 NT$ X」「🎯 NT$ Y」具體金額
3. 補實 telegram_bot_service.handle_callback 的 momo:eig: prefix
handler,HITL「🛑 忽略此事件」按鈕首次有對應 audit 寫入
Critic 審查通過(5 項必修全綠):
- Critical-1: user_label HTML escape 防 Telegram username XSS
- High-1: pre-fetch 改 asyncio.wait_for(5s) 防阻塞 escalation
- High-2: 全部行缺金額時 return None 觸發 plan fallback
- Medium-2: 空 event_id callback 拒絕避免 audit 污染
- Medium-3: gap_pct≤0 時 revenue_loss_7d 強制歸 0 不誤導降價
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-03 00:03:38 +08:00
OoO
9068d463bb
feat(ea): execute Phase 3 C-series architecture fixes to prevent recurrence
...
CD Pipeline / deploy (push) Successful in 2m37s
- C1: Removed weekly_strategy and meta_analysis from Elephant Alpha's SAFE_ACTIONS (orchestrator prompt and engine _ACTION_ZH) to prevent autonomous generation of scheduled reports
- C2: Removed hardcoded 0.85 confidence example from orchestrator prompt and implemented bounding validation (0.0~1.0) in _parse_strategic_decision
- C3: Expanded ADR-019 data freshness gate (_ppt_check_data_freshness) to cover /ppt weekly and /ppt strategy routes, proactively warning users of stale data
2026-05-02 14:39:10 +08:00
OoO
9158bbe1a6
fix(ea): execute Phase 2 B-series data quality and gate improvements
...
CD Pipeline / deploy (push) Successful in 2m40s
- B1 & B2: Updated SQL column names from 銷售金額 to 總業績 in openclaw_strategist_service.py and chart_generator_service.py
- B3: Removed bare except statements in DB fetchers to raise errors instead of failing silently
- B4: Implemented freshness gate (MAX(snapshot_date) < CURRENT_DATE - 2) in daily_sales_snapshot to prevent generating stale reports and send data stalled alerts
- B5: Replaced hardcoded 45.0 system load percentage with actual psutil CPU metric
2026-05-02 14:34:30 +08:00
OoO
e6df2fad28
fix(ea): remove weekly_strategy/meta_analysis from autonomous engine triggers (Phase 1 stopgap)
...
CD Pipeline / deploy (push) Successful in 2m39s
Critic-approved 3-point revision (REVISE → adopted):
1. Disable weekly_insight trigger at definition (line 279-285) — EA no
longer evaluates the 6h / >=5 ai_insights condition that fired
_generate_strategy_report without force_tg_alert=True.
2. Remove the openclaw weekly/meta dispatch table branches (line 591-606).
The 5 actions (generate_strategic_analysis, generate_weekly_strategy,
generate_market_analysis, generate_pricing_strategy,
generate_meta_analysis) now fall through to the existing
`raise ValueError(f"Unrecognized step: ...")` at line 631, which
_execute_decision's try/except converts into a circuit-breaker failure.
This is the correct failure semantics critic asked for.
3. Convert _generate_strategy_report / _generate_meta_report into hard
RuntimeError raisers and drop their imports of
openclaw_strategist_service. Deep insurance: any future caller crashes
immediately instead of silently bypassing dedupe.
Evidence: ai_insights logged 35+ duplicate weekly_strategy sends in 7 days
because EA's `_generate_strategy_report` invoked
generate_weekly_strategy_report() without force_tg_alert=True, bypassing
the run_scheduler.py weekly dedupe gate.
Out of scope (per task contract):
- run_scheduler.py:115 Monday 06:00 schedule — preserved (sole owner)
- services/openclaw_strategist_service.py — owned by B-series (SQL)
- Other EA triggers (price_drop_alert / market_opportunity /
threat_escalation / code_exception / resource_optimization) — preserved
- Other dispatch branches (hermes / nemotron / auto_heal / code_fix /
price_adjustment review) — preserved
- Did NOT add force_tg_alert=True defensive layer (critic flagged as
anti-pattern)
- Did NOT touch _TRIGGER_TO_DECISION_TYPE / _ALLOWED_ACTION_TYPES
Not pushed, not deployed. D1 deployment will be issued separately and
must use `docker compose up -d --no-deps --force-recreate momo-scheduler`
(per feedback_compose_restart_vs_up).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-02 13:12:14 +08:00
OoO
b5de8d5d61
fix(ai): 價格調整轉人工覆核
CD Pipeline / deploy (push) Successful in 2m16s
2026-05-01 14:09:54 +08:00
OoO
d4865983d8
補強 ElephantAlpha 執行與通知閉環
CD Pipeline / deploy (push) Successful in 1m10s
2026-04-29 23:14:09 +08:00
OoO
0c2e9bbced
串接 AI 洞察向量化與漏通知入口
CD Pipeline / deploy (push) Successful in 1m13s
2026-04-29 23:05:46 +08:00
OoO
4cbd775c1b
fix(aiops): 補齊 Elephant Alpha trigger context
...
CD Pipeline / deploy (push) Successful in 1m39s
部署閘門修復:補 autonomous engine 的 confidence/max decision 初始化與 _build_trigger_context,避免 scheduler autonomous monitoring 持續噴 AttributeError。
2026-04-29 21:48:41 +08:00
OoO
32ac92b8f0
fix: _ssh_exec signature in ElephantAlpha
CD Pipeline / deploy (push) Has been cancelled
2026-04-28 12:15:42 +08:00
OoO
3dd73dce03
fix: missing sqlalchemy text import and _ssh_exec in ElephantAlpha
CD Pipeline / deploy (push) Successful in 1m20s
2026-04-28 12:13:44 +08:00
OoO
bc7113bc86
fix: ElephantAlpha crash, AiderHeal Ollama host, MCP integration for Hermes/NemoTron, and MCP hallucination
CD Pipeline / deploy (push) Successful in 1m18s
2026-04-28 12:11:33 +08:00
ogt
784a3135c1
fix(telegram): 修正 EA 通知格式與 Agent 名稱問題
...
CD Pipeline / deploy (push) Successful in 1m14s
- 禁止 Gemini 音譯 Agent 名稱(赫瑪斯→Hermes, 內莫特朗→NemoTron)
- _AGENT_ZH 改為 _AGENT_LABEL,保留英文原名
- orchestrator system/user prompt 強制 reasoning 必須含具體數字
- _notify_telegram_executed 改為直接組裝訊息,顯示效益/依據/步驟
- _escalate_to_human 使用 _AGENT_LABEL 替換 _AGENT_ZH
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-21 13:03:49 +08:00
ogt
a62b83f488
feat(aiops): 完整 MCP + OpenClaw 全景電商分析管線
...
CD Pipeline / deploy (push) Successful in 1m14s
- 新增 services/mcp_collector_service.py:Gemini Search Grounding 外部情報收集
- 重寫 services/openclaw_strategist_service.py:真實 Gemini 2.5 Flash 分析,DB 持久化
- scheduler.py:修復 generate_meta_analysis_report ImportError,串接 Meta-Analysis
- elephant_alpha_autonomous_engine.py:新增 weekly_insight 觸發器路由 OpenClaw
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-21 12:50:35 +08:00
ogt
bf5f0d256a
fix(aiops): resolve ADR-014 logical bugs
...
- Fixed target_file context passing in auto_heal_service
- Fixed docker log scanning inside momo-scheduler using SSHJumpExecutor
- Fixed AiderHealExecutor SSH key path
2026-04-20 23:25:49 +08:00
ogt
3127466a85
feat(aiops): implement ADR-014 Autonomous Code Heal Pipeline
...
CD Pipeline / deploy (push) Successful in 1m14s
- Added AiderHealExecutor for SSH remote execution of aider-chat
- Added CODE_FIX action_type to AutoHealService
- Added code_exception trigger to Elephant Alpha engine (Traceback log scanning)
- Added 014 playbook migration script
2026-04-20 23:13:32 +08:00
ogt
65de5d7893
fix: 所有 Telegram 告警內容統一繁體中文
...
CD Pipeline / deploy (push) Has been cancelled
新增 _TRIGGER_ZH / _AGENT_ZH / _ACTION_ZH 翻譯表:
- trigger_type 英文代碼 → 繁中標籤(價格下滑警報、市場機會偵測等)
- agent 名稱 → 繁中(Hermes 分析師、NemoTron 監控、OpenClaw 策略師)
- action 代碼 → 繁中(競品價格分析、派送告警通知等)
- 升級審核觸發類型、參與模組、執行步驟全面繁中化
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-20 20:07:36 +08:00
ogt
61496af2c5
fix: stop runaway EA Telegram spam (cooldown + API key detection + dedup)
...
CD Pipeline / deploy (push) Successful in 1m20s
Root cause: OPENROUTER_API_KEY not set → fallback confidence=0.60 →
always below threshold → _escalate_to_human() every 60s loop → infinite
Telegram messages, all meaningless.
Three-layer fix:
1. API Key detection: if fallback_decision triggered (reasoning contains
"Elephant Alpha unavailable"), silently skip — no Telegram, no cost,
update last_triggered to prevent infinite retry
2. Per-trigger cooldown in _check_triggers():
price_drop_alert 30min / market_opportunity 60min /
threat_escalation 15min / resource_optimization 60min
3. Escalation dedup in _escalate_to_human(): _last_escalated[] tracks
last Telegram send time per trigger type; suppresses within cooldown
Valid HITL escalations (when EA is actually online) still work correctly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-20 05:34:21 +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