How does Traverse execute WASM?
Traverse turns a request into a result through a deterministic, multi-step execution pipeline. Every step is logged. Every failure is recorded. The same binary with the same inputs always produces the same output.
The execution steps
- Request arrives with a goal and a requested placement target (e.g. local).
- Registry discovery searches all loaded capabilities for ones that declare the requested goal and support the placement target.
- Constraint evaluation checks preconditions on each candidate. Capabilities that fail preconditions are removed from the selection pool.
- Selection picks the best remaining capability. If none qualify, the machine moves to error with capability_not_found.
- WASM binary loads into an isolated sandbox. Sandbox permissions are taken from the contract. By default, network_access, filesystem_access, and host_api_access are all false.
- Input validation checks the caller's inputs against the contract's input schema. Invalid inputs stop execution before the binary runs.
- Entrypoint is called with the validated inputs.
- Output validation checks the returned value against the contract's output schema. A mismatch triggers postcondition_failed.
- Events are emitted. The runtime enters the emitting_events state and publishes all output events declared in the contract.
- Trace artifact is produced. A structured JSON record captures every step, decision, and timing for this execution.
Sandbox defaults
Unless a capability's contract explicitly enables a permission, the WASM instance cannot reach outside the sandbox. These three flags cover the main host capabilities:
A capability that tries to use a host API it did not declare will fail at the WASM level. The contract is the spec and the enforcer.
Determinism
WASM execution is deterministic by design. The same binary with the same validated inputs produces the same output every time. This matters for testing, auditing, and reproducing failures from a trace artifact.
What the state machine looks like
Each arrow is a logged transition. If the machine stops at error, the trace tells you exactly which state failed and why.