4b985bb7f0
Public Run(ctx, cfg) <-chan Result streams diagnostic events for the seven tests (tcp, greet, auth?, connect, udp, stun, api) wired through the SOCKS5 primitives, STUN codec, retry classification and RU hints. - Per-test attempt loop with running/passed/failed events, transient-only retries (per-attempt timeout treated as transient, parent ctx cancel as permanent), context-aware backoff sleep. - Connection lifecycle: tcpConn shared across greet/auth/connect (closed and redialed on retry); separate udpConn2 control channel for UDP ASSOCIATE kept alive for the duration of the stun test. - STUN-via-SOCKS5: builds 10-byte SOCKS5 UDP header + STUN binding request, decodes reply with ATYP-aware header strip (1/3/4). - runAPI plugs SOCKS5 dial into http.Transport.DialContext; passes on HTTP 200 OR 401. - Skip semantics: dependency-failed tests emit single skipped result; cancellation latches and propagates as cancelled-failed (current) + cancelled-skipped (remaining). - Defaults applied to a copy of cfg; UseAuth=false suppresses any "auth" result entirely. Tests: 10 TestRun_* covering happy/auth-rejected/all-rejected/ connect-refused/udp-unsupported/timeout-then-ok/cancelled-mid-flight/ defaults plus extractRawHex unit. Fake SOCKS5 proxy + UDP relay echoing synthetic STUN binding success responses; httptest stub for API splice. Combined coverage 84.3% (>=80% target). go test -race clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>