160-tool MCP server for real-time global intelligence from free public APIs: markets, liquidity, prediction markets, SEC filings, conflict, military, aircraft-cohort early warning, migration and border flows, cyber, climate, news and more. Dated observation history, 29 research prompts, cited briefs, geofences, SSE dashboard. MIT, no paid API keys.
Python ai-toolsai-watchanthropicclaudecybersecuritydashboardgeofencinggeopoliticalgeospatialintelligencemarketsmcpmigrationmilitarymodel-context-protocolnuclearosintreal-timespace-weatherthreat-intelligence
History health: drop the unreachable overdue state; re-measured growth
Phoenix Agent (mac-studio)de7326462c8e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 8eaf7f3..739fd6a 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -13,9 +13,13 @@(top-level fetch-time stamps are ignored when hashing). Retention, each0 = keep forever: `WORLD_INTEL_HISTORY_PAYLOAD_DAYS` (default 7) forbodies, `WORLD_INTEL_HISTORY_CAPTURE_DAYS` (default 30) for the run log,- `WORLD_INTEL_HISTORY_DAYS` (default 365) for observations. Measured on a- full 55-source cycle: about 65-80 KB of new compressed bodies and about- 14 KB of capture rows per 5-minute cycle.+ `WORLD_INTEL_HISTORY_DAYS` (default 365) for observations. Measured over+ three full 55-source cycles: 90 KB and 193 KB of new compressed bodies in+ the two follow-up cycles (about 70 KB from sources that change every+ cycle, plus the military flight snapshot when it succeeds) and about+ 14 KB of capture rows per cycle. At `--interval 300` that is about+ 130-340 MB of bodies at the 7-day default and about 100 MB of run log at+ 30 days. Quote observations on a trading day were not measured.- Observations with three dates: `observed_at` (from the payload, or nullwhen it has none; never the collection time), `published_at` (when thepayload names a release time) and `collected_at`. Built-in extractors:diff --git a/src/world_intel_mcp/cli.py b/src/world_intel_mcp/cli.pyindex 542403d..00a29ce 100644--- a/src/world_intel_mcp/cli.py+++ b/src/world_intel_mcp/cli.py@@ -2680,9 +2680,10 @@ def history_health(ctx: click.Context, source: str | None) -> None:styles = {"ok": "green", "degraded": "yellow", "never_run": "dim"}for row in data["sources"]:state = row["state"]+ label = f"{state}, overdue" if state == "failing" and row.get("overdue") else statetable.add_row(_cell(row["source"]),- Text(state, style=styles.get(state, "red")),+ Text(label, style=styles.get(state, "red")),_cell(row.get("last_attempt_at") or "-"),_cell(row.get("last_success_at") or "-"),str(row.get("consecutive_failures", "-")),diff --git a/src/world_intel_mcp/history.py b/src/world_intel_mcp/history.pyindex 9ca1685..260f6ef 100644--- a/src/world_intel_mcp/history.py+++ b/src/world_intel_mcp/history.py@@ -52,18 +52,24 @@ Retention, each ``0`` = keep forever, pruned at the end of every recordedcycle in the same transaction:- ``WORLD_INTEL_HISTORY_PAYLOAD_DAYS`` (default 7) bounds payload bodies by- last sighting. Measured 2026-10-17 on a full 55-source cycle: about- 65-80 KB of new compressed bodies per 5-minute cycle (crypto quotes with- sparklines, the domestic flight snapshot and the news feed change every- cycle), so about 20 MB a day.+ last sighting. Measured 2026-10-17 over three full 55-source cycles (45 s+ each, so about 250 cycles a day at ``--interval 300``): about 70 KB of+ new compressed bodies every cycle from the sources whose data changes+ each time (crypto quotes 30 KB, domestic flights 19 KB, news 9 KB, disease+ outbreaks 6 KB, weather alerts 4.5 KB), plus 5-121 KB when the military+ flight snapshot succeeds; 90 KB and 193 KB in the two measured follow-up+ cycles. About 19-48 MB a day, so about 130-340 MB at the default.- ``WORLD_INTEL_HISTORY_CAPTURE_DAYS`` (default 30) bounds the run log:55 capture rows per cycle at about 250 bytes each with indexes, about- 4 MB a day.+ 3.4 MB a day, so about 100 MB at the default.- ``WORLD_INTEL_HISTORY_DAYS`` (default 365) bounds observations, which arestored only when new or changed. An observation can outlive the capturethat produced it; its ``capture_id`` then names a pruned capture.Gaps / not covered:+- Growth was measured on a Saturday with markets closed: the 15 Yahoo quote+ series, which have no observation date, gain a row per price change while+ markets trade, and that rate is not measured.- No backfill: sources that serve history (FRED CSV) are not replayed intothe store; only what the collector sees from the first recorded cycle on.- ``published_at`` is NULL for every built-in extractor: none of their@@ -746,12 +752,13 @@ class HistoryStore:age_success = None if last_success is None else now - last_successoverdue = age_success is None or age_success > overdue_afterattempt_overdue = age_attempt > overdue_after+ # A non-error last capture is itself the last success, so overdue+ # can differ from attempt_overdue only for a failing source; it is+ # reported there as the overdue flag, not as a state of its own.if attempt_overdue:state = "not_attempted_recently"elif last_status == "error":state = "failing"- elif overdue:- state = "overdue"else:state = last_statusentry.update(@@ -793,7 +800,8 @@ class HistoryStore:"Check latest_observed_at here or observed_at in intel_series_history.","Cadence is the stated expectation (default and overrides above), not ""the live daemon's --interval; a collector deliberately run less often "- "reads overdue.",+ "reads overdue. The daemon sleeps --interval after each cycle, so its "+ "real period is longer by the cycle's own duration.","A degraded capture with no records cannot tell a quiet period from a ""silent upstream failure.",HISTORY_ACCRUAL_NOTE + " A source the collector never ran reads never_run, "@@ -803,10 +811,11 @@ class HistoryStore:"ok": "last capture delivered records with no degradation marker","degraded": "last capture delivered a payload marked stale/degraded, empty, ""or without the measures its extractor expects",- "failing": "last capture was an error (consecutive_failures counts the run)",- "overdue": f"no payload delivered within {OVERDUE_MULTIPLE:g} cadences",+ "failing": "last capture was an error (consecutive_failures counts the run; "+ f"overdue is true when no payload arrived within {OVERDUE_MULTIPLE:g} "+ "cadences)","not_attempted_recently": f"the collector has not attempted it within "- f"{OVERDUE_MULTIPLE:g} cadences",+ f"{OVERDUE_MULTIPLE:g} cadences (overdue is then always true)","never_run": "no capture recorded",},}diff --git a/src/world_intel_mcp/tests/test_history.py b/src/world_intel_mcp/tests/test_history.pyindex 14c549b..57f9e7a 100644--- a/src/world_intel_mcp/tests/test_history.py+++ b/src/world_intel_mcp/tests/test_history.py@@ -11,6 +11,7 @@ history path.import asyncioimport json+import timeimport typesimport pytest@@ -702,6 +703,27 @@ def test_cli_history_health_table_and_json(cli_db) -> None:assert bad.startswith("Error:") and "unknown source" in bad+def test_cli_history_health_marks_failing_sources_overdue(tmp_path, monkeypatch) -> None:+ db = tmp_path / "overdue.db"+ monkeypatch.setenv("WORLD_INTEL_CACHE_DB", str(db))+ monkeypatch.setenv("COLUMNS", "220")+ monkeypatch.setattr(cli, "_fetcher", None)+ now = time.time()+ s = HistoryStore(db)+ _record(s, "wildfires", now - 1000, {"fires": [1]}) # last payload past 900 s+ _record(s, "wildfires", now - 60, None, "boom")+ _record(s, "earthquakes", now - 400, {"earthquakes": [{"id": "a", "magnitude": 5.0, "time": "2026-10-16T22:10:00Z"}]})+ _record(s, "earthquakes", now - 30, None, "timeout (45.0s)")+ s.close()+ out = _invoke("history", "health").output+ rows = {line.split()[0]: line for line in out.splitlines() if line.strip()}+ assert "failing, overdue" in rows["wildfires"]+ assert "failing" in rows["earthquakes"] and "overdue" not in rows["earthquakes"]+ data = json.loads(_invoke("--json-output", "history", "health").output)+ assert "overdue" not in data["states_explained"]+ assert {r["state"] for r in data["sources"]} <= set(data["states_explained"])++def test_cli_history_captures(cli_db) -> None:out = _invoke("history", "captures", "space_weather").outputassert "2 total, 1 changed, 2 distinct" in out