Skip to main content

worldwatch

tests license

Monitor and model the world via APIs.

worldwatch learns the normal joint behaviour of the world's observable systems — seismic activity, markets, news events, Wikipedia attention, internet health, weather alerts, radiation, satellite night lights — and flags calibrated deviations from it. The target it is built against is lead time over mainstream news.

The coupling structure it learns along the way is meant to be a primary output, not a by-product: which systems move together, and how that changes. The design note puts it as "the digital twin condenses out of the residuals."

The idea in five points

  • Surprise is the only currency. Every source gets its own model, and what leaves that model is a q_value — the tail quantile of an observation under its own predictive distribution. Nothing downstream ever sees raw values.
  • Therefore z-scores are excluded by design. A z-score assumes a scale that heavy-tailed, seasonal, count-valued streams do not have. Quantiles under a per-source predictive distribution are comparable across a seismograph and a price feed; standard deviations are not.
  • Missing data is data, never imputed. If a source fails to report when it was expected to, that goes to a separate presence channel and is modelled. Imputing it would manufacture the very calm the system is trying to detect the absence of.
  • One model per stream, fitted online. Level + trend + seasonal harmonics with Student-t noise (negative binomial for counts, Dirichlet–Markov for categoricals), advanced by Kalman-style recursions. No training runs, no GPU — it is meant to hold a whole planet's worth of streams on a cheap VPS.
  • Calibration is what makes corroboration valid. An alert requires persistence × geographic coherence × at least two independent modalities agreeing on the same place and time. That test only means something because the inputs are calibrated quantiles, so agreement across a seismic feed and a news feed is comparable evidence.

Shape of the pipeline

  sources          one ~10-line TOML stanza each, never code
     │
     ▼
  poll ─────────► ingest ────────► cascade
  async, per-      parse, drop      geometric time bins (width ∝ age),
  source failure   fields at the    count/min/max/mean/M2 + t-digest
  isolation        door             sketches
                                       │
                                       ▼
                                  Layer 0
                        one online state-space model per stream
                        + a presence model per stream
                                       │
                                  q_values only
                                       ▼
                             the surprise field
                    the permanent record, and the system's memory
                              (MB per year, not GB)
                                   │        │
                    ┌──────────────┘        └───────────────┐
                    ▼                                       ▼
                 alerts                                 Layer 1
        persistence × coherence ×              one sparse dynamic Gaussian
        ≥2 independent modalities              graphical model, whose sparsity
                    │                          pattern *is* the coupling graph
                    ▼
              API + map + push

Space is indexed by H3 hexagonal cells (resolution tied to timescale) or by named entity, so "the same place" is a well-defined join across modalities.

Status — early, and honest about it

The P0 spine runs end to end: polling → parsing → the geometric cascade → Layer 0 (continuous, count and presence flavours) → the surprise field → alerting → a read-only API with push notifications, driven by a worldwatch CLI and deployable with the systemd units under ops/. There are 15 source stanzas covering the 8 Tier-1 modalities, and the test suite runs in CI on every push.

Not started — these are empty packages, not partial implementations:

layer1/ the sparse GGM and the coupling graph. Today's alerting is the naive corroboration rule, not graph-informed.
allocate/ the attention allocator — per-source cadence tiers and promotion pressure diffusing along coupling-graph edges.
probe/ the active HTTP/DNS prober and cause attribution.

Also still to come in P1: the nursery (new sources held in shadow mode until their rolling PIT-uniformity test passes) and the historical replay harness that the lead-time claim will have to be argued from. No lead-time result is being claimed yet — the backtest substrate for making that argument doesn't exist.

Quick start

pip install -e ".[test]"

worldwatch init          # register the configured sources
worldwatch poll          # fetch one round
worldwatch consolidate   # roll observations up the geometric cascade
worldwatch presence      # update the presence channel
worldwatch detect        # score and raise alerts
worldwatch api           # read-only API + map dashboard (127.0.0.1:8000)

Python ≥ 3.12. SQLite in WAL mode is the only store, with a daily Parquet export for offline work; there is deliberately no Kafka, no Postgres, and no message queue.

Six of the eight modalities need no credentials. Cloudflare Radar needs WW_CLOUDFLARE_TOKEN and the night-lights tiles need WW_EARTHDATA_USER/WW_EARTHDATA_PASS; both simply stay quiet without them. See ops/worldwatch.env.example.

Adding a source

A source is a config stanza in src/worldwatch/config/sources/, not code: endpoint, how to parse it, how to geocode it, cadence, topic tags, and a type hint. If a new source needs Python beyond a parser function, that is treated as a signal to refactor rather than a normal cost.

Docs

New here? doc/PROGRESS.md explains the whole system in plain language, without the vocabulary.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

worldwatch-0.1.0.tar.gz (152.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

worldwatch-0.1.0-py3-none-any.whl (61.2 kB view details)

Uploaded Python 3

File details

Details for the file worldwatch-0.1.0.tar.gz.

File metadata

  • Download URL: worldwatch-0.1.0.tar.gz
  • Upload date:
  • Size: 152.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for worldwatch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a7de273c76f82a77eed5814974d80c94d45fa352d94c1f358f2179164d8963b4
MD5 f6875c30525654bb11f9877ebc5a848e
BLAKE2b-256 514ddc6b35bd566e403aee33cf1ee77e215c96fb236593ffad76005618ae096f

See more details on using hashes here.

File details

Details for the file worldwatch-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: worldwatch-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 61.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for worldwatch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de0232a271edc42cca7a0871847555976aaed907854c971afa0da24df2003417
MD5 a9c669b46ea51718ce36766cc4cdb148
BLAKE2b-256 104b33e7e72723d0eaeaf75e98b9736d1fe51f5dd34b8c6d46b362354fbfe193

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page