ed
b1ee947b32
docs(reports): FOLLOWUP_module_taxonomy_20260627 v2.1 - AGENT_TOOL_NAMES is redundant
...
User: 'isn't AGENT_TOOL_NAMES a redundant thing thats directly associated
with the mcp_client.py?' - YES, confirmed.
The existing test test_tool_names_subset_of_models_agent_tool_names
literally asserts: tool_names() ⊆ AGENT_TOOL_NAMES. So AGENT_TOOL_NAMES
is just a hardcoded snapshot of mcp_tool_specs.tool_names().
Action: DELETE AGENT_TOOL_NAMES from models.py (not just move it).
Derive at consumer sites: list(mcp_tool_specs.tool_names()).
8 consumer sites to update:
- 3 in src/app_controller.py:2110, 2972, 3273
- 5 in tests/test_arch_boundary_phase2.py:23, 29, 31, 32, 33
The cross-check test becomes either redundant or converts to a
positive assertion (e.g., assert that the derived list has at
least the canonical tool count).
models.py reduces further: from ~60 to ~30 lines after deletion.
This further reduces the models.py footprint. Combined with the
previous audit (move vendor files to ai_client.py, split out mma.py
+ project.py + project_files.py), models.py becomes essentially
empty - just the Pydantic proxy code that may also move to api_hooks.py.
Net effect: models.py could be ELIMINATED entirely (becomes ~0 lines
or just an __init__.py marker). The followup should consider whether
to delete models.py completely.
2026-06-26 06:14:40 -04:00
ed
5380b7153d
docs(reports): FOLLOWUP_module_taxonomy_20260627 v2 - unification over splitting
...
Revised per user directive: 'if anything I want more unification. I only
want splitifcation if there is a good reason such as import load times.
If there isn't an import issue or definition pollution issue just keep
it in the same file.'
Decision rule (the user's principle):
- Split ONLY for: import load times OR definition pollution
- Otherwise: keep in same file
- No sub-directories; prefix naming only
Only TWO refactors justified:
1. MERGE 5 ImGui LEAKS into gui_2.py (user: 'all ImGui rendering should be
in gui_2.py; only exception imgui_scopes.py'):
- bg_shader.py, shaders.py, command_palette.py, diff_viewer.py,
patch_modal.py -> move content to gui_2.py, git rm originals
2. MERGE 2 vendor files into ai_client.py (user: 'vendor_capabilities.py
and vendor_state.py are related to ai_client.py'):
- vendor_capabilities.py, vendor_state.py -> move to ai_client.py
- ai_client.py grows 3147 -> ~3310 lines (justified: unified vendor layer)
3. SPLIT models.py (clear definition pollution: 36 classes, 5+ domains,
1044 lines):
- CREATE src/mma.py (MMA Core: ThinkingSegment, Ticket, Track,
WorkerContext, TrackState)
- CREATE src/project.py (ProjectContext + 5 sub + config IO +
parse_history_entries)
- CREATE src/project_files.py (FileItem, ContextPreset,
ContextFileEntry, NamedViewPreset, Preset)
- MERGE other classes into existing sub-system files:
- Persona -> personas.py
- Tool/ToolPreset -> tool_presets.py
- BiasProfile -> tool_bias.py
- TextEditorConfig/ExternalEditorConfig -> external_editor.py
- MCPServerConfig/MCPConfiguration/etc -> mcp_client.py
- WorkspaceProfile -> workspace_manager.py
- REDUCE models.py to ~60 lines (Pydantic proxies + AGENT_TOOL_NAMES only)
Everything else (52 files): KEEP AS-IS. No reason to split.
Renames (optional, deferred):
- multi_agent_conductor.py -> mma_conductor.py
- dag_engine.py -> mma_dag.py
- conductor_tech_lead.py -> mma_tech_lead.py
- orchestrator_pm.py -> mma_pm.py
(These are renames for prefix consistency, not strictly necessary)
Net scope: 17 file changes; -4 files (65 -> 61).
10 VCs. 5 phases. 1 atomic commit per file move.
User: 'I want more unification' -> only 1 split (models.py), 7 merges.
2026-06-26 06:08:06 -04:00
ed
01b6c68e20
docs(reports): FOLLOWUP_module_taxonomy_20260627 - models.py audit + refactor plan
...
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)'.
2026-06-26 05:59:29 -04:00