# Implementation Plan: Test Suite Stabilization & Consolidation (test_stabilization_20260302) ## Phase 1: Infrastructure & Paradigm Consolidation - [ ] Task: Initialize MMA Environment `activate_skill mma-orchestrator` - [ ] Task: Setup Artifact Isolation Directories - [ ] Create `./tests/artifacts/` and `./tests/logs/` with appropriate `.gitignore`. - [ ] Task: Migrate Manual Launchers to `live_gui` Fixture - [ ] Refactor `tests/visual_mma_verification.py` to use the `live_gui` fixture. - [ ] Audit `simulation/` and `tests/` for other manual subprocess launchers and refactor. - [ ] Task: Conductor - User Manual Verification 'Phase 1: Infrastructure & Consolidation' (Protocol in workflow.md) ## Phase 2: Asyncio Stabilization & Logging - [ ] Task: Audit and Fix `conftest.py` Loop Lifecycle - [ ] Ensure all fixtures correctly handle loop cleanup and task cancellation. - [ ] Task: Resolve `Event loop is closed` in Core Test Suite - [ ] Update identified files to pass active loops and use `ThreadPoolExecutor`. - [ ] Task: Implement Centralized Sectioned Logging Utility - [ ] Task: Conductor - User Manual Verification 'Phase 2: Asyncio & Logging' (Protocol in workflow.md) ## Phase 3: Assertion Implementation & Simulation Fixes - [ ] Task: Replace `pytest.fail` with Functional Assertions - [ ] Focus on `api_events`, `execution_engine`, `token_usage`, and `agent_capabilities`. - [ ] Task: Resolve Simulation Entry Count Regressions - [ ] Fix entry count assertions in `test_context_sim_live` and align mocks. - [ ] Task: Conductor - User Manual Verification 'Phase 3: Assertions & Sims' (Protocol in workflow.md) ## Phase 4: Final Verification & Artifact Audit - [ ] Task: Full Suite Validation & Warning Cleanup - [ ] Task: Final Artifact Isolation Verification - [ ] Task: Conductor - User Manual Verification 'Phase 4: Final Verification' (Protocol in workflow.md)