feat: separate live early-warning + combined score on the regime tab
Deploy / lint (push) Successful in 7s
Deploy / test (push) Successful in 40s
Deploy / deploy (push) Successful in 24s

The event study showed the breadth-divergence signal genuinely leads (warned
before 7/11 drawdowns, ~6 weeks median, where the coincident baseline almost
never did). Surface it live to observe before deciding how to embed it — kept
separate from the index, not folded into its weights.

- regime_monitor daily job now computes breadth-divergence live and attaches a
  separate early_warning score plus a combined blend (weighted mean, default
  0.6/0.4, configurable via combined_weights) to each snapshot, including the
  backfill so the 7/30-day trends populate immediately. Stored in breakdown_json
  — no schema change. Best-effort: a breadth failure can't break the index.
- get_regime_monitor returns the index, early_warning, and combined scores each
  with 7/30-day deltas.
- Regime tab shows three gauges (generalized ScoreGauge): coincident index,
  early warning, and a compact combined blend. Stale snapshots render "—".

Note: the daily regime job now also does a universe-wide breadth scan.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-26 15:23:37 +02:00
parent 7c5fb1138d
commit 613fc756ec
4 changed files with 205 additions and 55 deletions
+11
View File
@@ -275,6 +275,13 @@ export interface RegimeSignal {
contribution: number;
}
export interface RegimeSubScore {
score: number | null;
band: RegimeBand | null;
delta_7?: number | null;
delta_30?: number | null;
}
export interface RegimeMonitor {
available: boolean;
reason?: string;
@@ -289,6 +296,10 @@ export interface RegimeMonitor {
fundamentals_fetched_at: string | null;
};
trend?: { delta_7: number | null; delta_30: number | null };
// Separate, observational early-warning score (breadth divergence) + a small
// combined blend. Decoupled from the index above.
early_warning?: RegimeSubScore;
combined?: RegimeSubScore;
}
export interface RegimeFundamentals {