fix(health): enforce 1h+ TTL buffer across all seed jobs (#2072)

Full audit of seed TTL vs cron cadence. Rule: TTL >= cron_interval + 1h.

CRITICAL (TTL = cron, 0 buffer):
- seed-supply-chain-trade: tariffTrendsUs TRADE_TTL(6h) → TARIFF_TTL(8h)
- seed-supply-chain-trade: customsRevenue TRADE_TTL(6h) → CUSTOMS_TTL(24h)
- seed-sanctions-pressure: CACHE_TTL 12h → 15h (12h cron, 3h buffer)
- seed-usa-spending: CACHE_TTL 1h → 2h (1h cron, 1h buffer)

WARN (<1h buffer):
- seed-security-advisories: TTL 2h → 3h (1h cron, now 2h buffer)
- seed-token-panels: TTL 1h → 90min (30min cron, now 1h buffer)
- seed-etf-flows: TTL 1h → 90min (15min cron, now 75min buffer)
- seed-stablecoin-markets: TTL 1h → 90min (10min cron, now 80min buffer)
- seed-gulf-quotes: TTL 1h → 90min (10min cron, now 80min buffer)
- seed-crypto-quotes: TTL 1h → 2h (5min cron, now 115min buffer)
- ais-relay CRYPTO_SEED_TTL: 1h → 2h
- ais-relay STABLECOIN_SEED_TTL: 1h → 2h
- ais-relay SECTORS_SEED_TTL: 1h → 2h
This commit is contained in:
Elie Habib
2026-03-22 22:55:06 +04:00
committed by GitHub
parent 75c1c8d39c
commit df29d59ff7
10 changed files with 14 additions and 13 deletions

View File

@@ -12,7 +12,7 @@ loadEnvFile(import.meta.url);
const CANONICAL_KEY = 'sanctions:pressure:v1';
const STATE_KEY = 'sanctions:pressure:state:v1';
const CACHE_TTL = 12 * 60 * 60;
const CACHE_TTL = 15 * 60 * 60; // 15h — 3h buffer over 12h cron cadence (was 12h = 0 buffer)
const DEFAULT_RECENT_LIMIT = 60;
const OFAC_TIMEOUT_MS = 45_000;
const PROGRAM_CODE_RE = /^[A-Z0-9][A-Z0-9-]{1,24}$/;