review: vendor extraction — gate opens; F-1 panic arm fixed

The extraction review against vendor.md's cut table, ADR-011
§Amendment, and AGENTS.md conventions. All five file diffs vs the
fast-socks5 v1.0.0 reference checkout read hunk-by-hunk and
categorized (cut / carried changes / adjustments / provenance /
tests); wasm, clippy, fmt, doc all green; RFC 1928 spot-checks
(reply form, method order, UDP zero fallback, domain cap, FRAG
split) independently verified against the RFC text.

F-1 (critical, resolved here): ReplyError::from_u8 kept upstream's
unreachable!("ReplyError code unsupported.") arm while being
wire-reachable — Socks5Stream::read_request_reply feeds the raw
reply byte from the wire into it, and RFC 1928 §6 marks 0x09-0xFF
unassigned, so a misbehaving peer would panic the consumer task.
Unassigned codes now map to GeneralFailure (the RFC's catch-all),
pinned by a new test, and the panic-translation adjustment is
recorded in vendor.md's adjustment list (with the Config-Default
and write_all notes) in the same change.

Findings F-2..F-4 (dead commented code dropped with its region;
Cargo.toml feature-layout comments; the preserved resolve_dns error
string) reviewed and accepted. Review task file carries the full
record; the gate to the downstream task groups is open.

Verified: cargo test (38 + 32), cargo test --all-features, clippy
--all-targets and --target wasm32-unknown-unknown (-D warnings),
cargo check --target wasm32-unknown-unknown, cargo fmt --check,
cargo doc --no-deps.
This commit is contained in:
glm-5.3-flash committed 2026-09-22 11:01:55 +00:00
1 parent d6fbd04ef3
commit 5b18d4d292
3 files changed
+168 -17

No files matched your search

+24 -3
View File
@@ -1,8 +1,11 @@
---
status: draft
last_updated: 2026-09-21 (the extraction amendment — ADR-011 §Amendment:
extraction not wholesale copy, the net gate dissolves, two carried
changes; Phase 1 initial draft 2026-09-20)
last_updated: 2026-09-22 (extraction review F-1: `ReplyError::from_u8`'s
panic arm mapped to `GeneralFailure`, panic-translation + Config/
write_all adjustments recorded — see the adjustment list; the
extraction amendment ADR-011 §Amendment: extraction not wholesale
copy, the net gate dissolves, two carried changes; Phase 1 initial
draft 2026-09-20)
---
# alksocks — The Inline Vendor (fast-socks5 subset)
@@ -120,6 +123,24 @@ mechanical edits to the copied code, ADR-011 §Amendment):
anyhow::Error)`) is dropped — the crate's error surface is
`thiserror`-typed; the vendored `SocksError`/`SocksServerError`
stay the wire-level vocabulary.
- The panic paths in the copied region are translated (AGENTS.md
convention 2 — no panics in library code; the extraction
post-dates the client task's summary, corrected by the extraction
review's F-1): `ReplyError::from_u8`'s upstream `unreachable!()`
arm for codes outside the RFC table maps unassigned codes
(`0x09`–`0xFF`, RFC 1928 §6) to `GeneralFailure` instead — the
value comes off the wire (`Socks5Stream::read_request_reply`
feeds the raw reply byte there), so a misbehaving peer surfaces
as a typed error, never a panic. (`client.rs`'s
`use_password_auth` `unreachable!()` and `server.rs`'s
`reply_error` `unwrap` were already translated by their tasks.)
- The client `Config` derives `Default` instead of upstream's manual
impl (upstream's manual impl only spelled the cut
`connect_timeout` field), and `request_header` writes with
`write_all` where upstream wrote with `write` (a partial write of
a request header would corrupt the conversation; byte-identical on
a healthy stream — `clippy::unused_io_amount` is deny-by-default).
Both are recorded here so a future re-vendor re-applies them.
## Maintenance Posture