From c1023923200f24a27dd1dfd0ca26e7e950b07e77 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Wed, 4 Mar 2026 10:01:55 -0500 Subject: [PATCH] feat(src): Resolve imports and create sloppy.py entry point --- .../codebase_migration_20260302/plan.md | 12 ++--------- scripts/mcp_server.py | 6 ++++-- scripts/tool_call.py | 6 ++++-- scripts/tool_discovery.py | 6 ++++-- scripts/update_paths.py | 20 +++++++++++++++++++ simulation/ping_pong.py | 1 + simulation/sim_base.py | 6 ++++-- sloppy.py | 12 +++++++++++ tests/conftest.py | 7 ++++--- tests/test_agent_capabilities.py | 1 + tests/test_agent_tools_wiring.py | 1 + tests/test_api_hook_client.py | 1 + tests/test_api_hook_extensions.py | 1 + tests/test_cli_tool_bridge.py | 1 + tests/test_cli_tool_bridge_mapping.py | 1 + tests/test_conductor_api_hook_integration.py | 1 + tests/test_deepseek_infra.py | 1 + tests/test_extended_sims.py | 1 + tests/test_gemini_cli_adapter.py | 1 + tests/test_gemini_metrics.py | 1 + tests/test_gui2_parity.py | 1 + tests/test_gui2_performance.py | 1 + tests/test_gui_diagnostics.py | 1 + tests/test_gui_events.py | 1 + tests/test_gui_performance_requirements.py | 1 + tests/test_gui_stress_performance.py | 1 + tests/test_gui_updates.py | 1 + tests/test_history_management.py | 1 + tests/test_hooks.py | 1 + tests/test_layout_reorganization.py | 1 + tests/test_live_workflow.py | 1 + tests/test_mcp_perf_tool.py | 1 + tests/test_performance_monitor.py | 1 + tests/test_sim_ai_settings.py | 1 + tests/test_sim_base.py | 1 + tests/test_sim_context.py | 1 + tests/test_sim_execution.py | 1 + tests/test_sim_tools.py | 1 + tests/test_token_usage.py | 1 + tests/test_user_agent.py | 1 + tests/test_visual_orchestration.py | 1 + tests/test_visual_sim_gui_ux.py | 1 + tests/test_visual_sim_mma_v2.py | 1 + tests/test_workflow_sim.py | 1 + 44 files changed, 90 insertions(+), 21 deletions(-) create mode 100644 scripts/update_paths.py create mode 100644 sloppy.py diff --git a/conductor/tracks/codebase_migration_20260302/plan.md b/conductor/tracks/codebase_migration_20260302/plan.md index e887b8d..c0effb5 100644 --- a/conductor/tracks/codebase_migration_20260302/plan.md +++ b/conductor/tracks/codebase_migration_20260302/plan.md @@ -12,16 +12,8 @@ - [ ] Task: Conductor - User Manual Verification 'Phase 2: Directory Restructuring & Migration' (Protocol in workflow.md) ## Phase 3: Entry Point & Import Resolution -- [ ] Task: Create `sloppy.py` Entry Point - - [ ] WHERE: Project root (`sloppy.py`) - - [ ] WHAT: Create the script to act as the primary launch point. It should import `App` from `src.gui_2` and pass CLI args. - - [ ] HOW: Write a standard Python script wrapper. - - [ ] SAFETY: Ensure it correctly propagates `sys.argv`. -- [ ] Task: Resolve Absolute and Relative Imports - - [ ] WHERE: `src/*.py`, `tests/*.py`, `simulation/*.py` - - [ ] WHAT: Update import statements. E.g., `import gui_2` becomes `from src import gui_2` or adjust `sys.path.append` in tests. - - [ ] HOW: Surgical string replacements. Ensure `pytest` can still find fixtures and test modules. - - [ ] SAFETY: Run `uv run pytest` to aggressively check for `ModuleNotFoundError`s. +- [x] Task: Create `sloppy.py` Entry Point +- [x] Task: Resolve Absolute and Relative Imports - [ ] Task: Conductor - User Manual Verification 'Phase 3: Entry Point & Import Resolution' (Protocol in workflow.md) ## Phase 4: Final Validation & Documentation diff --git a/scripts/mcp_server.py b/scripts/mcp_server.py index 906db76..0ef8c06 100644 --- a/scripts/mcp_server.py +++ b/scripts/mcp_server.py @@ -13,8 +13,10 @@ import asyncio import os import sys -# Add project root to sys.path -sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +# Add project root and src/ to sys.path +project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) +sys.path.insert(0, project_root) +sys.path.insert(0, os.path.join(project_root, "src")) import mcp_client import shell_runner diff --git a/scripts/tool_call.py b/scripts/tool_call.py index 69fabf3..c4ebc2b 100644 --- a/scripts/tool_call.py +++ b/scripts/tool_call.py @@ -7,8 +7,10 @@ import io sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8') -# Add project root to sys.path -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +# Add project root and src/ to sys.path +project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) +sys.path.append(project_root) +sys.path.append(os.path.join(project_root, "src")) try: import mcp_client diff --git a/scripts/tool_discovery.py b/scripts/tool_discovery.py index 0b2cd321..4312641 100644 --- a/scripts/tool_discovery.py +++ b/scripts/tool_discovery.py @@ -2,8 +2,10 @@ import json import sys import os -# Add project root to sys.path -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +# Add project root and src/ to sys.path +project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) +sys.path.append(project_root) +sys.path.append(os.path.join(project_root, "src")) try: import mcp_client diff --git a/scripts/update_paths.py b/scripts/update_paths.py new file mode 100644 index 0000000..5e5a40b --- /dev/null +++ b/scripts/update_paths.py @@ -0,0 +1,20 @@ +import os +import glob + +pattern = 'sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src")))' +replacement = pattern + '\nsys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src")))' + +# Files to update +files = glob.glob("tests/*.py") + glob.glob("simulation/*.py") + glob.glob("scripts/*.py") + +for file_path in files: + if not os.path.isfile(file_path): + continue + with open(file_path, 'r', encoding='utf-8') as f: + content = f.read() + if pattern in content and replacement not in content: + print(f"Updating {file_path}") + new_content = content.replace(pattern, replacement) + with open(file_path, 'w', encoding='utf-8') as f: + f.write(new_content) diff --git a/simulation/ping_pong.py b/simulation/ping_pong.py index 0e2fc7f..59aa59c 100644 --- a/simulation/ping_pong.py +++ b/simulation/ping_pong.py @@ -4,6 +4,7 @@ import time # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from api_hook_client import ApiHookClient from simulation.user_agent import UserSimAgent diff --git a/simulation/sim_base.py b/simulation/sim_base.py index bd8d701..3927afe 100644 --- a/simulation/sim_base.py +++ b/simulation/sim_base.py @@ -5,8 +5,10 @@ from typing import Any, Optional from api_hook_client import ApiHookClient from simulation.workflow_sim import WorkflowSimulator -# Ensure project root is in path -sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +# Ensure project root and src/ are in path +project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) +sys.path.append(project_root) +sys.path.append(os.path.join(project_root, "src")) class BaseSimulation: def __init__(self, client: ApiHookClient = None) -> None: diff --git a/sloppy.py b/sloppy.py new file mode 100644 index 0000000..89ecca0 --- /dev/null +++ b/sloppy.py @@ -0,0 +1,12 @@ +import sys +import os + +# Add src to sys.path so we can import from it easily +project_root = os.path.dirname(os.path.abspath(__file__)) +src_path = os.path.join(project_root, "src") +sys.path.insert(0, src_path) + +from gui_2 import main + +if __name__ == "__main__": + main() diff --git a/tests/conftest.py b/tests/conftest.py index 8834a09..212ac48 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -12,8 +12,9 @@ from pathlib import Path from typing import Generator, Any from unittest.mock import patch -# Ensure project root is in path for imports +# Ensure project root and src/ are in path for imports sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) # Import the App class after patching if necessary, but here we just need the type hint from gui_2 import App @@ -161,10 +162,10 @@ def app_instance() -> Generator[App, None, None]: @pytest.fixture(scope="session") def live_gui() -> Generator[tuple[subprocess.Popen, str], None, None]: """ - Session-scoped fixture that starts gui_2.py with --enable-test-hooks. + Session-scoped fixture that starts sloppy.py with --enable-test-hooks. Includes high-signal environment telemetry and workspace isolation. """ - gui_script = os.path.abspath("gui_2.py") + gui_script = os.path.abspath("sloppy.py") diag = VerificationLogger("live_gui_startup", "live_gui_diag") diag.log_state("GUI Script", "N/A", "gui_2.py") diff --git a/tests/test_agent_capabilities.py b/tests/test_agent_capabilities.py index 00c3796..bb2a6f3 100644 --- a/tests/test_agent_capabilities.py +++ b/tests/test_agent_capabilities.py @@ -4,6 +4,7 @@ from unittest.mock import patch, MagicMock # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) import ai_client diff --git a/tests/test_agent_tools_wiring.py b/tests/test_agent_tools_wiring.py index dc0f948..0e96f7f 100644 --- a/tests/test_agent_tools_wiring.py +++ b/tests/test_agent_tools_wiring.py @@ -4,6 +4,7 @@ import ai_client # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from ai_client import set_agent_tools, _build_anthropic_tools diff --git a/tests/test_api_hook_client.py b/tests/test_api_hook_client.py index 4624094..fd52fbe 100644 --- a/tests/test_api_hook_client.py +++ b/tests/test_api_hook_client.py @@ -5,6 +5,7 @@ import os # Ensure project root is in path for imports sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from api_hook_client import ApiHookClient diff --git a/tests/test_api_hook_extensions.py b/tests/test_api_hook_extensions.py index d5e5c37..a8efbd6 100644 --- a/tests/test_api_hook_extensions.py +++ b/tests/test_api_hook_extensions.py @@ -5,6 +5,7 @@ from unittest.mock import patch # Ensure project root is in path for imports sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from api_hook_client import ApiHookClient diff --git a/tests/test_cli_tool_bridge.py b/tests/test_cli_tool_bridge.py index 7e059c6..977bbda 100644 --- a/tests/test_cli_tool_bridge.py +++ b/tests/test_cli_tool_bridge.py @@ -7,6 +7,7 @@ import os # Add project root to sys.path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) # Import after path fix from scripts.cli_tool_bridge import main diff --git a/tests/test_cli_tool_bridge_mapping.py b/tests/test_cli_tool_bridge_mapping.py index a79eb18..0866b74 100644 --- a/tests/test_cli_tool_bridge_mapping.py +++ b/tests/test_cli_tool_bridge_mapping.py @@ -7,6 +7,7 @@ import os # Add project root to sys.path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) # Import after path fix from scripts.cli_tool_bridge import main diff --git a/tests/test_conductor_api_hook_integration.py b/tests/test_conductor_api_hook_integration.py index 2eff33c..6dd6c6f 100644 --- a/tests/test_conductor_api_hook_integration.py +++ b/tests/test_conductor_api_hook_integration.py @@ -5,6 +5,7 @@ from typing import Any # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from api_hook_client import ApiHookClient diff --git a/tests/test_deepseek_infra.py b/tests/test_deepseek_infra.py index 3b67fdc..652e065 100644 --- a/tests/test_deepseek_infra.py +++ b/tests/test_deepseek_infra.py @@ -5,6 +5,7 @@ import sys # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) import ai_client import project_manager diff --git a/tests/test_extended_sims.py b/tests/test_extended_sims.py index 6b41601..d0a3396 100644 --- a/tests/test_extended_sims.py +++ b/tests/test_extended_sims.py @@ -6,6 +6,7 @@ import os # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from api_hook_client import ApiHookClient from simulation.sim_context import ContextSimulation diff --git a/tests/test_gemini_cli_adapter.py b/tests/test_gemini_cli_adapter.py index 81a585c..a863bd4 100644 --- a/tests/test_gemini_cli_adapter.py +++ b/tests/test_gemini_cli_adapter.py @@ -8,6 +8,7 @@ import os # Ensure the project root is in sys.path to resolve imports correctly sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from gemini_cli_adapter import GeminiCliAdapter diff --git a/tests/test_gemini_metrics.py b/tests/test_gemini_metrics.py index 3c8367a..508df4a 100644 --- a/tests/test_gemini_metrics.py +++ b/tests/test_gemini_metrics.py @@ -4,6 +4,7 @@ from unittest.mock import MagicMock, patch # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) # Import the necessary functions from ai_client, including the reset helper from ai_client import get_gemini_cache_stats, reset_session diff --git a/tests/test_gui2_parity.py b/tests/test_gui2_parity.py index 601c7a4..cfd1858 100644 --- a/tests/test_gui2_parity.py +++ b/tests/test_gui2_parity.py @@ -8,6 +8,7 @@ import sys # Ensure project root is in path for imports sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from api_hook_client import ApiHookClient # Define a temporary file path for callback testing diff --git a/tests/test_gui2_performance.py b/tests/test_gui2_performance.py index 81e1212..042c3bd 100644 --- a/tests/test_gui2_performance.py +++ b/tests/test_gui2_performance.py @@ -5,6 +5,7 @@ import os # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from api_hook_client import ApiHookClient diff --git a/tests/test_gui_diagnostics.py b/tests/test_gui_diagnostics.py index 45f8584..dd0c37b 100644 --- a/tests/test_gui_diagnostics.py +++ b/tests/test_gui_diagnostics.py @@ -4,6 +4,7 @@ from typing import Any # Ensure project root is in path for imports sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) def test_diagnostics_panel_initialization(app_instance: Any) -> None: diff --git a/tests/test_gui_events.py b/tests/test_gui_events.py index c1e8450..e6a870b 100644 --- a/tests/test_gui_events.py +++ b/tests/test_gui_events.py @@ -5,6 +5,7 @@ from gui_2 import App # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) def test_gui_updates_on_event(app_instance: App) -> None: app_instance.last_md = "mock_md" diff --git a/tests/test_gui_performance_requirements.py b/tests/test_gui_performance_requirements.py index a431d99..175632a 100644 --- a/tests/test_gui_performance_requirements.py +++ b/tests/test_gui_performance_requirements.py @@ -4,6 +4,7 @@ import os # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from api_hook_client import ApiHookClient diff --git a/tests/test_gui_stress_performance.py b/tests/test_gui_stress_performance.py index 950b037..5713866 100644 --- a/tests/test_gui_stress_performance.py +++ b/tests/test_gui_stress_performance.py @@ -4,6 +4,7 @@ import os # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from api_hook_client import ApiHookClient diff --git a/tests/test_gui_updates.py b/tests/test_gui_updates.py index b563f96..2d773ae 100644 --- a/tests/test_gui_updates.py +++ b/tests/test_gui_updates.py @@ -5,6 +5,7 @@ from typing import Any # Ensure project root is in path for imports sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from gui_2 import App diff --git a/tests/test_history_management.py b/tests/test_history_management.py index 92f22b4..c11c377 100644 --- a/tests/test_history_management.py +++ b/tests/test_history_management.py @@ -6,6 +6,7 @@ from pathlib import Path # Ensure project root is in path for imports sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) # Import necessary modules from the project import aggregate diff --git a/tests/test_hooks.py b/tests/test_hooks.py index 03f4fd6..1b0f1ca 100644 --- a/tests/test_hooks.py +++ b/tests/test_hooks.py @@ -4,6 +4,7 @@ from unittest.mock import patch # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from api_hook_client import ApiHookClient diff --git a/tests/test_layout_reorganization.py b/tests/test_layout_reorganization.py index f06607a..499b9ca 100644 --- a/tests/test_layout_reorganization.py +++ b/tests/test_layout_reorganization.py @@ -5,6 +5,7 @@ import os # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from gui_2 import App diff --git a/tests/test_live_workflow.py b/tests/test_live_workflow.py index e73e419..42e5981 100644 --- a/tests/test_live_workflow.py +++ b/tests/test_live_workflow.py @@ -5,6 +5,7 @@ import os # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from api_hook_client import ApiHookClient diff --git a/tests/test_mcp_perf_tool.py b/tests/test_mcp_perf_tool.py index ac4abe7..44fecf7 100644 --- a/tests/test_mcp_perf_tool.py +++ b/tests/test_mcp_perf_tool.py @@ -4,6 +4,7 @@ from unittest.mock import patch # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) import mcp_client diff --git a/tests/test_performance_monitor.py b/tests/test_performance_monitor.py index e37790c..d86d96d 100644 --- a/tests/test_performance_monitor.py +++ b/tests/test_performance_monitor.py @@ -4,6 +4,7 @@ import time # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from performance_monitor import PerformanceMonitor diff --git a/tests/test_sim_ai_settings.py b/tests/test_sim_ai_settings.py index bcb7a2f..363c6d0 100644 --- a/tests/test_sim_ai_settings.py +++ b/tests/test_sim_ai_settings.py @@ -4,6 +4,7 @@ import sys # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from simulation.sim_ai_settings import AISettingsSimulation diff --git a/tests/test_sim_base.py b/tests/test_sim_base.py index e3a2af2..dfbff3b 100644 --- a/tests/test_sim_base.py +++ b/tests/test_sim_base.py @@ -4,6 +4,7 @@ import sys # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from simulation.sim_base import BaseSimulation diff --git a/tests/test_sim_context.py b/tests/test_sim_context.py index 07cd99d..5f1246b 100644 --- a/tests/test_sim_context.py +++ b/tests/test_sim_context.py @@ -4,6 +4,7 @@ import sys # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from simulation.sim_context import ContextSimulation diff --git a/tests/test_sim_execution.py b/tests/test_sim_execution.py index c0c6e50..b70a280 100644 --- a/tests/test_sim_execution.py +++ b/tests/test_sim_execution.py @@ -4,6 +4,7 @@ import sys # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from simulation.sim_execution import ExecutionSimulation diff --git a/tests/test_sim_tools.py b/tests/test_sim_tools.py index 8d4842f..10507f6 100644 --- a/tests/test_sim_tools.py +++ b/tests/test_sim_tools.py @@ -4,6 +4,7 @@ import sys # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from simulation.sim_tools import ToolsSimulation diff --git a/tests/test_token_usage.py b/tests/test_token_usage.py index db13d74..1539d65 100644 --- a/tests/test_token_usage.py +++ b/tests/test_token_usage.py @@ -6,6 +6,7 @@ from types import SimpleNamespace # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) import ai_client diff --git a/tests/test_user_agent.py b/tests/test_user_agent.py index 7cec5df..6c72d26 100644 --- a/tests/test_user_agent.py +++ b/tests/test_user_agent.py @@ -3,6 +3,7 @@ import os # Ensure project root is in path for imports sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from simulation.user_agent import UserSimAgent diff --git a/tests/test_visual_orchestration.py b/tests/test_visual_orchestration.py index 1241eb4..ec86dca 100644 --- a/tests/test_visual_orchestration.py +++ b/tests/test_visual_orchestration.py @@ -5,6 +5,7 @@ import os # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from api_hook_client import ApiHookClient diff --git a/tests/test_visual_sim_gui_ux.py b/tests/test_visual_sim_gui_ux.py index dbb6c81..7f4cfae 100644 --- a/tests/test_visual_sim_gui_ux.py +++ b/tests/test_visual_sim_gui_ux.py @@ -5,6 +5,7 @@ import os import json sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from api_hook_client import ApiHookClient diff --git a/tests/test_visual_sim_mma_v2.py b/tests/test_visual_sim_mma_v2.py index e27c9a7..fa7dfb8 100644 --- a/tests/test_visual_sim_mma_v2.py +++ b/tests/test_visual_sim_mma_v2.py @@ -4,6 +4,7 @@ import sys import os sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from api_hook_client import ApiHookClient diff --git a/tests/test_workflow_sim.py b/tests/test_workflow_sim.py index ffbc4db..29a8aec 100644 --- a/tests/test_workflow_sim.py +++ b/tests/test_workflow_sim.py @@ -4,6 +4,7 @@ from unittest.mock import MagicMock # Ensure project root is in path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))) from simulation.workflow_sim import WorkflowSimulator