Compare commits

...

4 Commits

5 changed files with 81 additions and 32 deletions

View File

@@ -162,6 +162,26 @@ class ApiHookClient:
pass
return None
def get_text_value(self, item_tag):
"""Wraps get_value and returns its string representation, or None."""
val = self.get_value(item_tag)
return str(val) if val is not None else None
def get_node_status(self, node_tag):
"""Wraps get_value for a DAG node or queries the diagnostic endpoint for its status."""
val = self.get_value(node_tag)
if val is not None:
return val
try:
diag = self._make_request('GET', '/api/gui/diagnostics')
if 'nodes' in diag and node_tag in diag['nodes']:
return diag['nodes'][node_tag]
if node_tag in diag:
return diag[node_tag]
except Exception:
pass
return None
def click(self, item, *args, **kwargs):
"""Simulates a click on a GUI button or item."""
user_data = kwargs.pop('user_data', None)

View File

@@ -4,33 +4,7 @@ This file tracks all major tracks for the project. Each track has its own detail
---
- [x] **Track: Implement context visualization and memory management improvements**
*Link: [./tracks/context_management_20260223/](./tracks/context_management_20260223/)*
---
- [~] **Track: get gui_2 working with latest changes to the project.**
*Link: [./tracks/gui2_feature_parity_20260223/](./tracks/gui2_feature_parity_20260223/)*
---
- [~] **Track: MMA Dashboard Visualization Overhaul**
*Link: [./tracks/mma_dashboard_visualization_overhaul/](./tracks/mma_dashboard_visualization_overhaul/)*
---
- [x] **Track: 4-Tier Architecture Implementation & Conductor Self-Improvement**
*Link: [./tracks/mma_implementation_20260224/](./tracks/mma_implementation_20260224/)*
---
- [~] **Track: MMA Core Engine Implementation**
---
- [ ] **Track: Robust Live Simulation Verification**
*Link: [./tracks/robust_live_simulation_verification/](./tracks/robust_live_simulation_verification/)*
---

View File

@@ -1,8 +1,8 @@
# Implementation Plan: Robust Live Simulation Verification
## Phase 1: Framework Foundation
- [ ] Task: Create `tests/visual_sim_mma_v2.py` based on existing simulation patterns.
- [ ] Task: Implement helper methods in `ApiHookClient` for querying specific DearPyGui item states (e.g., `get_text_value`, `get_node_status`).
## Phase 1: Framework Foundation [checkpoint: e93e2ea]
- [x] Task: Create `tests/visual_sim_mma_v2.py` based on existing simulation patterns. 2a30e62
- [x] Task: Implement helper methods in `ApiHookClient` for querying specific DearPyGui item states (e.g., `get_text_value`, `get_node_status`). 2a30e62
## Phase 2: Epic & Track Verification
- [ ] Task: Write the simulation routine to trigger a new Epic and verify the Track Browser updates correctly.

View File

@@ -63,3 +63,38 @@ def test_unsupported_method_error():
client = ApiHookClient()
with pytest.raises(ValueError, match="Unsupported HTTP method"):
client._make_request('PUT', '/some_endpoint', data={'key': 'value'})
def test_get_text_value():
"""
Test retrieval of string representation using get_text_value.
"""
client = ApiHookClient()
with patch.object(client, 'get_value', return_value=123):
assert client.get_text_value("dummy_tag") == "123"
with patch.object(client, 'get_value', return_value=None):
assert client.get_text_value("dummy_tag") is None
def test_get_node_status():
"""
Test retrieval of DAG node status using get_node_status.
"""
client = ApiHookClient()
# When get_value returns a status directly
with patch.object(client, 'get_value', return_value="running"):
assert client.get_node_status("my_node") == "running"
# When get_value returns None and diagnostics provides a nodes dict
with patch.object(client, 'get_value', return_value=None):
with patch.object(client, '_make_request', return_value={'nodes': {'my_node': 'completed'}}):
assert client.get_node_status("my_node") == "completed"
# When get_value returns None and diagnostics provides a direct key
with patch.object(client, 'get_value', return_value=None):
with patch.object(client, '_make_request', return_value={'my_node': 'failed'}):
assert client.get_node_status("my_node") == "failed"
# When neither works
with patch.object(client, 'get_value', return_value=None):
with patch.object(client, '_make_request', return_value={}):
assert client.get_node_status("my_node") is None

View File

@@ -0,0 +1,20 @@
import pytest
import time
import sys
import os
# Ensure project root is in path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from api_hook_client import ApiHookClient
@pytest.mark.integration
def test_mma_epic_simulation(live_gui):
"""
Integration test for MMA epic simulation.
Red Phase: asserts False.
"""
client = ApiHookClient()
assert client.wait_for_server(timeout=10)
assert False, "Red Phase: Not yet implemented"