Expand description
OAuth usage fallback cascade.
Glues the slice modules (cache, credentials, fetcher, jsonl,
usage) into the full cascade from docs/specs/data-fetching.md
§OAuth fallback cascade. The orchestrator is a pure function keyed
on injected dependencies so every branch is exercised without real
I/O, network, or Keychain access.
The lock-active short-circuit runs before the credentials read so
a process observing another’s backoff window can answer from disk
(or the JSONL fallback) without paying the Keychain subprocess.
NoCredentials-vs-Timeout masking is preserved because
credentials are still resolved before any endpoint call that could
time out.
Structs§
- Usage
Cascade Config - Tunables threaded into
resolve_usage. Out-of-box defaults matchdocs/specs/data-fetching.md§OAuth usage cache stack.
Constants§
- DEFAULT_
API_ BASE_ URL - Default endpoint base URL per ADR-0011 §Endpoint contract.
- DEFAULT_
CACHE_ DURATION - Default cache freshness window per
docs/specs/data-fetching.md§OAuth usage cache stack. - DEFAULT_
ERROR_ TTL - Shorter TTL applied to error responses and lock-backoff windows
for non-429 failures, per
docs/specs/data-fetching.md§OAuth usage cache stack (“Error cache uses a shorter TTL (30s default)”). - DEFAULT_
RATE_ LIMIT_ BACKOFF - Fallback backoff when a
429arrives without a parseableRetry-After. MatchesDEFAULT_RATE_LIMIT_BACKOFFinfetcher.rs(300s per ADR-0011 §Cache stack).
Functions§
- resolve_
usage - Resolve OAuth usage data using the full fallback cascade.