Overview
The Country Instability Index (CII) is a real-time stability scoring system (0-100) that blends structural baseline risk with detected events across multiple intelligence streams. Every country with incoming data receives a live score automatically.23 curated tier-1 nations have individually tuned baseline risk profiles. All other countries use universal default scoring (
DEFAULT_BASELINE_RISK = 15, DEFAULT_EVENT_MULTIPLIER = 1.0).Score Calculation Formula
The CII is calculated using a blended approach that combines baseline risk (40%) with dynamic event scoring (60%):src/services/country-instability.ts:883-907
Component Breakdown
Unrest Score (25% weight)
Measures civil unrest events from ACLED protests:Number of protest events detected in country (24h window).
Country-specific scaling factor. High-volume democracies (US, France, India) use logarithmic scaling to prevent routine protests from inflating scores.Examples:
- US: 0.3 (protests are routine, not destabilizing)
- Russia: 2.0 (protests are rare and significant)
- Iran: 2.0 (authoritarian state, every protest matters)
Math.min(30, fatalities * 5 * multiplier) — deadly protests escalate score significantly.Math.min(20, highSeverityCount * 10 * multiplier) — protest severity classification from ACLED.Internet outages during protests indicate censorship:
- Total outage: +30 per event
- Major outage: +15 per event
- Partial outage: +5 per event
- Cap: 50 points
src/services/country-instability.ts:683-716
Conflict Score (30% weight)
Measures armed conflict intensity from ACLED + GDELT + Iran attack events:Direct combat engagements (×3 multiplier).
Remote violence and explosions (×4 multiplier).
Violence against civilians (×5 multiplier + 10pt bonus cap).
Math.min(40, Math.sqrt(totalFatalities) * 5 * multiplier) — square root scaling prevents outlier events from dominating.Recent strikes (7-day window):
- Base: +3 per strike
- High/critical severity: additional +5 per strike
- Cap: 50 points
Israel-specific: OREF rocket alert integration
- Active alerts: +25 base
- Additional +5 per alert (up to +25 more)
- 24-hour history: +10 if ≥10 alerts, +5 if 3-9 alerts
src/services/country-instability.ts:747-791
Security Score (20% weight)
Measures military activity and aviation disruption:ADS-B tracked military aircraft (3pts each, cap 50).Foreign military presence: Flights from non-resident operators are double-weighted to account for threat projection.
AIS + USNI tracked naval vessels (5pts each, cap 30).
Airport delays/closures:
- Closure: +20
- Severe delay: +15
- Major delay: +10
- Moderate delay: +5
- Cap: 40 points
GPS/GNSS interference from ADS-B transponder analysis:
- High interference (>10%): +5 per H3 hex cell
- Medium interference (2-10%): +2 per hex
- Cap: 35 points
src/services/country-instability.ts:803-821
Information Score (25% weight)
Measures news velocity and reporting intensity:Clustered news events mentioning country (6h window).
Average sources-per-hour across news clusters.Threshold: High-volume countries (US, China, Russia) require velocity >5 to trigger boost. Others require >2.
+20 * multiplier if any news cluster has
isAlert flag (breaking news).src/services/country-instability.ts:823-846
Additional Boosters
Hotspot Proximity Boost
Events near intelligence hotspots (Tehran, Kyiv, Gaza, etc.) increase country scores:src/services/country-instability.ts:304-348
Focal Point Urgency Boost
Correlation between news coverage and map signals:Country appears as critical focal point (3+ signal types + high news coverage).
Country appears as elevated focal point (2+ signal types + moderate news coverage).
Displacement Boost
≥1M refugees + asylum seekers (UNHCR data).
100K–1M refugees + asylum seekers.
Climate Stress Boost
Temperature/precipitation >2 standard deviations from 30-day ERA5 baseline.
1.5-2 standard deviations from baseline.
Government Travel Advisory Boost
- Base: +15
- Multi-source consensus bonus:
- 3+ governments: +5
- 2 governments: +3
- Floor: Score cannot drop below 60 with Do-Not-Travel advisory
- Base: +10
- Multi-source bonus (same as above)
- Floor: Score cannot drop below 50
+5 (no floor)
Supplemental Signal Boost
Vessel tracking anomalies:
- High severity: +2.5 per event
- Elevated: +1.5 per event
- Low: +0.5 per event
- Cap: 10 points
NASA FIRMS thermal hotspots:
- High intensity (≥360K or ≥50MW): +1.5 per fire
- Normal fires: +0.25 each (20 fire cap)
- Cap: 8 points
Geolocated IOCs (C2 servers, phishing, malware):
- Critical: +3 per threat
- High: +1.8 per threat
- Medium: +0.9 per threat
- Cap: 12 points
Welford’s algorithm detects deviations from 90-day baseline:
- Critical (z-score ≥3.0): +2 per anomaly
- Normal (z-score 1.5-3.0): +0.75 per anomaly
- Cap: 6 points
Floor Scores
UCDP Conflict Classification
UN-classified active wars override optimistic scores:≥1,000 battle deaths in the current calendar year.Example: Ukraine automatically receives ≥70 CII due to UCDP “war” classification.
25-999 battle deaths.
No UCDP conflict classification.
Threat Level Ranges
Imminent or active crisis. Examples: Ukraine (85), Yemen (82), Syria (88).
Significant instability. Examples: Iran (72), Myanmar (68).
Moderate risk. Examples: Venezuela (58), Pakistan (54).
Baseline geopolitical activity. Examples: Russia (42), Saudi Arabia (38), Mexico (35).
Stable. Examples: US (18), Germany (12), Japan (15).
Trend Detection
Scores are compared against previous values (stored inMap<string, number>) to calculate 24-hour trends:
Learning Mode
On cold start (no cached scores), CII enters a 15-minute learning phase:15 minutes in milliseconds. Dashboard displays learning progress bar.
If cached scores from previous session exist (via
/api/risk-scores), learning mode is skipped entirely.src/services/country-instability.ts:85-96
Example Scores
Key Files
src/services/country-instability.ts— Core CII calculation enginesrc/services/focal-point-detector.ts— News-signal correlation for urgency boostsrc/services/geo-convergence.ts— Geographic event clusteringsrc/config/countries.ts— Curated country configurationsapi/risk-scores.ts— Cached CII scores endpoint