From ac0b564c028742623fa2bee124945cebd67f9fb1 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Thu, 7 May 2026 07:54:39 -0400 Subject: [PATCH] fix(mma): Change self.engine to self.engines dict for concurrent track support - self.engine was a single ConductorEngine reference that got overwritten when multiple tracks ran concurrently, orphaning the first track's engine - Now uses self.engines: Dict[str, ConductorEngine] keyed by track.id - Updated _spawn_worker, kill_worker, pause_mma, resume_mma, approve_ticket, _load_active_tickets, and _update_ticket_depends_on to use engines.get(track_id) Fixes concurrent MMA track execution bug where only one worker ever appeared. --- .slop_cache/summary_cache.json | 8 + fix_engines.py | 12 + manualslop_layout.ini | 32 +- mock_debug_prompt.txt | 5477 -------------------------------- project.toml | 1 + project_history.toml | 2 +- src/app_controller.py | 39 +- 7 files changed, 60 insertions(+), 5511 deletions(-) create mode 100644 fix_engines.py delete mode 100644 mock_debug_prompt.txt diff --git a/.slop_cache/summary_cache.json b/.slop_cache/summary_cache.json index 9d6eb9b..4392413 100644 --- a/.slop_cache/summary_cache.json +++ b/.slop_cache/summary_cache.json @@ -98,5 +98,13 @@ "C:\\projects\\manual_slop\\conductor\\tracks\\data_oriented_optimization_20260312\\spec.md": { "hash": "8d64d4ed23a19cef973bb639dee2953492445f5598c08e7dd7c272183ad9848b", "summary": "This specification outlines a data-oriented optimization pass for Python code in `./src` and `./simulation`, aiming to minimize Python overhead by treating it as a procedural semantic definer. Key requirements include updating product guidelines, auditing and refactoring code, expanding profiling, and evaluating C extensions as a last resort, while maintaining test coverage and GUI responsiveness.\n\n**Outline:**\n**Markdown** \u2014 35 lines\nheadings:\n Specification: Data-Oriented Python Optimization Pass\n Overview\n Functional Requirements\n Non-Functional Requirements\n Acceptance Criteria\n Out of Scope" + }, + "C:\\Users\\Ed\\AppData\\Local\\Temp\\pytest-of-Ed\\pytest-849\\test_auto_aggregate_skip0\\file1.txt": { + "hash": "d0b425e00e15a0d36b9b361f02bab63563aed6cb4665083905386c55d5b679fa", + "summary": "This document contains a single line of text, \"content1\". Its purpose and key takeaways are not discernible from the provided content.\n\n**Outline:**\n**TXT** \u2014 1 lines\npreview:\n```\ncontent1\n```" + }, + "C:\\Users\\Ed\\AppData\\Local\\Temp\\pytest-of-Ed\\pytest-849\\test_force_full0\\other.txt": { + "hash": "04d61c0832f9cbc2a210334352425d2519890a0a5945da96ccc5bd9ff101c4d3", + "summary": "This document is a plain text file containing ten lines of content. The preview provided shows the first eight lines, indicating the file's straightforward, sequential nature.\n\n**Outline:**\n**TXT** \u2014 10 lines\npreview:\n```\nline1\nline2\nline3\nline4\nline5\nline6\nline7\nline8\n```" } } \ No newline at end of file diff --git a/fix_engines.py b/fix_engines.py new file mode 100644 index 0000000..84dc5b9 --- /dev/null +++ b/fix_engines.py @@ -0,0 +1,12 @@ +with open('src/app_controller.py', 'rb') as f: + content = f.read() + +# Fix _update_ticket_depends_on +old = b' if self.engine:\r\n from src.dag_engine import TrackDAG, ExecutionEngine\r\n self.engine.dag = TrackDAG(self.active_track.tickets)\r\n self.engine.engine = ExecutionEngine(self.engine.dag, auto_queue=self.engine.engine.auto_queue)' +new = b' engine = self.engines.get(self.active_track.id if self.active_track else None)\r\n if engine:\r\n from src.dag_engine import TrackDAG, ExecutionEngine\r\n engine.dag = TrackDAG(self.active_track.tickets)\r\n engine.engine = ExecutionEngine(engine.dag, auto_queue=engine.engine.auto_queue)' +content = content.replace(old, new) + +with open('src/app_controller.py', 'wb') as f: + f.write(content) + +print("Done") \ No newline at end of file diff --git a/manualslop_layout.ini b/manualslop_layout.ini index ed77b94..e7fff7a 100644 --- a/manualslop_layout.ini +++ b/manualslop_layout.ini @@ -102,26 +102,26 @@ Collapsed=0 DockId=0x0000000D,0 [Window][Discussion Hub] -Pos=87,24 -Size=1593,1176 +Pos=1168,24 +Size=1593,1564 Collapsed=0 DockId=0x00000006,0 [Window][Operations Hub] Pos=0,24 -Size=85,1176 +Size=1166,1564 Collapsed=0 DockId=0x00000005,2 [Window][Files & Media] -Pos=87,24 -Size=1593,1176 +Pos=1168,24 +Size=1593,1564 Collapsed=0 DockId=0x00000006,1 [Window][AI Settings] Pos=0,24 -Size=85,1176 +Size=1166,1564 Collapsed=0 DockId=0x00000005,0 @@ -131,14 +131,14 @@ Size=416,325 Collapsed=0 [Window][MMA Dashboard] -Pos=87,24 -Size=1593,1176 +Pos=1168,24 +Size=1593,1564 Collapsed=0 DockId=0x00000006,2 [Window][Log Management] -Pos=87,24 -Size=1593,1176 +Pos=1168,24 +Size=1593,1564 Collapsed=0 DockId=0x00000006,3 @@ -407,13 +407,13 @@ DockId=0x00000006,1 [Window][Project Settings] Pos=0,24 -Size=85,1176 +Size=1166,1564 Collapsed=0 DockId=0x00000005,1 [Window][Undo/Redo History] -Pos=1268,24 -Size=1593,1754 +Pos=1168,24 +Size=1593,1564 Collapsed=0 DockId=0x00000006,4 @@ -551,12 +551,12 @@ Column 2 Width=150 DockNode ID=0x00000008 Pos=3125,170 Size=593,1157 Split=Y DockNode ID=0x00000009 Parent=0x00000008 SizeRef=1029,147 Selected=0x0469CA7A DockNode ID=0x0000000A Parent=0x00000008 SizeRef=1029,145 Selected=0xDF822E02 -DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=0,24 Size=1680,1176 Split=X +DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=0,24 Size=2761,1564 Split=X DockNode ID=0x00000003 Parent=0xAFC85805 SizeRef=2175,1183 Split=X DockNode ID=0x0000000B Parent=0x00000003 SizeRef=404,1186 Split=X Selected=0xF4139CA2 DockNode ID=0x00000007 Parent=0x0000000B SizeRef=1512,858 Split=X Selected=0x8CA2375C - DockNode ID=0x00000005 Parent=0x00000007 SizeRef=1266,1681 CentralNode=1 Selected=0x418C7449 - DockNode ID=0x00000006 Parent=0x00000007 SizeRef=1593,1681 Selected=0x2C0206CE + DockNode ID=0x00000005 Parent=0x00000007 SizeRef=1266,1681 CentralNode=1 Selected=0x7BD57D6A + DockNode ID=0x00000006 Parent=0x00000007 SizeRef=1593,1681 Selected=0x6F2B5B04 DockNode ID=0x0000000E Parent=0x0000000B SizeRef=1777,858 Selected=0x418C7449 DockNode ID=0x0000000D Parent=0x00000003 SizeRef=435,1186 Selected=0x363E93D6 DockNode ID=0x00000004 Parent=0xAFC85805 SizeRef=1162,1183 Split=X Selected=0x3AEC3498 diff --git a/mock_debug_prompt.txt b/mock_debug_prompt.txt deleted file mode 100644 index c230b97..0000000 --- a/mock_debug_prompt.txt +++ /dev/null @@ -1,5477 +0,0 @@ ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -PATH: Epic Initialization — please produce tracks ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -Please generate the implementation tickets for this track. ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -Please read test.txt -You are assigned to Ticket T1. -Task Description: do something ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -role: tool -Here are the results: {"content": "done"} ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -PATH: Epic Initialization — please produce tracks ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -Please generate the implementation tickets for this track. ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -Please read test.txt -You are assigned to Ticket T1. -Task Description: do something ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -role: tool -Here are the results: {"content": "done"} ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -PATH: Epic Initialization — please produce tracks ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -Please generate the implementation tickets for this track. ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -Please read test.txt -You are assigned to Ticket T1. -Task Description: do something ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -role: tool -Here are the results: {"content": "done"} ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -PATH: Epic Initialization — please produce tracks ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -Please generate the implementation tickets for this track. ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -Please read test.txt -You are assigned to Ticket T1. -Task Description: do something ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -role: tool -Here are the results: {"content": "done"} ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -PATH: Epic Initialization — please produce tracks ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -Please generate the implementation tickets for this track. ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -Please read test.txt -You are assigned to Ticket T1. -Task Description: do something ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -role: tool -Here are the results: {"content": "done"} ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -PATH: Epic Initialization — please produce tracks ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -Please generate the implementation tickets for this track. ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -Please read test.txt -You are assigned to Ticket T1. -Task Description: do something ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -role: tool -Here are the results: {"content": "done"} ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -PATH: Epic Initialization — please produce tracks ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -Please generate the implementation tickets for this track. ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -Please read test.txt -You are assigned to Ticket T1. -Task Description: do something ------------------- ---- MOCK INVOKED --- -ARGS: ['tests/mock_gemini_cli.py'] -PROMPT: -role: tool -Here are the results: {"content": "done"} ------------------- ---- MOCK INVOKED --- -ARGS: ['C:\\projects\\manual_slop\\tests\\mock_gemini_cli.py', '-m', 'gemini-2.5-flash-lite', '--prompt', '', '--output-format', 'stream-json'] -PROMPT: -You are a helpful coding assistant with access to a PowerShell tool (run_powershell) and MCP tools (file access: read_file, list_directory, search_files, get_file_summary, web access: web_search, fetch_url). When calling file/directory tools, always use the 'path' parameter for the target path. When asked to create or edit files, prefer targeted edits over full rewrites. Always explain what you are doing before invoking the tool. - -When writing or rewriting large files (especially those containing quotes, backticks, or special characters), avoid python -c with inline strings. Instead: (1) write a .py helper script to disk using a PS here-string (@'...'@ for literal content), (2) run it with `python