set shell := ["bash", "-eu", "-o", "pipefail", "-c"]

# Show available recipes
list:
  just --list

# Format all Rust code
fmt:
  cargo fmt --all

# Check formatting without writing
fmt-check:
  cargo fmt --all -- --check

# Lint all targets
lint:
  cargo clippy --workspace --all-targets -- -D warnings

# Type/build check (no tests)
check:
  cargo check --workspace --all-targets

# Run all tests
test:
  cargo test --workspace

# Run tests for a single crate (e.g. just test-crate agent-core)
test-crate crate:
  cargo test -p {{crate}}

# Run a single test by name (e.g. just test-one env_remove)
test-one name:
  cargo test --workspace -- {{name}}

# Full quality gate: format + lint + test
gate: fmt-check lint test

# Format + lint + test (auto-fixing format first)
fix-and-gate: fmt lint test

# Run live smoke tests (requires API keys in env)
test-live:
  APPS_LLM_RUN_LIVE=1 cargo test --workspace -- live
