chore(checkpoint): Phase 6 Test Suite Stabilization complete. 257/261 tests PASS. Resolved run_linear drift, formatter expectations, and Hook Server startup.

This commit is contained in:
2026-02-28 20:42:54 -05:00
parent 21496ee58f
commit 3b96b67d69
17 changed files with 106 additions and 75 deletions

View File

@@ -1,4 +1,4 @@
from __future__ import annotations from __future__ import annotations
import requests import requests
import json import json
import time import time
@@ -60,7 +60,7 @@ class ApiHookClient:
"""Checks the health of the hook server.""" """Checks the health of the hook server."""
url = f"{self.base_url}/status" url = f"{self.base_url}/status"
try: try:
response = requests.get(url, timeout=0.2) response = requests.get(url, timeout=5.0)
response.raise_for_status() response.raise_for_status()
return response.json() return response.json()
except Exception: except Exception:
@@ -242,3 +242,4 @@ class ApiHookClient:
data={'type': 'tool_approval', 'tool': tool_name, 'args': args}, data={'type': 'tool_approval', 'tool': tool_name, 'args': args},
timeout=60.0) timeout=60.0)
return res.get('response') return res.get('response')

View File

@@ -1,4 +1,4 @@
from __future__ import annotations from __future__ import annotations
import json import json
import threading import threading
import uuid import uuid
@@ -9,14 +9,12 @@ import session_logger
class HookServerInstance(ThreadingHTTPServer): class HookServerInstance(ThreadingHTTPServer):
"""Custom HTTPServer that carries a reference to the main App instance.""" """Custom HTTPServer that carries a reference to the main App instance."""
def __init__(self, server_address: tuple[str, int], RequestHandlerClass: type, app: Any) -> None:
def __init__(self, server_address: tuple[str, int], RequestHandlerClass: type, app: Any) -> None: super().__init__(server_address, RequestHandlerClass)
super().__init__(server_address, RequestHandlerClass) self.app = app
self.app = app
class HookHandler(BaseHTTPRequestHandler): class HookHandler(BaseHTTPRequestHandler):
"""Handles incoming HTTP requests for the API hooks.""" """Handles incoming HTTP requests for the API hooks."""
def do_GET(self) -> None: def do_GET(self) -> None:
app = self.server.app app = self.server.app
session_logger.log_api_hook("GET", self.path, "") session_logger.log_api_hook("GET", self.path, "")
@@ -84,7 +82,7 @@ class HookHandler(BaseHTTPRequestHandler):
"action": "custom_callback", "action": "custom_callback",
"callback": get_val "callback": get_val
}) })
if event.wait(timeout=2): if event.wait(timeout=60):
self.send_response(200) self.send_response(200)
self.send_header('Content-Type', 'application/json') self.send_header('Content-Type', 'application/json')
self.end_headers() self.end_headers()
@@ -110,7 +108,7 @@ class HookHandler(BaseHTTPRequestHandler):
"action": "custom_callback", "action": "custom_callback",
"callback": get_val "callback": get_val
}) })
if event.wait(timeout=2): if event.wait(timeout=60):
self.send_response(200) self.send_response(200)
self.send_header('Content-Type', 'application/json') self.send_header('Content-Type', 'application/json')
self.end_headers() self.end_headers()
@@ -137,7 +135,7 @@ class HookHandler(BaseHTTPRequestHandler):
"action": "custom_callback", "action": "custom_callback",
"callback": get_mma "callback": get_mma
}) })
if event.wait(timeout=2): if event.wait(timeout=60):
self.send_response(200) self.send_response(200)
self.send_header('Content-Type', 'application/json') self.send_header('Content-Type', 'application/json')
self.end_headers() self.end_headers()
@@ -164,7 +162,7 @@ class HookHandler(BaseHTTPRequestHandler):
"action": "custom_callback", "action": "custom_callback",
"callback": check_all "callback": check_all
}) })
if event.wait(timeout=2): if event.wait(timeout=60):
self.send_response(200) self.send_response(200)
self.send_header('Content-Type', 'application/json') self.send_header('Content-Type', 'application/json')
self.end_headers() self.end_headers()
@@ -318,3 +316,5 @@ class HookServer:
if self.thread: if self.thread:
self.thread.join() self.thread.join()
logging.info("Hook server stopped") logging.info("Hook server stopped")

