feat(server): integrate MCP queries and investigation messaging
Add project-bound OAuth MCP queries and controlled analysis with scoped evidence, limits, timeouts and a nearby-model spatial query using EPSG:4326 inputs. Default nearby searches to 200 meters and five results. Integrate investigation messaging/presentation, health/readiness and typed history; remove duplicate web search and fix online simulation and compressed baseline writes. Include project migrations 023-025; keep local credentials and demo seeding excluded. Validation: 319 focused pytest checks; real PostGIS temporary-table regression; read-only Jinqian bridge radius comparison; cross-language MCP discovery/calls.
This commit is contained in:
@@ -30,7 +30,7 @@ class FakeClient:
|
||||
|
||||
|
||||
def test_geocode_tianditu_gets_expected_params(monkeypatch):
|
||||
monkeypatch.setattr(geocoding.settings, "TIANDITU_GEOCODER_TOKEN", "tk-test")
|
||||
monkeypatch.setattr(geocoding.settings, "TIANDITU_TOKEN", "tk-test")
|
||||
monkeypatch.setattr(
|
||||
geocoding.settings,
|
||||
"TIANDITU_GEOCODER_URL",
|
||||
@@ -71,7 +71,7 @@ def test_geocode_tianditu_gets_expected_params(monkeypatch):
|
||||
|
||||
|
||||
def test_geocode_tianditu_accepts_key_word_alias(monkeypatch):
|
||||
monkeypatch.setattr(geocoding.settings, "TIANDITU_GEOCODER_TOKEN", "tk-test")
|
||||
monkeypatch.setattr(geocoding.settings, "TIANDITU_TOKEN", "tk-test")
|
||||
response = httpx.Response(
|
||||
200,
|
||||
json={"location": {"lon": "116", "lat": "39"}, "status": "0", "msg": "ok"},
|
||||
@@ -89,7 +89,7 @@ def test_geocode_tianditu_accepts_key_word_alias(monkeypatch):
|
||||
|
||||
|
||||
def test_geocode_tianditu_requires_token(monkeypatch):
|
||||
monkeypatch.setattr(geocoding.settings, "TIANDITU_GEOCODER_TOKEN", "")
|
||||
monkeypatch.setattr(geocoding.settings, "TIANDITU_TOKEN", "")
|
||||
|
||||
with pytest.raises(geocoding.TiandituGeocodingConfigError):
|
||||
asyncio.run(
|
||||
@@ -101,7 +101,7 @@ def test_geocode_tianditu_requires_token(monkeypatch):
|
||||
|
||||
|
||||
def test_geocode_tianditu_surfaces_http_error(monkeypatch):
|
||||
monkeypatch.setattr(geocoding.settings, "TIANDITU_GEOCODER_TOKEN", "tk-test")
|
||||
monkeypatch.setattr(geocoding.settings, "TIANDITU_TOKEN", "tk-test")
|
||||
response = httpx.Response(
|
||||
403,
|
||||
json={"msg": "invalid tk"},
|
||||
@@ -121,7 +121,7 @@ def test_geocode_tianditu_surfaces_http_error(monkeypatch):
|
||||
|
||||
|
||||
def test_geocode_tianditu_surfaces_tianditu_error_status(monkeypatch):
|
||||
monkeypatch.setattr(geocoding.settings, "TIANDITU_GEOCODER_TOKEN", "tk-test")
|
||||
monkeypatch.setattr(geocoding.settings, "TIANDITU_TOKEN", "tk-test")
|
||||
response = httpx.Response(
|
||||
200,
|
||||
json={"status": "100", "msg": "bad request"},
|
||||
|
||||
Reference in New Issue
Block a user