mirror of
https://github.com/zvx-echo6/central.git
synced 2026-08-26 17:31:39 +00:00
Central - data hub spine. Adapters -> NATS/JetStream -> archive.
- Python 88.6%
- HTML 9.4%
- CSS 1.2%
- Shell 0.6%
- PLpgSQL 0.2%
Pre-existing bug surfaced by v0.1.2's two supervisor restarts in 12 minutes.
Not a v0.10.2 regression.
Both wfigs adapters used an incremental time filter that silently returned 0
features on every poll after the first:
- wfigs_incidents queried where=ModifiedOnDateTime > timestamp '<last_poll>' --
but the upstream WFIGS layer renamed the column to ModifiedOnDateTime_dt
(epoch ms). ArcGIS treated the clause as not-matching.
- wfigs_perimeters queried where=attr_ModifiedOnDateTime_dt > timestamp '<last_poll>'
-- correct field name, but the column is epoch ms integer, not SQL timestamp,
so the comparison never matched.
In both adapters the fall-off detector then interpreted the empty result as
'all previously observed fires fell off' and emitted tombstones for every
IRWINID it had observed -- including Summit Creek (1924-acre Idaho WF, 85%
contained at 6/5/26). _last_poll_time was in-memory-only, so every supervisor
restart triggered exactly one valid where=1=1 poll, then broke again.
Fix: drop the incremental branch in both adapters; use where=1=1 every poll.
wfigs_observed + published_ids already de-duplicate the full page, so re-
fetching every poll is correct and idempotent. The vestigial _last_poll_time
state goes too.
Deploy plan (separate, after merge):
sudo systemctl stop central-supervisor
sudo -u central sqlite3 /var/lib/central/cursors.db \
"DELETE FROM published_ids WHERE adapter IN ('wfigs_incidents', 'wfigs_perimeters');"
sudo systemctl start central-supervisor
Tests: 1029 passed / 1 skipped under both zvx and central. +4 wfigs regression
tests covering where=1=1 invariance + _last_poll_time absence on both adapters.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| docs | ||
| etc-templates | ||
| scripts | ||
| sql | ||
| src/central | ||
| systemd | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .python-version | ||
| CHANGELOG.md | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
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
Testing
See docs/test-database.md for test database setup.
License
MIT. See LICENSE.