feat: causal lab

This commit is contained in:
OpenSquared
2026-07-02 16:46:38 +02:00
parent 5126360ce9
commit 01709e5edf
4 changed files with 384 additions and 0 deletions

View File

@@ -94,6 +94,13 @@ def startup():
_log.info("[Startup] Causal graph templates seeded")
except Exception as _e:
_log.warning(f"[Startup] Causal graph seed failed: {_e}")
# Guidance sync au démarrage (crée les guidance events manquants)
try:
from services.guidance_sync import sync_guidance as _gs
_gr = _gs()
_log.info(f"[Startup] Guidance sync done: {_gr}")
except Exception as _e:
_log.warning(f"[Startup] Guidance sync failed: {_e}")
# Auto-bootstrap désactivé — utiliser les boutons dans Cycle Actions / Timeline
# Start auto-cycle scheduler if enabled
from services.auto_cycle import start_scheduler
@@ -131,6 +138,13 @@ def startup():
r = calendar_sync()
src = r.get("source") or ("ff_fallback" if r.get("_fallback") else "fxstreet")
print(f"[Calendar] Sync done — {src}, upserted={r.get('total_upserted', '?')}", flush=True)
# Guidance sync — crée/met à jour les guidance events après chaque calendar sync
try:
from services.guidance_sync import sync_guidance
gr = sync_guidance()
print(f"[Guidance] Sync done — {gr}", flush=True)
except Exception as _ge:
print(f"[Guidance] Sync error: {_ge}", flush=True)
except Exception as e:
print(f"[Calendar] Sync loop error: {e}", flush=True)
try: