feat(conflicts): GET /api/conflicts conflict-zone catalog + news/GDELT counts #33

Merged
sirius merged 1 commit from osint-dashboard/t_e66223e3-osint-get-api-conflicts-catalog-news-cou into master 2026-08-31 21:52:03 -04:00
Owner

Summary

New GET /api/conflicts endpoint (spec docs/osiris-ideas.md §8): a curated OSINT conflict-zone catalog merged with a live event-count roll-up.

What

  • app/conflicts.py — static catalog of 13 theatres (Ukraine, Gaza, Sudan, Myanmar, DRC, Yemen, Syria, Lebanon, Sahel, Somalia, Red Sea, Taiwan Strait, Korean DMZ) with war|high|elevated severity, short factual descriptions, and an internal per-zone bbox used only for counting.
  • GET /api/conflicts{ zones: [{id, label, severity, lat, lon, description, eventCount, lastUpdated}], timestamp }.
  • eventCount = count of pre-existing geocoded rows inside each zone bbox — news_items map pins (/api/news/map) + geocoded events (source_type in rss/gdel-t2). Empty tables → eventCount=0, never 502.
  • overlay_catalog() gains a conflicts entry (kind=points, endpoint=/api/conflicts).

Not done (out of scope)

  • No LiveUAMap scraping; no RSS jitter around centroids (counts come from already-geocoded rows only).
  • No Leaflet UI, ACLED keys, Telegram.

Tests

tests/test_conflicts.py (no DB, no outbound HTTP): catalog length == 13, severity enum, unique ids / well-formed bboxes, overlay_catalog()["conflicts"] contract, pure zone_event_stats counting + latest, and the API contract with mocked main._fetch_geocoded_points (eventCount per zone, empty-DB zero counts).

pytest tests/test_conflicts.py tests/test_api_live_layers.py — 18 passed.

## Summary New `GET /api/conflicts` endpoint (spec `docs/osiris-ideas.md` §8): a curated OSINT conflict-zone catalog merged with a live event-count roll-up. ## What - `app/conflicts.py` — static catalog of 13 theatres (Ukraine, Gaza, Sudan, Myanmar, DRC, Yemen, Syria, Lebanon, Sahel, Somalia, Red Sea, Taiwan Strait, Korean DMZ) with `war|high|elevated` severity, short factual descriptions, and an internal per-zone bbox used only for counting. - `GET /api/conflicts` → `{ zones: [{id, label, severity, lat, lon, description, eventCount, lastUpdated}], timestamp }`. - `eventCount` = count of **pre-existing** geocoded rows inside each zone bbox — `news_items` map pins (`/api/news/map`) + geocoded `events` (`source_type` in `rss`/`gdel-t2`). Empty tables → `eventCount=0`, never 502. - `overlay_catalog()` gains a `conflicts` entry (`kind=points`, `endpoint=/api/conflicts`). ## Not done (out of scope) - No LiveUAMap scraping; no RSS jitter around centroids (counts come from already-geocoded rows only). - No Leaflet UI, ACLED keys, Telegram. ## Tests `tests/test_conflicts.py` (no DB, no outbound HTTP): catalog length == 13, severity enum, unique ids / well-formed bboxes, `overlay_catalog()["conflicts"]` contract, pure `zone_event_stats` counting + latest, and the API contract with mocked `main._fetch_geocoded_points` (eventCount per zone, empty-DB zero counts). `pytest tests/test_conflicts.py tests/test_api_live_layers.py` — 18 passed.
sirius added 1 commit 2026-08-31 21:28:42 -04:00
Curated static catalogue of 13 conflict theatres (Ukraine, Gaza, Sudan,
Myanmar, DRC, Yemen, Syria, Lebanon, Sahel, Somalia, Red Sea, Taiwan
Strait, Korean DMZ) with war|high|elevated severity and short factual
descriptions. GET /api/conflicts returns { zones: [{id,label,severity,
lat,lon,description,eventCount,lastUpdated}], timestamp } where
eventCount rolls up pre-existing geocoded news/GDELT//api/news/map rows
inside each zone bbox (0 when the tables are empty). Adds the conflicts
entry to overlay_catalog(). No upstream scraping, no jittered coords.
sirius merged commit af836b0414 into master 2026-08-31 21:52:03 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: sirius/osint-dashboard#33
No description provided.