feat: Impact Monitor — AI impact evaluation for eco events & geopolitical news
- New DB tables: event_categories (18 bootstrap categories) + instrument_impacts - impact_categories_bootstrap.py: FOMC/NFP/CPI/GDP/PCE/ISM/BOJ/ECB/BOE/OPEC+ + 7 géopolitical categories with per-instrument sensitivity & direction defaults - impact_service.py: GPT-4o-mini evaluation (0-1 score, direction, rationale) + monitor data aggregation - routers/impact.py: GET/POST endpoints for evaluate/bulk/monitor/adjust/categories - ImpactMonitor.tsx: two-tab page (Évalués / À évaluer), top instruments bar, inline score override modal, category browser - Startup auto-bootstrap for impact categories - Route /impact + sidebar nav entry Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ from routers import pattern_lab as pattern_lab_router
|
||||
from routers import specialist_desks as specialist_desks_router
|
||||
from routers import timeline as timeline_router
|
||||
from routers import instruments as instruments_router
|
||||
from routers import impact as impact_router
|
||||
from routers import logs as logs_router
|
||||
from routers import var as var_router
|
||||
from routers import reports as reports_router
|
||||
@@ -82,10 +83,12 @@ def startup():
|
||||
try:
|
||||
from services.macro_events_bootstrap import bootstrap_macro_events
|
||||
from services.eco_calendar_bootstrap import bootstrap_eco_events
|
||||
from services.impact_categories_bootstrap import bootstrap_impact_categories
|
||||
r1 = bootstrap_macro_events()
|
||||
r2 = bootstrap_eco_events()
|
||||
if r1.get("inserted", 0) or r2.get("inserted", 0):
|
||||
_log.info(f"[Startup] Events bootstrapped — macro: +{r1.get('inserted',0)}, eco: +{r2.get('inserted',0)}")
|
||||
r3 = bootstrap_impact_categories()
|
||||
if r1.get("inserted", 0) or r2.get("inserted", 0) or r3.get("inserted", 0):
|
||||
_log.info(f"[Startup] Bootstrapped — macro: +{r1.get('inserted',0)}, eco: +{r2.get('inserted',0)}, categories: +{r3.get('inserted',0)}")
|
||||
except Exception as _e:
|
||||
_log.warning(f"[Startup] Event bootstrap failed: {_e}")
|
||||
# Start auto-cycle scheduler if enabled
|
||||
@@ -135,6 +138,7 @@ app.include_router(pattern_lab_router.router)
|
||||
app.include_router(specialist_desks_router.router)
|
||||
app.include_router(timeline_router.router)
|
||||
app.include_router(instruments_router.router)
|
||||
app.include_router(impact_router.router)
|
||||
|
||||
|
||||
@app.get("/")
|
||||
|
||||
Reference in New Issue
Block a user