CodeVetter · Repo Unpack · Contributor handoff
encode/starlette
This brief is based on bounded source inspection at the requested commit; tests, benchmarks, and CI were inspected, not executed. Start edits from the ASGI contract and the relevant implementation/test pair, then follow cross-module state and message ownership. Preserve differences between standalone components, composed applications, and server-supported extensions. Existing repository scripts define future validation, but the current task authorizes read-only inspection only.
- Use tests and workflow definitions as intended checks, not passing evidence: this investigation executed neither tests nor CI. TestClient invokes the application in process and buffers output, so its assertions have a different boundary from deployed server validation.
- Read types.py, applications.py, routing.py, requests.py, responses.py, and exception handling before cross-cutting changes; preserve ASGI scope mutation, lazy stack construction, and the response-start barrier.
- Routing edits must retain first-full-match precedence, partial-match 405 handling, slash redirects, mount root_path semantics, and reverse URLs; synthetic routing benchmarks provide early/late/miss/wrong-method scenarios for later authorized measurement.
- For request/upload changes, review stream reuse, total limits versus spool thresholds, worker-thread rollover, and cleanup on stream or disk failure; prioritize tests/test_requests.py, tests/test_formparsers.py, and tests/middleware/test_body_limit.py in a later executable task.
- Middleware changes require both HTTP and non-HTTP scope review; BaseHTTPMiddleware has a documented-in-test context propagation limitation, while session persistence and file delivery require their own mutation/header and containment/range checks.
- Follow uv.lock and scripts/install's frozen synchronization; preserve strict mypy and Ruff's 120-character line policy, and test optional dependency/import behavior when changing integrations, including TestClient's httpx2 preference and deprecated httpx fallback.
- For later authorized verification, the direct targeted form is uv run coverage run -m pytest <test-file>; scripts/test additionally invokes scripts/check and the global 100% coverage report outside GitHub Actions. A targeted run alone may not satisfy that global threshold.
- Documentation headings require explanatory text before snippets; version authority is starlette/__init__.py and sync-version compares it with release notes. Contributing docs contain stale examples naming tests/test_application.py and __version__.py, so verify actual tracked paths before following examples or release instructions.