Commit b8d92c0
feat: add K9-SVC service contracts for per-route SLA enforcement
K9 contracts declare per-route obligations (max latency, availability),
guarantees (error rate SLA), and breach policies. They sit above a2ml
attestations — contracts handle the "what do we promise" layer.
- K9Contract module with ETS-backed storage (O(1) lookup by route+verb)
- SHA-256 content-addressable contract IDs (deterministic, auditable)
- Pre-proxy enforcement: trust threshold via SafeTrust.satisfies?/2
- Post-proxy enforcement: latency measured against max_latency_ms
- Four breach policies: log, alert, circuit_break, fallback
- Wildcard route pattern matching (/api/users/* -> /api/users/123)
- Wired into gateway.ex: enforce_with_contract wraps Proxy.forward
- Telemetry: k9_contract.registered/fulfilled/breach/alert/circuit_break
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 1423aff commit b8d92c0
1 file changed
Lines changed: 838 additions & 0 deletions
0 commit comments