chore(conductor): Add new track 'Codebase Audit and Cleanup'

This commit is contained in:
2026-03-08 20:59:17 -04:00
parent 72bb2cec68
commit 1e4eaf25d8
5 changed files with 98 additions and 11 deletions

View File

@@ -0,0 +1,5 @@
# Track codebase_audit_20260308 Context
- [Specification](./spec.md)
- [Implementation Plan](./plan.md)
- [Metadata](./metadata.json)

View File

@@ -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."
}

View File

@@ -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)

View File

@@ -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).