Skip to content

Commit 4246e21

Browse files
lesnik512claude
andcommitted
docs(deferred-work): append four items from retrospective review
Items D-1 through D-4 from docs/superpowers/specs/2026-05-31-shipped-work-review.md: unreachable PydanticDecoder TypeError fallback, module-global lru_cache, opaque extensions forwarding, and Response.json() exception/charset handling. None block Epic 2; each names the story under which it becomes actionable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dd225e1 commit 4246e21

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎docs/deferred-work.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
Items raised in reviews that are real but not actionable now.
44

5+
## Deferred from: retrospective review of stories 1-1 through 1-5 (2026-05-31)
6+
7+
- **`PydanticDecoder.decode` `TypeError` fallback is unreachable through normal usage** — the `except TypeError` branch only triggers when `_get_adapter(model)` raises during `lru_cache` lookup, which requires `model` to be unhashable; every concrete `type[T]` is hashable. Revisit when Story 1-6 (`msgspec` decoder) re-examines the `ResponseDecoder` protocol surface. (`src/httpware/decoders/pydantic.py:22-26`)
8+
- **`_get_adapter` `lru_cache` is module-global, not per-decoder instance** — keyed by `model` only; two `PydanticDecoder()` instances with different configurations (none today) would share adapters, and the cache survives across tests unless explicitly cleared. Revisit if/when a configurable `PydanticDecoder(mode=..., strict=...)` lands. (`src/httpware/decoders/pydantic.py:12-14`)
9+
- **`extensions=dict(request.extensions)` forwards opaque payloads to httpx2 verbatim** — `httpx2` interprets specific keys (e.g. `timeout`, `sni_hostname`); a typo or unknown key silently bypasses our timeout/limits config. Epic 2 (middleware) and Story 3-1 (per-request timeout) will own the extensions contract surface; introducing an allowlist now risks blocking legitimate forward-compat uses. (`src/httpware/transports/httpx2.py:121`)
10+
- **`Response.json()` raises raw and ignores charset** — `json.loads(self.content)` raises `json.JSONDecodeError` raw to callers and ignores any declared charset (`text` honors it); inconsistent with `_try_decode_json` in the transport which never raises. Revisit once `AsyncClient` lands (Story 1-7) and the call sites become observable. Partially overlaps with the existing story-1-2 charset entry, but the call-path inconsistency is the new angle. (`src/httpware/response.py:49-51`)
11+
512
## Deferred from: code review of story-1-5 (2026-05-14)
613

714
- **Empty/malformed payload tests** — `b""`, `b"null"`, `b"{}"`, invalid UTF-8: current pydantic-core behavior is correct but unpinned; a future pydantic upgrade could change error types undetected. (`tests/test_decoders_pydantic.py`)

0 commit comments

Comments
 (0)