eggfetch is a Rust-native async HTTP client (tokio + hyper). All networking lives in eggfetch-core plus the small eggfetch-http-connect CONNECT wire primitive it owns; CLI, Python, FFI, and Node are thin adapters (Python sync blocks on the async engine with GIL released).
Start at docs/architecture/overview.md (§ Deep-Dive Index). Normative CI/release rules: docs/verification-policy.md. Conventions: CONTRIBUTING.md. Live qualification binding: plans/httpx-parity-correction-status.md (+ compat/*/profile.toml); active planning control surface: plans/registry.md (canonical direction: plans/000-003, ADRs, subsystem roadmaps); pending maintainer actions at the top of plans/README.md (all older plan entries are historical). Task workflows: .skills/ — start with .skills/verification-qualification.md (tiers + exact-SHA rule), then the task skill: rust-development, python-bindings, cli-development, ffi-development, fuzz-testing, security-review, release-process, documentation, benchmark-maintenance. Each skill's Architecture References section indexes the matching docs/architecture/ deep dive.
./scripts/check.sh # Tier 1: required before every commit (CI repeats it on ubuntu-latest)
./scripts/check.sh extended # Tier 2: before release (full compat, API oracle, feature matrix, MSRV, docs, FFI, soak, bench)
./scripts/check.sh package # Tier 3: before publish (crate packaging + wheel build/smoke)
./scripts/check_security.sh # Live RustSec/license/source preflight before publicationDeep dive: docs/architecture/build-ci.md; normative policy: docs/verification-policy.md; exact-SHA rule: .skills/verification-qualification.md.
check.shrefuses to run outside an active venv with Python 3.10+ and pinned tooling inscripts/ci-requirements.txt. Setup:python3 -m venv .venv && source .venv/bin/activate && python -m pip install -r scripts/ci-requirements.txt.- After changing
crates/eggfetch-pythonRust code, rebuild before testing:maturin develop -m crates/eggfetch-python/Cargo.toml. Stale.socauses confusing failures. - Focused equivalents (same flags
check.shuses):cargo test --workspace --exclude eggfetch-python --all-features -- --test-threads=1cargo test -p eggfetch-core --all-features <filter> -- --test-threads=1python -m pytest crates/eggfetch-python/tests/ -q --ignore=crates/eggfetch-python/tests/compatEGGFETCH_COMPAT_REQUIRED=1 python -m pytest crates/eggfetch-python/tests/compat/ -v --strict-markerscargo clippy --workspace --all-targets --all-features -- -D warningscargo fmt --all -- --check
- Never parallelize Rust workspace tests (
--test-threads=1): RSS-stabilization tests go flaky under concurrency. Workspace tests excludeeggfetch-python(PyO3 builds separately viamaturin develop). - Tier 1 also runs stable contract fixtures across 8 profiles plus the lean profile's behavioral suites, plus manifest/typing guards; run them focused as
RUSTFLAGS= cargo test -p eggfetch-core --test public_api_contracts -- --test-threads=1(bareRUSTFLAGS=overrides CI's-D warnings, which fails lean profiles on profile-specific dead code),RUSTFLAGS= cargo test -p eggfetch-core --test lean_policy_tests --no-default-features --features standard-http1,tls-rustls -- --test-threads=1,RUSTFLAGS= cargo test -p eggfetch-core --test lean_route_tests --no-default-features --features standard-http1,tls-rustls -- --test-threads=1,python scripts/check_native_python_api.py --self-test,python scripts/check_python_typing_surface.py --self-test,bash scripts/check_lint_suppressions.sh --self-test,python scripts/test_h3_qualification.py(runner logic only — not an H3 qualification result), andpython scripts/check_adapter_features.py. - Tier 2 requires the exact Rust 1.89.0 toolchain (
rustup toolchain install 1.89.0 --profile minimal); it fails, never skips. Full compat also needs pinned deps (pip install -r compat/httpx/0.28.1/requirements.txt+compat/httpx2/2.12.0/requirements.txt). The extended Rust public-surface oracle requirescargo-public-api 0.52.0,cargo-semver-checks 0.49.0, and pinned nightlynightly-2026-05-07(seecompat/rust-public-api/README.md; eight profiles vs oracle planning baseline03ecba973010e2858bf16a2b5f84d51ce70adae4, distinct from the live Stage C SHA in the ledger and compat profiles). qualification/fixtures and H3 (experimental) are manual, never Tier 1 gates. Tier 1 runs only the H3 runner self-test (scripts/test_h3_qualification.py); it makes no network connection and implies no H3 conformance claim. Tier 2's downstream behavioral-fixture gate fails closed whentarget/downstream-qualification/artifact-manifest.jsonis absent — that artifact is release-blocking and has no in-repo producer, so the operator must supply it. Tier 1 Node JS surface (node test.js) is an explicit SKIP whennodeorcrates/eggfetch-node/eggfetch.nodeis absent, not a failure.scripts/performance_benchmark.pyis non-CI timing evidence only.
eggfetch-core: no PyO3, no clap, no CLI parsing.eggfetch-cli/eggfetch-python: no direct hyper/tokio TCP — all I/O through core. If you write HTTP logic outside core, refactor.eggfetch-http-connectis the only exception: generic CONNECT wire bytes only (target formatting, serialization, bounded head parsing). No sockets, TLS, retry, or policy; owned by theproxyfeature.unsafe_code = "forbid"workspace-wide; onlyeggfetch-ffiandeggfetch-nodeoverride to"allow". Never add newunsafewithout explicit discussion.- Pedantic clippy (
-D warnings);missing_docs = "warn".scripts/check_lint_suppressions.shrejects blanketallow/expect/denyofwarningsorclippy::all/pedantic/nursery/restriction(except FFI/Nodepedantic). The guard anchors on the attribute's lint list, so a blanket lint combined with other items or areason = "…"field is still rejected; it scanscrates/andfuzz/. Its--self-testruns in Tier 1. Use specific lint names with a justifying comment (reason = "…"). - Core default is
http1 + tls-rustls + tls-native-roots(http1alone is cleartext-only). Canonical recipes:docs/architecture/feature-flags.md#supported-core-profiles.http1/http2are aliases:native-http1/native-http2+high-level-url+logical-retry+redirects+basic-auth.- Without
high-level-urlthere is nourl/idna/ICU/percent-encoding; native callers own IDNA/punycode before constructinghttp::Uri. - Lean
standard-http1/standard-http2(+tls-rustls): Bearer-only single-attempt standard-route client, 3xx returned without following.transport-http1+standard-routewithoutadvanced-routingis the leanest native transport. - CLI enables cookies/multipart/proxy (no compression, no http2/http3); Python enables http2/http3/cookies/multipart/proxy + all compressions.
- Pipeline is
prepare.rs→route.rs(select_route(): UDS → dialer → static/direct → proxy/SOCKS → SNI → H3 → standard) →finalize.rs(one post-transport policy), entered viaretry.rs(logical-retry),redirect.rs(onlyredirects), orlean.rssingle-hop when both are absent. New request fields must go through the exhaustive typed rebuild helpers (retry_request/advance_redirect_hop) so omission fails to compile. Hyper client construction is centralized intransport/hyper_client.rs; forward stays H1-only. UDS/dialer/pinning/SNI arms requireadvanced-routingand fail closed in lean profiles. - Do not add public helpers beside existing Alt-Svc, lifecycle, metrics, dialer, or pool surfaces (inventory:
docs/architecture/rust-surface-containment.md). - TLS:
additional_ca_*augments the base store,ca_certificate_*replaces it. Native-root construction failure may fall back to WebPKI roots; cert/hostname verification failure must never retry with another store.crypto_provider()is per-config, never process-global. - Proxy fallback is typed only: CONNECT advances on 502/504, local SOCKS5 on destination-specific 0x03/0x04/0x05; auth/policy/protocol/malformed failures stop. Never cache a request's shrinking total deadline in route connectors; total is enforced by the outer dispatch and spans the
PoolGuardbody lifecycle through EOF/trailers (read = first-poll/per-chunk inactivity, total never resets, Total wins ties). ResponseBodypublic variant shapes are frozen — no new timeout fields/variants or#[non_exhaustive];BodyTimeoutStreamstays the single high-level timeout owner. Preserve chunking, cancellation, backpressure, decoding, and public surface when touching perf-sensitive paths.eggfetch-benchfixtures are harness code, not production proxy behavior. Keep protocol fixtures deterministic, test them independently of Criterion, and report unsupported framing explicitly rather than relying on read timeouts. The e2eBenchProxyis HTTP forward-only; it rejects CONNECT and chunked request bodies.
- Shared setup lives in
crates/eggfetch-python/src/request_preparation.rs;content=takes one iterator, async-only bodies are rejected before sync dispatch._nativeis private; public surface iscrates/eggfetch-python/python/eggfetch/__init__.py+__all__(keepcrates/eggfetch-python/tests/native_api_manifest.jsonin sync). TransportHintsoverride wire behavior only; they survive retry, redirect hops clear them except same-origin resolved destination. Native resolved-address pinning is Rust-only, never falls back to DNS.- Facades
eggfetch.compat.httpx(0.28.1) andeggfetch.compat.httpx2(2.12.0) coexist without cross-mutation. Never hand-edit generated API manifests — regenerate viascripts/generate_httpx_api_manifest.py+scripts/compare_httpx_api_manifest.py. - Live qualification ledger
plans/httpx-parity-correction-status.md(+compat/*/profile.toml) is authoritative for the current Stage C SHA — never hardcode a live SHA outside the canonical qualification records (docs/residual-differences.md,docs/reference/compatibility*.md). Do not paper overdocs/residual-differences.md. - Timeouts: map only
connect/read/write/pool; never synthesize nativetotal. CompatNO_PROXYparser differs from nativeNoProxy::parse()— do not unify.ssl.SSLContexttranslation is fail-closed (mutation reclassifies, subclasses/unrepresentable state →TypeError); proxy TLS comes only fromProxy(ssl_context=...). - Redact
authorization,proxy-authorization,cookie,set-cookiein all Debug/Display/__repr__/errors.Http2Onlyis enforced at three layers (ALPN,http2_only(true),negotiated_h2()); never fork a second engine. - Only 101 responses own
response.extensions["network_stream"]; CONNECT tunnels stay body-iterator only. SSE is Python framing over streams; WebSocket uses wsproto over the 101 stream — never raw sockets from Python. - Python
aread()builds the finalbytesinside the GIL bridge (no RustVeccopy); buffered iterators stay private and lazy. Cookie watermark shortcuts require isolated large-jar evidence showing a material win with unchanged semantics.
- Make the workspace green before adding functionality; run Tier 1 before committing. One logical change per commit; never commit without an explicit user request.
- Never add CI jobs, matrices, evidence schemas, or publish automation without an explicit request. CI is one job (
ci.yml) repeatingcheck.sh; releases are manual (order: http-connect → core → cli → ffi → python → node, then tag;eggfetch-benchandfuzz/are never published; PyPI via manually dispatchedpypi.yml, Trusted Publishing). Seedocs/verification-policy.md.