---
typeId: req
recordId: benac-wasm-001
fields:
  title: WASM package-host calling convention
  statement: >-
    Benac shall define a versioned WASM package-host calling convention for package
    interfaces that reference WASM artifacts.

    The calling convention shall define required module format, allowed imports,
    forbidden imports, required exports, memory requirements, input encoding, output
    encoding, error return behavior, UTF-8 handling, JSON handling, allocation/free
    conventions, invocation contract snapshot fields, and conformance vectors.

    A package operation using a WASM artifact shall receive package-visible input only
    through the calling-convention-defined invocation path and shall return output only
    through the calling-convention-defined output mechanism.

    The calling convention shall not classify packages.

    The calling convention shall not classify how package work is performed.
  rationale: >-
    Runs WASM is not enough. Package authors need one WASM package-host calling
    convention that works across hosts that mediate WASM attempts.
  verification: >-
    A WASM-backed calculator package compiled against the calling convention runs on
    conforming Host Implementations when required grants, artifacts, and resources are
    present and produces the same validated output and trace shape.
  testable: true
  status: draft
  area: BENAC-WASM
  sourceDocument: user-requested schema-first requirements cleanup
  sourceVersion: 2026-05-06
  sourceSections:
    - Package authoring
  order: 87.16
---
