#!/bin/sh
# Pre-commit hook: test + clippy + fmt check
set -e

echo "Running tests..."
# Exclude:
# - genai: local fork, vendored
# - sgr-agent-ml: requires onnxruntime native lib (ort-sys), CI/dev environment varies
cargo test --workspace --quiet --exclude genai --exclude sgr-agent-ml

echo "Running clippy..."
cargo clippy -p sgr-agent-core -p sgr-agent -p sgr-agent-tui -p solograph --all-targets -- -D warnings

echo "Checking format..."
cargo fmt -p sgr-agent -p sgr-agent-tui -p rust-code -p solograph -- --check

echo "All checks passed."
