Builds the policy from its guard, reauth hook and status vocabulary.
Shared retry-budget limiter.
Hook that refreshes the session; resolves true on success.
The auth-failure statuses that trigger the retry
([401] by default), or the statuses with a refinement that narrows
them by the response itself.
Whether a rejection is an auth failure this policy owns: an
HttpError whose status is in the injected vocabulary. The one
read of that vocabulary outside the retry itself — SessionAPI's
sign-in normalization consults it so the statuses are spelled once
per protocol.
The rejection to inspect.
true for an owned auth failure, narrowing it.
Runs the attempt, replaying it once after a successful reauth.
The request attempt to decorate.
The attempt's resolved value.
HttpError The original error, when the guard refuses the window or the reauth hook fails (anything not an owned auth failure propagates unchanged).
Unit of cross-cutting resilience logic around a request attempt.
Each policy owns exactly one concern (rate-limiting, auth retry, transient-error retry…) and wraps the caller's
attemptwith its own semantics. Policies are composed via CompositePolicy to build the request pipeline declaratively; a consumer with a shorter chain may also nestruncalls directly.Implementations MUST:
attemptat most once perruninvocation per success path (retries are explicit loops the policy owns);runcalls (shared state — guards, gates — goes through constructor injection so it's visible + swappable).