View File

@@ -22,7 +22,7 @@ paths = [
"C:\\projects\\manual_slop\\tests\\temp_livetoolssim.toml", "C:\\projects\\manual_slop\\tests\\temp_livetoolssim.toml",
"C:\\projects\\manual_slop\\tests\\temp_liveexecutionsim.toml", "C:\\projects\\manual_slop\\tests\\temp_liveexecutionsim.toml",
] ]
active = "C:\\projects\\manual_slop\\tests\\temp_liveexecutionsim.toml" active = "C:\\projects\\manual_slop\\tests\\temp_project.toml"
[gui.show_windows] [gui.show_windows]
"Context Hub" = true "Context Hub" = true

1
hello.ps1 Normal file
View File

@@ -0,0 +1 @@
Write-Host "Simulation Test"

View File

@@ -79,7 +79,7 @@ DockId=0x0000000F,2
[Window][Theme] [Window][Theme]
Pos=0,17 Pos=0,17
Size=393,824 Size=632,824
Collapsed=0 Collapsed=0
DockId=0x00000005,1 DockId=0x00000005,1
@@ -89,14 +89,14 @@ Size=900,700
Collapsed=0 Collapsed=0
[Window][Diagnostics] [Window][Diagnostics]
Pos=395,17 Pos=634,17
Size=734,545 Size=911,643
Collapsed=0 Collapsed=0
DockId=0x00000010,0 DockId=0x00000010,0
[Window][Context Hub] [Window][Context Hub]
Pos=0,17 Pos=0,17
Size=393,824 Size=632,824
Collapsed=0 Collapsed=0
DockId=0x00000005,0 DockId=0x00000005,0
@@ -107,26 +107,26 @@ Collapsed=0
DockId=0x0000000D,0 DockId=0x0000000D,0
[Window][Discussion Hub] [Window][Discussion Hub]
Pos=1131,17 Pos=1547,17
Size=549,1183 Size=879,1395
Collapsed=0 Collapsed=0
DockId=0x00000004,0 DockId=0x00000004,0
[Window][Operations Hub] [Window][Operations Hub]
Pos=395,17 Pos=634,17
Size=734,545 Size=911,643
Collapsed=0 Collapsed=0
DockId=0x00000010,1 DockId=0x00000010,1
[Window][Files & Media] [Window][Files & Media]
Pos=0,843 Pos=0,843
Size=393,357 Size=632,569
Collapsed=0 Collapsed=0
DockId=0x00000006,1 DockId=0x00000006,1
[Window][AI Settings] [Window][AI Settings]
Pos=0,843 Pos=0,843
Size=393,357 Size=632,569
Collapsed=0 Collapsed=0
DockId=0x00000006,0 DockId=0x00000006,0
@@ -136,14 +136,14 @@ Size=416,325
Collapsed=0 Collapsed=0
[Window][MMA Dashboard] [Window][MMA Dashboard]
Pos=395,564 Pos=634,662
Size=734,636 Size=911,750
Collapsed=0 Collapsed=0
DockId=0x00000011,0 DockId=0x00000011,0
[Window][Log Management] [Window][Log Management]
Pos=1131,17 Pos=1547,17
Size=549,1183 Size=879,1395
Collapsed=0 Collapsed=0
DockId=0x00000004,1 DockId=0x00000004,1
@@ -163,24 +163,30 @@ Column 4 Weight=0.6084
Column 5 Weight=0.4425 Column 5 Weight=0.4425
Column 6 Weight=1.0079 Column 6 Weight=1.0079
[Table][0x5D780033,4]
Column 0 Weight=1.0000
Column 1 Weight=1.0000
Column 2 Weight=1.0000
Column 3 Weight=1.0000
[Docking][Data] [Docking][Data]
DockNode ID=0x00000008 Pos=3125,170 Size=593,1157 Split=Y DockNode ID=0x00000008 Pos=3125,170 Size=593,1157 Split=Y
DockNode ID=0x00000009 Parent=0x00000008 SizeRef=1029,147 Selected=0x0469CA7A DockNode ID=0x00000009 Parent=0x00000008 SizeRef=1029,147 Selected=0x0469CA7A
DockNode ID=0x0000000A Parent=0x00000008 SizeRef=1029,145 Selected=0xDF822E02 DockNode ID=0x0000000A Parent=0x00000008 SizeRef=1029,145 Selected=0xDF822E02
DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=0,17 Size=1680,1183 Split=Y DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=0,17 Size=2426,1395 Split=Y
DockNode ID=0x0000000C Parent=0xAFC85805 SizeRef=1362,1041 Split=X Selected=0x5D11106F DockNode ID=0x0000000C Parent=0xAFC85805 SizeRef=1362,1041 Split=X Selected=0x5D11106F
DockNode ID=0x00000003 Parent=0x0000000C SizeRef=1129,1183 Split=X DockNode ID=0x00000003 Parent=0x0000000C SizeRef=1545,1183 Split=X
DockNode ID=0x0000000B Parent=0x00000003 SizeRef=404,1186 Split=Y Selected=0xF4139CA2 DockNode ID=0x0000000B Parent=0x00000003 SizeRef=404,1186 Split=Y Selected=0xF4139CA2
DockNode ID=0x00000002 Parent=0x0000000B SizeRef=1029,1119 Split=X Selected=0xF4139CA2 DockNode ID=0x00000002 Parent=0x0000000B SizeRef=1029,1119 Split=X Selected=0xF4139CA2
DockNode ID=0x00000007 Parent=0x00000002 SizeRef=393,858 Split=Y Selected=0x8CA2375C DockNode ID=0x00000007 Parent=0x00000002 SizeRef=632,858 Split=Y Selected=0x8CA2375C
DockNode ID=0x00000005 Parent=0x00000007 SizeRef=295,824 Selected=0xF4139CA2 DockNode ID=0x00000005 Parent=0x00000007 SizeRef=295,824 Selected=0xF4139CA2
DockNode ID=0x00000006 Parent=0x00000007 SizeRef=295,724 CentralNode=1 Selected=0x7BD57D6A DockNode ID=0x00000006 Parent=0x00000007 SizeRef=295,724 CentralNode=1 Selected=0x7BD57D6A
DockNode ID=0x0000000E Parent=0x00000002 SizeRef=734,858 Split=Y Selected=0x418C7449 DockNode ID=0x0000000E Parent=0x00000002 SizeRef=911,858 Split=Y Selected=0x418C7449
DockNode ID=0x00000010 Parent=0x0000000E SizeRef=868,545 Selected=0xB4CBF21A DockNode ID=0x00000010 Parent=0x0000000E SizeRef=868,545 Selected=0x418C7449
DockNode ID=0x00000011 Parent=0x0000000E SizeRef=868,636 Selected=0x3AEC3498 DockNode ID=0x00000011 Parent=0x0000000E SizeRef=868,636 Selected=0x3AEC3498
DockNode ID=0x00000001 Parent=0x0000000B SizeRef=1029,775 Selected=0x8B4EBFA6 DockNode ID=0x00000001 Parent=0x0000000B SizeRef=1029,775 Selected=0x8B4EBFA6
DockNode ID=0x0000000D Parent=0x00000003 SizeRef=435,1186 Selected=0x363E93D6 DockNode ID=0x0000000D Parent=0x00000003 SizeRef=435,1186 Selected=0x363E93D6
DockNode ID=0x00000004 Parent=0x0000000C SizeRef=549,1183 Selected=0x6F2B5B04 DockNode ID=0x00000004 Parent=0x0000000C SizeRef=879,1183 Selected=0x6F2B5B04
DockNode ID=0x0000000F Parent=0xAFC85805 SizeRef=1362,451 Selected=0xDD6419BC DockNode ID=0x0000000F Parent=0xAFC85805 SizeRef=1362,451 Selected=0xDD6419BC
;;;<<<Layout_655921752_Default>>>;;; ;;;<<<Layout_655921752_Default>>>;;;

