diff --git a/.coverage b/.coverage index 545e61e..c1ee9fa 100644 Binary files a/.coverage and b/.coverage differ diff --git a/conductor/tracks/mma_core_engine_20260224/plan.md b/conductor/tracks/mma_core_engine_20260224/plan.md index 4b1edc6..6fddcba 100644 --- a/conductor/tracks/mma_core_engine_20260224/plan.md +++ b/conductor/tracks/mma_core_engine_20260224/plan.md @@ -59,7 +59,7 @@ - [x] Verify that no regressions were introduced in existing functionality. ## Phase 7: MMA Observability & UX -- [ ] Task: MMA Dashboard Implementation +- [~] Task: MMA Dashboard Implementation - [ ] Create a new dockable panel in `gui_2.py` for "MMA Dashboard". - [ ] Display active `Track` and `Ticket` queue status. - [ ] Task: Execution Clutch UI diff --git a/config.toml b/config.toml index 7e4ed17..4891a42 100644 --- a/config.toml +++ b/config.toml @@ -1,6 +1,6 @@ [ai] -provider = "gemini_cli" -model = "gemini-3-flash-preview" +provider = "gemini" +model = "gemini-2.5-flash-lite" temperature = 0.0 max_tokens = 8192 history_trunc_limit = 8000 diff --git a/debug_ast.py b/debug_ast.py new file mode 100644 index 0000000..0eb7c0c --- /dev/null +++ b/debug_ast.py @@ -0,0 +1,18 @@ +import tree_sitter +import tree_sitter_python + +code = """def hot_func(): + # [HOT] + print(1)""" + +PY_LANGUAGE = tree_sitter.Language(tree_sitter_python.language()) +parser = tree_sitter.Parser(PY_LANGUAGE) +tree = parser.parse(bytes(code, "utf8")) + +def walk(node, indent=0): + content = code[node.start_byte:node.end_byte].strip() + print(f"{' ' * indent}{node.type} ({node.start_byte}-{node.end_byte}): {content[:20]}") + for child in node.children: + walk(child, indent + 1) + +walk(tree.root_node) diff --git a/debug_ast_2.py b/debug_ast_2.py new file mode 100644 index 0000000..3069cfb --- /dev/null +++ b/debug_ast_2.py @@ -0,0 +1,102 @@ +import tree_sitter +import tree_sitter_python + +class ASTParser: + def __init__(self, language: str): + self.language = tree_sitter.Language(tree_sitter_python.language()) + self.parser = tree_sitter.Parser(self.language) + + def parse(self, code: str) -> tree_sitter.Tree: + return self.parser.parse(bytes(code, "utf8")) + + def get_curated_view(self, code: str) -> str: + tree = self.parse(code) + edits = [] + + def is_docstring(node): + if node.type == "expression_statement" and node.child_count > 0: + if node.children[0].type == "string": + return True + return False + + def has_core_logic_decorator(node): + parent = node.parent + if parent and parent.type == "decorated_definition": + for child in parent.children: + if child.type == "decorator": + if "@core_logic" in code[child.start_byte:child.end_byte]: + return True + return False + + def has_hot_comment(func_node): + print(f"Checking {code[func_node.start_byte:func_node.start_byte+20].strip()}...") + stack = [func_node] + while stack: + curr = stack.pop() + if curr.type == "comment": + comment_text = code[curr.start_byte:curr.end_byte] + print(f" Found comment: {comment_text}") + if "[HOT]" in comment_text: + print(" [HOT] FOUND!") + return True + for child in curr.children: + stack.append(child) + return False + + def walk(node): + if node.type == "function_definition": + body = node.child_by_field_name("body") + if body and body.type == "block": + preserve = has_core_logic_decorator(node) or has_hot_comment(node) + print(f"Function {code[node.start_byte:node.start_byte+20].strip()}, preserve={preserve}") + + if not preserve: + indent = " " * body.start_point.column + first_stmt = None + for child in body.children: + if child.type != "comment": + first_stmt = child + break + + if first_stmt and is_docstring(first_stmt): + start_byte = first_stmt.end_byte + end_byte = body.end_byte + if end_byte > start_byte: + edits.append((start_byte, end_byte, "\\n" + indent + "...")) + else: + start_byte = body.start_byte + end_byte = body.end_byte + edits.append((start_byte, end_byte, "...")) + + for child in node.children: + walk(child) + + walk(tree.root_node) + edits.sort(key=lambda x: x[0], reverse=True) + code_bytes = bytearray(code, "utf8") + for start, end, replacement in edits: + code_bytes[start:end] = bytes(replacement, "utf8") + return code_bytes.decode("utf8") + +parser = ASTParser("python") +code = ''' +@core_logic +def core_func(): + """Core logic doc.""" + print("this should be preserved") + return True + +def hot_func(): + # [HOT] + print("this should also be preserved") + return 42 + +def normal_func(): + """Normal doc.""" + print("this should be stripped") + return None +''' + +result = parser.get_curated_view(code) +print("\\n--- RESULT ---\\n") +print(result) diff --git a/inspect_ast.py b/inspect_ast.py new file mode 100644 index 0000000..173f0a4 --- /dev/null +++ b/inspect_ast.py @@ -0,0 +1,29 @@ + +import tree_sitter +import tree_sitter_python + +language = tree_sitter.Language(tree_sitter_python.language()) +parser = tree_sitter.Parser(language) + +code = """ +@core_logic +def decorated_func(): + """Docstring.""" + print("core logic here") + +def hot_func(): + # [HOT] + print("hot logic here") + +def normal_func(): + print("normal logic here") +""" + +tree = parser.parse(bytes(code, "utf8")) + +def print_node(node, indent=0): + print(" " * indent + f"{node.type} [{node.start_byte}-{node.end_byte}] " + (f"'{code[node.start_byte:node.end_byte]}'" if node.type in ["decorator", "comment", "identifier"] else "")) + for child in node.children: + print_node(child, indent + 1) + +print_node(tree.root_node) diff --git a/project.toml b/project.toml index 1b71c32..2d9b669 100644 --- a/project.toml +++ b/project.toml @@ -18,6 +18,9 @@ paths = [] [gemini_cli] binary_path = "gemini" +[deepseek] +reasoning_effort = "medium" + [agent.tools] run_powershell = true read_file = true diff --git a/project_history.toml b/project_history.toml index 31147a2..c8e8311 100644 --- a/project_history.toml +++ b/project_history.toml @@ -8,5 +8,5 @@ active = "main" [discussions.main] git_commit = "" -last_updated = "2026-02-25T21:53:52" +last_updated = "2026-02-26T21:32:42" history = [] diff --git a/tests/temp_liveaisettingssim.toml b/tests/temp_liveaisettingssim.toml index e4e2bb8..a79cd08 100644 --- a/tests/temp_liveaisettingssim.toml +++ b/tests/temp_liveaisettingssim.toml @@ -22,6 +22,9 @@ paths = [] [gemini_cli] binary_path = "gemini" +[deepseek] +reasoning_effort = "medium" + [agent.tools] run_powershell = true read_file = true diff --git a/tests/temp_liveaisettingssim_history.toml b/tests/temp_liveaisettingssim_history.toml index 5095350..bf4a4d8 100644 --- a/tests/temp_liveaisettingssim_history.toml +++ b/tests/temp_liveaisettingssim_history.toml @@ -3,11 +3,12 @@ roles = [ "AI", "Vendor API", "System", + "Reasoning", ] active = "main" auto_add = true [discussions.main] git_commit = "" -last_updated = "2026-02-25T21:54:43" +last_updated = "2026-02-26T21:33:34" history = [] diff --git a/tests/temp_livecontextsim_history.toml b/tests/temp_livecontextsim_history.toml index 793d320..1a70e9e 100644 --- a/tests/temp_livecontextsim_history.toml +++ b/tests/temp_livecontextsim_history.toml @@ -3,12 +3,13 @@ roles = [ "AI", "Vendor API", "System", + "Reasoning", ] history = [] -active = "TestDisc_1772074463" +active = "TestDisc_1772159592" auto_add = true -[discussions.TestDisc_1772074463] +[discussions.TestDisc_1772159592] git_commit = "" -last_updated = "2026-02-25T21:54:37" +last_updated = "2026-02-26T21:33:27" history = [] diff --git a/tests/temp_liveexecutionsim.toml b/tests/temp_liveexecutionsim.toml index fbe6a23..7255da2 100644 --- a/tests/temp_liveexecutionsim.toml +++ b/tests/temp_liveexecutionsim.toml @@ -22,6 +22,9 @@ paths = [] [gemini_cli] binary_path = "gemini" +[deepseek] +reasoning_effort = "medium" + [agent.tools] run_powershell = true read_file = true diff --git a/tests/temp_liveexecutionsim_history.toml b/tests/temp_liveexecutionsim_history.toml index 4e5e701..e630ea5 100644 --- a/tests/temp_liveexecutionsim_history.toml +++ b/tests/temp_liveexecutionsim_history.toml @@ -3,11 +3,12 @@ roles = [ "AI", "Vendor API", "System", + "Reasoning", ] active = "main" auto_add = true [discussions.main] git_commit = "" -last_updated = "2026-02-25T21:55:13" +last_updated = "2026-02-26T21:34:05" history = [] diff --git a/tests/temp_livetoolssim.toml b/tests/temp_livetoolssim.toml index ddc6026..2b21302 100644 --- a/tests/temp_livetoolssim.toml +++ b/tests/temp_livetoolssim.toml @@ -22,6 +22,9 @@ paths = [] [gemini_cli] binary_path = "gemini" +[deepseek] +reasoning_effort = "medium" + [agent.tools] run_powershell = true read_file = true diff --git a/tests/temp_livetoolssim_history.toml b/tests/temp_livetoolssim_history.toml index ecf9177..4471b07 100644 --- a/tests/temp_livetoolssim_history.toml +++ b/tests/temp_livetoolssim_history.toml @@ -3,11 +3,12 @@ roles = [ "AI", "Vendor API", "System", + "Reasoning", ] active = "main" auto_add = true [discussions.main] git_commit = "" -last_updated = "2026-02-25T21:55:00" +last_updated = "2026-02-26T21:33:51" history = [] diff --git a/tests/temp_project.toml b/tests/temp_project.toml index ec9b612..53bd8d3 100644 --- a/tests/temp_project.toml +++ b/tests/temp_project.toml @@ -20,7 +20,10 @@ base_dir = "." paths = [] [gemini_cli] -binary_path = "\"C:\\projects\\manual_slop\\.venv\\Scripts\\python.exe\" \"C:\\projects\\manual_slop\\tests\\mock_gemini_cli.py\"" +binary_path = "gemini" + +[deepseek] +reasoning_effort = "medium" [agent.tools] run_powershell = true diff --git a/tests/temp_project_history.toml b/tests/temp_project_history.toml index afd2ada..2fff951 100644 --- a/tests/temp_project_history.toml +++ b/tests/temp_project_history.toml @@ -3,26 +3,12 @@ roles = [ "AI", "Vendor API", "System", + "Reasoning", ] -active = "testing gemini-cli" +active = "main" auto_add = true [discussions.main] git_commit = "" -last_updated = "2026-02-25T23:33:11" -history = [ - "@2026-02-25T22:34:11\nSystem:\n[PERFORMANCE ALERT] CPU usage high: 92.2%. Please consider optimizing recent changes or reducing load.", -] - -[discussions."testing deepseek"] -git_commit = "" -last_updated = "2026-02-26T12:38:38" -history = [ - "@2026-02-26T12:38:30\nUser:\nwasap deepseek?", - "@2026-02-26T12:38:34\nAI:\nHey there! 👋 I'm DeepSeek, an AI assistant created by DeepSeek Company. I'm here to help you with various tasks like coding, writing, analysis, problem-solving, and more!\n\nI can:\n- Write and debug code in multiple programming languages\n- Help with technical questions and explanations\n- Assist with writing and content creation\n- Analyze documents and data\n- Search the web for current information (when you enable it)\n- Work with files and directories\n\nWhat can I help you with today? Whether it's coding, learning something new, or just having a conversation, I'm ready to assist! 😊", -] - -[discussions."testing gemini-cli"] -git_commit = "" -last_updated = "2026-02-26T13:08:53" +last_updated = "2026-02-26T21:34:07" history = [] diff --git a/tests/test_ast_parser_curated.py b/tests/test_ast_parser_curated.py new file mode 100644 index 0000000..a0e4dac --- /dev/null +++ b/tests/test_ast_parser_curated.py @@ -0,0 +1,44 @@ +import pytest +from file_cache import ASTParser + +def test_ast_parser_get_curated_view(): + parser = ASTParser("python") + code = ''' +@core_logic +def core_func(): + """Core logic doc.""" + print("this should be preserved") + return True + +def hot_func(): + # [HOT] + print("this should also be preserved") + return 42 + +def normal_func(): + """Normal doc.""" + print("this should be stripped") + return None + +class MyClass: + @core_logic + def core_method(self): + print("method preserved") +''' + curated = parser.get_curated_view(code) + + # Check that core_func is preserved + assert 'print("this should be preserved")' in curated + assert 'return True' in curated + + # Check that hot_func is preserved + assert '# [HOT]' in curated + assert 'print("this should also be preserved")' in curated + + # Check that normal_func is stripped but docstring is preserved + assert '"""Normal doc."""' in curated + assert 'print("this should be stripped")' not in curated + assert '...' in curated + + # Check that core_method is preserved + assert 'print("method preserved")' in curated