# Culling Candidates: Source-Wide Redundancy Audit

This document identifies specific code, modules, and data structures that are redundant or unused and should be removed during the "Heavy Curation" phase.

## 1. Redundant Modules (Legacy/Superseded)

| Module Path | Reason for Culling | Successor / Context |
| :--- | :--- | :--- |
| `src/theme.py` | DearPyGui-specific logic. Project has migrated to `imgui-bundle`. | `src/theme_2.py` |
| `src/native_orchestrator.py` | Legacy orchestration logic. Unused in core app. | `src/orchestrator_pm.py` |
| `src/beads_client.py` | Functional, but only used by specific "Beads" features. Review if still desired. | MMA / Conductor |

## 2. Redundant Data Structures (`src/models.py`)

- **Duplicate Class: `TextEditorConfig`**: Defined twice in `models.py`. Remove the second instance.
- **Duplicate Class: `ExternalEditorConfig`**: Defined twice in `models.py`. Remove the second instance.
- **Malformed Class: `Metadata`**: Has three `@dataclass` decorators. Strip down to one.
- **Unused Constants**: `AGENT_TOOL_NAMES` is largely redundant if `MCP_TOOL_SPECS` in `mcp_client` is the source of truth.

## 3. Unused Public Symbols (Audit Results)

The following symbols have 0 project-wide usages (excluding their own definition and tests):

### 3.1 Aggregation & AI
- `build_tier1_context` (`src/aggregate.py`)
- `build_tier2_context` (`src/aggregate.py`)
- `get_history_trunc_limit` (`src/ai_client.py`)
- `set_history_trunc_limit` (`src/ai_client.py`)
- `get_history_bleed_stats` (`src/ai_client.py`)

### 3.2 UI & Viewers
- `parse_diff_header` (`src/diff_viewer.py`)
- `format_diff_for_display` (`src/diff_viewer.py`)
- `render_diff_text_immediate` (`src/diff_viewer.py`)
- `create_backup` / `restore_from_backup` / `cleanup_backup` (`src/diff_viewer.py`)
- `apply_faux_acrylic_glass` (`src/shaders.py`)
- `ShaderManager` (`src/shader_manager.py`)

### 3.3 Infrastructure & Cache
- `resolve_project_editor_override` (`src/external_editor.py`)
- `content_block_type` (`src/file_cache.py`)
- `evict` / `list_cached` (`src/file_cache.py`)
- `get_git_log` (`src/project_manager.py`)

## 4. Next Steps: Heavy Curation
1. **Surgical Deletion**: Remove identified unused symbols and duplicate classes.
2. **Module Culling**: Delete `theme.py` and `native_orchestrator.py`.
3. **Consolidation**: Refactor `aggregate.py` to use a single param-driven context builder instead of tier-specific ones.