View File

@@ -8,5 +8,5 @@ active = "main"
[discussions.main] [discussions.main]
git_commit = "" git_commit = ""
last_updated = "2026-02-28T19:35:01" last_updated = "2026-02-28T20:41:51"
history = [] history = []

View File

@@ -124,7 +124,7 @@ def get_dependencies(filepath: str) -> list[str]:
print(f"Error getting dependencies for {filepath}: {e}") print(f"Error getting dependencies for {filepath}: {e}")
return [] return []
def execute_agent(role: str, prompt: str, docs: list[str]) -> str: def execute_agent(role: str, prompt: str, docs: list[str], debug: bool = False) -> str:
model = get_model_for_role(role) model = get_model_for_role(role)
# Advanced Context: Dependency skeletons for Tier 3 # Advanced Context: Dependency skeletons for Tier 3
injected_context = "" injected_context = ""
@@ -197,7 +197,20 @@ def execute_agent(role: str, prompt: str, docs: list[str]) -> str:
try: try:
env = os.environ.copy() env = os.environ.copy()
env["GEMINI_CLI_HOOK_CONTEXT"] = "mma_headless" env["GEMINI_CLI_HOOK_CONTEXT"] = "mma_headless"
if debug:
print(f"--- MMA DEBUG ---")
print(f"Executing Command: {cmd}")
print(f"Relevant Environment Variables:")
for key, value in env.items():
if key.startswith("GEMINI_CLI_"):
print(f" {key}={value}")
process = subprocess.run(cmd, input=command_text, capture_output=True, text=True, encoding='utf-8', env=env) process = subprocess.run(cmd, input=command_text, capture_output=True, text=True, encoding='utf-8', env=env)
if debug:
print(f"Subprocess Result:")
print(f" Return Code: {process.returncode}")
print(f" Stdout: {process.stdout[:1000]}...")
print(f" Stderr: {process.stderr}")
print(f"--- END DEBUG ---")
result = process.stdout result = process.stdout
if not process.stdout and process.stderr: if not process.stdout and process.stderr:
result = f"Error: {process.stderr}" result = f"Error: {process.stderr}"
@@ -231,6 +244,11 @@ def create_parser() -> argparse.ArgumentParser:
type=str, type=str,
help="TOML file defining the task" help="TOML file defining the task"
) )
parser.add_argument(
"--debug",
action="store_true",
help="Enable debug logging"
)
parser.add_argument( parser.add_argument(
"prompt", "prompt",
type=str, type=str,
@@ -244,6 +262,7 @@ def main() -> None:
args = parser.parse_args() args = parser.parse_args()
role = args.role role = args.role
prompt = args.prompt prompt = args.prompt
debug = args.debug
docs = [] docs = []
if args.task_file and os.path.exists(args.task_file): if args.task_file and os.path.exists(args.task_file):
with open(args.task_file, "rb") as f: with open(args.task_file, "rb") as f:
@@ -251,6 +270,8 @@ def main() -> None:
role = task_data.get("role", role) role = task_data.get("role", role)
prompt = task_data.get("prompt", prompt) prompt = task_data.get("prompt", prompt)
docs = task_data.get("docs", []) docs = task_data.get("docs", [])
# Only override debug if it's explicitly set in the task file (optional)
debug = task_data.get("debug", debug)
if not role or not prompt: if not role or not prompt:
parser.print_help() parser.print_help()
return return
@@ -262,8 +283,8 @@ def main() -> None:
for ref in file_refs: for ref in file_refs:
if os.path.exists(ref) and ref not in docs: if os.path.exists(ref) and ref not in docs:
docs.append(ref) docs.append(ref)
print(f"Executing role: {role} with docs: {docs}") print(f"Executing role: {role} with docs: {docs} (debug={debug})")
result = execute_agent(role, prompt, docs) result = execute_agent(role, prompt, docs, debug=debug)
print(result) print(result)
if __name__ == "__main__": if __name__ == "__main__":

View File

@@ -1,20 +1,21 @@
import sys, json, os, subprocess import sys, json, os, subprocess
prompt = sys.stdin.read() prompt = sys.stdin.read()
if '"role": "tool"' in prompt: if '"role": "tool"' in prompt:
print(json.dumps({"type": "message", "role": "assistant", "content": "Tool worked!"}), flush=True) print(json.dumps({"type": "message", "role": "assistant", "content": "Tool worked!"}), flush=True)
print(json.dumps({"type": "result", "stats": {"total_tokens": 20}}), flush=True) print(json.dumps({"type": "result", "stats": {"total_tokens": 20}}), flush=True)
else: else:
# We must call the bridge to trigger the GUI approval! # We must call the bridge to trigger the GUI approval!
tool_call = {"name": "list_directory", "input": {"dir_path": "."}} tool_call = {"name": "list_directory", "input": {"dir_path": "."}}
bridge_cmd = [sys.executable, "C:/projects/manual_slop/scripts/cli_tool_bridge.py"] bridge_cmd = [sys.executable, "C:/projects/manual_slop/scripts/cli_tool_bridge.py"]
proc = subprocess.Popen(bridge_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True) proc = subprocess.Popen(bridge_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True)
stdout, _ = proc.communicate(input=json.dumps(tool_call)) stdout, _ = proc.communicate(input=json.dumps(tool_call))
# Even if bridge says allow, we emit the tool_use to the adapter
print(json.dumps({"type": "message", "role": "assistant", "content": "I will list the directory."}), flush=True) # Even if bridge says allow, we emit the tool_use to the adapter
print(json.dumps({ print(json.dumps({"type": "message", "role": "assistant", "content": "I will list the directory."}), flush=True)
"type": "tool_use", print(json.dumps({
"name": "list_directory", "type": "tool_use",
"id": "alias_call", "name": "list_directory",
"args": {"dir_path": "."} "id": "alias_call",
}), flush=True) "args": {"dir_path": "."}
print(json.dumps({"type": "result", "stats": {"total_tokens": 10}}), flush=True) }), flush=True)
print(json.dumps({"type": "result", "stats": {"total_tokens": 10}}), flush=True)

View File

@@ -10,5 +10,5 @@ auto_add = true
[discussions.main] [discussions.main]
git_commit = "" git_commit = ""
last_updated = "2026-02-28T07:35:03" last_updated = "2026-02-28T20:39:12"
history = [] history = []

View File

@@ -6,10 +6,10 @@ roles = [
"Reasoning", "Reasoning",
] ]
history = [] history = []
active = "TestDisc_1772282083" active = "TestDisc_1772329132"
auto_add = true auto_add = true
[discussions.TestDisc_1772282083] [discussions.TestDisc_1772329132]
git_commit = "" git_commit = ""
last_updated = "2026-02-28T07:34:56" last_updated = "2026-02-28T20:39:05"
history = [] history = []

View File

@@ -10,5 +10,5 @@ auto_add = true
[discussions.main] [discussions.main]
git_commit = "" git_commit = ""
last_updated = "2026-02-28T19:35:01" last_updated = "2026-02-28T20:41:54"
history = [] history = []

View File

@@ -10,5 +10,5 @@ auto_add = true
[discussions.main] [discussions.main]
git_commit = "" git_commit = ""
last_updated = "2026-02-28T07:35:20" last_updated = "2026-02-28T20:39:30"
history = [] history = []

View File

@@ -15,6 +15,8 @@ output_dir = "./md_gen"
base_dir = "." base_dir = "."
paths = [] paths = []
[files.tier_assignments]
[screenshots] [screenshots]
base_dir = "." base_dir = "."
paths = [] paths = []

View File

@@ -5,18 +5,10 @@ roles = [
"System", "System",
"Reasoning", "Reasoning",
] ]
active = "AutoDisc" active = "main"
auto_add = true auto_add = true
[discussions.main] [discussions.main]
git_commit = "" git_commit = ""
last_updated = "2026-02-27T18:58:03" last_updated = "2026-02-28T20:41:57"
history = [
"@2026-02-27T18:57:55\nUser:\nHello! This is an automated test. Just say 'Acknowledged'.",
"@2026-02-27T18:58:02\nAI:\nAcknowledged",
]
[discussions.AutoDisc]
git_commit = ""
last_updated = "2026-02-28T07:34:41"
history = [] history = []

