diff --git a/conductor/tracks.md b/conductor/tracks.md index 6727d27..3968f7c 100644 --- a/conductor/tracks.md +++ b/conductor/tracks.md @@ -25,11 +25,14 @@ This file tracks all major tracks for the project. Each track has its own detail *Link: [./tracks/hook_api_expansion_20260308/](./tracks/hook_api_expansion_20260308/)* *Goal: Maximize internal state exposure and provide comprehensive control endpoints (worker spawn/kill, pipeline pause/resume, DAG mutation) via the Hook API. Implement WebSocket-based real-time event streaming.* +5. [ ] **Track: Codebase Audit and Cleanup** +*Link: [./tracks/codebase_audit_20260308/](./tracks/codebase_audit_20260308/)* + --- ### GUI Overhauls & Visualizations -3. [ ] **Track: Advanced Log Management and Session Restoration** +1. [~] **Track: Advanced Log Management and Session Restoration** *Link: [./tracks/log_session_overhaul_20260308/](./tracks/log_session_overhaul_20260308/)* *Goal: Centralize log management, improve session restoration reliability with full-UI replay mode, and optimize log size via external script/output referencing. Implement transient diagnostic logging for system warnings.* @@ -49,11 +52,11 @@ This file tracks all major tracks for the project. Each track has its own detail ### C/C++ Language Support -5. [ ] **Track: Tree-Sitter C/C++ MCP Tools** +1. [ ] **Track: Tree-Sitter C/C++ MCP Tools** *Link: [./tracks/ts_cpp_tree_sitter_20260308/](./tracks/ts_cpp_tree_sitter_20260308/)* *Goal: Add tree-sitter C and C++ grammars. Extend ASTParser to support C/C++ skeleton and outline extraction. Add MCP tools ts_c_get_skeleton, ts_cpp_get_skeleton, ts_c_get_code_outline, ts_cpp_get_code_outline.* -6. [ ] **Track: Bootstrap gencpp Python Bindings** +2. [ ] **Track: Bootstrap gencpp Python Bindings** *Link: [./tracks/gencpp_python_bindings_20260308/](./tracks/gencpp_python_bindings_20260308/)* *Goal: Bootstrap standalone Python project with CFFI bindings for gencpp C library. Provides foundation for richer C++ AST parsing in future (beyond tree-sitter syntax).* @@ -61,26 +64,26 @@ This file tracks all major tracks for the project. Each track has its own detail ### Path Configuration -7. [ ] **Track: Project-Specific Conductor Directory** +1. [ ] **Track: Project-Specific Conductor Directory** *Link: [./tracks/project_conductor_dir_20260308/](./tracks/project_conductor_dir_20260308/)* *Goal: Make conductor directory per-project. Each project TOML can specify custom conductor dir for isolated track/state management.* -8. [ ] **Track: GUI Path Configuration in Context Hub** +2. [ ] **Track: GUI Path Configuration in Context Hub** *Link: [./tracks/gui_path_config_20260308/](./tracks/gui_path_config_20260308/)* *Goal: Add path configuration UI to Context Hub. Allow users to view and edit configurable paths directly from the GUI.* --- ### Manual UX Controls -9. [ ] **Track: Saved System Prompt Presets** +1. [ ] **Track: Saved System Prompt Presets** *Link: [./tracks/saved_presets_20260308/](./tracks/saved_presets_20260308/)* *Goal: Ability to have saved presets for global and project system prompts. Includes full AI profiles with temperature and top_p settings, managed via a dedicated GUI modal.* -10. [ ] **Track: Saved Tool Presets** +2. [ ] **Track: Saved Tool Presets** *Link: [./tracks/saved_tool_presets_20260308/](./tracks/saved_tool_presets_20260308/)* *Goal: Make agent tools have presets. Add flags for tools related to their level of approval (auto, ask). Move tools to ai settings. Put tools in dynamic TOML-defined categories (Python, General, etc.). Tool Presets added to mma agent role options.* -11. [ ] **Track: External Text Editor Integration for Approvals** +3. [ ] **Track: External Text Editor Integration for Approvals** *Link: [./tracks/external_editor_integration_20260308/](./tracks/external_editor_integration_20260308/)* *Goal: Add support to open files modified by agents in external editors (10xNotepad/VSCode) for native diffing and manual editing during the tool approval flow.* @@ -88,15 +91,15 @@ This file tracks all major tracks for the project. Each track has its own detail ### Model Providers -12. [ ] **Track: OpenAI Provider Integration** +1. [ ] **Track: OpenAI Provider Integration** *Link: [./tracks/openai_integration_20260308/](./tracks/openai_integration_20260308/)* *Goal: Add support for OpenAI as a first-class model provider (GPT-4o, GPT-4o-mini, o1, o3-mini). Achieve functional parity with Gemini/Anthropic, including Vision, Structured Output, and response streaming.* -13. [ ] **Track: Zhipu AI (GLM) Provider Integration** +2. [ ] **Track: Zhipu AI (GLM) Provider Integration** *Link: [./tracks/zhipu_integration_20260308/](./tracks/zhipu_integration_20260308/)* *Goal: Add support for Zhipu AI (z.ai) as a first-class model provider (GLM-4, GLM-4-Flash, GLM-4V). Implement core client, vision support, and cost tracking.* -14. [ ] **Track: AI Provider Caching Optimization** +3. [ ] **Track: AI Provider Caching Optimization** *Link: [./tracks/caching_optimization_20260308/](./tracks/caching_optimization_20260308/)* *Goal: Verify and optimize caching strategies across all providers. Implement 4-breakpoint hierarchy for Anthropic, prefix stabilization for OpenAI/DeepSeek, and hybrid explicit/implicit caching for Gemini. Add GUI hit rate metrics.* @@ -172,3 +175,5 @@ This file tracks all major tracks for the project. Each track has its own detail - [x] **Track: Simulation Hardening** - [x] **Track: Deep Architectural Documentation Refresh** - [x] **Track: Robust Live Simulation Verification** + +--- diff --git a/conductor/tracks/codebase_audit_20260308/index.md b/conductor/tracks/codebase_audit_20260308/index.md new file mode 100644 index 0000000..ea2b8ea --- /dev/null +++ b/conductor/tracks/codebase_audit_20260308/index.md @@ -0,0 +1,5 @@ +# Track codebase_audit_20260308 Context + +- [Specification](./spec.md) +- [Implementation Plan](./plan.md) +- [Metadata](./metadata.json) \ No newline at end of file diff --git a/conductor/tracks/codebase_audit_20260308/metadata.json b/conductor/tracks/codebase_audit_20260308/metadata.json new file mode 100644 index 0000000..f6a02b5 --- /dev/null +++ b/conductor/tracks/codebase_audit_20260308/metadata.json @@ -0,0 +1,8 @@ +{ + "track_id": "codebase_audit_20260308", + "type": "chore", + "status": "new", + "created_at": "2026-03-08T00:00:00Z", + "updated_at": "2026-03-08T00:00:00Z", + "description": "Codebase Audit and Cleanup for redundant codepaths, missing docstrings, and coherent file organization." +} \ No newline at end of file diff --git a/conductor/tracks/codebase_audit_20260308/plan.md b/conductor/tracks/codebase_audit_20260308/plan.md new file mode 100644 index 0000000..79cea39 --- /dev/null +++ b/conductor/tracks/codebase_audit_20260308/plan.md @@ -0,0 +1,36 @@ +# Implementation Plan: Codebase Audit and Cleanup + +## Phase 1: Audit and Refactor Orchestration & DAG Core +- [ ] Task: Audit `src/multi_agent_conductor.py` for redundant logic, missing docstrings, and organization. + - [ ] Perform minor refactoring of small redundancies. + - [ ] Add minimal docstrings to critical paths. + - [ ] Document large architectural redundancies if found. +- [ ] Task: Audit `src/dag_engine.py` for redundant logic, missing docstrings, and organization. + - [ ] Perform minor refactoring of small redundancies. + - [ ] Add minimal docstrings to critical paths. + - [ ] Document large architectural redundancies if found. +- [ ] Task: Audit `src/native_orchestrator.py` and `src/orchestrator_pm.py`. + - [ ] Perform minor refactoring of small redundancies. + - [ ] Add minimal docstrings to critical paths. + - [ ] Document large architectural redundancies if found. +- [ ] Task: Conductor - User Manual Verification 'Phase 1: Audit and Refactor Orchestration & DAG Core' (Protocol in workflow.md) + +## Phase 2: Audit and Refactor AI Clients & Tools +- [ ] Task: Audit `src/ai_client.py` and `src/gemini_cli_adapter.py`. + - [ ] Perform minor refactoring of small redundancies. + - [ ] Add minimal docstrings to critical paths. + - [ ] Document large architectural redundancies if found. +- [ ] Task: Audit `src/mcp_client.py` and `src/shell_runner.py`. + - [ ] Perform minor refactoring of small redundancies. + - [ ] Add minimal docstrings to critical paths. + - [ ] Document large architectural redundancies if found. +- [ ] Task: Audit `src/api_hook_client.py` and `src/api_hooks.py`. + - [ ] Perform minor refactoring of small redundancies. + - [ ] Add minimal docstrings to critical paths. + - [ ] Document large architectural redundancies if found. +- [ ] Task: Conductor - User Manual Verification 'Phase 2: Audit and Refactor AI Clients & Tools' (Protocol in workflow.md) + +## Phase 3: Final Review and Reporting +- [ ] Task: Compile findings of large architectural redundancies from Phase 1 and 2. + - [ ] Generate a markdown report summarizing the findings. +- [ ] Task: Conductor - User Manual Verification 'Phase 3: Final Review and Reporting' (Protocol in workflow.md) \ No newline at end of file diff --git a/conductor/tracks/codebase_audit_20260308/spec.md b/conductor/tracks/codebase_audit_20260308/spec.md new file mode 100644 index 0000000..676c724 --- /dev/null +++ b/conductor/tracks/codebase_audit_20260308/spec.md @@ -0,0 +1,33 @@ +# Specification: Codebase Audit and Cleanup + +## Overview +The objective of this track is to audit the `./src` and `./simulation` directories to improve human readability and maintainability. The codebase has matured, and it is necessary to identify and address redundant code paths and state tracking, add missing docstrings to critical paths, and organize declarations/definitions within files. + +## Scope +- **Target Directories:** `./src` and `./simulation`. +- **Phasing:** Prioritize core modules first (orchestration, DAG engine, AI clients, etc.). +- **Refactoring Strategy:** Perform minor refactoring for small redundancies immediately. For larger, architectural redundancies, document and flag them for follow-up tracks. +- **Documentation:** Add minimal docstrings (brief descriptions without formal tags) to critical code paths where missing. + +## Functional Requirements +- **Audit Core Modules:** Systematically review core files in `./src` (e.g., `multi_agent_conductor.py`, `dag_engine.py`, `ai_client.py`, `mcp_client.py`). +- **Identify Redundancies:** Locate duplicate logic, unused functions, or overlapping state tracking across systems. +- **Organize Code:** Reorder declarations, classes, and definitions within files to flow logically for human reading. +- **Add Docstrings:** Ensure all core classes and critical functions have at least a minimal descriptive docstring. +- **Report Findings:** Generate a report documenting any large architectural redundancies discovered during the audit that were not immediately fixed. + +## Non-Functional Requirements +- Ensure no change in existing functionality or behavior. +- Maintain existing test coverage. +- Adhere strictly to the `1-space indentation` rule for all Python files modified. + +## Acceptance Criteria +- Core files in `./src` have been audited, reorganized, and documented with minimal docstrings. +- Minor redundant code paths have been consolidated. +- A summary report of significant architectural redundancies is generated. +- All tests pass after refactoring. + +## Out of Scope +- Major architectural overhauls or rewrites. +- Immediate refactoring of the UI/GUI components or Simulation framework (reserved for later phases/tracks). +- Addition of extensive, heavily tagged docstrings (e.g., Google or Sphinx style). \ No newline at end of file