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%
v0.10.5 passed int(30e9) to ConsumerConfig(inactive_threshold=...)
thinking the value was already in nanoseconds. nats-py treats the field
as float SECONDS and multiplies by 1e9 internally before sending to the
server. The server received 30e18 -- out of int64 range -- and rejected
the consumer creation with err_code=10025 ("invalid JSON: json: cannot
unmarshal number 30000000000000000000 into Go struct field
ConsumerConfig.config.inactive_threshold of type time.Duration").
preview_resend caught the per-stream exception and returned 0 across
every stream. The operator saw "0 events" in the modal regardless of
window. No data corruption, no error popup, just a silent feature
failure caught during the v0.10.5 live verification.
Fix: rename _INACTIVE_THRESHOLD_NS -> _INACTIVE_THRESHOLD_S and set
value to 30.0 (float seconds). One callsite updated. Module comment
explains the unit confusion for future maintainers.
Regression guard: tests/test_resend.py gains
test_pull_subscribe_inactive_threshold_within_nats_range -- captures the
config kwarg passed to pull_subscribe on a real resend call, asserts the
threshold is in [1, 3600] seconds AND its nanosecond-equivalent fits in
int64. The exact v0.10.5 bug (int(30e9)) would trip both assertions.
This was the test gap that let v0.10.5 ship -- _mk_js's MagicMock
swallowed any config shape without validating it.
Full suite: 1011 passed / 1 skipped (was 1010; +1 regression guard).
Ruff clean.
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.