call_with_retry
A helper function in `resilience.py` that calls a service and retries connection errors, timeouts and 5xx replies, waiting longer after each failed attempt (exponential backoff). Replies below 500, such as a 409, are returned immediately.