//! Circuit Breaker Keys (Phase 7D) — failure tracking and circuit state.

use super::builders::global_key;

/// Circuit breaker key: `\x00CB:{agent_hex}`
///
/// Stores the circuit breaker record for an agent.
/// Tracks failure counts, state (Closed/Open/HalfOpen), and timestamps.
pub fn circuit_breaker_key(agent_hex: &str) -> Vec<u8> {
    global_key(b"CB:", agent_hex.as_bytes())
}

/// Circuit breaker scan prefix: `\x00CB:`
///
/// Scan all circuit breaker entries. Used to list tripped circuits.
pub fn circuit_breaker_scan_prefix() -> Vec<u8> {
    global_key(b"CB:", b"")
}
