Compare commits

..

2 Commits

4 changed files with 27 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ Architecture reference: [docs/guide_architecture.md](../../../docs/guide_archite
Focus: Stop `mma_exec.py` from injecting massive full-text dependencies and remove hardcoded external paths.
- [x] Task 1.1: In `scripts/mma_exec.py`, completely remove the `UNFETTERED_MODULES` constant and its associated `if dep in UNFETTERED_MODULES:` check. Ensure all imported local dependencies strictly use `generate_skeleton()`. 6875459
- [~] Task 1.2: In `scripts/mma_exec.py` and `scripts/claude_mma_exec.py`, remove the hardcoded reference to `C:\projects\misc\setup_*.ps1`. Rely on the active environment's PATH to resolve `gemini` and `claude`, or provide an `.env` configurable override.
- [x] Task 1.2: In `scripts/mma_exec.py` and `scripts/claude_mma_exec.py`, remove the hardcoded reference to `C:\projects\misc\setup_*.ps1`. Rely on the active environment's PATH to resolve `gemini` and `claude`, or provide an `.env` configurable override. b30f040
## Phase 2: Complete MCP Tool Integration & Seal HITL Bypass (Application Core)
Focus: Expose all native MCP tools in the config and GUI, and ensure mutating tools trigger user approval.

View File

@@ -188,11 +188,7 @@ def execute_agent(role: str, prompt: str, docs: list[str], timeout: int | None =
print(f"Error inlining {doc}: {e}")
command_text += f"\n\nTASK: {prompt}\n\n"
# Spawn claude CLI non-interactively via PowerShell
ps_command = (
"if (Test-Path 'C:\\projects\\misc\\setup_claude.ps1') "
"{ . 'C:\\projects\\misc\\setup_claude.ps1' }; "
f"claude --model {model} --print --dangerously-skip-permissions"
)
ps_command = f"claude --model {model} --print --dangerously-skip-permissions"
cmd = ['powershell.exe', '-NoProfile', '-Command', ps_command]
try:
env = os.environ.copy()

View File

@@ -194,10 +194,7 @@ def execute_agent(role: str, prompt: str, docs: list[str], debug: bool = False,
command_text += f"\n\nTASK: {prompt}\n\n"
# Use subprocess with input to pipe the prompt via stdin, avoiding WinError 206.
# We use -p 'mma_task' to ensure non-interactive (headless) mode and valid parsing.
ps_command = (
f"if (Test-Path 'C:\\projects\\misc\\setup_gemini.ps1') {{ . 'C:\\projects\\misc\\setup_gemini.ps1' }}; "
f"gemini -p '{role}' --output-format json --model {model}"
)
ps_command = f"gemini -p '{role}' --output-format json --model {model}"
cmd = ['powershell.exe', '-NoProfile', '-Command', ps_command]
try:
env = os.environ.copy()

View File

@@ -67,5 +67,29 @@ class TestArchBoundaryPhase1(unittest.TestCase):
captured_input = mock_run.call_args[1].get('input', '')
self.assertIn('DEPENDENCY SKELETON: mcp_client.py', captured_input)
def test_mma_exec_no_hardcoded_path(self):
"""TEST 4: mma_exec.execute_agent must not contain hardcoded machine paths."""
import importlib as il
import sys as _sys
scripts_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'scripts'))
if scripts_path not in _sys.path:
_sys.path.insert(0, scripts_path)
import mma_exec as _mma
il.reload(_mma)
source = inspect.getsource(_mma.execute_agent)
self.assertNotIn('C:\\projects\\misc', source, "Hardcoded machine path must be removed from mma_exec.execute_agent")
def test_claude_mma_exec_no_hardcoded_path(self):
"""TEST 5: claude_mma_exec.execute_agent must not contain hardcoded machine paths."""
import importlib as il
import sys as _sys
scripts_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'scripts'))
if scripts_path not in _sys.path:
_sys.path.insert(0, scripts_path)
import claude_mma_exec as _cmma
il.reload(_cmma)
source = inspect.getsource(_cmma.execute_agent)
self.assertNotIn('C:\\projects\\misc', source, "Hardcoded machine path must be removed from claude_mma_exec.execute_agent")
if __name__ == '__main__':
unittest.main()