conductor(plan): Mark asyncio decoupling track complete

This commit is contained in:
2026-03-05 16:58:02 -05:00
parent 4c150317ba
commit d4923c5198

View File

@@ -3,31 +3,31 @@
> **TEST DEBT FIX:** This track is responsible for permanently eliminating the `RuntimeError: Event loop is closed` test suite crashes by ripping out the conflict-prone asyncio loops from the AppController.
## Phase 1: Event System Migration
- [ ] Task: Initialize MMA Environment `activate_skill mma-orchestrator`
- [ ] Task: Refactor `events.py`
- [ ] WHERE: `src/events.py`
- [ ] WHAT: Replace `AsyncEventQueue` with `SyncEventQueue` using `import queue`.
- [ ] HOW: Change `async def get()` to a blocking `def get()`. Remove `asyncio` imports.
- [ ] SAFETY: Ensure thread-safety.
- [ ] Task: Conductor - User Manual Verification 'Phase 1: Event System'
- [x] Task: Initialize MMA Environment `activate_skill mma-orchestrator`
- [x] Task: Refactor `events.py`
- [x] WHERE: `src/events.py`
- [x] WHAT: Replace `AsyncEventQueue` with `SyncEventQueue` using `import queue`.
- [x] HOW: Change `async def get()` to a blocking `def get()`. Remove `asyncio` imports.
- [x] SAFETY: Ensure thread-safety.
- [x] Task: Conductor - User Manual Verification 'Phase 1: Event System'
## Phase 2: AppController Decoupling
- [ ] Task: Refactor `AppController` Event Loop
- [ ] WHERE: `src/app_controller.py`
- [ ] WHAT: Remove `self._loop` and `asyncio.new_event_loop()`.
- [ ] HOW: Change `_run_event_loop` to just call `_process_event_queue` directly (which will now block on queue gets).
- [ ] SAFETY: Ensure `shutdown()` properly signals the queue to unblock and join the thread.
- [ ] Task: Thread Task Dispatching
- [ ] WHERE: `src/app_controller.py`
- [ ] WHAT: Replace `asyncio.run_coroutine_threadsafe(self.event_queue.put(...))` with direct synchronous `.put()`. Replace `self._loop.run_in_executor` with `threading.Thread(target=self._handle_request_event)`.
- [ ] HOW: Mechanical replacement of async primitives.
- [ ] SAFETY: None.
- [ ] Task: Conductor - User Manual Verification 'Phase 2: Decoupling'
- [x] Task: Refactor `AppController` Event Loop
- [x] WHERE: `src/app_controller.py`
- [x] WHAT: Remove `self._loop` and `asyncio.new_event_loop()`.
- [x] HOW: Change `_run_event_loop` to just call `_process_event_queue` directly (which will now block on queue gets).
- [x] SAFETY: Ensure `shutdown()` properly signals the queue to unblock and join the thread.
- [x] Task: Thread Task Dispatching
- [x] WHERE: `src/app_controller.py`
- [x] WHAT: Replace `asyncio.run_coroutine_threadsafe(self.event_queue.put(...))` with direct synchronous `.put()`. Replace `self._loop.run_in_executor` with `threading.Thread(target=self._handle_request_event)`.
- [x] HOW: Mechanical replacement of async primitives.
- [x] SAFETY: None.
- [x] Task: Conductor - User Manual Verification 'Phase 2: Decoupling'
## Phase 3: Final Validation
- [ ] Task: Full Suite Validation
- [ ] WHERE: Project root
- [ ] WHAT: `uv run pytest`
- [ ] HOW: Ensure 100% pass rate with no hanging threads or event loop errors.
- [ ] SAFETY: None.
- [ ] Task: Conductor - User Manual Verification 'Phase 3: Final Validation'
- [x] Task: Full Suite Validation
- [x] WHERE: Project root
- [x] WHAT: `uv run pytest`
- [x] HOW: Ensure 100% pass rate with no hanging threads or event loop errors.
- [x] SAFETY: None.
- [x] Task: Conductor - User Manual Verification 'Phase 3: Final Validation'