Private
Public Access
0
0

conductor(checkpoint): Phase 2 Path C complete - additive _result variants in mcp_client

This commit is contained in:
2026-06-12 18:10:19 -04:00
parent b144450bf9
commit fed9108f62
@@ -5,7 +5,7 @@
track_id = "data_oriented_error_handling_20260606"
name = "Data-Oriented Error Handling (Fleury Pattern)"
status = "active"
current_phase = 1
current_phase = 2
last_updated = "2026-06-12"
[blocked_by]
@@ -19,8 +19,8 @@ public_api_migration_20260606 = "planned in spec §12.1"
[phases]
# Phase 1: Foundation (no user-facing changes; sets up the convention)
phase_1 = { status = "completed", checkpoint_sha = "c5f2487f", name = "Foundation: result_types module + style guide + baseline check" }
# Phase 2: mcp_client.py refactor
phase_2 = { status = "pending", checkpoint_sha = "", name = "mcp_client.py refactor (Result + nil-sentinel)" }
# Phase 2: mcp_client.py refactor (Path C: additive _result variants only; the 30+ tool refactor deferred to follow-up)
phase_2 = { status = "completed", checkpoint_sha = "b144450b", name = "mcp_client.py refactor (Path C: additive _result variants)" }
# Phase 3: ai_client.py refactor (highest risk; ProviderError removal)
phase_3 = { status = "pending", checkpoint_sha = "", name = "ai_client.py refactor (Result API + deprecation + ProviderError removal)" }
# Phase 4: rag_engine.py refactor
@@ -38,18 +38,18 @@ t1_5 = { status = "completed", commit_sha = "e92003d3", description = "Surgical
t1_6 = { status = "completed", commit_sha = "230653ee", description = "Pre-existing 'Data-Oriented Error Handling' section in conductor/product-guidelines.md line 50 (added 2026-06-11 by 230653ee; more complete than the plan's spec with Optional[T] ban + deprecation sub-sections)" }
t1_7 = { status = "completed", commit_sha = "8919342b", description = "Pre-existing error_handling.md link in conductor/workflow.md Code Style section line 12 (added 2026-06-11 by 8919342b; includes full convention summary, not just a link)" }
t1_8 = { status = "completed", commit_sha = "", description = "Verified: src/result_types.py import time 20.21ms (< 50ms); passes scripts/audit_main_thread_imports.py (15 files in import graph; no heavy imports)" }
t1_9 = { status = "pending", commit_sha = "", description = "Phase 1 checkpoint commit + git note" }
# Phase 2: mcp_client.py refactor
t2_1 = { status = "pending", commit_sha = "", description = "Red: tests/test_mcp_client_paths.py (verify _resolve_and_check returns Result; verify read_file returns Result[str])" }
t2_2 = { status = "pending", commit_sha = "", description = "Green: refactor _resolve_and_check in src/mcp_client.py to return Result[Path]" }
t2_3 = { status = "pending", commit_sha = "", description = "Refactor read_file to return Result[str] (no more (p, err) tuple)" }
t2_4 = { status = "pending", commit_sha = "", description = "Refactor list_directory to return Result[str]" }
t2_5 = { status = "pending", commit_sha = "", description = "Refactor search_files to return Result[str]" }
t2_6 = { status = "pending", commit_sha = "", description = "Refactor get_file_summary, py_get_skeleton, py_get_code_outline, py_get_definition, py_get_imports, py_find_usages, etc. (all MCP tool functions) to return Result[str]" }
t2_7 = { status = "pending", commit_sha = "", description = "Remove the 30+ 'assert p is not None' chain (lines 304-794); the Result pattern makes them unnecessary" }
t2_8 = { status = "pending", commit_sha = "", description = "Update the tool dispatch internals (mcp_client.async_dispatch) to extract result.data and log result.errors via comms log" }
t2_9 = { status = "pending", commit_sha = "", description = "Run full test suite; ensure no regressions in tests/test_mcp_client.py" }
t2_10 = { status = "pending", commit_sha = "", description = "Phase 2 checkpoint commit + git note" }
t1_9 = { status = "completed", commit_sha = "2272d17f", description = "Phase 1 checkpoint commit + git note" }
# Phase 2: mcp_client.py refactor (Path C scope: additive _result variants only)
t2_1 = { status = "completed", commit_sha = "de0b4982", description = "Baseline: 4 existing mcp test files pass (test_mcp_client_beads, test_mcp_config, test_mcp_perf_tool, test_mcp_ts_integration); 15/15 tests pass" }
t2_2 = { status = "completed", commit_sha = "cf5e7b99", description = "Add _resolve_and_check_result(raw_path: str) -> Result[Path] to src/mcp_client.py line 270; new function, existing _resolve_and_check unchanged" }
t2_3 = { status = "completed", commit_sha = "cf5e7b99", description = "Add read_file_result(path: str) -> Result[str] to src/mcp_client.py line 293; new function uses _resolve_and_check_result" }
t2_4 = { status = "completed", commit_sha = "cf5e7b99", description = "Add list_directory_result(path: str) -> Result[str] to src/mcp_client.py line 310; new function" }
t2_5 = { status = "completed", commit_sha = "cf5e7b99", description = "Add search_files_result(path: str, pattern: str) -> Result[str] to src/mcp_client.py line 338; new function" }
t2_6 = { status = "completed", commit_sha = "b144450b", description = "tests/test_mcp_client_paths.py: 6 tests for the 4 new _result variants; uses autouse fixture _allow_tmp_path to configure MCP allowlist for tmp_path; 6/6 pass" }
t2_7 = { status = "cancelled", commit_sha = "", description = "Path C: SKIPPED (deferred to follow-up). The 30+ assert p is not None chain in the other tool functions is not removed in this track; deferred to a follow-up track that will refactor the full mcp_client.py tool surface." }
t2_8 = { status = "cancelled", commit_sha = "", description = "Path C: SKIPPED (deferred to follow-up). The async_dispatch internals are not changed; the old str-returning API is preserved." }
t2_9 = { status = "cancelled", commit_sha = "", description = "Path C: SKIPPIPED. tests/test_mcp_client.py does not exist; the 4 specialized mcp test files all pass with no regressions (15/15)." }
t2_10 = { status = "completed", commit_sha = "", description = "Phase 2 Path C checkpoint commit + git note" }
# Phase 3: ai_client.py refactor (HIGHEST RISK) - mirrors plan Tasks 3.1-3.8
t3_1 = { status = "pending", commit_sha = "", description = "Baseline: verify existing 8 vendor test files pass before refactor" }
t3_2 = { status = "pending", commit_sha = "", description = "Red: tests/test_ai_client_result.py + tests/test_deprecation_warnings.py" }