2.5 KiB
2.5 KiB
Track Specification: Codebase Migration to src & Cleanup (codebase_migration_20260302)
Overview
This track focuses on restructuring the codebase to alleviate clutter by moving the main implementation files from the project root into a dedicated src/ directory. Additionally, files that are completely unused by the current implementation will be automatically identified and removed. A new clean entry point (sloppy.py) will be created in the root directory.
Functional Requirements
- Directory Restructuring:
- Move all active Python implementation files (e.g.,
gui_2.py,ai_client.py,mcp_client.py,shell_runner.py,project_manager.py,events.py, etc.) into a newsrc/directory. - Update internal imports within all moved files to reflect their new locations or ensure the Python path resolves them correctly.
- Move all active Python implementation files (e.g.,
- Root Directory Retention:
- Keep configuration files (e.g.,
config.toml,pyproject.toml,requirements.txt,.gitignore) in the project root. - Keep documentation files and directories (e.g.,
Readme.md,BUILD.md,docs/) in the project root. - Keep the
tests/andsimulation/directories at the root level.
- Keep configuration files (e.g.,
- New Entry Point:
- Create a new file
sloppy.pyin the root directory. sloppy.pywill serve as the primary entry point to launch the application (jumpstarting the underlyinggui_2.pylogic which will be moved intosrc/).
- Create a new file
- Dead Code/File Removal:
- Automatically identify completely unused files and scripts in the project root (e.g., legacy files, unreferenced tools).
- Delete the identified unused files to clean up the repository.
Non-Functional Requirements
- Ensure all automated tests (
tests/) and simulations (simulation/) continue to function perfectly withoutModuleNotFoundErrors. sloppy.pymust support existing CLI arguments (e.g.,--enable-test-hooks).
Acceptance Criteria
- A
src/directory exists and contains the main application logic. - The root directory is clean, containing mainly configs, docs,
tests/,simulation/, andsloppy.py. sloppy.pysuccessfully launches the application.- The full test suite runs and passes (i.e. all imports are correctly resolved).
- Obsolete/unused files have been successfully deleted from the repository.
Out of Scope
- Complete refactoring of
gui_2.pyinto a fully modular system (this track only moves it, though preparing it for future non-monolithic structure is conceptually aligned).