conductor(plan): write 7-phase implementation plan for mcp_architecture_refactor_20260606
~25 tasks across 7 phases, each with explicit Red-Green-Refactor TDD steps: - Phase 1 (1.1-1.5): Foundation. 3-layer security module (8 unit tests returning Result[Path]); SubMCP Protocol + MCPController class (6 unit tests). Controller added ALONGSIDE the existing 45 functions in mcp_client.py (no removal yet). - Phase 2 (2.1-2.4): Backward compat. git mv mcp_client.py to mcp_client_legacy.py; create new mcp_client.py as a slim shim re-exporting 45+ old symbols. 12 legacy shim tests verify the surface. The 4 existing test files + src/app_controller.py:61 still work. - Phase 3 (3.1-3.4): FileIOMCP extracted (9 tools, 10 unit tests). - Phase 4 (4.1-4.4): PythonMCP extracted (14 tools, 14 unit tests). - Phase 5 (5.1-5.5): CMCP, CppMCP, WebMCP, AnalysisMCP extracted (4 sub-MCPs, 18 unit tests; pattern mirrors Phase 3/4). - Phase 6 (6.1-6.3): ExternalMCP extracted from mcp_client_legacy. Class name preserved (ExternalMCPManager). - Phase 7 (7.1-7.5): Update dispatch() in the legacy shim to use the new controller (inverted-dict O(1) lookup); update docs; manual smoke test; archive the track. Each sub-MCP follows the same template (class with name / description / tools / invoke; security check for path-taking tools; Result wrapping in invoke(); delegation to legacy functions for the actual implementation). The sub-MCPs are thin adapters in v1; a future track can move the implementations into the sub-MCP files directly. Self-review at the end maps every spec section to a task (no gaps), confirms zero placeholders, and verifies type/method-name consistency across phases (SubMCP Protocol, MCPController class, Result[str, ErrorInfo], _resolve_and_check all defined in Phase 1; used consistently across Phases 3-6).
This commit is contained in: