feat(story-1.4): transport protocol and Httpx2Transport adapter#4
Merged
lesnik512 merged 1 commit intoMay 14, 2026
Merged
Conversation
Adds the Transport protocol (Seam 1, middleware ↔ transport) and the
default Httpx2Transport implementation — the single seam where httpx2 is
imported. Adds a minimal StreamResponse placeholder so the protocol's
stream() signature can be typed today and fleshed out in Story 4.1.
- src/httpware/transports/__init__.py: @runtime_checkable Transport
Protocol with __call__ / stream / aclose
- src/httpware/transports/httpx2.py: Httpx2Transport adapter; lazy
AsyncClient init guarded by asyncio.Lock; httpx2.{TimeoutException,
HTTPError, InvalidURL, CookieConflict} and the closed-client
RuntimeError mapped to httpware.{TimeoutError, TransportError} with
the original message preserved on the mapped instance
- src/httpware/response.py: StreamResponse placeholder (status, headers,
url) re-exported from httpware/__init__.py
- tests/test_no_httpx2_leakage.py: CI invariant — only
transports/httpx2.py may import httpx2; cwd-robust pathing
- tests/test_transports_httpx2.py: 63 unit tests covering protocol
membership, success / 4xx / 5xx / exception-mapping / lazy-init /
concurrent-init / post-close paths
- docs/stories/1-4-...: story spec + Review Findings with 3-layer
adversarial review outcome
- docs/deferred-work.md: 5 review-time deferrals + extended
case-insensitive-headers entry to cover multi-value collapse
- CHANGELOG.md: Unreleased / Added entry
Full suite 140 passing, 100% coverage on every source module, lint
green (ruff + ty), httpx2 leakage invariant holds.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the Transport protocol (Seam 1, middleware ↔ transport) and the default Httpx2Transport implementation — the single seam where httpx2 is imported. Adds a minimal StreamResponse placeholder so the protocol's stream() signature can be typed today and fleshed out in Story 4.1.
Full suite 140 passing, 100% coverage on every source module, lint green (ruff + ty), httpx2 leakage invariant holds.