Skip to content

feat(wasm): add engine policy and strict module admission validation #25

Closed

Description

@zackees

Context

Implementation child of #15 and foundation for #13 and #14. The repository currently has no Wasm engine or validator dependency. Establish one private engine policy and strict module admission boundary before guest execution is added.

Proposal

Add an explicit heavyweight sketch-host feature and private engine/validation module. Wasmtime 45 with Cranelift is the researched baseline; pin the selected versions and verify the actual Cargo resolution/feature graph before relying on it. Do not add an engine fallback.

Validate before compilation or instantiation: owned versioned kernel imports plus exact restricted-stdlib compatibility imports; forbidden ambient WASI filesystem/environment/network/clock/random/process/stdio and arbitrary host imports; exports/entrypoint/ABI metadata; shared-memory declaration/maxima; and capability/configuration mismatch. Errors are facade-owned typed diagnostics.

Invariants

  • default = [] neither resolves nor compiles Wasmtime, Cranelift, parser, bindgen, generated guest support, or guest-build dependencies.
  • Engine/parser types remain private; expose no Engine, Module, Store, Memory, parser, or backend types.
  • Validation is an allowlist and no effect occurs before admission.
  • One engine/code generator only; no speculative public runtime/validator traits.

Non-goals

  • Building/executing a guest, thread bootstrap, resources, streams/blobs, worker containment, Tauri, or screenshots.
  • Treating a version declaration as verified without lockfile/resolution evidence.

Acceptance criteria

  • RED: fixtures demonstrate the current crate has no engine policy/validator or defined import/export contract.
  • RED: ambient WASI, arbitrary host imports, wrong ABI metadata, forbidden exports, and invalid shared-memory fixtures fail admission.
  • GREEN: feature-gated Cargo resolution pins one verified Wasmtime 45/Cranelift baseline, or records an evidence-backed compatible adjustment, with no fallback engine.
  • GREEN: valid admission verifies owned import allowlist, ABI/entrypoint metadata, exports, shared-memory shape/maxima, and declared capability requirements before compilation/instantiation.
  • GREEN: invalid fixtures fail deterministically through facade-owned typed diagnostics before host effects.
  • GREEN: soldr cargo test --locked --no-default-features proves default isolation from all sketch-host dependency trees.
  • GREEN: focused validation tests compile on Linux, macOS, and Windows x86-64/ARM64 targets.

Deliverables

  • Private engine/validator feature and version-policy record.
  • Valid/invalid Wasm fixtures and admission regression tests.
  • Default-feature dependency-isolation check and focused Soldr documentation.

Decisions

  • Wasmtime 45/Cranelift is a researched baseline; Cargo resolution is the acceptance evidence.
  • Strict admission lands before execution so later work cannot normalize ambient authority.

Related issues

Activity

  1. added
    enhancement
    on Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions