Skip to content

feat(oref): add OREF sirens panel with Hebrew-to-English translation#545

Merged
koala73 merged 1 commit intomainfrom
feat/oref-sirens-panel
Feb 28, 2026
Merged

feat(oref): add OREF sirens panel with Hebrew-to-English translation#545
koala73 merged 1 commit intomainfrom
feat/oref-sirens-panel

Conversation

@koala73
Copy link
Owner

@koala73 koala73 commented Feb 28, 2026

Summary

  • Add real-time Israel Home Front Command (OREF) siren alerts panel with live and 24h history views
  • Edge Function proxy (api/oref-alerts.js) to relay OREF API data
  • Hebrew→English translation of alert fields (title, data[], desc) via existing translateText() LLM fallback chain (Ollama → Groq → OpenRouter → Browser T5)
  • 3-layer caching to minimize token cost: in-memory Map (per-session), server Redis (cross-user), circuit breaker (failure protection)
  • i18n strings for all 23 locales
  • Panel registration, data-loader integration, polling service with 10s interval

Test plan

  • npx tsc --noEmit passes clean
  • Dev server with GROQ_API_KEY configured → panel shows English-translated alerts
  • Disable all AI providers → Hebrew text shown as-is (graceful fallback)
  • Verify polling doesn't trigger repeated LLM calls for same alert IDs (check console)
  • Run node tests/oref-proxy.test.mjs for Edge Function proxy tests

Add real-time Israel Home Front Command (OREF) siren alerts panel:
- Edge Function proxy at api/oref-alerts.js
- OrefSirensPanel component with live/history views
- oref-alerts service with 10s polling and update callbacks
- Hebrew→English translation via existing translateText() LLM chain
  with 3-layer caching (in-memory Map → server Redis → circuit breaker)
- i18n strings for all 23 locales
- Panel registration, data-loader integration, CSS styles
@vercel
Copy link

vercel bot commented Feb 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worldmonitor Building Building Preview, Comment Feb 28, 2026 1:59pm
worldmonitor-finance Building Building Preview, Comment Feb 28, 2026 1:59pm
worldmonitor-happy Building Building Preview, Comment Feb 28, 2026 1:59pm
worldmonitor-startup Building Building Preview, Comment Feb 28, 2026 1:59pm

Request Review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c99e45b946

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +366 to +368
const result = execSync(
`curl -s -x "${proxyUrl}" --max-time 15 -H "Accept: application/json" -H "Referer: https://www.oref.org.il/" "${url}"`,
{ encoding: 'utf8', timeout: 20000 }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Replace synchronous curl call in OREF poller

Using execSync here blocks the Node.js event loop for up to 20 seconds on every OREF poll attempt (--max-time 15 plus process overhead), so when OREF is enabled the relay can stop serving unrelated HTTP/WS traffic during each fetch window. This can cause visible freezes in AIS/other relay endpoints under normal operation, not just under failure conditions.

Useful? React with 👍 / 👎.

// OREF (Israel Home Front Command) siren alerts — fetched via HTTP proxy (Israel exit)
const OREF_PROXY_AUTH = process.env.OREF_PROXY_AUTH || ''; // format: user:pass@host:port
const OREF_ALERTS_URL = 'https://www.oref.org.il/WarningMessages/alert/alerts.json';
const OREF_POLL_INTERVAL_MS = Math.max(30_000, Number(process.env.OREF_POLL_INTERVAL_MS || 300_000));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Lower default OREF source polling latency

The relay polls OREF every 5 minutes by default and enforces a minimum of 30 seconds, while the frontend poller runs every 10 seconds and the UI text describes near-real-time behavior. With this default, short-lived sirens can be missed or shown long after they trigger, so the feature is inaccurate out of the box unless operators explicitly override the env var.

Useful? React with 👍 / 👎.

Comment on lines +1084 to +1086
onOrefAlertsUpdate((update) => {
(this.ctx.panels['oref-sirens'] as OrefSirensPanel)?.setData(update);
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid re-registering OREF update callbacks on each reload

This registration runs every time loadIntelligenceSignals() executes (including periodic refreshes), but the callback list is only cleared on app destroy. Over time this accumulates duplicate listeners, causing repeated setData calls per tick and unnecessary render/memory growth during long-running sessions.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant