chore(mma): Checkpoint progress on visual simulation and UI refresh before sub-agent delegation

This commit is contained in:
2026-02-28 21:41:46 -05:00
parent d65fa79e26
commit ed56e56a2c
11 changed files with 146 additions and 73 deletions

View File

@@ -37,6 +37,6 @@ web_search = true
fetch_url = true
[mma]
epic = "Build a simple calculator"
epic = "Develop a new feature"
active_track_id = ""
tracks = []

View File

@@ -10,5 +10,5 @@ auto_add = true
[discussions.main]
git_commit = ""
last_updated = "2026-02-28T21:00:47"
last_updated = "2026-02-28T21:27:02"
history = []

View File

@@ -9,45 +9,71 @@ 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) -> None:
def test_mma_complete_lifecycle(live_gui) -> None:
"""
Integration test for MMA epic simulation.
Red Phase: asserts False.
Tests the entire MMA lifecycle from epic planning to track loading and ticket verification
in a single test case to avoid state dependency issues between separate test functions.
"""
client = ApiHookClient()
assert client.wait_for_server(timeout=10)
# Try selecting MMA Dashboard tab if applicable (using typical naming convention)
try:
client.select_tab('main_tab_bar', 'tab_mma')
except Exception:
pass
# Set model to mock to avoid real API calls and timeouts
# 1. Set model to 'mock'.
try:
client.set_value('current_model', 'mock')
except Exception:
pass
client.set_value('mma_epic_input', 'Build a simple calculator')
except Exception as e:
pytest.fail(f"Failed to set model to 'mock': {e}")
# 2. Enter epic and click 'Plan Epic'.
client.set_value('mma_epic_input', 'Develop a new feature')
client.click('btn_mma_plan_epic')
# 1. Poll for Proposed Tracks
proposed_success = False
for i in range(30):
# 3. Wait for 'proposed_tracks'.
proposed_tracks_found = False
for _ in range(60): # Poll for up to 60 seconds
status = client.get_mma_status()
print(f"Polling status: {status}")
# Assuming 'ai_status' might be a key within the status dictionary. If not, this needs adjustment.
print(f"Polling ai_status: {status.get('ai_status', 'N/A')}")
if status and status.get('proposed_tracks') and len(status['proposed_tracks']) > 0:
proposed_success = True
proposed_tracks_found = True
break
time.sleep(1)
assert proposed_success, "Failed to generate proposed tracks."
assert proposed_tracks_found, "Failed to find proposed tracks after planning epic."
# 2. Accept Proposed Tracks
# 4. Click 'Accept' to start tracks.
client.click('btn_mma_accept_tracks')
# 3. Poll for Final Tracks
tracks_success = False
for i in range(30):
# 5. Wait for 'tracks' list to populate.
tracks_populated = False
for _ in range(30): # Poll for up to 30 seconds
status = client.get_mma_status()
if status and status.get('tracks') and len(status['tracks']) > 0:
tracks_success = True
tracks_populated = True
break
time.sleep(1)
assert tracks_success, "Failed to generate at least one track."
assert tracks_populated, "Failed to populate tracks list after accepting proposed tracks."
# 6. Verify that one of the new tracks can be loaded and its tickets appear in 'active_tickets'.
status_after_tracks = client.get_mma_status()
assert status_after_tracks is not None, "Failed to get MMA status after tracks populated."
tracks_list = status_after_tracks.get('tracks')
assert tracks_list is not None and len(tracks_list) > 0, "Tracks list is empty or not found."
track_id_to_load = tracks_list[0]['id']
print(f"Attempting to load track with ID: {track_id_to_load}")
# Load the first track
client.click('btn_mma_load_track', user_data=track_id_to_load)
# Poll until 'active_track' is not None and 'active_tickets' are present
active_track_and_tickets_found = False
for _ in range(60): # Poll for up to 60 seconds
status = client.get_mma_status()
if status and status.get('active_track') == track_id_to_load and \
'active_tickets' in status and len(status['active_tickets']) > 0:
active_track_and_tickets_found = True
break
time.sleep(1)
assert active_track_and_tickets_found, f"Timed out waiting for track {track_id_to_load} to load and populate active tickets."
print(f"Successfully loaded and verified track ID: {track_id_to_load} with active tickets.")