# Implementation Plan: GUI Decoupling & Controller Architecture (gui_decoupling_controller_20260302) ## Phase 1: Controller Skeleton & State Migration - [x] Task: Initialize MMA Environment `activate_skill mma-orchestrator` [d0009bb] - [x] Task: Create `app_controller.py` Skeleton [d0009bb] - [x] Task: Migrate Data State from GUI [d0009bb] - [ ] Task: Conductor - User Manual Verification 'Phase 1: State Migration' (Protocol in workflow.md) ## Phase 2: Logic & Background Thread Migration - [x] Task: Extract Background Threads & Event Queue [9260c7d] - [x] Task: Extract I/O and AI Methods [9260c7d] - [ ] Task: Conductor - User Manual Verification 'Phase 2: Logic Migration' (Protocol in workflow.md) ## Phase 3: Test Suite Refactoring - [x] Task: Update `conftest.py` Fixtures [f2b2575] - [x] Task: Resolve Broken GUI Tests [f2b2575] - [ ] Task: Conductor - User Manual Verification 'Phase 3: Test Suite Refactoring' (Protocol in workflow.md) ## Phase 4: Final Validation - [ ] Task: Full Suite Validation & Warning Cleanup - [ ] WHERE: Project root - [ ] WHAT: `uv run pytest` - [ ] HOW: Ensure 100% pass rate. - [ ] SAFETY: Watch out for lingering thread closure issues. - [ ] Task: Conductor - User Manual Verification 'Phase 4: Final Validation' (Protocol in workflow.md) ## Phase 5: Stabilization & Cleanup (RECOVERY) - [ ] Task: Task 5.1: AST Synchronization Audit - [ ] Task: Task 5.2: Restore Controller Properties (Restore `current_provider`) - [ ] Task: Task 5.3: Replace magic `__getattr__` with Explicit Delegation - [ ] Task: Task 5.4: Fix Sandbox Isolation logic in `conftest.py` - [ ] Task: Task 5.5: Event Loop Consolidation & Single-Writer Sync