View File

@@ -1,4 +1,4 @@
import pytest import pytest
import time import time
import os import os
import sys import sys
@@ -86,7 +86,7 @@ else:
client.set_value("ai_input", "Test parameter aliases") client.set_value("ai_input", "Test parameter aliases")
client.click("btn_gen_send") client.click("btn_gen_send")
# Handle approval # Handle approval
timeout = 15 timeout = 60
start_time = time.time() start_time = time.time()
approved = False approved = False
while time.time() - start_time < timeout: while time.time() - start_time < timeout:
@@ -124,7 +124,7 @@ def test_gemini_cli_loop_termination(live_gui: Any) -> None:
client.set_value("ai_input", "Perform multi-round tool test") client.set_value("ai_input", "Perform multi-round tool test")
client.click("btn_gen_send") client.click("btn_gen_send")
# Handle approvals (mock does one tool call) # Handle approvals (mock does one tool call)
timeout = 20 timeout = 60
start_time = time.time() start_time = time.time()
approved = False approved = False
while time.time() - start_time < timeout: while time.time() - start_time < timeout:
@@ -148,3 +148,4 @@ def test_gemini_cli_loop_termination(live_gui: Any) -> None:
if found_final: break if found_final: break
time.sleep(1) time.sleep(1)
assert found_final, "Final message after multi-round tool loop not found" assert found_final, "Final message after multi-round tool loop not found"

