Files
worldmonitor/tests
Elie Habib 11a0323fdc fix(correlation): normalize escalation signals to ISO2 country codes (#1529)
* fix(correlation): normalize escalation signals to ISO2 country codes

Protests used full names ("Iran") while news clusters used ISO2 ("IR"),
causing clusterByCountry() to produce duplicate rows. All signal sources
now normalize via normalizeToCode() before clustering. generateTitle()
resolves codes back to full names for display.

* test(correlation): add behavioral tests for escalation country normalization

Suite B: mocked geometry, tests collectSignals normalizes "Iran" to "IR",
generateTitle shows full names, and mixed-format signals share same code.

* fix(correlation): resolve aliases before 2-char fast path in normalizeToCode

nameToCountryCode() now runs first so two-letter aliases like UK resolve
to their canonical ISO2 code (GB) instead of being returned verbatim.
Adds static test for resolution order and behavioral test for UK->GB.
2026-03-13 12:32:53 +04:00
..