# Implementation Plan: Data-Oriented Python Optimization Pass

## Phase 1: Guidelines and Instrumentation
- [ ] Task: Update `conductor/product-guidelines.md` with Data-Oriented Python heuristics and the "less Python does the better" philosophy.
- [ ] Task: Review existing profiling instrumentation in `src/performance_monitor.py` or diagnostic hooks.
- [ ] Task: Expand profiling instrumentation to capture more detailed execution times for non-GUI data structures/processes if necessary.
- [ ] Task: Conductor - User Manual Verification 'Phase 1: Guidelines and Instrumentation' (Protocol in workflow.md)

## Phase 2: Audit and Profiling (`src/` and `simulation/`)
- [ ] Task: Run profiling scenarios (especially utilizing simulations) to generate baseline metrics.
- [ ] Task: Audit `src/` (e.g., `dag_engine.py`, `multi_agent_conductor.py`, `aggregate.py`) against the new guidelines, cross-referencing with profiling data to identify bottlenecks.
- [ ] Task: Audit `simulation/` files against the new guidelines to ensure the test harness is performant and non-blocking.
- [ ] Task: Compile a list of identified bottleneck targets to refactor.
- [ ] Task: Conductor - User Manual Verification 'Phase 2: Audit and Profiling (`src/` and `simulation/`)' (Protocol in workflow.md)

## Phase 3: Targeted Optimization and Refactoring
- [ ] Task: Write/update tests for the first identified bottleneck to establish a performance or structural baseline (Red Phase).
- [ ] Task: Refactor the first identified bottleneck to align with data-oriented guidelines (Green Phase).
- [ ] Task: Write/update tests for remaining identified bottlenecks.
- [ ] Task: Refactor remaining identified bottlenecks.
- [ ] Task: Conductor - User Manual Verification 'Phase 3: Targeted Optimization and Refactoring' (Protocol in workflow.md)

## Phase 4: Final Evaluation and Documentation
- [ ] Task: Re-run all profiling scenarios to compare against the baseline metrics.
- [ ] Task: Analyze remaining bottlenecks that did not reach performance thresholds and document them as candidates for C/C++ bindings (Last Resort).
- [ ] Task: Generate a final summary report of the optimizations applied and the C extension evaluation.
- [ ] Task: Conductor - User Manual Verification 'Phase 4: Final Evaluation and Documentation' (Protocol in workflow.md)