fix: target standard CPython 3.14 (mitmproxy incompatible with 3.14t)

mitmproxy's aioquic/mitmproxy-rs deps have no free-threaded wheels and
source builds fail. Workload is I/O-bound so free-threading gave no
benefit. Switch .python-version to 3.14, drop /tmp stub overrides,
reinstall mitmproxy with real wheels (imports cleanly). Update README
and design spec to record the decision.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 23:50:26 +08:00
parent c6173b0ceb
commit 422990bc4e
5 changed files with 132 additions and 41 deletions
+23 -23
View File
@@ -1,33 +1,33 @@
# auto-reverse
Automated API reverse-engineering CLI tool built on Python 3.14 (free-threaded).
Conversational CLI that reverse-engineers a website's API: an LLM drives a headed
browser while an embedded mitmproxy captures real traffic and documents it into a
live OpenAPI spec + markdown.
## Dependency Fallback Notes
## Runtime
### mitmproxy on free-threaded Python 3.14
Built on **standard CPython 3.14** (managed via `uv`).
`mitmproxy` depends on `aioquic` (for HTTP/3 + QUIC support) and `mitmproxy-rs` (for WireGuard/process-mode features). Both packages ship only as `abi3` wheels that use CPython's Limited API (`Py_LIMITED_API`), which is **explicitly unsupported** on free-threaded Python 3.14 (`cpython-3.14t`). Neither package has source builds compatible with the free-threaded ABI either.
> **Note on free-threading:** an earlier iteration targeted free-threaded 3.14
> (`3.14t`), but `mitmproxy` cannot run there yet — its `aioquic` and
> `mitmproxy-rs` dependencies only ship Limited-API (`abi3`) wheels, which the
> free-threaded build rejects, and source builds fail. Since auto-reverse's
> concurrency is entirely I/O-bound (an asyncio proxy loop, an agent loop waiting
> on network/LLM, and Playwright running as a separate Node subprocess),
> free-threading offered no practical benefit here. The project therefore targets
> standard CPython 3.14.
**Workaround applied:** `[tool.uv.override-dependencies]` in `pyproject.toml` stubs out both packages with minimal pure-Python packages located at `/tmp/aioquic-stub` and `/tmp/mitmproxy-rs-stub`. The proxy will function for HTTP/1.1 and HTTP/2 traffic; HTTP/3 (QUIC) and WireGuard/process-capture modes are unavailable until upstream packages ship free-threaded wheels.
To regenerate the stubs on a fresh checkout, run:
## Setup
```bash
./scripts/create_stubs.sh # (to be created in a later task)
```
Or create them manually before `uv sync`:
```bash
# aioquic stub
mkdir -p /tmp/aioquic-stub/src/aioquic
printf '[project]\nname="aioquic"\nversion="1.2.0"\nrequires-python=">=3.14"\ndependencies=[]\n[build-system]\nrequires=["hatchling"]\nbuild-backend="hatchling.build"\n' > /tmp/aioquic-stub/pyproject.toml
echo '"""Stub: HTTP/3 unavailable on free-threaded Python 3.14."""' > /tmp/aioquic-stub/src/aioquic/__init__.py
# mitmproxy-rs stub
mkdir -p /tmp/mitmproxy-rs-stub/src/mitmproxy_rs
printf '[project]\nname="mitmproxy-rs"\nversion="0.12.9"\nrequires-python=">=3.14"\ndependencies=[]\n[build-system]\nrequires=["hatchling"]\nbuild-backend="hatchling.build"\n' > /tmp/mitmproxy-rs-stub/pyproject.toml
echo '"""Stub: WireGuard/process-mode unavailable on free-threaded Python 3.14."""' > /tmp/mitmproxy-rs-stub/src/mitmproxy_rs/__init__.py
uv sync
uv run playwright install chromium
```
## Usage
```bash
ANTHROPIC_API_KEY=... uv run auto-reverse https://example.com
```
(Full usage, flags, and REPL commands are documented as the CLI lands.)