01b6c68e20
User directive: models.py is a dumping ground. Needs clean mma_/project_ taxonomy per AGENTS.md 'File Size and Naming Convention' HARD RULE. Audit findings: - models.py is 1044 lines, 13 regions, 5+ unrelated domains - 36 classes/functions in 1 file - Top docstring claims MMA + project config but actually contains: editor configs, MCP config, file contexts, persona configs, Pydantic proxies - Phase 2 of cruft_elimination_20260627 just added 6 more (ProjectContext) making the mess worse Proposed taxonomy: - src/mma.py = main MMA file (Ticket, Track, WorkerContext, ThinkingSegment, TrackState) - src/project.py = main project-config file (ProjectContext + 5 sub + config IO + parse_history_entries) - src/project_files.py = file-related (FileItem, ContextPreset, ContextFileEntry, NamedViewPreset, Preset) - Tool/Persona/Editor/MCP/Workspace dataclasses merge into their existing sub-system files (tool_presets.py, tool_bias.py, personas.py, external_editor.py, mcp_client.py, workspace_manager.py) - src/models.py reduced to ~60 lines (Pydantic proxies + AGENT_TOOL_NAMES only) 5-phase refactor plan: - Phase 1: src/mma.py + 5 file imports updated - Phase 2: src/project.py + project_manager.py imports updated - Phase 3: src/project_files.py + 4 file imports updated - Phase 4: Merge 8+ dataclasses into 6 existing sub-system files - Phase 5: Reduce src/models.py to ~60 lines 11 VCs. 1 atomic commit per file move. Regression-guard tests after each. Critical: the cruft_elimination_20260627 Phase 2 spec must be updated to say 'add ProjectContext to src/project.py' (NOT src/models.py). Tier 2 should re-execute Phase 2 with the corrected file location before this broader taxonomy refactor starts. User instruction: 'I need top-level prefix for modules that cannot have their definitions in the single file (mma_ with mma.py being the main one, project_, with project.py, etc)'.