Class WasmSandboxFactory

java.lang.Object
com.tnsai.quality.sandbox.WasmSandboxFactory
All Implemented Interfaces:
SandboxFactory

public final class WasmSandboxFactory extends Object implements SandboxFactory
WebAssembly + WASI SandboxFactory entry-point (TNS-296).

Stub for v1 — available() returns false and create(com.tnsai.quality.sandbox.SandboxSpec) throws SandboxException until a real WASM runtime adapter (Pyodide for Python, Wasmer / WasmEdge for the polyglot path, Bun WASM for JS) lands as a follow-up.

The class exists in v1 so consumers can write code against SandboxFactory.byId("wasm") today and the wiring lights up automatically once a child issue ships the adapter.

Since:
0.10.0 (TNS-296)
  • Constructor Details

    • WasmSandboxFactory

      public WasmSandboxFactory()
  • Method Details

    • id

      public String id()
      Description copied from interface: SandboxFactory
      Stable backend identifier ("process", "container", "wasm", "firecracker", …). Used by callers pinning a specific backend.
      Specified by:
      id in interface SandboxFactory
    • priority

      public int priority()
      Higher than container — WASM is the lightest available backend. Not promoted by SandboxFactory.preferred() while available() is false.
      Specified by:
      priority in interface SandboxFactory
    • available

      public boolean available()
      V1 stub returns false unconditionally; once a runtime adapter ships, this becomes a probe (e.g. Pyodide jar present on the classpath).
      Specified by:
      available in interface SandboxFactory
    • create

      public Sandbox create(SandboxSpec spec)
      Description copied from interface: SandboxFactory
      Create a Sandbox from spec. Implementations MUST reject specs they cannot honour (e.g. a backend that doesn't support NetPolicy.AllowList throws here rather than silently downgrading) — silent relaxation is the accidental-blast-radius footgun this layer exists to prevent.
      Specified by:
      create in interface SandboxFactory