Skip to content

Add read-only Forge API and Live Map /api/events feed - #2

Merged
Zacharon merged 1 commit into
mainfrom
feature/forge-api
Oct 19, 2026
Merged

Zacharon merged 1 commit into
mainfrom
feature/forge-api

Conversation

@Zacharon

Copy link
Copy Markdown
Owner

Before: the ontology store could only be read from Python, and nothing connected it to Live Map.

After: osint-forge-api --db forge.db (or --database-url postgresql://...) serves the store over HTTP. Routes are /objects, /events, /claims, /assessments, /search, plus history, links and neighborhood for each object. It also serves /api/events, a public feed in the envelope Live Map already reads (events, canonicalEvents, generatedAt, filters, sourceStatus, ...). That lets Live Map point at Forge without changing its client.

The API is read-only. Writes still go through the Python store until authentication exists.

How: the API is a stdlib WSGI app with no new dependencies. osint_forge/api/projection.py mirrors Live Map's createNormalizedEvent and toLegacyEvent:

  • confidence is stored as 0..1 and published as 0..100.
  • Credentialed or non-HTTP source URLs are dropped.
  • (0, 0) stays a mapped point.
  • Events marked public: false are never published.

tests/fixtures/contracts/live_map_events.json is a shared conformance fixture. It contains fixture objects, a fixed clock, the exact expected envelope, and a type schema. The tests reproduce it on SQLite, and the CI postgres job reproduces it on PostgreSQL. Live Map can validate its own responses against the same schema. Errors come back as structured JSON with no stack traces, and provenance metadata is not served. Details are in docs/API.md.

Tests: python -m unittest discover -s tests gives 120 OK (13 skipped without PostgreSQL). Ontology and API tests also pass against a local PostgreSQL 16.


Generated by Claude Code

A stdlib WSGI app serves objects, history, links, neighborhoods and search
from the ontology store, plus /api/events in the envelope Live Map already
reads. A shared conformance fixture pins the feed shape; tests reproduce it
on SQLite and PostgreSQL.

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 05:09
@Zacharon
Zacharon merged commit 9e139da 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