@visiq/core-wasm
v0.1.3
Published
VisIQ governance core (visiq-core-rs) compiled to WASM — the ONE Rust evaluation core, bound to JS. Same core the Go/Java/Ruby/Python SDKs use. evaluate(eventJson, bundleJson) -> decisionJson.
Downloads
4,315
Maintainers
Readme
@visiq/core-wasm
The VisIQ governance evaluation core (experiments/matrix-v2/visiq-core-rs, the ONE
compiled Rust engine) exposed to JavaScript/TypeScript via WebAssembly — so the TS SDK
evaluates through the same core the Go / Java / Ruby / Python bindings use, instead
of a parallel TS implementation that can drift.
const { evaluate } = require('@visiq/core-wasm');
const decisionJson = evaluate(JSON.stringify(event), JSON.stringify(bundle));- Synchronous, no async init.
--target nodejsglue instantiates the wasm from bytes atrequiretime (new WebAssembly.Module/Instance) — a drop-in for a sync call. (Node/server only; a browser build would need--target web+ async init.) evaluate(eventJson, bundleJson) → decisionJsonis the language-neutral seam (evaluate_jsonin the core). Fail-closed (G001) on malformed input — never throws.- Faithful.
node conformance.mjsproves it reproduces the frozen golden corpus (sdk-corpus/GOLDEN-oracle-vectors.json) — the same vectors every other binding reproduces. 85/85, 0 diverge.
Rebuild
./build.sh (needs rustup + wasm32-unknown-unknown + wasm-bindgen-cli =0.2.100;
the crate pins wasm-bindgen = "=0.2.100" so CLI/schema versions match).
Scope / what this is NOT
This emits the decision tuple {decision, allowed, action:{decision,argRedactionRules},
retrieval:{action,redactionRules}}. It does not emit rule attribution (ruleCode,
reason prose, decisionId) — those are out-of-core (#25) and still computed in TS. A
full @visiq/harness cutover to this core therefore needs the core extended to return
matched-rule attribution; until then this package is the proven, corpus-gated binding.
See experiments/matrix-v2/visiq-core-rs/PARITY-GAPS.md.
