refactor(sdm): Global pass with refined 'External Only' SDM tags. Pruned redundant internal references and fixed indentation logic in injector. Verified full project compilation.
This commit is contained in:
+17
-2
@@ -62,6 +62,9 @@ class BaseSimulation:
|
||||
self.project_path = None
|
||||
|
||||
def setup(self, project_name: str = "SimProject") -> None:
|
||||
"""
|
||||
[C: simulation/sim_execution.py:ExecutionSimulation.setup, tests/test_extended_sims.py:test_ai_settings_sim_live, tests/test_extended_sims.py:test_context_sim_live, tests/test_extended_sims.py:test_execution_sim_live, tests/test_extended_sims.py:test_tools_sim_live, tests/test_sim_base.py:test_base_simulation_setup]
|
||||
"""
|
||||
print("\n[BaseSim] Connecting to GUI...")
|
||||
if not self.client.wait_for_server(timeout=5):
|
||||
raise RuntimeError("Could not connect to GUI. Ensure it is running with --enable-test-hooks")
|
||||
@@ -88,6 +91,9 @@ class BaseSimulation:
|
||||
time.sleep(1.5)
|
||||
|
||||
def teardown(self) -> None:
|
||||
"""
|
||||
[C: tests/test_extended_sims.py:test_ai_settings_sim_live, tests/test_extended_sims.py:test_context_sim_live, tests/test_extended_sims.py:test_execution_sim_live, tests/test_extended_sims.py:test_tools_sim_live]
|
||||
"""
|
||||
if self.project_path and os.path.exists(self.project_path):
|
||||
# We keep it for debugging if it failed, but usually we'd clean up
|
||||
# os.remove(self.project_path)
|
||||
@@ -95,9 +101,15 @@ class BaseSimulation:
|
||||
print("[BaseSim] Teardown complete.")
|
||||
|
||||
def get_value(self, tag: str) -> Any:
|
||||
"""
|
||||
[C: simulation/sim_context.py:ContextSimulation.run, simulation/sim_execution.py:ExecutionSimulation.run, simulation/workflow_sim.py:WorkflowSimulator.run_discussion_turn_async, simulation/workflow_sim.py:WorkflowSimulator.wait_for_ai_response, tests/smoke_status_hook.py:test_status_hook, tests/smoke_status_hook.py:wait_for_value, tests/test_auto_switch_sim.py:test_auto_switch_sim, tests/test_deepseek_infra.py:test_gui_provider_list_via_hooks, tests/test_extended_sims.py:test_ai_settings_sim_live, tests/test_gui2_parity.py:test_gui2_click_hook_works, tests/test_gui2_parity.py:test_gui2_set_value_hook_works, tests/test_rag_phase4_final_verify.py:test_phase4_final_verify, tests/test_rag_phase4_stress.py:test_rag_large_codebase_verification_sim, tests/test_rag_visual_sim.py:test_rag_full_lifecycle_sim, tests/test_rag_visual_sim.py:test_rag_settings_persistence_sim, tests/test_selectable_ui.py:test_selectable_label_stability, tests/test_system_prompt_sim.py:test_system_prompt_sim, tests/test_undo_redo_sim.py:test_undo_redo_context_mutation, tests/test_undo_redo_sim.py:test_undo_redo_discussion_mutation, tests/test_undo_redo_sim.py:test_undo_redo_lifecycle, tests/test_visual_mma.py:test_visual_mma_components, tests/test_workspace_profiles_sim.py:test_workspace_profiles_restoration]
|
||||
"""
|
||||
return self.client.get_value(tag)
|
||||
|
||||
def wait_for_event(self, event_type: str, timeout: int = 5) -> Optional[dict]:
|
||||
"""
|
||||
[C: simulation/sim_execution.py:ExecutionSimulation.run, tests/test_z_negative_flows.py:test_mock_error_result, tests/test_z_negative_flows.py:test_mock_malformed_json, tests/test_z_negative_flows.py:test_mock_timeout]
|
||||
"""
|
||||
return self.client.wait_for_event(event_type, timeout)
|
||||
|
||||
def assert_panel_visible(self, panel_tag: str, msg: str = None) -> None:
|
||||
@@ -115,7 +127,10 @@ class BaseSimulation:
|
||||
return False
|
||||
|
||||
def run_sim(sim_class: type) -> None:
|
||||
"""Helper to run a simulation class standalone."""
|
||||
"""
|
||||
Helper to run a simulation class standalone.
|
||||
[C: simulation/sim_context.py:module, simulation/sim_execution.py:module, simulation/sim_tools.py:module]
|
||||
"""
|
||||
sim = sim_class()
|
||||
try:
|
||||
sim.setup()
|
||||
@@ -127,4 +142,4 @@ def run_sim(sim_class: type) -> None:
|
||||
traceback.print_exc()
|
||||
sys.exit(1)
|
||||
finally:
|
||||
sim.teardown()
|
||||
sim.teardown()
|
||||
Reference in New Issue
Block a user