[package]
name = "mockforge-chaos"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
description = "Chaos engineering features for MockForge - fault injection and resilience testing"
repository.workspace = true
homepage.workspace = true
documentation.workspace = true
readme.workspace = true
keywords.workspace = true
categories.workspace = true
# Previously internal, now published to crates.io

[dependencies]
# Async runtime
tokio = { workspace = true }
futures = { workspace = true }
async-trait = "0.1"

# Serialization
serde = { workspace = true }
serde_json = { workspace = true }
serde_yaml = "0.9"

# HTTP/web framework
axum = { workspace = true }
http = "1.0"
http-body-util = "0.1"

# Error handling
thiserror = { workspace = true }
anyhow = { workspace = true }

# Utilities
rand = { workspace = true }
chrono = { workspace = true }
tracing = { workspace = true }
uuid = { version = "1.23", features = ["v4", "serde"] }
once_cell = "1.21"
parking_lot = { workspace = true }

# Metrics (updated to 0.14+ to fix protobuf vulnerability RUSTSEC-2024-0437)
prometheus = { version = "0.14", features = ["process"] }

# IP / CIDR matching for per-request fault matchers
ipnet = "2"

# Cron scheduling
cron = "0.15"

# Rate limiting
governor = "0.8"
nonzero_ext = "0.3"

# HTTP client for health checks
reqwest = { version = "0.12", features = ["json"] }

# Cryptography
sha2 = "0.10"

# State persistence
bincode = "1.3"

# Distributed state (Redis)
redis = { version = "0.24", features = ["tokio-comp", "connection-manager"], optional = true }

# Tracing
mockforge-tracing = { version = "0.3.70", path = "../mockforge-tracing" }

# Recorder
mockforge-recorder = { version = "0.3.70", path = "../mockforge-recorder" }

# Core (for MockAI integration)
mockforge-core = { version = "0.3.70", path = "../mockforge-core" }
mockforge-openapi = { version = "0.3.173", path = "../mockforge-openapi" }
mockforge-foundation = { version = "0.3.173", path = "../mockforge-foundation" }
# PDF generation
printpdf = "0.7"

# WebSocket support
tokio-tungstenite = "0.28"

[features]
default = ["ml", "enterprise"]
# Machine learning components (reinforcement learning, multi-armed bandits,
# anomaly detection, parameter optimization, assertion generation)
ml = []
# Enterprise features (integrations, multi-cluster, multi-tenancy, GitOps,
# distributed coordination, chaos mesh, template marketplace, version control)
enterprise = []
distributed = ["redis"]

[dev-dependencies]
tokio = { version = "1.52", features = ["macros", "rt-multi-thread", "test-util"] }
tempfile = "3.27"
# Used by `resilience_middleware` tests to drive the layered axum router
# via `ServiceExt::oneshot` without spinning up a real listener.
tower = { version = "0.5", features = ["util"] }
