diff --git a/.env.example b/.env.example index 2362898..35f8b80 100644 --- a/.env.example +++ b/.env.example @@ -28,7 +28,7 @@ FINNHUB_API_KEY= ALPHA_VANTAGE_API_KEY= # Regime Monitor — FRED (VIX + HY credit spreads). Free key: https://fred.stlouisfed.org/docs/api/api_key.html -# Optional: without it the VIX (P5) and credit-spread (F2) signals show as n/a. +# Optional: without it the volatility (V1) and credit (C1) pillars show as n/a. FRED_API_KEY= # Scheduled Jobs diff --git a/app/services/regime_monitor_service.py b/app/services/regime_monitor_service.py index f1df46f..1f4f5f4 100644 --- a/app/services/regime_monitor_service.py +++ b/app/services/regime_monitor_service.py @@ -772,7 +772,7 @@ async def update_regime_monitor(db: AsyncSession, rebuild_sessions: int = REBUIL written, latest_result = await _upsert_snapshot( db, computed, - rewrite_existing_v2=rebuilding or snapshot_date == date.today(), + rewrite_existing_v2=rebuilding or snapshot_date == latest_date, ) snapshots_written += int(written) await db.commit() diff --git a/docs/research/regime-monitor-v2.md b/docs/research/regime-monitor-v2.md index 85832c1..e99edcb 100644 --- a/docs/research/regime-monitor-v2.md +++ b/docs/research/regime-monitor-v2.md @@ -48,6 +48,11 @@ Each snapshot stores the fixed basket symbols, hash, and freeze date. Reconstruc history before that freeze date is retrospective/exploratory; readings after it form the forward record. +The automatic 400-session rebuild is intentionally one-shot: it runs only when +no v2 snapshot exists. If an initial seed used partial data or the wrong basket, +the operational reseed procedure is to remove the v2 snapshot rows and run the +Regime Monitor job again. There is no routine force-rebuild flag. + ## Warning study The study calls the outcome a **10% correction**, not a regime break. The first diff --git a/frontend/src/pages/RegimePage.tsx b/frontend/src/pages/RegimePage.tsx index 053d764..5a50c48 100644 --- a/frontend/src/pages/RegimePage.tsx +++ b/frontend/src/pages/RegimePage.tsx @@ -328,6 +328,12 @@ export default function RegimePage() { footnote={<>Breadth divergence, SMH/SPY rollover, and point-in-time fundamental observations. Unknown or stale fundamentals reduce coverage; they never default to 50.>} /> +
+ Data quality · oldest market input:{' '} + {data.data_quality?.oldest_market_input_age_days == null + ? 'unavailable' + : `${data.data_quality.oldest_market_input_age_days}d`} +