Skip to content

Add optional source-reliability layer, new data sources & SOURCES health panel - #230

Open
stephenlthorn wants to merge 1 commit into
simplifaisoul:masterfrom
stephenlthorn:feat/source-reliability-layer
Open

Add optional source-reliability layer, new data sources & SOURCES health panel#230
stephenlthorn wants to merge 1 commit into
simplifaisoul:masterfrom
stephenlthorn:feat/source-reliability-layer

Conversation

@stephenlthorn

@stephenlthorn stephenlthorn commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

An optional, purely additive enhancement to Osiris — it doesn't change or replace any existing route or behavior. It adds a reliability toolkit, five new data sources built on it, and a panel to see feed health. Existing layers work exactly as they do today; everything here is new files plus a handful of additive edits (new layer toggles, new map layers, a new SOURCES button).

Huge thanks for building Osiris — this is meant to build on it, not restructure it. Happy to adjust anything to fit your conventions, or trim it down.

🛡️ Optional reliability layer (src/lib/sources/**, unit-tested)

A SourceAdapter framework any route can opt into via runSource(...):

  • TTL caching (fresh-vs-stale) — a transient upstream hiccup serves the last good data instead of an empty layer.
  • Per-source rate limiting to stay within free-tier quotas.
  • Health tracking (ok / degraded / down / unknown).
  • Fallback chains (runWithFallback, e.g. FIRMS VIIRS → MODIS).
  • HMR-safe singleton + a registry.

Your existing routes are left untouched — they can adopt this incrementally if/when you want. Nothing is forced onto them.

🌐 New sources (adapter + route + toggleable map layer)

Keyless: NOAA Tsunami, NOAA NDBC ocean buoys (900+ stations), ransomware.live recent victims (jittered country centroid, since records carry only a country).

Opt-in keyed, disabled with no errors until configured: Shodan "Exposed Devices" (SHODAN_API_KEY), WiGLE wireless lookup in the region dossier (WIGLE_API_NAME + WIGLE_API_TOKEN). Documented in .env.example.

📡 SOURCES panel + GET /api/sources/health

Reports each registered source's status, freshness and attribution. A new SOURCES tab (desktop tool strip + mobile nav) groups them with status dots and provider links; polls every 45s.

Scope

  • 37 new files; the only edits to existing files are additive: LayerPanel (new toggles), OsirisMap (new layers/popups), page.tsx (new fetch blocks + SOURCES button), and .env.example (new opt-in keys).
  • Zero existing routes changed.

✅ Verification

Clean production build; 88 unit tests pass; dev server confirmed the new routes serve live data and keyed sources degrade gracefully when unset.


Note: I also have a couple of small, unrelated fixes (a privacy fix for the analytics middleware, and a few data-source bugs I noticed) that I'm happy to send as separate focused PRs if useful.

…anel

Purely additive — no existing route or behavior is changed. Adds an
opt-in reliability toolkit, five new data sources built on it, and a
panel to see feed health.

Reliability layer (src/lib/sources/**, unit-tested):
- SourceAdapter framework with TTL caching (fresh-vs-stale), per-source
  rate limiting, health tracking (ok/degraded/down/unknown), fallback
  chains (runWithFallback), and params-aware cache keys.
- HMR-safe singleton + a registry. Existing routes are left untouched;
  they can adopt runSource incrementally if/when desired.

New data sources (adapter + route + toggleable map layer):
- NOAA Tsunami warnings, NOAA NDBC ocean buoys (900+ stations),
  ransomware.live recent victims (jittered country centroid, since
  records carry only a country).

Opt-in keyed sources — disabled cleanly with no errors until configured:
- Shodan "Exposed Devices" layer (SHODAN_API_KEY)
- WiGLE wireless-network lookup in the region dossier
  (WIGLE_API_NAME + WIGLE_API_TOKEN)
Both documented in .env.example.

SOURCES panel + GET /api/sources/health:
- Endpoint reports every registered source's status, freshness and
  attribution. A new SOURCES tab (desktop tool strip + mobile nav)
  groups them with status dots and provider links; polls every 45s.

The only edits to existing files are additive: new layer toggles in
LayerPanel, new map layers/popups in OsirisMap, and the new fetch
blocks + SOURCES button in page.tsx. Existing layers behave exactly
as before.

Verification: clean production build; 88 unit tests pass (adapters,
runner, cache, rate-limit, health, registry, health endpoint); dev
server confirmed the new routes serve live data and the keyed sources
degrade gracefully when unset.
@stephenlthorn
stephenlthorn force-pushed the feat/source-reliability-layer branch from 8b6bff8 to b11d273 Compare July 6, 2026 13:46
@stephenlthorn stephenlthorn changed the title Source-reliability layer, adapter migration, new sources & SOURCES health panel Add optional source-reliability layer, new data sources & SOURCES health panel Jul 6, 2026
@simplifaisoul simplifaisoul added enhancement New feature or request Triage labels Jul 7, 2026
Repository owner deleted a comment from vercel Bot Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants