feat(mma): Complete Phase 7 implementation: MMA Dashboard, HITL Step Modal, and Memory Mutator

This commit is contained in:
2026-02-26 21:48:41 -05:00
parent 63a82e0d15
commit 332fc4d774
5 changed files with 105 additions and 26 deletions

View File

@@ -5,7 +5,8 @@ from multi_agent_conductor import ConductorEngine
import ai_client
import json
def test_headless_verification_full_run():
@pytest.mark.asyncio
async def test_headless_verification_full_run():
"""
1. Initialize a ConductorEngine with a Track containing multiple dependent Tickets.
2. Simulate a full execution run using engine.run_linear().
@@ -15,7 +16,10 @@ def test_headless_verification_full_run():
t1 = Ticket(id="T1", description="Task 1", status="todo", assigned_to="worker1")
t2 = Ticket(id="T2", description="Task 2", status="todo", assigned_to="worker1", depends_on=["T1"])
track = Track(id="track_verify", description="Verification Track", tickets=[t1, t2])
engine = ConductorEngine(track=track)
from events import AsyncEventQueue
queue = AsyncEventQueue()
engine = ConductorEngine(track=track, event_queue=queue)
with patch("ai_client.send") as mock_send, \
patch("ai_client.reset_session") as mock_reset:
@@ -23,7 +27,7 @@ def test_headless_verification_full_run():
# We need mock_send to return something that doesn't contain "BLOCKED"
mock_send.return_value = "Task completed successfully."
engine.run_linear()
await engine.run_linear()
# Verify both tickets are completed
assert t1.status == "completed"
@@ -33,17 +37,20 @@ def test_headless_verification_full_run():
assert mock_send.call_count == 2
# Verify Context Amnesia: reset_session should be called for each ticket
# This confirms that each worker call starts with a clean slate.
assert mock_reset.call_count == 2
def test_headless_verification_error_and_qa_interceptor():
@pytest.mark.asyncio
async def test_headless_verification_error_and_qa_interceptor():
"""
5. Simulate a shell error and verify that the Tier 4 QA interceptor is triggered
and its summary is injected into the worker's history for the next retry.
"""
t1 = Ticket(id="T1", description="Task with error", status="todo", assigned_to="worker1")
track = Track(id="track_error", description="Error Track", tickets=[t1])
engine = ConductorEngine(track=track)
from events import AsyncEventQueue
queue = AsyncEventQueue()
engine = ConductorEngine(track=track, event_queue=queue)
# We need to simulate the tool loop inside ai_client._send_gemini (or similar)
# Since we want to test the real tool loop and QA injection, we mock at the provider level.
@@ -108,7 +115,7 @@ QA ANALYSIS:
mock_run.side_effect = run_side_effect
mock_qa.return_value = "FIX: Check if path exists."
engine.run_linear()
await engine.run_linear()
# Verify QA analysis was triggered
mock_qa.assert_called_once_with("Error: file not found")