From 92329f6fd59df297b96678de8fd2390903141d82 Mon Sep 17 00:00:00 2001 From: gahusb Date: Fri, 22 May 2026 03:24:18 +0900 Subject: [PATCH] =?UTF-8?q?feat(lotto-evolver):=20LottoAgent.run=5Fweekly?= =?UTF-8?q?=5Fevolution=5Freport=20+=20=ED=86=A0=2022:15=20cron?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- agent-office/app/agents/lotto.py | 20 ++++++++++++++++++++ agent-office/app/scheduler.py | 6 ++++++ 2 files changed, 26 insertions(+) diff --git a/agent-office/app/agents/lotto.py b/agent-office/app/agents/lotto.py index 7d50db5..a5c1707 100644 --- a/agent-office/app/agents/lotto.py +++ b/agent-office/app/agents/lotto.py @@ -147,6 +147,26 @@ class LottoAgent(BaseAgent): add_log(self.agent_id, f"daily_digest 발송: 평가 {evaluated} / 발화 {len(sigs)}") return {"ok": True, **digest} + async def run_weekly_evolution_report(self) -> dict: + """토 22:15 — lotto-lab evaluate-now 트리거 후 텔레그램 리포트.""" + from ..service_proxy import lotto_evolver_evaluate, lotto_evolver_status + from ..notifiers.telegram_lotto import send_evolution_report + from ..db import add_log + + try: + eval_result = await lotto_evolver_evaluate() + status = await lotto_evolver_status() + current_base = status.get("current_base") or [0.2] * 5 + await send_evolution_report(eval_result, current_base) + add_log( + self.agent_id, + f"weekly_evolution_report 발송: draw={eval_result.get('draw_no')} reason={eval_result.get('update_reason')}", + ) + return {"ok": True, **eval_result} + except Exception as e: + add_log(self.agent_id, f"weekly_evolution_report 예외: {e}", level="error") + return {"ok": False, "message": f"{type(e).__name__}: {e}"} + async def _run(self, source: str) -> dict: task_id = create_task(self.agent_id, "curate_weekly", {"source": source}) await self.transition("working", "후보 수집 및 AI 큐레이션 중...", task_id) diff --git a/agent-office/app/scheduler.py b/agent-office/app/scheduler.py index fa7b561..aba3776 100644 --- a/agent-office/app/scheduler.py +++ b/agent-office/app/scheduler.py @@ -56,6 +56,11 @@ async def _run_lotto_daily_digest(): if agent: await agent.run_daily_digest() +async def _run_lotto_weekly_evolution_report(): + agent = AGENT_REGISTRY.get("lotto") + if agent: + await agent.run_weekly_evolution_report() + async def _run_youtube_research(): agent = AGENT_REGISTRY.get("youtube") if agent: @@ -97,6 +102,7 @@ def init_scheduler(): scheduler.add_job(_run_lotto_sim_check, "cron", minute=15, hour="0,4,8,12,16,20", id="lotto_sim_check") scheduler.add_job(_run_lotto_deep_check, "cron", day_of_week="sun,wed", hour=21, minute=15, id="lotto_deep_check") scheduler.add_job(_run_lotto_daily_digest, "cron", hour=9, minute=25, id="lotto_digest") + scheduler.add_job(_run_lotto_weekly_evolution_report, "cron", day_of_week="sat", hour=22, minute=15, id="lotto_evolution_weekly") scheduler.add_job(_run_youtube_research, "cron", hour=9, minute=10, id="youtube_research") scheduler.add_job(_send_youtube_weekly_report, "cron", day_of_week="mon", hour=8, minute=0, id="youtube_weekly_report") scheduler.add_job(_poll_pipelines, "interval", seconds=30, id="pipeline_poll")