fix(lotto-signals): draw_no 모든 source에 전달 (drift baseline 회차 가드 활성화)

light/sim source에서도 current_draw_no를 항상 fetch해 drift/confidence
메트릭의 회차 단위 중복 push 가드가 올바르게 동작하도록 수정.
lotto_latest_draw() 헬퍼를 service_proxy에 추가하고 run_signal_check에서
source에 무관하게 최신 회차를 먼저 조회; deep_check는 curate_weekly
반환값을 우선 사용.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-20 08:24:02 +09:00
parent e72a52a950
commit f509339cbb
2 changed files with 24 additions and 2 deletions

View File

@@ -360,3 +360,20 @@ async def lotto_strategy_weights() -> Dict[str, float]:
if isinstance(weights, list):
return {item["strategy"]: float(item["weight"]) for item in weights}
return {k: float(v) for k, v in (weights or {}).items()}
async def lotto_latest_draw() -> Optional[int]:
"""GET /api/lotto/latest — 최신 회차 번호만 반환."""
from .config import LOTTO_BACKEND_URL
try:
resp = await _client.get(f"{LOTTO_BACKEND_URL}/api/lotto/latest")
resp.raise_for_status()
data = resp.json()
# /api/lotto/latest 응답 키: {"drawNo": N, ...}
# 하위 호환을 위해 drawNo, draw_no, drwNo, draw 순서로 시도
for key in ("drawNo", "draw_no", "drwNo", "draw"):
if isinstance(data, dict) and data.get(key):
return int(data[key])
return None
except Exception:
return None