Skip to content

Move the USGS earthquake source into Forge - #3

Merged
Zacharon merged 1 commit into
mainfrom
feature/usgs-source
Oct 19, 2026
Merged

Zacharon merged 1 commit into
mainfrom
feature/usgs-source

Conversation

@Zacharon

Copy link
Copy Markdown
Owner

Before: USGS earthquakes were collected only by Live Map. Forge's /api/events feed had no real source behind it.

After: osint-forge-usgs loads the USGS summary feed into the Forge ontology as event objects, and they show up in /api/events. It can read a saved feed with --file, or fetch the live feed with --live --confirm-live.

How: osint_forge/ingestion/usgs.py ports the rules from Live Map's src/data/providers/usgs.js and src/ingestion/usgs-pipeline.js:

  • Each USGS id gets one object, event:usgs-<id>.
  • Unchanged features write nothing, and USGS corrections become new revisions.
  • A correction older than the stored updated time is ignored.
  • A deleted feature gets a withdrawn, non-public revision. It leaves the feed but stays in history.
  • Source links are kept only on https://earthquake.usgs.gov.
  • The feed is capped at 1000 features, and a feed with no acceptable records is refused.
  • Severity, confidence (0.96 reviewed / 0.88 automatic), verification status and the natural-disaster domain match Live Map.

Live collection goes through a new usgs entry in config/source_registry.json. Its PII risk is low, it is live-capable, and it is off by default, so --live alone is refused.

Tests run against the hand-built fixture tests/fixtures/usgs/summary_feed.json. They cover creation, rejects, no-op reloads, corrections, out-of-order updates, withdrawal, the feed projection, invalid feeds and the CLI gate. The full suite gives OK (13 PostgreSQL tests skipped without a database). The ingest was also run against a local PostgreSQL 16. The live USGS fetch could not be tried from this environment because outbound access to earthquake.usgs.gov is blocked.


Generated by Claude Code

Port Live Map's USGS provider and ingestion rules: one revisioned event
object per USGS id, out-of-order corrections ignored, deleted features
withdrawn from the public feed but kept in history, and source links
limited to earthquake.usgs.gov. Live fetching is gated by a new source
registry entry.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GcagdBzPRAWDhhc9Yipm4d
@Zacharon
Zacharon marked this pull request as ready for review October 19, 2026 23:08
@Zacharon
Zacharon merged commit 6b5efe7 into main Oct 19, 2026
3 checks passed
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.

2 participants