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:
@@ -82,8 +82,16 @@ def _create_validated_placement(
|
||||
sensor_locations: list[str],
|
||||
sensor_type: str = "pressure",
|
||||
method: str | None = None,
|
||||
persist_results: bool = True,
|
||||
) -> dict[str, Any]:
|
||||
validate_sensor_placement_nodes(project_code, sensor_locations)
|
||||
if not persist_results:
|
||||
return {
|
||||
"sensor_locations": sensor_locations,
|
||||
"sensor_points": _sensor_points(project_code, sensor_locations),
|
||||
"method": method,
|
||||
"sensor_type": sensor_type,
|
||||
}
|
||||
return sensor_placement_repository.create_sensor_placement(
|
||||
project_code,
|
||||
run_name=run_name,
|
||||
@@ -102,6 +110,7 @@ def optimize_sensor_placement_by_sensitivity(
|
||||
min_diameter: int,
|
||||
created_by: str,
|
||||
sensor_type: str = "pressure",
|
||||
persist_results: bool = True,
|
||||
) -> dict[str, Any]:
|
||||
"""Run sensitivity placement and persist the validated result."""
|
||||
|
||||
@@ -119,6 +128,7 @@ def optimize_sensor_placement_by_sensitivity(
|
||||
sensor_locations=sensor_locations,
|
||||
sensor_type=sensor_type,
|
||||
method="sensitivity",
|
||||
persist_results=persist_results,
|
||||
)
|
||||
|
||||
|
||||
@@ -129,6 +139,7 @@ def optimize_sensor_placement_by_kmeans(
|
||||
min_diameter: int,
|
||||
created_by: str,
|
||||
sensor_type: str = "pressure",
|
||||
persist_results: bool = True,
|
||||
) -> dict[str, Any]:
|
||||
"""Export the model, run K-means placement, and persist the result."""
|
||||
|
||||
@@ -146,6 +157,7 @@ def optimize_sensor_placement_by_kmeans(
|
||||
sensor_locations=sensor_locations,
|
||||
sensor_type=sensor_type,
|
||||
method="kmeans",
|
||||
persist_results=persist_results,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user