From 9331c0dcbb1443e1f8e86d83f314a0dc41c618a3 Mon Sep 17 00:00:00 2001 From: Alexander Whitestone Date: Mon, 6 Apr 2026 22:46:15 -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 --- .githooks/pre-commit.py | 19 +++++++++++++++++++ .gitignore | 1 + 2 files changed, 20 insertions(+) diff --git a/.githooks/pre-commit.py b/.githooks/pre-commit.py index a48ade0af..ac5745e1f 100755 --- a/.githooks/pre-commit.py +++ b/.githooks/pre-commit.py @@ -288,6 +288,25 @@ def main() -> int: # Scan both full staged file contents and the diff content findings = scan_files(staged_files, get_file_content_at_staged) + # Scan for cloud API usage patterns in staged files + CLOUD_API_PATTERNS = [ + r"openai\.", + r"anthropic\.", + r"groq\.", + r"requests\.", + r"httpx\.", + r"aiosonic\.", + r"asyncio\.to_thread\(|asyncio\.create_task\(", + r"async def .*:\s*await", + ] + for filepath in staged_files: + content = get_file_content_at_staged(filepath) + if is_binary_content(content): + continue + for pattern in CLOUD_API_PATTERNS: + if re.search(pattern, content.decode("utf-8", errors="ignore")): + findings.append(Finding(filepath, -1, f"Cloud API usage detected: {pattern}")) + diff_text = get_staged_diff() if diff_text: for line_no, line in enumerate(diff_text.splitlines(), start=1): 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*