Files
worldmonitor/scripts/package.json
Elie Habib 3ccf06efda feat(intelligence): regional seed bundle for Railway cron (#3001)
* feat(intelligence): regional seed bundle for Railway cron

Single Railway cron entry point for both regional intelligence seeders:

  scripts/seed-bundle-regional.mjs
  Railway cron: 0 */6 * * * (every 6 hours)
  startCommand: node seed-bundle-regional.mjs
  rootDirectory: scripts

Runs seed-regional-snapshots.mjs on every invocation (6h cadence) and
seed-regional-briefs.mjs weekly (skips if last seed-meta < 6.5 days old).

Both individual scripts had process.exit(1) inside main() which would
kill the bundle process before the second seeder could run. Replaced
with throw so the bundle's try/catch handles failures gracefully —
snapshots failing doesn't prevent briefs from running. The isDirectRun
guards still call process.exit(1) for standalone invocations.

Added "seed-bundle-regional" to scripts/package.json scripts.

## Railway service setup

  Service name: seed-bundle-regional
  Builder: Nixpacks
  Root directory: scripts
  Start command: node seed-bundle-regional.mjs
  Cron schedule: 0 */6 * * *
  Watch paths: scripts/seed-bundle-regional.mjs,
               scripts/seed-regional-*.mjs,
               scripts/regional-snapshot/**,
               scripts/shared/**

  Required env vars (copy from ais-relay service):
    UPSTASH_REDIS_REST_URL
    UPSTASH_REDIS_REST_TOKEN
    GROQ_API_KEY
    OPENROUTER_API_KEY
    NODE_OPTIONS=--max-old-space-size=512

* fix(intelligence): exit non-zero on failure + skip briefs after stale snapshots (review H1+M2 on #3001)

H1: bundle now exits with process.exit(1) when any seeder fails so
Railway cron monitoring can detect broken runs.

M2: briefs are skipped when snapshots failed this cycle. The brief
seeder reads :latest snapshot from Redis without freshness checking,
so running after a snapshot failure would publish a brief summarizing
stale state and write fresh seed-meta that hides the staleness.

Also fixed biome parse error: cron expression in JSDoc comment
contained bare asterisks that biome parsed as JS operators.

* fix(intelligence): correct startCommand docs + add in-process import caveat (review M on #3001)
2026-04-12 11:46:04 +04:00

29 lines
746 B
JSON

{
"name": "worldmonitor-railway-relay",
"version": "1.1.1",
"description": "Railway relay: AIS/OpenSky + RSS proxy + Telegram OSINT poller",
"main": "ais-relay.cjs",
"scripts": {
"start": "node ais-relay.cjs",
"notification-relay": "node notification-relay.cjs",
"telegram:session": "node telegram/session-auth.mjs",
"seed-bundle-regional": "node seed-bundle-regional.mjs"
},
"dependencies": {
"@anthropic-ai/sdk": "^0.82.0",
"@aws-sdk/client-s3": "^3.1009.0",
"convex": "^1",
"exceljs": "^4.4.0",
"h3-js": "^4.2.1",
"resend": "^4",
"sax": "^1.6.0",
"telegram": "^2.22.2",
"undici": "^7.0.0",
"tsx": "^4.21.0",
"ws": "^8.18.0"
},
"engines": {
"node": ">=20"
}
}