feat: [Bezalel Epic-006] Sovereign Forge — Full Autonomy on a 2GB RAM VPS Without Cloud Inference (#168)
Refs #168 Agent: groq
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -58,3 +58,4 @@ mini-swe-agent/
|
||||
# Nix
|
||||
.direnv/
|
||||
result
|
||||
.aider*
|
||||
|
||||
@@ -1,20 +1,41 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Syntax guard — compile all Python files to catch syntax errors before merge."""
|
||||
import py_compile
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
# List of regex patterns for cloud inference APIs
|
||||
CLOUD_API_PATTERNS = [
|
||||
r'https?://(?:api\.)?(openai\.com|anthropic\.ai|anthropic\.com|openrouter\.ai|nous\.ai|kimi\.ai|groq\.com)',
|
||||
r'https?://(?:api\.)?gitea\.com', # if Gitea is cloud-hosted
|
||||
]
|
||||
|
||||
errors = []
|
||||
|
||||
for p in Path(".").rglob("*.py"):
|
||||
if ".venv" in p.parts or "__pycache__" in p.parts:
|
||||
continue
|
||||
|
||||
try:
|
||||
py_compile.compile(str(p), doraise=True)
|
||||
except py_compile.PyCompileError as e:
|
||||
errors.append(f"{p}: {e}")
|
||||
errors.append(f"SYNTAX ERROR: {p}: {e}")
|
||||
print(f"SYNTAX ERROR: {p}: {e}", file=sys.stderr)
|
||||
|
||||
# Read file content to check for cloud API calls
|
||||
try:
|
||||
content = p.read_text()
|
||||
for pattern in CLOUD_API_PATTERNS:
|
||||
if re.search(pattern, content, re.IGNORECASE):
|
||||
errors.append(f"CLOUD API CALL: {p}")
|
||||
print(f"CLOUD API CALL: {p} — matches pattern: {pattern}", file=sys.stderr)
|
||||
break
|
||||
except Exception as e:
|
||||
print(f"ERROR reading {p}: {e}", 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) found", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
print("All Python files compile successfully")
|
||||
|
||||
print("All Python files compile and are cloud API-free")
|
||||
|
||||
Reference in New Issue
Block a user