diff --git a/backend/routers/causal_lab.py b/backend/routers/causal_lab.py index 57fcb68..099209e 100644 --- a/backend/routers/causal_lab.py +++ b/backend/routers/causal_lab.py @@ -45,12 +45,25 @@ def _fetch_prices(event_date_str: str, instruments: list[str], lag_days: int = 0 """ YFINANCE_MAP = { "EURUSD": "EURUSD=X", + "GBPUSD": "GBPUSD=X", + "USDJPY": "USDJPY=X", + "USDCHF": "USDCHF=X", + "AUDUSD": "AUDUSD=X", + "NZDUSD": "NZDUSD=X", + "USDCAD": "USDCAD=X", "XAUUSD": "GC=F", + "XAGUSD": "SI=F", "SP500": "^GSPC", + "NASDAQ": "^IXIC", + "DAX": "^GDAXI", + "FTSE": "^FTSE", "BRENT": "BZ=F", + "WTI": "CL=F", "US2Y": "US2YT=RR", "US10Y": "^TNX", "EU10Y": "GE10YT=RR", + "US30Y": "^TYX", + "DXY": "DX-Y.NYB", } out: dict = {"mode": "none"} diff --git a/frontend/src/pages/InstrumentDashboard.tsx b/frontend/src/pages/InstrumentDashboard.tsx index 57025e9..df2ea72 100644 --- a/frontend/src/pages/InstrumentDashboard.tsx +++ b/frontend/src/pages/InstrumentDashboard.tsx @@ -1031,7 +1031,7 @@ function ExplanationScore({ // For each linked event, compute the comprehension score and collect scored ones const scored: number[] = [] const totalLinked: number[] = [] - const debugRows: {id?: number; name: string; pred: string; actual: string; score: number | null; reason: string; surprisePct?: number | null}[] = [] + const debugRows: {id?: number; name: string; pred: string; actual: string; score: number | null; reason: string; surprisePct?: number | null; rawPred?: string}[] = [] for (const ev of events) { if (!ev.template_id) continue @@ -1066,6 +1066,7 @@ function ExplanationScore({ actual: hasActual ? '✓' : '✗', score: null, reason, surprisePct: ev.surprise_pct ?? null, + rawPred: (ev.prediction_json ?? 'null').slice(0, 30), }) const s = comprehensionScore(ev, tmpl, inst) @@ -1146,6 +1147,7 @@ function ExplanationScore({ ? {r.surprisePct > 0 ? '+' : ''}{r.surprisePct.toFixed(1)}% : surp?} {r.score != null && {r.score}%} + {r.rawPred} ))} {debugInfo && ( @@ -1167,6 +1169,19 @@ function ExplanationScore({ ))} + {/* DB state: show rows not in refresh (non-empty pred/actual but still 'vide' in snapshot) */} + {debugInfo.db_state?.length > 0 && ( +