Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix: resolve binary file and performance issues in security check

LearningCircuit9e3453892b27
diff --git a/.github/scripts/check-file-writes.sh b/.github/scripts/check-file-writes.sh
index 5b0787ecc5..01ae6869e8 100755
--- a/.github/scripts/check-file-writes.sh
+++ b/.github/scripts/check-file-writes.sh
@@ -49,8 +49,12 @@ EXCLUDE_DIRS=(
".venv"
"venv"
"migrations"
- "static/js/lib"
- "static/vendor"
+ "static"
+ "vendor"
+ "dist"
+ "build"
+ ".next"
+ "coverage"
)
# Files to exclude
@@ -64,6 +68,10 @@ EXCLUDE_FILES=(
"setup.py"
"webpack.config.js"
"**/migrations/*.py"
+ "*.min.js"
+ "*.bundle.js"
+ "*-min.js"
+ "*.min.css"
)
# Safe keywords that indicate encrypted or safe operations
@@ -94,24 +102,25 @@ echo "Scanning codebase for suspicious patterns..."
# Single pass to collect all matches
for pattern in "${SUSPICIOUS_PATTERNS[@]}"; do
- matches=$(grep -rn -- "$pattern" . $EXCLUDE_ARGS --include="*.py" --include="*.js" --include="*.ts" 2>/dev/null || true)
+ # Use grep with binary files excluded and max line length to avoid issues with minified files
+ matches=$(grep -rn -I -- "$pattern" . $EXCLUDE_ARGS --include="*.py" --include="*.js" --include="*.ts" 2>/dev/null | head -1000 || true)
if [ -n "$matches" ]; then
ALL_MATCHES="$ALL_MATCHES$matches\n"
fi
done
# Also check for specific problematic patterns in one pass
-temp_matches=$(grep -rn -E "get_report_as_temp_file|tmp_path|tempfile|/tmp/" . $EXCLUDE_ARGS --include="*.py" 2>/dev/null || true)
+temp_matches=$(grep -rn -I -E "get_report_as_temp_file|tmp_path|tempfile|/tmp/" . $EXCLUDE_ARGS --include="*.py" 2>/dev/null | head -500 || true)
if [ -n "$temp_matches" ]; then
ALL_MATCHES="$ALL_MATCHES$temp_matches\n"
fi
-db_matches=$(grep -rn -E "report_content.*open|report_content.*write|markdown_content.*open|markdown_content.*write" . $EXCLUDE_ARGS --include="*.py" 2>/dev/null || true)
+db_matches=$(grep -rn -I -E "report_content.*open|report_content.*write|markdown_content.*open|markdown_content.*write" . $EXCLUDE_ARGS --include="*.py" 2>/dev/null | head -500 || true)
if [ -n "$db_matches" ]; then
ALL_MATCHES="$ALL_MATCHES$db_matches\n"
fi
-export_matches=$(grep -rn -E "export.*Path|export.*path\.open|export.*\.write" . $EXCLUDE_ARGS --include="*.py" 2>/dev/null || true)
+export_matches=$(grep -rn -I -E "export.*Path|export.*path\.open|export.*\.write" . $EXCLUDE_ARGS --include="*.py" 2>/dev/null | head -500 || true)
if [ -n "$export_matches" ]; then
ALL_MATCHES="$ALL_MATCHES$export_matches\n"
fi
@@ -120,8 +129,8 @@ fi
if [ -n "$ALL_MATCHES" ]; then
echo "Filtering results for false positives..."
- # Remove duplicates and sort
- ALL_MATCHES=$(echo -e "$ALL_MATCHES" | sort -u)
+ # Remove duplicates and sort (use tr to handle potential null bytes)
+ ALL_MATCHES=$(echo -e "$ALL_MATCHES" | tr -d '\0' | sort -u)
filtered_matches=""
while IFS= read -r line; do