From 8026b9379b75e12392c28a97c268b5421da82a40 Mon Sep 17 00:00:00 2001 From: OoO Date: Wed, 13 May 2026 11:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=88=E4=BD=8F=20scheduler=20=E6=97=A9?= =?UTF-8?q?=E6=99=A8=E6=8E=92=E7=A8=8B=E9=8C=AF=E9=96=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/memory/claude_inventory_validation_20260513.md | 2 ++ tests/test_run_scheduler_embed_consistency.py | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/docs/memory/claude_inventory_validation_20260513.md b/docs/memory/claude_inventory_validation_20260513.md index 7375182..39c5e16 100644 --- a/docs/memory/claude_inventory_validation_20260513.md +++ b/docs/memory/claude_inventory_validation_20260513.md @@ -32,6 +32,7 @@ - V2 提到的 `app.py` 死 import 與 `scheduler.py import schedule` 已不成立;`app.py` 仍使用 `schedule.run_pending()` 等呼叫。 - Cron 盲區清單多數已補 `_notify_scheduler_failure()`;ROI 月報已避開 09:00 改 09:05,AI smoke 已是 09:10。 - V2 指出的 9 個 cron 盲區已補回歸守門:8 個 `run_scheduler.py` wrapper 必須呼叫 `_notify_scheduler_failure()`,`scheduler.py::run_promo_event_task` 必須呼叫 `notify_failure()`。 +- 09:00 排程衝突已有回歸守門:`daily_report=09:00`、`roi_monthly_report=09:05`、`ai_smoke_daily_summary=09:10` 必須保持錯開。 - 0-byte `database/momo*.db` 迷惑檔已不存在;真實 SQLite 僅在 `data/momo_database.db`。 - `.gitignore` 已涵蓋 `.claude/worktrees/`、`.tmp_*`、`MOMO Pro/`、uploads/screenshots。 - `cache_service.py` 已成為 `cache_manager.py` 的相容 shim,`_SALES_CACHE_TTL` 單一來源有測試鎖住。 @@ -89,3 +90,4 @@ - `8a36856` 補強 Telegram callback 診斷 - `5b52af9` 補強 cache best-effort 診斷 - `497c376` 記錄 AI smoke service 入口驗證 +- `b22cbb2` 守住 scheduler 失敗告警覆蓋 diff --git a/tests/test_run_scheduler_embed_consistency.py b/tests/test_run_scheduler_embed_consistency.py index cd925b4..f7186d9 100644 --- a/tests/test_run_scheduler_embed_consistency.py +++ b/tests/test_run_scheduler_embed_consistency.py @@ -139,3 +139,11 @@ def test_v2_cron_blind_spot_list_has_failure_notifications(monkeypatch): promo_source = _function_source("scheduler.py", "run_promo_event_task") assert "notify_failure(" in promo_source + + +def test_roi_ai_smoke_and_daily_report_schedules_stay_staggered(): + source = Path("run_scheduler.py").read_text() + + assert 'schedule.every().day.at("09:00").do(run_daily_report_task)' in source + assert 'schedule.every().day.at("09:05").do(run_roi_monthly_report_if_new_month)' in source + assert 'schedule.every().day.at("09:10").do(run_ai_smoke_daily_summary_task)' in source