Builds the policy over a shared gate and diagnostic logger.
Shared rate-limit window tracker.
Sink for the 429 diagnostic line.
Refuses fast while the gate is paused, otherwise runs the attempt and records any 429 that comes back.
The request attempt to decorate.
The attempt's resolved value.
RateLimitError while the gate is paused.
Rate-limit circuit breaker. Two responsibilities:
Retry-Afterheader and surface a diagnostic log before re-raising. Subsequent callers see the paused state and refuse immediately (see point 1).Ownership: only 429 responses. Any other error (401, 5xx, network) propagates untouched so outer/inner policies can handle it.