API Core - v1.5.0
    Preparing search index...

    Interface ResiliencePolicy

    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 attempt with its own semantics. Policies are composed via CompositePolicy to build the request pipeline declaratively; a consumer with a shorter chain may also nest run calls directly.

    Implementations MUST:

    • run the caller's attempt at most once per run invocation per success path (retries are explicit loops the policy owns);
    • propagate errors they don't own — a policy handles only the concern it was built for; anything else flows through untouched;
    • be stateless across run calls (shared state — guards, gates — goes through constructor injection so it's visible + swappable).
    interface ResiliencePolicy {
        run: <T>(attempt: () => Promise<T>) => Promise<T>;
    }

    Implemented by

    Index
    run: <T>(attempt: () => Promise<T>) => Promise<T>

    Runs the caller's attempt under this policy's semantics.