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
Guide: failed earthquake and wildfire fetches are data gaps on the merged code
Phoenix Agent (mac-studio)9db8c7509602
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex e6b197f..bc08402 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -469,12 +469,13 @@ source here, and no proxy is substituted for any of these measures.dropped a city that a large quake had reached. The step now says soand to compare each city's position with every step-1 event beforedropping it. The code is unchanged.-- aoi-watch-setup said every failed domain is listed in `data_gaps` and- left out of the diff. Earthquakes, and wildfires when- `NASA_FIRMS_API_KEY` is set, return empty with no error when their- fetch fails, so the diff reports everything departing with no gap. Both- AOI prompts now say so, call a whole domain departing at once- unconfirmed, and point to `failing_sources`. The code is unchanged.+- aoi-watch-setup, aoi-review and wildfire-situation describe failed+ fetches as the code now reports them: a total earthquake or wildfire+ outage is an error that the AOI brief and changes list in `data_gaps`+ and leave out of the diff, and a FIRMS region that did not answer is+ named in `failed_regions` (partial coverage in an AOI). Both AOI+ prompts still call a whole domain departing at once with no gap+ unconfirmed and point to `failing_sources`.- conflict-trend told the model to check the latest UCDP `date_start`before reading a thin window as calm, but when the pinned release(gedevents/25.1) ends before the window the tool returns count 0 withdiff --git a/src/world_intel_mcp/guide_prompts.py b/src/world_intel_mcp/guide_prompts.pyindex fa3d057..71327c3 100644--- a/src/world_intel_mcp/guide_prompts.py+++ b/src/world_intel_mcp/guide_prompts.py@@ -803,8 +803,10 @@ PROMPTS: tuple[ResearchPrompt, ...] = ("FIRMS detections are satellite heat signatures, not mapped fire ""perimeters; one large fire produces many detections.","Without NASA_FIRMS_API_KEY the fire tool returns an error. With a "- "key set, a failed fetch can still come back as empty regions. "- "Report either as missing data, not zero fires.",+ "key set, a region FIRMS did not answer is named in failed_regions "+ "and carries its own error (its count of 0 is not a measurement), "+ "and every region failing is an error. Report either as missing "+ "data, not zero fires.","Climate anomalies are measured against the prior year, not a ""long-term normal.",),@@ -1149,12 +1151,12 @@ PROMPTS: tuple[ResearchPrompt, ...] = (limits=("The first change check records a baseline and claims nothing ""entered or left.",- "Most domains that fail are listed in data_gaps and left out of "- "the diff, but earthquakes, and wildfires when NASA_FIRMS_API_KEY "- "is set, can come back empty from a failed fetch with no data_gaps "- "entry, which reads as everything leaving. A whole domain "- "departing at once is unconfirmed: check failing_sources in "- "intel://guide/source-health and say it could not be confirmed.",+ "A domain that fails is listed in data_gaps and left out of the "+ "diff; a wildfire region FIRMS did not answer is listed as partial "+ "coverage. Never read a failed domain as everything leaving. A "+ "whole domain departing at once with no data_gaps entry is still "+ "unconfirmed: check failing_sources in intel://guide/source-health "+ "and say it could not be confirmed.","Each intel_aoi_changes call compares with the snapshot saved by ""the call before it (yours or a collector AOI sweep) and then ""replaces that snapshot.",@@ -1193,11 +1195,12 @@ PROMPTS: tuple[ResearchPrompt, ...] = ("Every intel_aoi_changes call saves a new snapshot. Call it once: a ""retried call compares with the snapshot the first call just saved ""and reports that nothing changed.",- "Earthquakes, and wildfires when NASA_FIRMS_API_KEY is set, can "- "return empty from a failed fetch with no data_gaps entry, so a "- "whole domain departing at once may be an outage: check "- "failing_sources in intel://guide/source-health and report it as "- "unconfirmed.",+ "A domain that fails, earthquakes and wildfires included, is "+ "listed in data_gaps and left out of the changes; a wildfire "+ "region FIRMS did not answer is listed as partial coverage. A "+ "whole domain departing at once with no data_gaps entry is still "+ "unconfirmed: check failing_sources in intel://guide/source-health "+ "and report it as unconfirmed.","News for an AOI is found by place name near its centre, so a ""nearby place with the same name can leak in.",),diff --git a/src/world_intel_mcp/tests/test_guide_failed_domains.py b/src/world_intel_mcp/tests/test_guide_failed_domains.pynew file mode 100644index 0000000..af30c23--- /dev/null+++ b/src/world_intel_mcp/tests/test_guide_failed_domains.py@@ -0,0 +1,67 @@+"""The AOI and wildfire prompts describe failed fetches the way the code+reports them.++Since 44cbfba a total earthquake or wildfire outage is an ``error`` (the+AOI brief and changes list it in ``data_gaps`` and leave it out of the+diff), and a FIRMS region that did not answer is named in+``failed_regions`` with its own error. Round 3 of the guide was written on+a base where both came back empty, so its text said they fail silently;+these tests pin the merged behavior and the corrected text.++Gaps / not covered: a real USGS or FIRMS outage (every request here is a+mocked 503); an AOI whose wildfire scope partly fails is checked through+``fetch_wildfires`` only, not through a full ``fetch_aoi_changes`` run.+"""++import asyncio++import httpx++from world_intel_mcp.cache import Cache+from world_intel_mcp.circuit_breaker import CircuitBreaker+from world_intel_mcp.fetcher import Fetcher+from world_intel_mcp.sources import seismology, wildfire+from world_intel_mcp.tests.test_guide import _text+++def _render(name: str) -> str:+ return " ".join(_text(name).split())+++async def test_failed_earthquake_and_wildfire_fetches_are_errors(monkeypatch, tmp_path):+ client = httpx.AsyncClient(transport=httpx.MockTransport(lambda request: httpx.Response(503)))+ cache = Cache(db_path=tmp_path / "failed-domains.db")+ down = Fetcher(cache, CircuitBreaker(), max_retries=0, client=client)+ monkeypatch.setenv("NASA_FIRMS_API_KEY", "test-only")++ async def _no_wait(*args, **kwargs) -> None:+ return None++ monkeypatch.setattr(asyncio, "sleep", _no_wait)+ try:+ quakes = await seismology.fetch_earthquakes(down)+ fires = await wildfire.fetch_wildfires(down)+ finally:+ await client.aclose()+ cache.close()+ assert quakes["earthquakes"] == [] and quakes["degraded"] is True+ assert "USGS earthquake fetch failed" in quakes["error"]+ assert "failed for every requested region" in fires["error"]+ assert fires["failed_regions"] == sorted(fires["fires_by_region"])+ assert all("error" in r for r in fires["fires_by_region"].values())+++def test_aoi_prompts_say_a_failed_domain_is_a_data_gap():+ for name in ("aoi-watch-setup", "aoi-review"):+ text = _render(name)+ assert "is listed in data_gaps and left out of the" in text+ assert "listed as partial coverage" in text+ assert "failing_sources in intel://guide/source-health" in text+ assert "empty from a failed fetch" not in text+++def test_wildfire_prompt_names_failed_regions():+ text = _render("wildfire-situation")+ assert "named in failed_regions" in text+ assert "every region failing is an error" in text+ assert "can still come back as empty regions" not in text