From de9dd3c155e528d8b6575066c48c59486c9989fd Mon Sep 17 00:00:00 2001 From: Ed_ Date: Fri, 26 Jun 2026 20:23:28 -0400 Subject: [PATCH] fix(app_controller): use direct import for load_config_from_disk + save_config_to_disk The de-cruft track (post_module_taxonomy_de_cruft_20260627) removed the __getattr__ lazy-load entries for moved classes from models.py in commit 426ba343. The migration in commit 8f11340b + 9e07fac1 handled 'from src.models import X' (85 sites) and 'models.' attribute access (44 sites) but missed 2 specific sites in app_controller.py that use the moved config-IO functions: - line 5169: self.config = models.load_config_from_disk() - line 5181: models.save_config_to_disk(self.config) Both functions moved to src/project.py in module_taxonomy_refactor Phase 3b. The de-cruft track's __getattr__ removal exposed the mismatch: the app_controller was calling models.load_config_from_disk but the function was no longer accessible via the shim. This commit fixes both sites: 1. Adds 'from src.project import load_config_from_disk, save_config_to_disk' to the import block (next to the existing src.project_files import) 2. Replaces 'models.load_config_from_disk()' with 'load_config_from_disk()' 3. Replaces 'models.save_config_to_disk(self.config)' with 'save_config_to_disk(self.config)' After this commit: - 'from src.app_controller import AppController' works without AttributeError on models.load_config_from_disk - 'uv run sloppy.py' can complete the load_config phase of init_state The de-cruft track's __getattr__ removal is now consistent: the load_config_from_disk and save_config_to_disk access patterns are eliminated from the call sites, not just hidden behind the shim. Discovered by user: running 'uv run sloppy.py' on the de-cruft branch produced AttributeError because app_controller.py:5169 still called models.load_config_from_disk. The user reported 'If I ran the same execution on your current branch in your sandbox, the same thing will occur' which was correct; the bug was on the de-cruft branch itself, not in the user's main repo. --- src/app_controller.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app_controller.py b/src/app_controller.py index 5b7b2202..3920ea24 100644 --- a/src/app_controller.py +++ b/src/app_controller.py @@ -4,6 +4,7 @@ from src.mma import Ticket, Track, TrackState from src.personas import Persona from src.mcp_client import MCPConfiguration, RAGConfig, load_mcp_config from src.project_files import ContextPreset, FileItem, NamedViewPreset, Preset +from src.project import load_config_from_disk, save_config_to_disk from src.tool_bias import BiasProfile import copy @@ -5166,7 +5167,7 @@ class AppController: scripts/audit_no_models_config_io.py. [C: src/app_controller.py:AppController.__init__] """ - self.config = models.load_config_from_disk() + self.config = load_config_from_disk() return self.config def save_config(self) -> None: @@ -5178,7 +5179,7 @@ class AppController: scripts/audit_no_models_config_io.py. [C: src/app_controller.py:AppController._cb_project_save, src/app_controller.py:AppController._do_generate] """ - models.save_config_to_disk(self.config) + save_config_to_disk(self.config) #endregion: --- Config I/O (single source of truth) --- #endregion: MMA (Controller)