New backend/app/services/forecasting package (Site Finder v2 EPIC 7, §9.5/§9.6 foundation). Deterministic, no LLM. MonthlyMacro dataclass + get_monthly_macro (daily key_rate resampled to monthly last-known-value via SQL DISTINCT ON, reuses macro.get_macro_series for the already-monthly sverdl mortgage series, carry-forward key_rate over a continuous month grid, graceful on empty/DB error). Pure helpers: classify_regime (down/up/stable, eps 0.25pp), macro_at_lag (0/1/2/3/6), is_confounded_window (COVID 2020-03, geopolitics 2022-02, subsidy cutback 2024-07). 51 unit tests, no live DB. psycopg v3 CAST(:x AS type) throughout.
0 lines
Python
0 lines
Python