default:
    just --list

check:
    cargo check --all-features

test:
    cargo nextest run --all-features
    cargo test --doc --all-features

clip:
    cargo clippy --all-features -- -D warnings

fmt:
    cargo fmt

ci: fmt clip test
    cargo bench --no-run --all-features
    cargo check --no-default-features

pre-commit: fmt
    cargo clippy --all-features -- -D warnings
    cargo check --all-features

bench:
    cargo bench --all-features

# Coverage: like `mix test --cover` — pings back what's NOT covered.
cover:
    ./scripts/coverage-feedback

# Coverage with CI threshold gate (fails if below 70%)
cover-check:
    ./scripts/coverage-feedback --ci --threshold 70

# Raw coverage JSON for tooling
cover-json:
    ./scripts/coverage-feedback --json

# Benchmark with improvement report
bench-report:
    ./scripts/bench-report

# Save benchmark baseline for future comparison
bench-save:
    ./scripts/bench-report --save

# Compare benchmarks against saved baseline
bench-compare:
    ./scripts/bench-report --compare

# Fuzz testing (proptest-based, high iteration count)
fuzz:
    PROPTEST_CASES=10000 cargo test --test fuzz_targets --all-features --release -- --nocapture

# Deep fuzz (100K iterations per target)
fuzz-deep:
    PROPTEST_CASES=100000 cargo test --test fuzz_targets --all-features --release -- --nocapture

# Chaos testing
chaos:
    CHAOS_ITERATIONS=2000 cargo test --test chaos_testing --all-features --release -- --nocapture

# Extended chaos (5K iterations per chaos scenario)
chaos-deep:
    CHAOS_ITERATIONS=5000 cargo test --test chaos_testing --all-features --release -- --nocapture

# Full fuzz+chaos feedback loop (gates → extended load)
fuzz-chaos:
    cargo test --test fuzz_chaos_feedback --all-features --release -- --nocapture

# Everything: fuzz + chaos + feedback loop + benchmarks
stress: fuzz chaos fuzz-chaos bench

doc:
    cargo doc --all-features --no-deps --open

deps-doc:
    cargo doc --document-private-items --no-deps --open

lib-doc:
    cargo doc --all-features --open
