Skip to content

A10: WitError -> ComponentException, {tag, val} -> {kind, value} - #114

Merged
lannbot merged 1 commit into
mainfrom
a10-component-exception-kind-value
Aug 12, 2026
Merged

A10: WitError -> ComponentException, {tag, val} -> {kind, value}#114
lannbot merged 1 commit into
mainfrom
a10-component-exception-kind-value

Conversation

@lannbot

@lannbot lannbot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Contract amendment A10 (contracts/embedder-api.md), per the operator's call after evaluating WebAssembly/component-model#686: adopt the draft web embedding's exception naming and variant dictionary shape now, while the consumer surface is still cheap to move. If #686's shape holds, native support and this API agree for free.

Two renames, semantics identical:

  • WitErrorComponentException (isWitErrorisComponentException); still extends Error, still carries structured payload (no DOMException inheritance — absent in the bare sm/jsc shell lanes; revisit if the draft stabilizes).
  • Variant-family discriminants { tag, val }{ kind, value } (variants, nested results, nested-option boxing). Payloadless cases still omit value; case names stay kebab-case verbatim. Deliberate divergence from jco's {tag, val}, superseding the v0.2 rationale.

Wire vocabulary untouched:

  • Brand key stays deltic.witError/1 (opaque constant, CEWD precedent) — pre-A10 copies and hand-rolled zero-import brands keep interoperating; the A9 dual-copy test still passes unmodified in behavior.
  • Plan-format op discriminants keep tag (different contract); interpreter-internal single-key shapes unchanged.

Consumer note: breaking API rename for polymorph host modules on their next deltic bump — mechanical (s/WitError/ComponentException/, s/\.tag/\.kind/ + s/\.val/\.value/ on variant values). Migration notes section updated.

Gates: full just gates green (build/test-rust, runtime 484/0, protocol, wasi-shims, ct-runner, bundle, ports, webrtc, conformance 1254/0, sched-seeds 1+4242, shells sm/node/bun, browsers chromium+firefox, websocket-conformance 55/0, smoke-tls, smoke-c0).

Contract amendment A10 (contracts/embedder-api.md): align the embedder
API's exception naming and variant-family discriminant shape with the
draft web embedding (WebAssembly/component-model PR #686) while the
consumer surface is still cheap to move. Semantics unchanged:
payloadless cases still omit `value`; case names stay kebab-case
verbatim; nested options box as { kind: "some", value } | { kind: "none" }.

Wire vocabulary is untouched: the brand key stays deltic.witError/1
(opaque constant, CEWD-style) so pre-A10 copies and hand-rolled brands
keep interoperating, and plan-format op discriminants (a different
contract) keep `tag`. The interpreter's internal single-key shapes are
likewise unchanged (embedder-api.md §Implementation strategy).

Mechanical sweep: protocol (class/predicate/identifier), runtime
embedder layer, bindgen codegen + regenerated fixtures, ct-runner,
wasi-shims, ports (websocket/webcrypto/webrtc), kitchen-sink,
release-bundle dual-copy test, current-state docs prose. Historical
records (milestones, smoke-c0 REPORT) deliberately untouched.
@lannbot
lannbot enabled auto-merge August 12, 2026 03:25
@lannbot
lannbot merged commit 3c8c0e9 into main Aug 12, 2026
4 checks passed
@lannbot
lannbot deleted the a10-component-exception-kind-value branch August 23, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants