hopefully done refining
This commit is contained in:
@@ -1,31 +1,63 @@
|
||||
# Implementation Plan: MMA Multi-Worker Visualization (mma_multiworker_viz_20260306)
|
||||
|
||||
## Phase 1: Layout Design
|
||||
- [ ] Task: Initialize MMA Environment
|
||||
- [ ] Task: Design multi-pane layout
|
||||
- WHERE: src/gui_2.py
|
||||
- WHAT: Split view for workers
|
||||
- HOW: imgui.columns or child windows
|
||||
- SAFETY: Handle 0 workers
|
||||
> **Reference:** [Spec](./spec.md) | [Architecture Guide](../../../docs/guide_architecture.md)
|
||||
|
||||
## Phase 2: Worker Tracking
|
||||
- [ ] Task: Track worker status
|
||||
- WHERE: src/multi_agent_conductor.py
|
||||
- WHAT: Per-worker status
|
||||
- HOW: Dictionary of worker states
|
||||
- SAFETY: Thread-safe updates
|
||||
## Phase 1: Stream Structure Enhancement
|
||||
Focus: Extend existing mma_streams for per-worker tracking
|
||||
|
||||
## Phase 3: Controls
|
||||
- [ ] Task: Add kill buttons
|
||||
- WHERE: src/gui_2.py
|
||||
- WHAT: Button per worker to kill
|
||||
- HOW: Signal worker thread
|
||||
- SAFETY: Graceful termination
|
||||
- [ ] Task: Add restart buttons
|
||||
- WHERE: src/gui_2.py
|
||||
- WHAT: Respawn killed worker
|
||||
- HOW: Re-submit ticket
|
||||
- [ ] Task 1.1: Initialize MMA Environment
|
||||
- [ ] Task 1.2: Review existing mma_streams structure
|
||||
- WHERE: `src/app_controller.py` line 142
|
||||
- WHAT: Current is `Dict[str, str]` - stream_id -> accumulated text
|
||||
- NOTE: Keep this structure, add per-worker metadata separately
|
||||
|
||||
## Phase 4: Verification
|
||||
- [ ] Task: Test multi-worker display
|
||||
- [ ] Task: Conductor - Phase Verification
|
||||
## Phase 2: Worker Status Tracking
|
||||
Focus: Track worker status separately
|
||||
|
||||
- [ ] Task 2.1: Add worker status dict
|
||||
- WHERE: `src/app_controller.py`
|
||||
- WHAT: Track status per worker
|
||||
- HOW:
|
||||
```python
|
||||
self._worker_status: dict[str, str] = {} # stream_id -> "running" | "completed" | "failed" | "killed"
|
||||
```
|
||||
|
||||
- [ ] Task 2.2: Update status on worker events
|
||||
- WHERE: `src/app_controller.py` `_process_pending_gui_tasks()`
|
||||
- WHAT: Update status based on mma events
|
||||
- HOW: On "response" event, set status to "completed"
|
||||
|
||||
## Phase 3: Multi-Pane Display
|
||||
Focus: Display all active streams
|
||||
|
||||
- [ ] Task 3.1: Iterate all Tier 3 streams
|
||||
- WHERE: `src/gui_2.py` `_render_tier_stream_panel()`
|
||||
- WHAT: Show all workers in split view
|
||||
- HOW:
|
||||
```python
|
||||
tier3_keys = [k for k in self.mma_streams if "Tier 3" in k]
|
||||
for key in tier3_keys:
|
||||
status = self._worker_status.get(key, "unknown")
|
||||
imgui.text(f"{key}: {status}")
|
||||
if imgui.begin_child(f"stream_{key}", height=150):
|
||||
imgui.text_wrapped(self.mma_streams.get(key, ""))
|
||||
imgui.end_child()
|
||||
```
|
||||
|
||||
## Phase 4: Stream Pruning
|
||||
Focus: Limit memory per stream
|
||||
|
||||
- [ ] Task 4.1: Prune stream on append
|
||||
- WHERE: `src/app_controller.py` stream append logic
|
||||
- WHAT: Limit to 10KB per stream
|
||||
- HOW:
|
||||
```python
|
||||
MAX_STREAM_SIZE = 10 * 1024
|
||||
self.mma_streams[stream_id] += text
|
||||
if len(self.mma_streams[stream_id]) > MAX_STREAM_SIZE:
|
||||
self.mma_streams[stream_id] = self.mma_streams[stream_id][-MAX_STREAM_SIZE:]
|
||||
```
|
||||
|
||||
## Phase 5: Testing
|
||||
- [ ] Task 5.1: Write unit tests
|
||||
- [ ] Task 5.2: Conductor - Phase Verification
|
||||
|
||||
Reference in New Issue
Block a user