@visiq/core-wasm 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -11
- package/package.json +2 -2
- package/pkg/visiq_core_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -7,28 +7,38 @@ of a parallel TS implementation that can drift.
|
|
|
7
7
|
|
|
8
8
|
```js
|
|
9
9
|
const { evaluate } = require('@visiq/core-wasm');
|
|
10
|
-
|
|
10
|
+
// PLAIN OBJECTS IN, PLAIN OBJECT OUT — `evaluate` does the JSON marshalling
|
|
11
|
+
// itself. Do NOT pre-stringify: `evaluate(JSON.stringify(event), …)` double-
|
|
12
|
+
// encodes, the core sees a JSON *string* where an object belongs, and the
|
|
13
|
+
// decision comes back with `allowed: true` for an event policy DENIES.
|
|
14
|
+
const decision = evaluate(event, bundle);
|
|
15
|
+
if (!decision.allowed) {
|
|
16
|
+
// blocked by policy — do not execute the tool call
|
|
17
|
+
}
|
|
11
18
|
```
|
|
12
19
|
|
|
13
20
|
- **Synchronous, no async init.** `--target nodejs` glue instantiates the wasm from bytes
|
|
14
21
|
at `require` time (`new WebAssembly.Module`/`Instance`) — a drop-in for a sync call.
|
|
15
22
|
(Node/server only; a browser build would need `--target web` + async init.)
|
|
16
|
-
- **`evaluate(
|
|
17
|
-
|
|
23
|
+
- **`evaluate(event, bundle) → decision`** takes and returns plain objects; the
|
|
24
|
+
language-neutral seam underneath is `evaluate_json` (JSON string in, JSON string out),
|
|
25
|
+
and this package's wrapper is what stringifies/parses around it. Fail-closed (G001) on
|
|
26
|
+
malformed input — never throws.
|
|
18
27
|
- **Faithful.** `node conformance.mjs` proves it reproduces the frozen golden corpus
|
|
19
28
|
(`sdk-corpus/GOLDEN-oracle-vectors.json`) — the same vectors every other binding
|
|
20
|
-
reproduces. **
|
|
29
|
+
reproduces. **118/118, 0 diverge.**
|
|
21
30
|
|
|
22
31
|
## Rebuild
|
|
23
32
|
|
|
24
33
|
`./build.sh` (needs rustup + `wasm32-unknown-unknown` + `wasm-bindgen-cli` **=0.2.100**;
|
|
25
34
|
the crate pins `wasm-bindgen = "=0.2.100"` so CLI/schema versions match).
|
|
26
35
|
|
|
27
|
-
## Scope
|
|
36
|
+
## Scope
|
|
28
37
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
`reason` prose,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
`evaluate` returns the full decision object — `{decision, allowed, reason, ruleId,
|
|
39
|
+
ruleCode, enforced, agentMode, action:{decision,argRedactionRules},
|
|
40
|
+
retrieval:{action,redactionRules}}`. Matched-rule attribution (`reason` prose,
|
|
41
|
+
`ruleId`, `ruleCode`) IS emitted in-core; `decisionId` is not — it is minted by the
|
|
42
|
+
caller. `@visiq/runtime` declares this package a REQUIRED dependency and calls it the
|
|
43
|
+
sole decision engine, so the harness cutover is done, not pending. Remaining seams are
|
|
44
|
+
tracked in `experiments/matrix-v2/visiq-core-rs/PARITY-GAPS.md`.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visiq/core-wasm",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "VisIQ governance core
|
|
3
|
+
"version": "0.1.7",
|
|
4
|
+
"description": "VisIQ governance core for Node.js — the one compiled Rust rule engine behind every VisIQ SDK, prebuilt to WebAssembly; evaluate(event, bundle) takes plain objects and synchronously returns a decision object.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"types": "index.d.ts",
|
package/pkg/visiq_core_bg.wasm
CHANGED
|
Binary file
|