diff --git a/tests/mock_concurrent_mma.py b/tests/mock_concurrent_mma.py index e3ba0a08..79648936 100644 --- a/tests/mock_concurrent_mma.py +++ b/tests/mock_concurrent_mma.py @@ -46,6 +46,10 @@ def main() -> None: session_id = argv[i + 1] call_n = _next_call_count() + try: + with open(b"C:\\projects\\manual_slop_tier2\\tests\\artifacts\\tier2_state\\fix_mma_concurrent_tracks_sim_20260627\\mock_diag.log", "ab") as _df: + _df.write(f"[MOCK] call_n={call_n} session_id={session_id!r}\n".encode()) + except Exception: pass # 1. Sprint Planning (different tickets for different tracks) # Route on prompt content (the production passes the track_brief which @@ -63,11 +67,22 @@ def main() -> None: elif "Track C" in prompt: track_label = "C" else: track_label = "A" _emit_sprint_ticket(track_label) + try: + with open(b"C:\\projects\\manual_slop_tier2\\tests\\artifacts\\tier2_state\\fix_mma_concurrent_tracks_sim_20260627\\mock_diag.log", "ab") as _df: + _df.write(f"[MOCK] ROUTED TO: sprint track={track_label}\n".encode()) + except Exception: pass return # 2. Worker Execution # CHECK BEFORE epic so worker takes priority over the catch-all epic branch. - if 'You are assigned to Ticket' in prompt or session_id.startswith("mock-worker-"): + if 'You are assigned to Ticket' in prompt: + # NOTE: Removed session_id.startswith("mock-worker-") fallback. The session_id + # persists across tests in the same session (gemini_cli_adapter is a singleton). + # The fallback caused test_mma_concurrent_tracks_stress_sim to fail when it ran + # AFTER test_mma_concurrent_tracks_execution: the execution test set the session_id + # to mock-worker-ticket-A-1, and the stress test's epic call used --resume with that + # session_id, which the fallback incorrectly matched, returning a worker response + # instead of an epic response. import re match = re.search(r'Ticket (ticket-[A-Ba-b]-1)', prompt, re.IGNORECASE) if match: @@ -77,6 +92,10 @@ def main() -> None: else: tid = "unknown" + try: + with open(b"C:\\projects\\manual_slop_tier2\\tests\\artifacts\\tier2_state\\fix_mma_concurrent_tracks_sim_20260627\\mock_diag.log", "ab") as _df: + _df.write(f"[MOCK] ROUTED TO: worker tid={tid}\n".encode()) + except Exception: pass print(json.dumps({ "type": "message", "role": "assistant", @@ -113,9 +132,17 @@ def main() -> None: "stats": {"total_tokens": 100, "input_tokens": 50, "output_tokens": 50}, "session_id": "mock-epic" }), flush=True) + try: + with open(b"C:\\projects\\manual_slop_tier2\\tests\\artifacts\\tier2_state\\fix_mma_concurrent_tracks_sim_20260627\\mock_diag.log", "ab") as _df: + _df.write(b"[MOCK] ROUTED TO: epic_catchall\n") + except Exception: pass return # Default + try: + with open(b"C:\\projects\\manual_slop_tier2\\tests\\artifacts\\tier2_state\\fix_mma_concurrent_tracks_sim_20260627\\mock_diag.log", "ab") as _df: + _df.write(b"[MOCK] ROUTED TO: default\n") + except Exception: pass print(json.dumps({ "type": "message", "role": "assistant",