From 214ecb38a3dbb0443976c807fa2d7a45fd8aab43 Mon Sep 17 00:00:00 2001 From: Alexander Whitestone Date: Mon, 6 Apr 2026 23:03:46 -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 | 27 +++++++++++++++++++++++++-- 2 files changed, 26 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..75d7a5e31 100755 --- a/scripts/syntax_guard.py +++ b/scripts/syntax_guard.py @@ -14,7 +14,30 @@ for p in Path(".").rglob("*.py"): errors.append(f"{p}: {e}") print(f"SYNTAX ERROR: {p}: {e}", file=sys.stderr) + # Check for cloud API usage + with open(p, "r", encoding="utf-8") as f: + content = f.read() + if any(import_pattern.search(content) for import_pattern in CLOUD_API_IMPORTS): + errors.append(f"{p}: Cloud API import detected") + print(f"CLOUD API IMPORT: {p}", file=sys.stderr) + if any(call_pattern.search(content) for call_pattern in CLOUD_API_CALLS): + errors.append(f"{p}: Cloud API call detected") + print(f"CLOUD API CALL: {p}", file=sys.stderr) + +CLOUD_API_IMPORTS = [ + re.compile(r'\bimport\s+(requests|httpx|aiohttp|urllib\.request)\b'), + re.compile(r'\bfrom\s+(requests|httpx|aiohttp|urllib\.request)\b'), +] + +CLOUD_API_CALLS = [ + re.compile(r'\b(requests\.(get|post|put|delete|patch|head|options))\b'), + re.compile(r'\b(httpx\.(get|post|put|delete|patch|head|options))\b'), + re.compile(r'\b(aiohttp\.(ClientSession\.)?\b(get|post|put|delete|patch|head|options))\b'), + re.compile(r'\b(urllib\.request\.(urlopen|urlretrieve))\b'), + re.compile(r'\brequests\.Session\(\)\.(get|post|put|delete|patch|head|options)\b'), +] + if errors: - print(f"\n{len(errors)} file(s) with syntax errors", file=sys.stderr) + print(f"\n{len(errors)} file(s) with syntax or cloud API errors", file=sys.stderr) sys.exit(1) -print("All Python files compile successfully") +print("All Python files compile and are cloud API-free")