Error taxonomy names the documented failure modes: timed-out, not-supported, in-use - #59
Merged
Conversation
…ported, in-use Issue #13 findings C14 and D16. Three failure modes the docs already described rode cases that misnamed them: - timed-out(string): a dial the peer never answers, and a relay open that never completes, kept their own case instead of folding into connect-failed (whose doc no longer claims timeouts) or riding error.other from the generic connection-lost mapping. A mid-life idle timeout surfaces the same way on stream operations. - not-supported(string): the deployment-profile latitude (D16) is live today — the deltic host stubs wasi:sockets with the honest error-code.not-supported, and the endpoint flattened it into invalid-argument. The udp bind path now carries the distinction, and the latitude is recorded at the option definition sites: udp-bind-addr fails bind with not-supported on a UDP-less host; a stubbed WebRTC import is not detected at bind and leaves upgrades non-functional (written, not implied). - in-use(string): the B4/B6 guards left error.other load-bearing in six documented flows (in-flight read/write refusals, via-stream claims, finish under a write). They get the dedicated case, in the spirit of the siblings' receiving-via-stream. Conformance sharpens accordingly: the absent-peer matrix row now pins TimedOut and the wrong-alpn row ConnectFailed (both previously grepped the word connect); the stream-negative probes match in-use exactly; the deltic exam's scenario 1 gains the browser-profile probe — bind with udp-bind-addr set must fail not-supported, the stub's error-code carried through unflattened. Addresses #13 findings C14 and D16.
Issue #13 findings C10, C9 (formats), D15, and the D17 remnant — all doc rulings, no behavior change. C10: connect no longer promotes the v0 dial narrowing to contract. Dial-path selection from addr.addrs is implementation-defined — prefer, race, or fall back are all conforming — so an upstream-backed implementation of this surface (which always races) is no longer non-conformant by construction. This implementation's actual selection stays recorded where the narrowings live (endpoint/src/lib.rs); the matrix rows that lean on no-fallback assert that recorded latitude, not the contract. C9: transport-addr's string formats are specified — relay is an http(s) base URL with one-spelling-per-relay guidance (normalization is implementation-defined beyond the exact string), ip is dotted-quad or bracketed IPv6 with scope-id support implementation-defined and unparseable entries ignored for dialing. D15, resolved as a ruling rather than a declaration: the built component's import set includes a toolchain wasi 0.2 tail (io, cli, clocks, filesystem, random — bind's reset and token keys ride wasi:random through the language's entropy source). Declaring one of those interfaces in the source world at a pinned version would fight toolchain drift and split the import in two on mismatch. The world's doc now states what the world is (the deliberately-bound surface) and names the artifact's embedded WIT as the authoritative import manifest. D17 remnant: read(max: 0) resolving some([]) is documented. Addresses #13 findings C9, C10, D15, D17.
This was referenced Aug 12, 2026
Closed
lann
enabled auto-merge
August 12, 2026 17:08
The contract stops over-promising and under-recording
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #13 findings C14 and D16 — the first of the two C/D-tail PRs discussed (the contract-truthfulness sweep follows separately).
Three failure modes the docs already described were riding cases that misnamed them:
timed-out(string)A dial the peer never answers, and a relay open that never completes, get their own case. Consumers legitimately dispatch on the difference (retry a timeout; don't retry a refusal), and noq distinguishes
TimedOutnatively — the fold intoconnect-failed(#56's mapping, matching the then-current taxonomy) splits back out with one match arm.connect-failed's doc drops its timeout claim; a mid-life idle timeout surfaces the same case on stream operations, alongside the A2closedcontract.not-supported(string)— and D16's latitude, recordedThe deployment-profile gap is live today, not theoretical: the deltic host stubs
wasi:socketswith the honesterror-code.not-supported(its own header says it's the browser host's answer), and the endpoint flattened it intoinvalid-argument— a capability answer misreported as an argument error. The udp bind path now carries the distinction through typed errors, and the latitude lives at the option definition sites, per the recorded-latitude ladder:udp-bind-addron a UDP-less deployment:bindfailsnot-supported.webrtcon a deployment stubbing the channel import: not detected at bind — upgrades never occur and connections stay on their dial path. Written as latitude rather than left implied; a bind-time capability probe would need surface the WebRTC import doesn't have, so the honest contract is the degradation.in-use(string)The B4/B6 guards deliberately parked six documented flows on
error.other(in-flight read/write refusals, both via-stream claims, finish-under-a-write) —otheras load-bearing in documented flows is exactly the smell C14 named. One dedicated case covers the family, in the spirit of the siblings'receiving-via-stream; the payload says which conflict. The via-stream abandonment future staysother— it is not a conflict.Conformance
TimedOutand the wrong-alpn rowConnectFailed(both previously grepped the word "connect", which either case satisfied).in-useexactly instead of sniffingother's message text.udp-bind-addrset must failnot-supported— the stub's error-code carried through unflattened. Placed after the zero-socket-calls check, since the probe deliberately reaches the stub.Ordering note: this rode the #58 A10 transition (
ComponentException,kind/valueenvelopes) — the facade and exam edits here follow the new shapes, and stale.depscheckouts needed the usualsetup.shre-run (the #51 lesson, dutifully re-learned).Verified
just check,just probes,just matrix(15 rows),just exam-deltic(6/6, new probe green),just bench(budgets hold).Addresses #13 (C14, D16).