From ef3c51268460fc568a24c798e80c0f2ae2cb7b86 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 May 2026 22:24:43 +0000 Subject: [PATCH] feat(core): EntryContext aggiunge iv_rv_history e dvol_24h_ago Campi opzionali con default vuoto/None per non rompere i caller esistenti. Saranno popolati da entry_cycle quando i flag adaptive_enabled / vol_of_vol_guard_enabled sono True. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/cerbero_bite/core/entry_validator.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/cerbero_bite/core/entry_validator.py b/src/cerbero_bite/core/entry_validator.py index f2d5e6f..4ab5e5c 100644 --- a/src/cerbero_bite/core/entry_validator.py +++ b/src/cerbero_bite/core/entry_validator.py @@ -50,6 +50,19 @@ class EntryContext(BaseModel): # invalida l'entry). iv_minus_rv: Decimal | None = None + # Storia recente di IV-RV (un valore per ogni tick di + # market_snapshots, ASC, NULL e fetch_ok=0 esclusi). Caricata dal + # repository in `entry_cycle` quando `iv_minus_rv_adaptive_enabled` + # è True. Tuple per coerenza con frozen=True. Vuoto = warmup hard + # (gate disabilitato). + iv_rv_history: tuple[Decimal, ...] = () + + # DVOL al tick più vicino a now - vol_of_vol_lookback_hours. + # ``None`` = gap nel dato (es. cron mancante 24h fa) → VoV guard + # skip. Caricato dal repository in `entry_cycle` quando + # `vol_of_vol_guard_enabled` è True. + dvol_24h_ago: Decimal | None = None + class EntryDecision(BaseModel): """Result of :func:`validate_entry`. ``reasons`` holds *all* blocking reasons."""