One error classification and renderer for the http client on native, embedded and p3 (ADR-0023 steps 0 and 2) - #2841
Merged
Merged
Conversation
…C-370 added) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…table that names the URL and carries no OS errno Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…als, timeouts and size limit onto the same classes and texts Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…and mirror C-328, C-330, C-366, C-367 and C-370 from als Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… fixtures Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merged
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.
Part of #2659. Implements ADR-0023 step 0 (the contracts, landed in almide/als#113 and pinned here) and step 2 (the error classification).
Step 0
proofs/als-pin.txt→ 3c5b9f2, in its own commit.check-als-pin.shOK).Step 2
crates/almide-rt-core/src/http_error_core.rsholds the one table of classes and texts, plushttp_quote. Native and the embedded host render from it: URL parse, header check, dial, TLS, read/write, size cap, framing, and the call handle's transport errors. No text carries an OS errno. Native's wording changes once, as §4.2 accepts. rt-core also refuses the nine managed header names (C-370).crates/almide-wasm-run/src/wasi_p3_http_err.rs: the p3 shim lays the same pieces out as data. It adds$http_quote(a byte-for-byte twin),$http_err,$http_hdr_checkand$http_env_num.wasi:httperror-codecase onto a class by name.ALMIDE_HTTP_TIMEOUT_SECSas request options and enforcesALMIDE_HTTP_MAX_RESPONSE_BYTESon the body.internal-error(some(msg))through asmsg.(p3 transport)text now remains only for the bring-up stop knob.Evidence
tests/http_error_class_cross_test.rsruns on native, embedded (almide run --target wasm) and p3 (wasmtime run -S http=y), comparing stdout, stderr and exit code. It covers two cases:spec/embedded_cross/http_error_classes.almd: the scheme reasons, the escapes, and a closed port.spec/embedded_cross/http_header_refusal.almd: bad names and values, and the managed names.docs/stdlib/http.mdgains the class table.# oracle:header kept). The alloc and size ledgers are untouched: neither the core emitter nor the stdlib changed.Not covered by fixtures
HTTP-request-URI-invalidtext until the stdlib parser (step 6).