Home / Market / wasm component wit compatibility

wasm component wit compatibility

Audit WebAssembly Component Model WIT world evolution offline with pinned wasm-tools AST/semver-check across imports, exports, signatures, types, resources, and binary components.

skill★ 509150 dlgithubCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

--- name: wasm-component-wit-compatibility description: "Audit WebAssembly Component Model WIT world evolution offline with pinned wasm-tools AST/semver-check across imports, exports, signatures, types, resources, and binary components." category: development risk: safe source: self source_type: self date_added: "2026-12-01" author: Koushik-Katkam tags: [webassembly, wasm, component-model, wit, wasm-tools, compatibility]

---

WebAssembly Component WIT Compatibility

Overview

Compare WebAssembly Component Model WIT world contracts offline using the real pinned wasm-tools parser (wasm-tools component wit --json and wasm-tools component semver-check) over both .wit packages and validated .wasm binary components, without regular-expression scraping over WIT text and without executing WebAssembly code. Verifies removed required exports, newly required host imports, parameter/result contract changes, package/interface semver versions, nominal type and resource identities, and compatibility direction.

Distinction from existing repository skills:

When to Use

Prerequisites

How It Works

1. Define the compatibility direction explicitly

Audit direction defaults strictly to NEW_COMPONENT_ON_OLD_HOST:

2. Parse genuine WIT ASTs and binary components with wasm-tools

Run the local verification suite in WIT compatibility harness:

  1. Run wasm-tools component wit <target> --json (rejects invalid WIT/Wasm as INVALID_INPUT cleanly) to inspect resolved packages, worlds, interfaces, types, and functions.
  2. Run wasm-tools component semver-check --prev <new-world> --new <old-world> <wit> only when both worlds live in the same .wit file/package source (never substituting an unrelated third .wit fixture) to confirm official Component Model semver compatibility alongside structured AST diff diagnostics.
  3. Build and validate an actual .wasm binary component offline (wasm-tools parse + component embed + component new + validate --features component-model) and extract its embedded WIT contract via component wit component.wasm --json without instantiation or execution.

3. Distinguish conservative structural differences from proven incompatibility

Always state explicitly that structural AST differences flag conservative compatibility breaks (some changes, such as compatible minor package version bumps or nominal aliases, can require host/guest ABI review), whereas passing matching WIT identifiers, function signatures, and semver checks never proves behavioral equivalence or canonical-ABI runtime safety across different guest implementations or memory allocators.

Examples

Run the self-contained verification suite in WIT compatibility harness:

User request: "Check whether our plugin-v2 WIT world breaks hosts compiled against plugin-v1."
Inputs: WIT package(s) or binary .wasm components audited via wasm-tools 1.263.0.
Expected result: Backward-compatible export addition passes semver-check and reports NEW_COMPONENT_ON_OLD_HOST;
  removed export, newly required host import, u32->u64 param change, and changed resource method return BREAKING findings;
  syntax errors return INVALID_INPUT.

Limitations

Safety and Side Effects

Sources and related skills