koala73 / koala73/worldmonitor
feat(economic): CII confidence scoring + anomaly detection panel
- Dominant language
- TypeScript
- Stars
- 86.6k
- Forks
- 13.1k
- Avg merge
- 8h 4m
- Merged PRs (30d)
- 825
Description
### Feature area
AI / Intelligence analysis
### Description
Add a CII Confidence & Anomaly Alert panel that surfaces two signals per country:
1. **Confidence score (0–100)** — based on data freshness, source diversity, and country-type variance — displayed as 🟢 High / 🟡 Medium / 🔴 Low badge.
2. **Anomaly alerts** — triggered when CII deviates beyond rolling 30-day statistical thresholds (±2σ):
- 🔥 Thermal Spike — CII up 15+ pts in 24h
- 📉 Rapid Cooling — CII down 10+ pts in 24h
- 📈 Trend Acceleration — 3 consecutive increases, growing magnitude
- ⚠️ Market-CII Divergence — CII and market moving in opposite directions
- 🚨 All-Time High/Low — CII exceeds 90-day range
Each alert includes a one-line human-readable interpretation (e.g. *"Markets bullish despite deteriorating instability — potential euphoria signal"*).
### Problem it solves
Currently a CII score of 65 in Yemen means something completely different than 65 in Switzerland — but there's no way to know which scores to trust or which countries need attention right now.
Users must manually compare CII against market signals with no automated alerting. The system tells you WHAT the CII score is, but not WHEN to trust it or WHEN it's behaving abnormally.
### Alternatives considered
Manual monitoring of all 54 countries is not scalable. A simple threshold (e.g. "alert if CII > 70") ignores country-specific baselines and produces too many false positives for stable democracies while missing critical moves in volatile regions.
### Additional context
No new data sources required — everything builds on existing infrastructure:
- CII scores + history → existing CII seeder
- Market direction → existing market:stocks-bootstrap:v1
- Country type classification → existing CII adaptive weights config
- Data freshness → Redis key TTLs
New files: seed-cii-confidence.mjs, seed-cii-anomalies.mjs, CIIAnomalyPanel.tsx, list_cii_alerts.proto, list-cii-alerts.ts
Follows the existing Railway seeder pattern (15–30 min intervals).
Estimated effort: 6–8 hours.
Contributor guide
Research direction
Start by reading the existing CII seeder, market:stocks-bootstrap:v1, adaptive weights configuration, and Redis TTL usage to understand the available signals and Railway seeder pattern. Then trace the proposed seed-cii-confidence.mjs, seed-cii-anomalies.mjs, CIIAnomalyPanel.tsx, list_cii_alerts.proto, and list-cii-alerts.ts flow; done means confidence badges and the specified anomaly alerts appear with human-readable interpretations at the intended interval.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- redis, typescript
- Domain
- analytics, full-stack
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100