Central - data hub spine. Adapters -> NATS/JetStream -> archive.
  • Python 90.6%
  • HTML 9%
  • PLpgSQL 0.4%
Find a file
Matt Johnson c39e3174b8 fix: preserve last_completed_poll across adapter disable/enable
Previously, _stop_adapter() used pop() to remove adapter state,
which lost last_completed_poll. On re-enable, a fresh state was
created, causing immediate poll and violating rate-limit guarantee.

Changes:
- Add is_running property to AdapterState
- _stop_adapter: preserve state, just cancel task
- _start_adapter: reuse existing stopped state if present
- Add _remove_adapter for full cleanup when adapter is deleted
- _on_config_change: call _remove_adapter for deleted adapters

Integration tests verify:
- Test A: gap > cadence -> immediate poll (correct)
- Test B: gap < cadence -> wait until last_poll + cadence (was broken)
- Test C: delete + re-add -> fresh state (correct)

Tests-fail-before-fix verified: Test A/B failed on unfixed code
with "State was removed on stop!", pass with fix.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-16 02:37:57 +00:00
docs scaffold: initial repository structure 2026-05-15 19:16:24 +00:00
etc-templates scaffold: initial repository structure 2026-05-15 19:16:24 +00:00
scripts scaffold: initial repository structure 2026-05-15 19:16:24 +00:00
sql feat(db): add migration 002 for updated_at trigger and enabled index 2026-05-16 01:36:30 +00:00
src/central fix: preserve last_completed_poll across adapter disable/enable 2026-05-16 02:37:57 +00:00
systemd runtime: NWS adapter, supervisor, archive consumer, systemd units 2026-05-15 21:29:08 +00:00
tests fix: preserve last_completed_poll across adapter disable/enable 2026-05-16 02:37:57 +00:00
.gitignore scaffold: initial repository structure 2026-05-15 19:16:24 +00:00
.python-version foundation: models, adapter ABC, config, CE wire, schema 2026-05-15 21:08:56 +00:00
LICENSE scaffold: initial repository structure 2026-05-15 19:16:24 +00:00
pyproject.toml feat(config): add CLI smoke command and dependencies 2026-05-15 23:08:03 +00:00
README.md scaffold: initial repository structure 2026-05-15 19:16:24 +00:00
uv.lock foundation: models, adapter ABC, config, CE wire, schema 2026-05-15 21:08:56 +00:00

Central

Central is the data hub spine for the infrastructure. Adapters normalize upstream sources into a canonical event shape, publish CloudEvents to NATS/JetStream, and archive to TimescaleDB for historical query. Single-LXC deployment.

Status

Phase 0 — scaffold. Not yet operational.

Architecture

  • Python 3.12 (uv-managed)
  • NATS + JetStream for live event bus
  • TimescaleDB + PostGIS for archive and geospatial query
  • One supervisor process managing adapter lifecycle
  • One archive consumer process persisting events to TimescaleDB
  • Both processes systemd-managed

License

MIT. See LICENSE.