feat(telegram): ADR-019 Phase 1 - PPT data freshness gate + store_insight fix
All checks were successful
CD Pipeline / deploy (push) Successful in 2m55s

ADR-019 Phase 1 (止血):PPT 生成前 probe 資料新鮮度。月初/缺資料期間用戶按
ppt:monthly/daily 不再產出空白報告,改主動 inline keyboard 詢問:
  - 改看最新有資料的月份/日期(一鍵)
  - 自訂月份/日期(接 await:date_ppt_*)
  - 取消

新增 PPTDataInsufficientError exception + _ppt_check_data_freshness() helper。
_generate_ppt_cmd 簽章加 _reply_to=None;_ppt_background 靜默吞此例外。

順手修同檔 :1976/:1993 兩處 store_insight() positional args 錯位 bug —
原本 (date, report_type, ai_text) 對應 signature (insight_type, content, period)
完全錯位,導致 period varchar(50) 被 2000 字 AI 內容截斷、INSERT 失敗、
ai_insights 表寫入永久失敗。改成 kwargs 呼叫。

ADR-019 (Telegram Bot Agentic Conversation Layer) 同步落地,Status: Accepted。
六 Phase 路線圖見 ADR 文件,本 commit 完成 Phase 1。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
OoO
2026-05-02 12:52:45 +08:00
parent 1a886d962b
commit db02ecf2cf
3 changed files with 199 additions and 7 deletions

View File

@@ -40,6 +40,7 @@
| [016](ADR-016-daily-sales-cache-fingerprint.md) | daily_sales cache fingerprintgunicorn 多 worker 一致性) | Accepted | 2026-04-29 |
| [017](ADR-017-modularization-cleanup-roadmap.md) | 模組化收尾路線圖Phase 3f | Accepted | 2026-04-29 |
| [018](ADR-018-four-agent-ai-automation-control-plane.md) | 四 AI Agent 自動化控制面Hermes/NemoTron/OpenClaw/ElephantAlpha | Accepted | 2026-04-29 |
| [019](ADR-019-telegram-bot-agentic-conversation-layer.md) | Telegram Bot Agentic Conversation Layer菜單→Agent 決策統一入口) | Accepted | 2026-05-02 |
## 規範