3.4 KiB
3.4 KiB
Implementation Plan: Codebase Migration to src & Cleanup (codebase_migration_20260302)
Phase 1: Unused File Identification & Removal
- Task: Initialize MMA Environment
activate_skill mma-orchestrator - Task: Audit Codebase for Dead Files
- WHERE: Project root
- WHAT: Run
py_find_usagesor grep on suspected unused files to verify they are not referenced bygui_2.py,tests/,simulation/, or core config files. - HOW: Gather a list of unused files.
- SAFETY: Do not delete files referenced in
.tomlfiles or Github action workflows.
- Task: Delete Unused Files
- WHERE: Project root
- WHAT: Use
run_powershellwithRemove-Itemto delete the identified unused files. - HOW: Explicitly list and delete them.
- SAFETY: Stage deletions to Git carefully.
- Task: Conductor - User Manual Verification 'Phase 1: Unused File Identification & Removal' (Protocol in workflow.md)
Phase 2: Directory Restructuring & Migration
- Task: Create
src/Directory- WHERE: Project root
- WHAT: Create the
src/directory. Add an empty__init__.pyto make it a package. - HOW:
New-Item -ItemType Directory src; New-Item src/__init__.py. - SAFETY: None.
- Task: Move Application Files to
src/- WHERE: Project root
- WHAT: Move core
.pyfiles (gui_2.py,ai_client.py,mcp_client.py,shell_runner.py,project_manager.py,events.py, etc.) intosrc/. - HOW: Use
git mvviarun_powershellor standardMove-Item. - SAFETY: Preserve git history of these files.
- Task: Conductor - User Manual Verification 'Phase 2: Directory Restructuring & Migration' (Protocol in workflow.md)
Phase 3: Entry Point & Import Resolution
- Task: Create
sloppy.pyEntry Point- WHERE: Project root (
sloppy.py) - WHAT: Create the script to act as the primary launch point. It should import
Appfromsrc.gui_2and pass CLI args. - HOW: Write a standard Python script wrapper.
- SAFETY: Ensure it correctly propagates
sys.argv.
- WHERE: Project root (
- Task: Resolve Absolute and Relative Imports
- WHERE:
src/*.py,tests/*.py,simulation/*.py - WHAT: Update import statements. E.g.,
import gui_2becomesfrom src import gui_2or adjustsys.path.appendin tests. - HOW: Surgical string replacements. Ensure
pytestcan still find fixtures and test modules. - SAFETY: Run
uv run pytestto aggressively check forModuleNotFoundErrors.
- WHERE:
- Task: Conductor - User Manual Verification 'Phase 3: Entry Point & Import Resolution' (Protocol in workflow.md)
Phase 4: Final Validation & Documentation
- Task: Full Test Suite Validation
- WHERE: Project root
- WHAT: Run
uv run pytest. Fix any remaining path resolution issues for logs, artifacts, and configs. - HOW: Verify 100% pass rate.
- SAFETY: Artifacts must still be written to
tests/artifacts/.
- Task: Update Core Documentation
- WHERE:
Readme.md,docs/,conductor/tech-stack.md - WHAT: Document
sloppy.pyas the new entry point. Document thesrc/directory layout. - HOW: Surgical text replacement.
- SAFETY: Accurate representation of new structure.
- WHERE:
- Task: Conductor - User Manual Verification 'Phase 4: Final Validation & Documentation' (Protocol in workflow.md)