import Foundation

/// Thin HTTP I/O boundary (frozen contract, plan §3.1). `APIClient` builds
/// `URLRequest`s (Origin stamped iff the endpoint is a mutating `G` route,
/// plan §3.4 铁律) and sends them through this seam; the production
/// implementation wraps `URLSession`, `FakeHTTPTransport` (TestSupport)
/// queues canned responses.
public protocol HTTPTransport: Sendable {
    /// Perform one HTTP exchange. Implementations throw on transport-level
    /// failure; non-2xx statuses are returned, not thrown — classification
    /// (e.g. `PairingError`) is the caller's job.
    func send(_ request: URLRequest) async throws -> (Data, HTTPURLResponse)
}