View File

@@ -1,4 +1,4 @@
from typing import Any from typing import Any
import pytest import pytest
import time import time
import os import os
@@ -36,7 +36,7 @@ def test_gemini_cli_full_integration(live_gui: Any) -> None:
client.click("btn_gen_send") client.click("btn_gen_send")
# 3. Monitor for approval events # 3. Monitor for approval events
print("[TEST] Waiting for approval events...") print("[TEST] Waiting for approval events...")
timeout = 45 timeout = 90
start_time = time.time() start_time = time.time()
approved_count = 0 approved_count = 0
while time.time() - start_time < timeout: while time.time() - start_time < timeout:
@@ -89,7 +89,7 @@ def test_gemini_cli_rejection_and_history(live_gui: Any) -> None:
client.set_value("ai_input", "Deny me") client.set_value("ai_input", "Deny me")
client.click("btn_gen_send") client.click("btn_gen_send")
# 3. Wait for event and reject # 3. Wait for event and reject
timeout = 20 timeout = 60
start_time = time.time() start_time = time.time()
denied = False denied = False
while time.time() - start_time < timeout: while time.time() - start_time < timeout:
@@ -120,3 +120,4 @@ def test_gemini_cli_rejection_and_history(live_gui: Any) -> None:
if rejection_found: break if rejection_found: break
time.sleep(1.0) time.sleep(1.0)
assert rejection_found, "Rejection message not found in history" assert rejection_found, "Rejection message not found in history"

View File

@@ -0,0 +1,5 @@
import pytest
def test_vlogger_available(vlogger):
vlogger.log_state("Test", "Before", "After")
vlogger.finalize("Test Title", "PASS", "Test Result")