Skip to content

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.

news_market: pin independence from cluster "sources"; require news-reaction

Phoenix Agent (mac-studio)db8c9f7b632f
diff --git a/src/world_intel_mcp/tests/test_cli.py b/src/world_intel_mcp/tests/test_cli.py
index 0406b2f..8eb3dd5 100644
--- a/src/world_intel_mcp/tests/test_cli.py
+++ b/src/world_intel_mcp/tests/test_cli.py
@@ -133,6 +133,7 @@ def test_command_registry() -> None:
"dashboard",
"report",
"aoi",
+ "news-reaction",
} <= names
# webcams_cmd has no explicit name=, but click >= 8.1 strips the
# `_cmd` suffix when deriving default command names, so the
diff --git a/src/world_intel_mcp/tests/test_news_market.py b/src/world_intel_mcp/tests/test_news_market.py
index 12376b0..7e60d43 100644
--- a/src/world_intel_mcp/tests/test_news_market.py
+++ b/src/world_intel_mcp/tests/test_news_market.py
@@ -695,6 +695,35 @@ async def test_composite_default_needs_multi_article_clusters(fast_fetcher, monk
assert row["status"] == "measured" and row["excess_return_pct"] == 1.5334
+async def test_composite_independent_of_cluster_sources_shape(fast_fetcher, monkeypatch):
+ """Outlets are counted from the items' feed_name, so a cluster's
+ "sources" being empty (as live before the clustering fix) or holding
+ outlet names, with or without an outlet count, changes nothing."""
+ items = [
+ _item("Apple foldable iPhones sell out in hours", "2026-10-15T21:00:00Z", feed="The Verge"),
+ _item("Apple foldable iPhones sell out within hours", "2026-10-15T20:30:00Z", "finance", "CNBC"),
+ ]
+ _feed(monkeypatch, items)
+ _mock_markets()
+ respx.get(_SEC).mock(return_value=httpx.Response(200, json=_SEC_SUBSET))
+ real = nm.clustering.cluster_articles
+ outs = []
+ for extra in ({"sources": []}, {"sources": ["The Verge", "CNBC"], "outlet_count": 2}):
+ def _shaped(articles, similarity_threshold=0.3, title_field="title", _extra=extra):
+ return [{**c, **_extra} for c in real(articles, similarity_threshold, title_field)]
+
+ monkeypatch.setattr(nm.clustering, "cluster_articles", _shaped)
+ outs.append(await nm.fetch_news_market_reaction(fast_fetcher, now=_SATURDAY))
+ empty, named = outs
+ assert empty["company_reactions"] == named["company_reactions"]
+ assert empty["summary"] == named["summary"]
+ [row] = named["company_reactions"]
+ assert row["story"]["outlets"] == 2
+ assert row["status"] == "measured" and row["excess_return_pct"] == 1.5334
+
+
@pytest.mark.asyncio
@respx.mock
async def test_composite_story_time_problems_are_gaps(fast_fetcher, monkeypatch):