feat: separate live early-warning + combined score on the regime tab
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user