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:
2026-05-09 14:32:44 -04:00
parent 696c08692e
commit 8c06c1767b
142 changed files with 2352 additions and 990 deletions
+13 -10
View File
@@ -16,9 +16,10 @@ from src.gui_2 import App
def test_telemetry_data_updates_correctly(app_instance: Any) -> None:
"""
Tests that the _refresh_api_metrics method correctly updates
the internal state for display by querying the ai_client.
Verifies the boundary between GUI state and API state.
Tests that the _refresh_api_metrics method correctly updates
the internal state for display by querying the ai_client.
Verifies the boundary between GUI state and API state.
"""
# 1. Set the provider to anthropic
app_instance._current_provider = "anthropic"
@@ -41,9 +42,10 @@ def test_telemetry_data_updates_correctly(app_instance: Any) -> None:
def test_performance_history_updates(app_instance: Any) -> None:
"""
Verify the data structure that feeds the sparkline.
This ensures that the rolling buffer for performance telemetry maintains
the correct size and default initialization to prevent GUI rendering crashes.
Verify the data structure that feeds the sparkline.
This ensures that the rolling buffer for performance telemetry maintains
the correct size and default initialization to prevent GUI rendering crashes.
"""
# ANTI-SIMPLIFICATION: Verifying exactly 100 elements ensures the sparkline won't overflow
assert len(app_instance.perf_history["frame_time"]) == 100
@@ -51,9 +53,10 @@ def test_performance_history_updates(app_instance: Any) -> None:
def test_gui_updates_on_event(app_instance: App) -> None:
"""
Verifies that when an API event is received (e.g. from ai_client),
the _on_api_event handler correctly updates internal metrics and
queues the update to be processed by the GUI event loop.
Verifies that when an API event is received (e.g. from ai_client),
the _on_api_event handler correctly updates internal metrics and
queues the update to be processed by the GUI event loop.
"""
mock_stats = {"percentage": 50.0, "current": 500, "limit": 1000}
app_instance.last_md = "mock_md"
@@ -75,4 +78,4 @@ def test_gui_updates_on_event(app_instance: App) -> None:
app_instance._process_pending_gui_tasks()
# ANTI-SIMPLIFICATION: This assertion proves that the event pipeline
# successfully transmitted state from the background thread to the GUI state.
assert app_instance._token_stats["percentage"] == 50.0
assert app_instance._token_stats["percentage"] == 50.0