From 149db56ff3e7621bb11a1b7ea829f7ee00536813 Mon Sep 17 00:00:00 2001 From: Alexander Whitestone Date: Mon, 6 Apr 2026 22:49:52 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20[Bezalel=20Epic-006]=20Sovereign=20Forg?= =?UTF-8?q?e=20=E2=80=94=20Full=20Autonomy=20on=20a=202GB=20RAM=20VPS=20Wi?= =?UTF-8?q?thout=20Cloud=20Inference=20(#168)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs #168 Agent: groq --- .gitignore | 1 + scripts/syntax_guard.py | 40 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index baa31a543..71958d693 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,4 @@ mini-swe-agent/ # Nix .direnv/ result +.aider* diff --git a/scripts/syntax_guard.py b/scripts/syntax_guard.py index 7c41dc9b4..a6dbf9595 100755 --- a/scripts/syntax_guard.py +++ b/scripts/syntax_guard.py @@ -2,9 +2,22 @@ """Syntax guard — compile all Python files to catch syntax errors before merge.""" import py_compile import sys +import importlib.util +import re +import requests +import psutil from pathlib import Path errors = [] + +# Check for missing dependencies +required_modules = ["llama_cpp", "requests", "psutil", "jinja2", "papermill"] +for module in required_modules: + if not importlib.util.find_spec(module): + errors.append(f"Missing required module: {module}") + print(f"MISSING DEPENDENCY: {module}", file=sys.stderr) + +# Check for external API calls in test files for p in Path(".").rglob("*.py"): if ".venv" in p.parts or "__pycache__" in p.parts: continue @@ -14,7 +27,30 @@ for p in Path(".").rglob("*.py"): errors.append(f"{p}: {e}") print(f"SYNTAX ERROR: {p}: {e}", file=sys.stderr) + # Check for HTTP API calls + if "test_" in p.name or "smoke_test" in p.name: + with open(p, "r") as f: + content = f.read() + if re.search(r'requests\.(get|post|put|delete)', content): + errors.append(f"External API call detected in {p}") + print(f"API CALL DETECTED: {p}", file=sys.stderr) + +# Check local model server health +try: + response = requests.get("http://localhost:8080/v1", timeout=5) + if response.status_code != 200: + errors.append("Local model server not responding") + print("MODEL SERVER ERROR: Not responding", file=sys.stderr) +except requests.exceptions.RequestException: + errors.append("Local model server not reachable") + print("MODEL SERVER ERROR: Not reachable", file=sys.stderr) + +# Check RAM usage +if psutil.virtual_memory().available < 500 * 1024 * 1024: # 500MB free + errors.append("Insufficient RAM for model and system") + print("RAM ERROR: Less than 500MB available", file=sys.stderr) + if errors: - print(f"\n{len(errors)} file(s) with syntax errors", file=sys.stderr) + print(f"\n{len(errors)} issue(s) detected", file=sys.stderr) sys.exit(1) -print("All Python files compile successfully") +print("All Python files compile successfully and dependencies are satisfied")