1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! [`Fetcher`] port — authoritative substrate readout for sv-axis.
use async_trait;
/// Authoritative `sv:{sub}` source for the cache-miss path.
///
/// Promoted to the SDK in Phase 11.Z from chat-auth's private
/// `SessionVersionFetcher` trait (§3 Row 6 "replace, don't layer"). The
/// shape stays narrow: one async method returning the current `sv` for
/// a given `sub` (ULID-form `ppnum_id`), or a typed [`FetchError`] on
/// failure.
///
/// **Fail-closed contract.** Failure here surfaces as
/// [`super::EpochRevocationError::Transient`] from the composer, which
/// the engine maps to [`AuthError::SessionVersionLookupUnavailable`]
/// and the SDK maps to
/// [`crate::token::VerifyError::SessionVersionLookupUnavailable`].
/// Silently admitting on fetch failure would let stale tokens slip
/// through after a break-glass — the entire point of the sv axis.
///
/// ## Implementations
///
/// - chat-api `PgFetcher` — cross-schema SQL `SELECT session_version
/// FROM scaccounts.ppnum_humans WHERE ppnum_id = $1`. Kept consumer-
/// side because it depends on chat-api's `PgPool` and the cross-
/// schema search-path policy. Single-DB architecture only.
/// - RCW/CTW Fetcher — Slice 3/4 deferred decision per RFC_2026-05-08
/// §4.4 (cache-only fail-closed, PAS per-user readout endpoint, or
/// engine relax). 3rd-party-trust-boundary apps cannot use chat-api's
/// cross-schema pattern (separate DB clusters from PAS).
/// - 0.9.0 `UserinfoFetcher` — DELETED in 0.10.0 (RFC_2026-05-08 §4.3).
/// The API was misleading — PAS's userinfo authenticates the caller
/// only, not an arbitrary queried subject.
///
/// [`AuthError::SessionVersionLookupUnavailable`]: ppoppo_token::access_token::AuthError::SessionVersionLookupUnavailable
/// Opaque fetch failure. Carries a free-form detail for audit logs;
/// the composer collapses every variant onto
/// [`super::EpochRevocationError::Transient`] (fail-closed) so the
/// engine sees a uniform contract regardless of substrate flavor.
;