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 #
| Oracle | Checks | Download | Source |
| Preserve empty input | Empty input renders as empty output. | wasm | wat |
| Preserve whitespace | Common whitespace inputs pass through unchanged. | wasm | wat |
| Preserve ASCII | Printable ASCII passes through unchanged. | wasm | wat |
| Reject invalid UTF-8 | A byte-to-UTF-8 validator rejects malformed sequences through commit. | wasm | wat |
| Reject non-ASCII | A byte-to-ASCII validator rejects the first byte above 0x7f through commit. | wasm | wat |
| Trap invalid UTF-8 | A component whose input precondition is valid UTF-8 traps when that precondition is broken. | wasm | wat |
| Trap empty input | Empty input must trap. Useful for validators that require a value. | wasm | wat |
| Oracle | Checks | Download | Source |
| Luhn | Normalized Luhn-valid values pass; invalid values reject. | wasm | wat |
| E.164 phone numbers | Phone numbers normalize to E.164 form. | wasm | wat |
| ISO 4217 alpha to numeric | Currency alphabetic codes map to numeric codes. | wasm | zig |
| en-US currency | Locale-specific currency formatting. | wasm | zig |
| en-IN currency | Locale-specific currency formatting. | wasm | zig |
| de-DE currency | Locale-specific currency formatting. | wasm | zig |
| fr-FR currency | Locale-specific currency formatting. | wasm | zig |
| ja-JP currency | Locale-specific currency formatting. | wasm | zig |
Unicode And Markdown #
| Oracle | Checks | Download | Source |
| Unicode 17 uppercase | Default Unicode uppercase mappings. | wasm | zig |
| Unicode 17 lowercase | Default Unicode lowercase mappings. | wasm | zig |
| Unicode 17 label casefold | Label-safe Unicode case folding. | wasm | zig |
| CommonMark 0.31.2 | The 655 upstream CommonMark examples. | wasm | zig |
| GFM additions | GitHub Flavored Markdown behavior covered by local fixtures. | wasm | zig |
| CommonMark differential corpus | Minimized Markdown inputs that catch renderer differences. | wasm | zig |
| HTML5 entities | Entity decoding behavior inside rendered HTML. | wasm | zig |
| Oracle | Checks | Download | Source |
| SVG to data URI | SVG bytes encode to a safe data URI form. | wasm | zig |
| Data URI to CSS URL | Data URIs wrap correctly for CSS url(...). | wasm | zig |
| Mermaid to Unicode HTML | Strict Mermaid subset renders to Unicode diagram HTML. | wasm | zig |
| JPEG to BMP B8G8R8A8 sRGB | Baseline JPEG decodes to canonical 32-bit BGRA BMP. | wasm | zig |
| BMP B8G8R8A8 sRGB ICC to sRGB | 32-bit BGRA BMP color conversion contract. | wasm | zig |
| WARC connected search params | WARC recipe behavior for connected search parameters. | wasm | zig |
Syntax Highlighting #
These oracles check representative highlighted HTML output for language-specific
syntax highlighters.