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:
+22
-10
@@ -28,6 +28,9 @@ class VerificationLogger:
|
||||
self.logs_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
def log_state(self, field: str, before: Any, after: Any) -> None:
|
||||
"""
|
||||
[C: tests/test_ai_style_formatter.py:test_multiple_top_level_definitions, tests/test_conductor_engine_v2.py:test_conductor_engine_dynamic_parsing_and_execution, tests/test_conductor_engine_v2.py:test_conductor_engine_run_executes_tickets_in_order, tests/test_conductor_tech_lead.py:test_topological_sort_vlog, tests/test_headless_verification.py:test_headless_verification_error_and_qa_interceptor, tests/test_headless_verification.py:test_headless_verification_full_run, tests/test_tier4_interceptor.py:test_run_powershell_qa_callback_on_failure, tests/test_vlogger_availability.py:test_vlogger_available]
|
||||
"""
|
||||
delta = ""
|
||||
if isinstance(before, (int, float)) and isinstance(after, (int, float)):
|
||||
diff = after - before
|
||||
@@ -40,6 +43,9 @@ class VerificationLogger:
|
||||
})
|
||||
|
||||
def finalize(self, title: str, status: str, result_msg: str) -> None:
|
||||
"""
|
||||
[C: tests/test_ai_style_formatter.py:test_multiple_top_level_definitions, tests/test_conductor_engine_v2.py:test_conductor_engine_dynamic_parsing_and_execution, tests/test_conductor_engine_v2.py:test_conductor_engine_run_executes_tickets_in_order, tests/test_conductor_tech_lead.py:test_topological_sort_vlog, tests/test_headless_verification.py:test_headless_verification_error_and_qa_interceptor, tests/test_headless_verification.py:test_headless_verification_full_run, tests/test_tier4_interceptor.py:test_end_to_end_tier4_integration, tests/test_tier4_interceptor.py:test_run_powershell_qa_callback_on_failure, tests/test_tier4_interceptor.py:test_run_powershell_qa_callback_on_stderr_only, tests/test_vlogger_availability.py:test_vlogger_available]
|
||||
"""
|
||||
round(time.time() - self.start_time, 2)
|
||||
log_file = self.logs_dir / f"{self.script_name}.txt"
|
||||
with open(log_file, "w", encoding="utf-8") as f:
|
||||
@@ -57,7 +63,8 @@ class VerificationLogger:
|
||||
@pytest.fixture(autouse=True)
|
||||
def reset_paths() -> Generator[None, None, None]:
|
||||
"""
|
||||
Autouse fixture that resets the paths global state before each test.
|
||||
|
||||
Autouse fixture that resets the paths global state before each test.
|
||||
"""
|
||||
from src import paths
|
||||
paths.reset_resolved()
|
||||
@@ -67,8 +74,9 @@ def reset_paths() -> Generator[None, None, None]:
|
||||
@pytest.fixture(autouse=True)
|
||||
def reset_ai_client() -> Generator[None, None, None]:
|
||||
"""
|
||||
Autouse fixture that resets the ai_client global state before each test.
|
||||
This is critical for preventing state pollution between tests.
|
||||
|
||||
Autouse fixture that resets the ai_client global state before each test.
|
||||
This is critical for preventing state pollution between tests.
|
||||
"""
|
||||
from src import ai_client
|
||||
from src import mcp_client
|
||||
@@ -115,7 +123,8 @@ def kill_process_tree(pid: int | None) -> None:
|
||||
@pytest.fixture
|
||||
def mock_app() -> Generator[App, None, None]:
|
||||
"""
|
||||
Mock version of the App for simple unit tests that don't need a loop.
|
||||
|
||||
Mock version of the App for simple unit tests that don't need a loop.
|
||||
"""
|
||||
with (
|
||||
patch('src.models.load_config', return_value={
|
||||
@@ -146,8 +155,10 @@ def mock_app() -> Generator[App, None, None]:
|
||||
@pytest.fixture
|
||||
def app_instance() -> Generator[App, None, None]:
|
||||
"""
|
||||
Centralized App instance with all external side effects mocked.
|
||||
Matches the pattern used in test_token_viz.py and test_gui_phase4.py.
|
||||
|
||||
Centralized App instance with all external side effects mocked.
|
||||
Matches the pattern used in test_token_viz.py and test_gui_phase4.py.
|
||||
[C: tests/test_gui2_events.py:test_app_subscribes_to_events]
|
||||
"""
|
||||
with (
|
||||
patch('src.models.load_config', return_value={
|
||||
@@ -180,9 +191,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 sloppy.py with --enable-test-hooks.
|
||||
Includes high-signal environment telemetry and workspace isolation.
|
||||
"""
|
||||
|
||||
Session-scoped fixture that starts sloppy.py with --enable-test-hooks.
|
||||
Includes high-signal environment telemetry and workspace isolation.
|
||||
"""
|
||||
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")
|
||||
@@ -347,4 +359,4 @@ def live_gui() -> Generator[tuple[subprocess.Popen, str], None, None]:
|
||||
except PermissionError:
|
||||
time.sleep(0.5)
|
||||
except:
|
||||
break
|
||||
break
|
||||
Reference in New Issue
Block a user