diff --git a/.forum/src/hooks/pre-commit b/.forum/src/hooks/pre-commit index 7294dc0..881e9c7 100755 --- a/.forum/src/hooks/pre-commit +++ b/.forum/src/hooks/pre-commit @@ -34,9 +34,10 @@ fi # Optional: SCIP / AST Extraction using tree-sitter if command -v tree-sitter &> /dev/null; then echo "-> Generating local AST structures..." - # Generate AST for TS/JS files if present, fallback gracefully if not parseable mkdir -p "$REPO_ROOT/.forum/ast" - find "$REPO_ROOT/src" -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" 2>/dev/null | xargs -I {} bash -c 'tree-sitter parse {} > "$REPO_ROOT/.forum/ast/$(basename {}).ast" 2>/dev/null || true' + find "$REPO_ROOT/src" \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) 2>/dev/null | while read -r file; do + tree-sitter parse "$file" > "$REPO_ROOT/.forum/ast/$(basename "$file").ast" 2>/dev/null || true + done echo " AST structures saved to .forum/ast/" fi diff --git a/.gitignore b/.gitignore index f774fac..94b2ed5 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,7 @@ cov_profile/ /index.scip /reports/ /.stryker-tmp/ + +# Agent Forum local runtime artifacts & caches +.forum/ast/ +.forum/security/