QIP Oracles

Compliance oracles are executable test assets packaged as Wasm. An oracle owns its memory, imports the small qip oracle bridge, and declares ordered cases: this input must render exactly these bytes, this input must trap, or this output must satisfy a procedural check.

You can use these oracles with qip comply against QIP Content components, or instantiate the same .wasm from JavaScript, Go, Rust, Python, or another host and route the oracle calls to a non-QIP implementation. The implementation does not need to be Wasm. It only needs an adapter that accepts input bytes and either returns output bytes or reports a trap-like failure.

curl -O https://qip.dev/oracles/luhn.comply.wasm
qip comply components/utf8/luhn.wasm --with luhn.comply.wasm
npx qipx comply components/utf8/luhn.wasm --with luhn.comply.wasm

For the bridge ABI and authoring rules, see qip comply.

General UTF-8 And Text Oracles #

OracleChecksDownloadSource
Preserve empty inputEmpty input renders as empty output.wasmwat
Preserve whitespaceCommon whitespace inputs pass through unchanged.wasmwat
Preserve ASCIIPrintable ASCII passes through unchanged.wasmwat
Reject invalid UTF-8A byte-to-UTF-8 validator rejects malformed sequences through commit.wasmwat
Reject non-ASCIIA byte-to-ASCII validator rejects the first byte above 0x7f through commit.wasmwat
Trap invalid UTF-8A component whose input precondition is valid UTF-8 traps when that precondition is broken.wasmwat
Trap empty inputEmpty input must trap. Useful for validators that require a value.wasmwat

Identifiers And Formatting #

OracleChecksDownloadSource
LuhnNormalized Luhn-valid values pass; invalid values reject.wasmwat
E.164 phone numbersPhone numbers normalize to E.164 form.wasmwat
ISO 4217 alpha to numericCurrency alphabetic codes map to numeric codes.wasmzig
en-US currencyLocale-specific currency formatting.wasmzig
en-IN currencyLocale-specific currency formatting.wasmzig
de-DE currencyLocale-specific currency formatting.wasmzig
fr-FR currencyLocale-specific currency formatting.wasmzig
ja-JP currencyLocale-specific currency formatting.wasmzig

Unicode And Markdown #

OracleChecksDownloadSource
Unicode 17 uppercaseDefault Unicode uppercase mappings.wasmzig
Unicode 17 lowercaseDefault Unicode lowercase mappings.wasmzig
Unicode 17 label casefoldLabel-safe Unicode case folding.wasmzig
CommonMark 0.31.2The 655 upstream CommonMark examples.wasmzig
GFM additionsGitHub Flavored Markdown behavior covered by local fixtures.wasmzig
CommonMark differential corpusMinimized Markdown inputs that catch renderer differences.wasmzig
HTML5 entitiesEntity decoding behavior inside rendered HTML.wasmzig

Documents, Images, And Web Formats #

OracleChecksDownloadSource
SVG to data URISVG bytes encode to a safe data URI form.wasmzig
Data URI to CSS URLData URIs wrap correctly for CSS url(...).wasmzig
Mermaid to Unicode HTMLStrict Mermaid subset renders to Unicode diagram HTML.wasmzig
JPEG to BMP B8G8R8A8 sRGBBaseline JPEG decodes to canonical 32-bit BGRA BMP.wasmzig
BMP B8G8R8A8 sRGB ICC to sRGB32-bit BGRA BMP color conversion contract.wasmzig
WARC connected search paramsWARC recipe behavior for connected search parameters.wasmzig

Syntax Highlighting #

These oracles check representative highlighted HTML output for language-specific syntax highlighters.

LanguageDownloadSource
Bashwasmzig
Cwasmzig
C#wasmzig
CSSwasmzig
Gowasmzig
HTMLwasmzig
Javawasmzig
JavaScriptwasmzig
Pythonwasmzig
Rubywasmzig
Swiftwasmzig
Wasm textwasmzig
Zigwasmzig