mirror of
https://github.com/hanzoai/zip.git
synced 2026-10-30 20:11:40 +00:00
middleware/breaker.go ships a stateless-by-design circuit breaker. Per process, not coordinated. Three states (Closed/Open/HalfOpen), the half- open state admits exactly one probe at a time. Default classifier treats handler errors and 5xx as failures; 4xx never trips the breaker. isolation_test.go proves two zip.App instances in the same process do not bleed routes/middleware. This is the structural invariant that makes horizontal scale safe — if any future change introduces a package- level map keyed by App, this test will catch it. docs/SCALE_AUDIT.md records the per-checklist verdict for the edge- scale-cleanup audit.