chore(conductor): Add new track 'AI-Optimized Python Style Refactor'
This commit is contained in:
@@ -4,7 +4,10 @@ This file tracks all major tracks for the project. Each track has its own detail
|
||||
|
||||
---
|
||||
|
||||
- [ ] **Track: Robust Live Simulation Verification**
|
||||
- [~] **Track: Robust Live Simulation Verification**
|
||||
*Link: [./tracks/robust_live_simulation_verification/](./tracks/robust_live_simulation_verification/)*
|
||||
|
||||
---
|
||||
|
||||
- [ ] **Track: AI-Optimized Python Style Refactor**
|
||||
*Link: [./tracks/python_style_refactor_20260227/](./tracks/python_style_refactor_20260227/)*
|
||||
5
conductor/tracks/python_style_refactor_20260227/index.md
Normal file
5
conductor/tracks/python_style_refactor_20260227/index.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Track python_style_refactor_20260227 Context
|
||||
|
||||
- [Specification](./spec.md)
|
||||
- [Implementation Plan](./plan.md)
|
||||
- [Metadata](./metadata.json)
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"track_id": "python_style_refactor_20260227",
|
||||
"type": "refactor",
|
||||
"status": "new",
|
||||
"created_at": "2026-02-27T10:00:00Z",
|
||||
"updated_at": "2026-02-27T10:00:00Z",
|
||||
"description": "Adjust python code style. I want to covert all the python code in this codebase (not thirdparty pacakge code) to usse single space python indentation. I also want to reduce empty newlines. This is to reduce redundant tokens as this codebase is mostly managed by ai agents. Do any ideal adjustments for ai agents to the code style in @C:\projects\manual_slop\conductor\code_styleguides\python.md and if they are non-trivval changes we'll make phases for their refactors."
|
||||
}
|
||||
22
conductor/tracks/python_style_refactor_20260227/plan.md
Normal file
22
conductor/tracks/python_style_refactor_20260227/plan.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Implementation Plan: AI-Optimized Python Style Refactor
|
||||
|
||||
## Phase 1: Research and Pilot Tooling
|
||||
- [ ] Task: Conductor - Define and Test Style Transformation Logic. (Develop or adapt a tool to perform 1-space indentation and newline reduction safely).
|
||||
- [ ] Task: Conductor - Run Style Pilot on a Representative Module (e.g., `theme.py`).
|
||||
- [ ] Task: Conductor - User Manual Verification 'Phase 1: Pilot and Tooling' (Protocol in workflow.md)
|
||||
|
||||
## Phase 2: Core Refactor - Indentation and Newlines
|
||||
- [ ] Task: Conductor - Refactor Primary Engine Modules (`ai_client.py`, `aggregate.py`, `mcp_client.py`, `shell_runner.py`).
|
||||
- [ ] Task: Conductor - Refactor Project & Session Management Modules (`project_manager.py`, `session_logger.py`).
|
||||
- [ ] Task: Conductor - Refactor UI Modules (`gui_2.py`, `gui_legacy.py`, `theme.py`, `theme_2.py`).
|
||||
- [ ] Task: Conductor - Refactor Remaining Utility and Support Modules (`events.py`, `file_cache.py`, `models.py`, `mma_prompts.py`).
|
||||
- [ ] Task: Conductor - User Manual Verification 'Phase 2: Indentation and Newline Refactor' (Protocol in workflow.md)
|
||||
|
||||
## Phase 3: AI-Optimized Metadata and Final Cleanup
|
||||
- [ ] Task: Conductor - Implement Strict Type Hinting and Compact Imports across the Entire Codebase.
|
||||
- [ ] Task: Conductor - Update `conductor/code_styleguides/python.md` with the new AI-optimized standard.
|
||||
- [ ] Task: Conductor - User Manual Verification 'Phase 3: Metadata and Final Documentation' (Protocol in workflow.md)
|
||||
|
||||
---
|
||||
|
||||
**Protocol Note:** Each task will follow the Standard Task Workflow (Red/Green phases with Tier 3 Worker delegation). Phase completion will trigger the mandatory Verification and Checkpointing protocol.
|
||||
32
conductor/tracks/python_style_refactor_20260227/spec.md
Normal file
32
conductor/tracks/python_style_refactor_20260227/spec.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# Specification: AI-Optimized Python Style Refactor
|
||||
|
||||
## 1. Overview
|
||||
Refactor the Python codebase to a "Single-Space, Ultra-Compact" style specifically designed to minimize token consumption for AI agents. This involves reducing whitespace and blank lines while enhancing structural metadata (type hints) for better agent comprehension.
|
||||
|
||||
## 2. Functional Requirements
|
||||
- **Indentation:** All 4-space indentations must be converted to **exactly 1 space** per level. This includes hanging indents and line continuations.
|
||||
- **Newlines (Ultra-Compact):**
|
||||
- Maximum **one (1)** blank line between top-level definitions (classes, functions).
|
||||
- **Zero (0)** blank lines inside function or method bodies.
|
||||
- **Imports (Compact):** Consolidate imports into compact blocks to reduce vertical space.
|
||||
- **Typing (Strict):** Ensure all function and method signatures include strict type hints for `Args` and `Returns`.
|
||||
- **Scope:**
|
||||
- Target: All `.py` files in the project root and subdirectories.
|
||||
- Exclusions: `.venv/`, `__pycache__/`, and third-party package code.
|
||||
|
||||
## 3. Non-Functional Requirements
|
||||
- **Valid Python:** The resulting code MUST remain syntactically valid and executable Python 3.11+.
|
||||
- **AST Compatibility:** The style must not interfere with existing AST tools (`ast`, `tree-sitter`) used for interface extraction and code outlines.
|
||||
- **Token Efficiency:** The primary goal is to reduce the total token count of the codebase.
|
||||
|
||||
## 4. Acceptance Criteria
|
||||
- [ ] Codebase indentation is uniformly 1 space.
|
||||
- [ ] No `.py` file contains consecutive blank lines.
|
||||
- [ ] No `.py` file contains blank lines within function or method bodies.
|
||||
- [ ] All functions/methods have complete type hints.
|
||||
- [ ] Application remains functional and passes existing tests.
|
||||
|
||||
## 5. Out of Scope
|
||||
- Architectural changes or logic refactoring.
|
||||
- Modification of non-Python files (e.g., `.md`, `.toml`, `.ps1`).
|
||||
- Breaking PEP 8 compliance where it's not strictly necessary for token reduction (though indentation and blank lines are explicitly targeted).
|
||||
Reference in New Issue
Block a user