Visitor Web Router ABI v0

This document freezes the web-request-router ABI contract for Visitor Router v0.

Go implementation for this ABI contract lives under internal/routerabi.

Required Exports

All exports below are required and use Wasm i32 values for pointers, sizes, counts, and status codes.

Export nameKindSignature
memorymemorylinear memory
input_ptrfunction() -> i32
input_capfunction() -> i32
routefunction(path_size: i32, query_size: i32) -> i32
etag_ptrfunction() -> i32
etag_sizefunction() -> i32
content_type_ptrfunction() -> i32
content_type_sizefunction() -> i32
content_sha256_ptrfunction() -> i32
content_sha256_countfunction() -> i32
recipe_sha256_ptrfunction() -> i32
recipe_sha256_countfunction() -> i32
location_ptrfunction() -> i32
location_sizefunction() -> i32

Input Buffer Layout

At input_ptr:

Route Semantics

  1. Host calls status := route(path_size, query_size).
  2. If 300 <= status <= 399: response is a redirect and location_size > 0 is required.
  3. If status >= 400: response is an error.
  4. Otherwise: response body is resolved from content[] digests folded through recipes[] digests.

Host Invariants (Must Enforce)

The host must validate all exported pointer/size/count outputs before reading bytes:

Digest shape:

Reference Fixture

Reference fixture spec is in: