mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-05-15 11:36:20 +02:00
* feat: correlation engine with 4-domain signal convergence analysis Multi-domain convergence detection engine with adapter pattern for military force posture, escalation monitoring, economic warfare, and disaster cascade domains. Grid-based spatial clustering with union-find and circular-mean centroid computation (antimeridian-safe). LLM-assisted assessment via deductSituation RPC for high-scoring convergence cards. Adapters collect signals from AppContext intelligence cache, cluster by proximity/country/entity, score by weighted type diversity with 30pt cap, and detect trend direction across 5-minute refresh cycles. Fixes from review: - Concurrent-run guard prevents overlapping engine executions - Entity keyword matching uses compound patterns first to avoid false positives (removed ambiguous "bank", "reserve", "rate", etc.) - LLM cache key includes score bucket to prevent collision between same-location clusters with different signal counts - Outage signal dedup: disaster adapter excludes outages in countries with active conflict events (already captured by escalation adapter) * fix: address review feedback on correlation engine PR #1524 - Call pruneLlmCache() at start of each run() to prevent unbounded growth - Add LLM concurrency limit (max 3 in-flight) to prevent RPC storms - Fix EconomicCorrelationPanel missing setMapNavigateHandler (View on map button was silently broken) - Remove unsafe (m as any) timestamp cast in economic adapter; use `now` since MarketDataCore has no per-quote timestamp field - Require minimum 2 signals for country/entity clusters (single signal is not convergence) - Use toFixed(1) for geographic cluster keys to reduce ID collisions * fix: prevent false convergence cards from sentinel coords and catch-all bucket - disaster.ts: skip outages with 0/0 sentinel coordinates (infra mapping uses 0/0 for unknown locations, creating fake geographic hotspots) - disaster.ts: use == null instead of truthy check for earthquake coords (truthy check drops legitimate events at latitude/longitude 0) - engine.ts: drop unmatched entity labels instead of clustering into "general" bucket (unrelated sanctions news and market moves were merging into false convergence cards) * fix: filter 0/0 sentinel coordinates in escalation outage signals Same fix as disaster adapter: infrastructure/index.ts synthesizes 0/0 for missing outage locations, which corrupts centroid computation, map navigation, and LLM geoContext. --------- Co-authored-by: Elie Habib <elie.habib@gmail.com>