From 20fe32fc531c3b1b4d3efa283fa43997b95076e4 Mon Sep 17 00:00:00 2001 From: 732642856 <732642856@qq.com> Date: Thu, 16 Jul 2026 22:41:10 +0800 Subject: [PATCH] Add strict evidence service boundary --- .../interpretation_source_inventory_gate.py | 4 +-- scripts/strict_evidence_service.py | 29 +++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 scripts/strict_evidence_service.py diff --git a/scripts/interpretation_source_inventory_gate.py b/scripts/interpretation_source_inventory_gate.py index 4f27209d..aa24a9ec 100644 --- a/scripts/interpretation_source_inventory_gate.py +++ b/scripts/interpretation_source_inventory_gate.py @@ -13,7 +13,7 @@ ROOT = Path(__file__).resolve().parents[1] if str(ROOT) not in sys.path: sys.path.insert(0, str(ROOT)) -from mcp_server import _existing_interpretation_source_pack # noqa: E402 +from scripts.strict_evidence_service import existing_interpretation_source_pack # noqa: E402 REQUIRED_LAYERS = [ @@ -100,7 +100,7 @@ CANDIDATE_KEYWORDS = [ def build_report() -> dict[str, Any]: - source_pack = _existing_interpretation_source_pack() + source_pack = existing_interpretation_source_pack() inventory = source_pack.get("interpretation_source_inventory") if isinstance(source_pack, dict) else {} if not isinstance(inventory, dict): inventory = {} diff --git a/scripts/strict_evidence_service.py b/scripts/strict_evidence_service.py new file mode 100644 index 00000000..86a1b90d --- /dev/null +++ b/scripts/strict_evidence_service.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 +"""Stable strict-evidence service boundary. + +This module is the import target for engine/API code. The current implementation +delegates to the legacy MCP implementation while the large helper stack is being +extracted out of `mcp_server.py`. +""" + +from __future__ import annotations + +import sys +from pathlib import Path +from typing import Any + +ROOT = Path(__file__).resolve().parents[1] +if str(ROOT) not in sys.path: + sys.path.insert(0, str(ROOT)) + + +def collect_strict_evidence(route: str, result: dict[str, Any]) -> dict[str, Any]: + from mcp_server import _collect_strict_evidence + + return _collect_strict_evidence(route, result) + + +def existing_interpretation_source_pack() -> dict[str, Any]: + from mcp_server import _existing_interpretation_source_pack + + return _existing_interpretation_source_pack()