Skip to main content

Evaluator Compatibility

An evaluator's is the binary WIT boundary between its WebAssembly component and the Vigilo host. Evaluator package versions describe evaluator behavior; ABI versions describe the binary interface contract. They are separate.

Supported ABI​

ABIWIT sourceHost adapterUse
1.0.0vigilo/wit/evaluator/v1.0.0/evaluator.witvigilo-evaluator-v1@1Supported evaluator contract

Use the versioned WIT path in Vigilo.toml and generated bindings. The host accepts only the exact supported 1.0.0 identity and contract hash.

Publication​

Publishing verifies all of the following before inserting an artifact:

  1. [wit] names a supported package, world, interface, and ABI version.
  2. Source packages reference an exact WIT file; portable packages declare its immutable contract hash. Both must match the host's supported contract.
  3. The compiled component links against the exact host adapter.
  4. Portable Wasm bytes match their declared BLAKE3 hash and embedded package identity.
  5. The registry records the artifact content hash, WIT contract hash, and adapter id.

A version string alone is not proof of compatibility. Unknown contracts, changed frozen contracts, and components compiled for a different interface are rejected.

The registry also records the publishing host's Wasmtime version. Vigilo embeds the exact resolved runtime version during compilation; reporting it does not require Cargo or a lockfile at runtime. Build-time discovery reads dependency-free workspace metadata and the direct Wasmtime entry in Cargo.lock, without downloading unrelated dependency sources. Missing or ambiguous runtime identity fails the build.

Run Pinning​

Run creation resolves each profile evaluator to one immutable tuple:

evaluator id + artifact content hash + ABI identity + host adapter + runtime version

The hashed execution plan stores that tuple and the exact Wasm size. Before acceptance the cell stages and pins the matching object. Workers verify the immutable run configuration and the staged Wasm before compiling with the pinned ABI. The prepared-evaluator cache includes the cell generation and ABI.

Registry lifecycle changes affect new runs. An accepted run continues with its pinned cell artifact after registry unavailability, deprecation, or yanking. A missing or corrupted cell object fails verification before compilation.

Adapter Boundary​

The vigilo/src/evaluator_abi/v1.rs adapter owns generated WIT bindings, identity and contract hash, typed linking, input/output conversion, execution, and a real WebAssembly compatibility fixture. Shared workers and scoring code use the canonical host contracts. The static registry in vigilo/src/evaluator_abi.rs rejects unknown ABI identities and changed contract hashes.

Fixture-backed compatibility tests use the evaluator-abi-fixtures Cargo feature. They are normal tests rather than ignored tests, keeping them isolated from the PostgreSQL tier that selects --ignored tests.

Build both fixtures before running the ABI tests:

cargo build -p sentiment-basic-en -p response-resource-fixture --locked --target wasm32-wasip2 --release
cargo test -p vigilo --locked --features evaluator-abi-fixtures --lib evaluator_abi::

The resource fixture exercises reads through actual Wasm imports, including invalid ranges and expired handles from earlier invocations. Evaluator errors, traps, and guest-requested WASI exits fail an individual invocation and leave the worker available for subsequent evaluations.

The registry is static and auditable. CI invariants reject duplicate declarations, adapter ids, and fixture artifacts; runtime resolution rejects unknown identities and changed contract hashes. Workers cache a compiled component and pre-instantiated linker plan with its resolved adapter, so version selection and typed linking happen once per artifact load rather than once per evaluation. ABI-specific bindings and conversions stay inside the adapter; workers, aggregation, database workflows, and profile policy use host contracts.

Response Evidence Contract​

The pre-release WIT defines ordered response evidence independently from evaluator measurements. input.response-evidence is optional; absence must not be treated as an empty observed response. Messages contain ordered content parts, and tool calls and results retain explicit correlation identifiers. Completion status and stop reason are separate: a completed response can be a refusal.

The requirements export declares original-body, mapped-item, content-media-type, and tool evidence requirements. A successful HTTP invocation supplies its captured original body to the evaluator. Calls without captured bytes cannot satisfy an original-body requirement. Mapped requirements are checked against the atomic mapping result. Missing media types or tool evidence produce an explicit evaluator error. Mapping failure does not prevent an independent original-body evaluator from running. The sentiment example requires mapped text/plain message content and never substitutes the case prompt for a missing answer.

executor.read-resource(handle, offset, max-bytes) reads original bytes on demand. The host shares immutable allocations across evaluators and copies only the requested range into Wasm memory. Handles are authorized only within their evaluator invocation; a handle from another invocation is invalid. Store destruction releases the resource table on success, evaluator error, or trap. Live handles are never persisted. Their numeric values are not stable evidence and must not be used to derive evaluation scores.

A store with no resource table returns unavailable. A foreign handle returns invalid-handle; offset beyond EOF returns out-of-bounds; offset at EOF returns empty bytes. Zero or oversized reads, exhausted budgets, and expired resource deadlines return limit-exceeded.

Each invocation permits at most 64 resources and 4096 read calls, including failed and EOF reads. Each read requests at most 64 KiB. Total retained resource bytes are bounded by the configured Wasm memory ceiling; this is an additional host-side budget, separate from guest linear memory. Cumulative returned bytes are bounded by four times that ceiling. Repeated reads count again. Resource access also respects the configured evaluation timeout. Original capture stays ephemeral on this path; it does not establish durable replay availability.

Configuration schema, evidence schema, evaluator ABI, and application release versions are distinct. Exact schema identity checks reject unsupported versions; WIT hashes additionally bind the component shape. These pre-v1 contracts are subject to breaking changes. Source packages and fixtures use the same WIT source.