mesh-circuit-breaker

mesh-circuit-breaker — Failure isolation for Mesh Protocol services

Reliability & Ops

Usage

mesh circuit  [args]

Commands

status, trip, reset, check, list, history, config

Commons Entry


# mesh-circuit-breaker

**Category:** resilience
**Layer:** L4-infrastructure
**Tool:** tools/mesh-circuit-breaker/circuit.sh
**CLI:** `mesh circuit|cb`
**Status:** active

## Summary
Failure isolation for Mesh Protocol services. Tracks failures per service, trips open after threshold, auto-recovers via half-open state. Prevents cascading failures across mesh.

## Commands
- `status [service]` — Show circuit state
- `check <service>` — Check availability (exit 0=ok, 1=open)
- `fail <service> [reason]` — Record failure
- `success <service>` — Record success
- `trip <service> [reason]` — Manual trip
- `reset <service>` — Reset to closed
- `list` — List circuits
- `history [service] [n]` — Event log
- `config [key] [val]` — Get/set thresholds

## State Machine
closed → open (after N failures) → half-open (after cooldown) → closed (after M successes)

## Integration
Uses ledger-write.sh for standardized event logging. Pairs with mesh-rate-limiter and mesh-sla for full resilience stack.