test(baseline): add 3 Phase 8 invariant tests (mcp_client SS=0, MIG=0)
TIER-2 READ conductor/code_styleguides/error_handling.md end-to-end before Phase 8. Phase 8 = mcp_client silent-swallow + UNCLEAR + nested BC cleanup: - 5 INTERNAL_SILENT_SWALLOW sites migrated (L171 _is_allowed via Path.is_relative_to; L1661+L1666 stop via ErrorInfo accumulation + stdout drain) - 3 nested BC sites migrated (_search_file, derive_code_path_result, trace) - mcp_client now has ZERO migration-target sites Total tests: 25 pass (4 Phase 1 + 3 Phase 2 + 3 Phase 3 + 3 Phase 4 + 3 Phase 5 + 3 Phase 6 + 3 Phase 7 + 3 Phase 8). Audit: mcp_client BOUNDARY_CONVERSION: 5, INTERNAL_COMPLIANT: 43. Migration-target: 0 (was 9 after Phase 7).
This commit is contained in:
@@ -270,4 +270,33 @@ def test_phase7_modules_import_cleanly():
|
||||
assert hasattr(src.mcp_client, "get_tree_result")
|
||||
assert hasattr(src.mcp_client, "web_search_result")
|
||||
assert hasattr(src.mcp_client, "fetch_url_result")
|
||||
assert hasattr(src.mcp_client, "get_ui_performance_result")
|
||||
assert hasattr(src.mcp_client, "get_ui_performance_result")
|
||||
|
||||
# ============ Phase 8 tests (3) ============
|
||||
|
||||
def test_phase8_mcp_client_silent_swallow_zero():
|
||||
"""Phase 8 CRITICAL anti-sliming phase: mcp_client INTERNAL_SILENT_SWALLOW = 0."""
|
||||
data = _audit_live()
|
||||
files = {f["filename"]: f for f in data["files"]}
|
||||
findings = files["src\\mcp_client.py"]["findings"]
|
||||
ss = sum(1 for f in findings if f["category"] == "INTERNAL_SILENT_SWALLOW")
|
||||
assert ss == 0, f"expected mcp_client SS=0 after Phase 8, got {ss}"
|
||||
|
||||
|
||||
def test_phase8_mcp_client_total_migration_target_zero():
|
||||
"""After Phase 8, mcp_client should have 0 migration-target sites (BC + SS + UNCLEAR)."""
|
||||
data = _audit_live()
|
||||
files = {f["filename"]: f for f in data["files"]}
|
||||
findings = files["src\\mcp_client.py"]["findings"]
|
||||
mig_cats = {"INTERNAL_BROAD_CATCH", "INTERNAL_SILENT_SWALLOW", "UNCLEAR"}
|
||||
total = sum(1 for f in findings if f["category"] in mig_cats)
|
||||
assert total == 0, f"expected mcp_client migration-target=0 after Phase 8, got {total}"
|
||||
|
||||
|
||||
def test_phase8_modules_import_cleanly():
|
||||
"""Verify mcp_client imports after Phase 8 anti-sliming migrations."""
|
||||
import src.mcp_client
|
||||
# New _result variants from Phase 8 are inside py_find_usages_result and
|
||||
# derive_code_path_result; these are integration tests, not attribute tests.
|
||||
assert hasattr(src.mcp_client, "py_find_usages_result")
|
||||
assert hasattr(src.mcp_client, "derive_code_path_result")
|
||||
|
||||
Reference in New Issue
Block a user