feat(intelligence): GDELT tone/vol timeline analysis for escalation signals (#2044) (#2087)

* feat(intelligence): GDELT tone/vol timeline per topic (#2044)

* fix(gdelt-timeline): add isMain guard to seed script, fix gateway cache tier

- Wrap runSeed() call in isMain guard (process.argv[1].endsWith check) to
  prevent CI failures when the seed module is imported rather than executed
  directly — pre-push hook does not catch this
- Change gateway cache tier from 'medium' (20min CDN) to 'daily' (1h
  browser/s-maxage=86400 CDN) to align with the 1h TIMELINE_TTL on the
  per-topic tone/vol Redis keys

* fix(gdelt-timeline): TTL 1h→12h, medium cache tier, real fetchedAt, exit 0

- seed-gdelt-intel.mjs: TIMELINE_TTL 3600→43200 (12h = 2× 6h cron) so
  tone/vol keys survive between cron runs instead of expiring after 1h
- seed-gdelt-intel.mjs: afterPublish wraps tone/vol as {data, fetchedAt}
  so the real write timestamp is stored alongside the arrays
- get-gdelt-topic-timeline.ts: unwrap new envelope shape; fetchedAt now
  reflects actual data write time instead of request time
- gateway.ts: daily→medium cache tier (CDN s-maxage=1200 matches 6h cadence)
- seed-gdelt-intel.mjs: process.exit(1)→0 to match seeder suite convention

* fix(gdelt-timeline): add GdeltTimelinePoint type cast in unwrap helper
This commit is contained in:
Elie Habib
2026-03-23 20:10:15 +04:00
committed by GitHub
parent 9696a545eb
commit 4f19e36804
10 changed files with 337 additions and 10 deletions

File diff suppressed because one or more lines are too long