The 2026-11-29 proposal: starting point and plan

View Source

This page keeps two sections of the design as they were written on 2026-11-29, before any code: what erlang_wasm and barrel_mcp offered on that date, and the phased plan that built wasm_tools 0.1.0. They are history. Most of the gaps they list were closed upstream before 0.1.0 (erlang_wasm 0.15.0, barrel_mcp 4.9.0), so do not read them as the current state. You need this page to know why an upstream change was made, or how the first release was planned. The decisions and their reasons are in the design; in the text below, "this page" means the design as it was then.

1. What exists today (verified in source)

erlang_wasm 0.14.0, supported API unless marked internal:

needwherestate
decode once, instantiate manywasm_component:prepare/1, instantiate/3ok
typed callwasm_component:call/4, signature written by hand, not checked against the binaryok
Erlang valuesrecord = map with binary keys, variant {Name, Payload}, enum binary, option none | {some, V}, result {ok, V} | {error, E}, flags [binary()], list<u8> binary, char integerok
export namesexports/1, top level onlypartial
export signatures with parameter namesnone public. wasm_component_link:resource_info/2 (internal) has sigs; parameter names dropped (wasm_component_types.erl:371); world-level named types stay {typeref, N}; composed components give no sigs; no async flagmissing
imports with sigswasm_component_types:import_interfaces/1 (internal)internal
custom sections (package-docs)skipped (wasm_component.erl:237)missing
argument checksintegers masked, not range-checked (wasm_canon.erl:113-125): 256 as u8 becomes 0; UTF-8 and chars unchecked; a wrong shape becomes malformed/internalbug
WASI 0.2, deny by defaultwasi_preview2:command/1: no mounts, empty env, stdio discarded, no wasi:sockets without network; clocks and random always onok
network grantaddresses or CIDR plus ports, never names (wasi_net). One network key feeds both wasi:sockets and wasi:http (wasi_preview2.erl:387-401). wasi:http resolves a name only with resolve => allow, which also opens DNS lookups to the guestok, no host-name policy
host imports#{{Iface, Func} => wasm_component:import_fun(Sig, Fun)}; a missing one is {error, {unresolved_import, _}} at instantiateok
limitsflat instantiate opts fuel, max_memory_pages, max_depth, max_host_calls; wasm_limits:untrusted/0; timeout only in workers; an inline call stops only when its process is killed; finite fuel forces the interpreterok
cleanup on killpages, sockets, HTTP/1 connections, async tasks freed when the owning process dies; guest code reads only its own message tags, so only exit signals stop itok
core module cachekeyed by sha256; evicted when no process holds it; 50 loads/s node-wide; hold/1 pins while the calling process livesok
component workernone; wasm_instance_worker is core-only (unbounded queue, a queued caller's timeout kills the worker serving another call)not needed
statefulwasm_actor: send-only, no deadlinelater
scriptswasm_script_worker with JS, Python, Lua adapters; JSON in and out; 1.2 to 2 ms overhead per requestlater
observabilityno telemetry, no hooks, no fuel-used readoutmissing

barrel_mcp 4.8.1:

needstate
register and remove tools at runtime with schemas, title, annotationsreg_tool/4, unreg_tool/1: ok
one handler for many toolsarity-2 handler gets tool_name in Ctx: ok
a process per call, killed on timeout and canceltimeout kills; notifications/cancelled sends {cancel, ReqId}, kills after 5 s: ok. tasks/cancel and session DELETE never kill
structured output, tool errors{structured, Data, Content}, {tool_error, Content}: ok
list_changedautomatic, to every session: ok, not scoped
scopeone registry per node; a same-name registration silently overwrites (barrel_mcp_registry.erl:671), so a component could replace an application's native tool; a registry restart wipes every tool: gap
ownershipnone, tools stay until unreg_tool: gap
per-tool dataunknown options dropped, handler is MFA only: gap
authorizationvisible/4 filters tools/list only; tools/call is not checked: gap
input validationopt-in, schema recompiled per call: not used by us

Hex: erlang_wasm_tools and wasm_tools both free (hex.pm API 404, 2026-11-29).

13. Plan (nothing merged without the maintainer's review)

One prompt per project, one branch and one pull request per project, one commit per step. The three run in parallel sessions.

  • Phase 0 (done): this page; the test components in test/fixtures/component/ (one cargo workspace built by scripts/build-fixtures.sh with plain cargo and the wasm-tools CLI: calculator and http_client for wasm32-wasip2; data_transform, multi_iface, iface_conflict, custom_host and limits for wasm32-unknown-unknown; erlang_wasm's vectors, counter, hostcall and asyncval copied), all smoke-tested against erlang_wasm 0.14.0; and the three prompts:
    • ~/Projects/erlang_wasm_component_tools_prompt.md: erlang_wasm, branch component-tools off 0.14.0, seven commits (E1 describe, E2 argument checks, E4 HTTP grant and hook, E3 custom sections, E5 memory-limit context, E6 h1 0.13, E7 HTTP peer close).
    • ~/Projects/barrel_mcp_dynamic_tools_prompt.md: barrel_mcp, branch dynamic-tools off 4.8.1, four commits (B1 owner and exclusive names, B5 tool data, B3 visibility on tools/call, B2 batch registration).
    • ~/Projects/erlang_wasm_tools_prompt.md: this repository, branch first-release, every step to 0.1.0 (this page and the fixtures, the native API, the MCP adapter, docs and examples), built against the two upstream branches through git dependencies, switched to their Hex releases before 0.1.0.
  • Phase 1, in parallel: each prompt in its own session. Before each release, the docs-maintainability-review plan goes to the maintainer (erlang_wasm 0.15.0, barrel_mcp 4.9.0, wasm_tools 0.1.0).
  • Later, not 0.1: snapshots for components with heavy initialisation; stateful tools on wasm_actor; scripts and core modules with an explicit descriptor interface (same schema and codec); async and stream exports; a bounded call queue; a JSON manifest; wasi:config; OCI and remote loaders; a progress host interface; management tools over MCP with a registry ceiling (off by default, behind a scope); the compiled tier.