From 51918d9bc39fcb90e1ec3128088c4bce100ba7ec Mon Sep 17 00:00:00 2001 From: Ed_ Date: Thu, 26 Feb 2026 21:39:03 -0500 Subject: [PATCH] chore: Checkpoint commit of unstaged changes, including new tests and debug scripts --- .coverage | Bin 53248 -> 53248 bytes .../tracks/mma_core_engine_20260224/plan.md | 2 +- config.toml | 4 +- debug_ast.py | 18 ++++ debug_ast_2.py | 102 ++++++++++++++++++ inspect_ast.py | 29 +++++ project.toml | 3 + project_history.toml | 2 +- tests/temp_liveaisettingssim.toml | 3 + tests/temp_liveaisettingssim_history.toml | 3 +- tests/temp_livecontextsim_history.toml | 7 +- tests/temp_liveexecutionsim.toml | 3 + tests/temp_liveexecutionsim_history.toml | 3 +- tests/temp_livetoolssim.toml | 3 + tests/temp_livetoolssim_history.toml | 3 +- tests/temp_project.toml | 5 +- tests/temp_project_history.toml | 20 +--- tests/test_ast_parser_curated.py | 44 ++++++++ 18 files changed, 226 insertions(+), 28 deletions(-) create mode 100644 debug_ast.py create mode 100644 debug_ast_2.py create mode 100644 inspect_ast.py create mode 100644 tests/test_ast_parser_curated.py diff --git a/.coverage b/.coverage index 545e61ee6b6edfc7ac6afa0663cd7ec48e2b629f..c1ee9fa2c02112693f81c271d98b51c0756e5640 100644 GIT binary patch delta 611 zcmZ{gPe>GT6vyB1_j}5WZS%&0*i9FQ+>0J0`U4%uKr zsiE-8Skll8)vGe$NILNkLZ;NPd4jlOE{&rTL(2!+wHnsE_Yi_#q^I$UuV@FF{i&FT&^S2 z(Cu1(_ThR|vJD5o0C1x&Edo|HFK2+wvkre@z22KV{SPD9)Zy?6__+1{gr|iLS0}y5 zNzx)}io|KMnZ+&VBFB*=&@?YCy<+TL(Xz1B)y4&+ZJzG3aqP zZJuGNUmms)hLAR&e48)W0G-H=UKi$&%0lAhl1J{5J+jL#dxKV#Il9aF@;gU(T~=Be zbGJ-xNLLg(bHejThS)>GJz$*6 z9foyI5UU1ZVzbNd>;lMd^*aag;DAI>vCo}IGLfv$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ms_~6OztkCOpqyPc{_^07DweB;O1d=u?XhM0 zDk!Fwj#r2&7AO@rkLSL#@9TeV2%NDtv#FKPw76*e4(9ZSHL7XD)IWBuHC8}dZpr44 zcCG5^5emzpwsPU@p_HB%?qAnk@#CCV|EGJep{M@vwnq-{ox1;lBTRl7uq-W@J-Xwl zfA`cIJEvdX`In7HNyLR8&g`$L6^7c$ks16@^+xzx*V*xbe<{k@Vs4QC; z<3e1^+EW;){LkZzX#v#omyGW@>U7`!F)QX{+2S?MpF2;_?r5Gc2zk)3aMA3ugX=$g z{l5Fy^jxS{u$}$Cd;IK6j$a&}y~9=2s?+B{YijHGt;4!(D4AQs$1ADT7fg)qh0EVK<{kI=DtvZmquYV@Xm<}zu zmSZ{yBeTws2DR*l{jKcYrkli6s7Q7Dn-4o5sPUeix!Ih8rEB&NzqZ^v{+M_CDn>M8 zmWs_AkM4V{`3e=I=S679EZ;voK2@z1pezXgmTm%CA%ay0KiJKA3uN`LufSO7XSN4GTtZIPj_&TH%x3F^W2Bx9L^*zbgOk?H!<^y8U~b zUpTYFGIOZ?8)nPp9Q1Nms!@F=F!Es97C@q_%KTyX0>ESDQc-O*fu#bJrbBb8<_p(!x?f&4JTj?i!gm?0jrj!|&gYx0%i8V9h94b5OnRQ;ihTufi>Q7%M$y!iOrL!2*JE_1- zgf4!0ZD6?)lOV%*H_S;1+ckgioXq@?f~C}#5ST{o#|v8bVZvw8CyL~5>=_^#i? zqsA1nz`as+>^||v3E|+A+nq0+`ugkZZYn_N>(b-z9WMZO$}5Yp8-+wk5M+G^R=}VRXvd!f z$7BH#wxUS_0^A(M5(XSyZBkDjpLpYLl0ew4sJee0ORoQ|E+=- zi8k>|akV%lJ}>@W+$HvkzZLh3Ch;}#Tk#3;U&POajpB=WyP 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