Package com.tnsai.quality.sandbox
Class WasmSandboxFactory
java.lang.Object
com.tnsai.quality.sandbox.WasmSandboxFactory
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanV1 stub returnsfalseunconditionally; once a runtime adapter ships, this becomes a probe (e.g.create(SandboxSpec spec) Create aSandboxfromspec.id()Stable backend identifier ("process","container","wasm","firecracker", …).intpriority()Higher than container — WASM is the lightest available backend.
-
Constructor Details
-
WasmSandboxFactory
public WasmSandboxFactory()
-
-
Method Details
-
id
Description copied from interface:SandboxFactoryStable backend identifier ("process","container","wasm","firecracker", …). Used by callers pinning a specific backend.- Specified by:
idin interfaceSandboxFactory
-
priority
public int priority()Higher than container — WASM is the lightest available backend. Not promoted bySandboxFactory.preferred()whileavailable()isfalse.- Specified by:
priorityin interfaceSandboxFactory
-
available
public boolean available()V1 stub returnsfalseunconditionally; once a runtime adapter ships, this becomes a probe (e.g. Pyodide jar present on the classpath).- Specified by:
availablein interfaceSandboxFactory
-
create
Description copied from interface:SandboxFactoryCreate aSandboxfromspec. Implementations MUST reject specs they cannot honour (e.g. a backend that doesn't supportNetPolicy.AllowListthrows here rather than silently downgrading) — silent relaxation is the accidental-blast-radius footgun this layer exists to prevent.- Specified by:
createin interfaceSandboxFactory
-