redact walks each pointer through the document schema and refuses, with a
TraceError, a pointer that does not name a value position (user data such
as node inputs and outputs, results values, rule cells and references,
logs, details, step values, writes, stored operands, verbatim traces).
Readers refuse $redacted and $omitted markers in structural positions with
an error naming the place, treat $literal as opaque everywhere and keyed
maps' $-keys as ids. Lenient restore no longer fails on a loop expression
whose items list was redacted away or on a collected table field whose
write was redacted. redact keeps the opaque context verbatim.
The Node graph response's trace is ZenEngineResponseTrace | null, where
ZenEngineResponseTrace = ZenTraceV1 | ZenLegacyGraphTrace | PolicyTrace and
the legacy members have no version, so trace.version === 1 narrows to
ZenTraceV1.
Compiled engine only; the interpreted engine keeps legacy traces. The
interpreted graph, policy and function code is unchanged from
release/2.2: asked for a trace (true, v1 or legacy) it returns its
legacy trace, never converts to v1, and ignores now, timezone and seed.
- trace format v1 inside the engine (compiled/trace), public as
zen_engine::trace: convert (legacy to v1), restore (v1 to legacy),
inspect and redact, with the native encoder and policy writer, and
TraceFormat, TraceDocument, PolicyTrace and TraceBatch; no separate
crate
- TraceFormat option (off, v1, legacy) replacing EvaluationTraceKind on
every evaluation path; on the compiled engine legacy traces are
restored from v1
- native TraceCollector for single-row, batch and columnar evaluation:
a static template per compiled graph and typed facts pushed by the
engine (rule hits, switch branches, expression results, sub-decision
and loop levels), written as v1 without a legacy map
- native policy writer for executions, members, reads, writes and
absence markers
- engine glue under compiled/ (compiled/trace/mod.rs,
compiled/pinning.rs); workspace request, result and error types take
the trace format and the policy trace as type parameters defaulting
to the legacy types, with public aliases for TraceFormat and
PolicyTrace; the response trace enum gains V1 and its policy variant
holds a PolicyTrace
- pinned evaluation context on the compiled engine: now, timezone and
seed options, one clock read per evaluation and per batch, per-row
random streams (row i draws from row_seed(seed, i)) in every batch and
columnar path, Date and Math.random pinned in compiled function nodes;
evaluatedAt, timezone and seed in the envelope
- format additions: result rows for repeated keys, $redacted and
$omitted with truncated, reserved context, requires flags
- now, timezone, seed and trace format options in the Node, Python, C
and uniffi bindings
- golden tests: compiled v1 and legacy restore to the base traces for
every spec case, interpreted variants return legacy traces equal to
the base for any trace option, native and convert agree, batch and
columnar rows equal single rows, timing stress, pinned and
random-stream tests, and the interpreted engine ignores pinning;
trace API, damaged-input, POC fixture (tests/fixtures/trace) and
corpus tests, and the trace_corpus example for the POC cross-check
napi 3.14 decodes a class reference only inside a native borrow scope, which a resolved loader promise does not have, so every loader returning ZenDecisionContent failed with "Value is none of these types". Decode the loader result into LoadedDecision, which copies the content Arc while the JS object is alive and keeps buffers for parsing off the JS thread.
* build(nodejs): declare the wasm32-wasip1 package as an optional dependency
cli 3.10 drops WASI packages from the root optionalDependencies when native targets exist, which would leave browser.js importing an uninstalled package. Ignore and clear the root facades pre-publish now generates.
* build(nodejs): keep the root package free of the threadless wasm facade
napi prepublish copies the 15.6MB wasm into the root package and rewrites files and exports for workerd consumers. Run it through prepublish.mjs, which keeps its optionalDependencies but restores files and exports and removes the generated root files, so the root tarball is back to ~20kB.
* feat(nodejs): replace the threaded wasm build with threadless wasm32-wasip1
The browser binding no longer needs SharedArrayBuffer or cross-origin isolation. napi moves to 3.14 / cli 3.10.8 with emnapi 2.0.0-alpha.6; the wasm build registers napi-async-runtime's current-thread backend and spawns each evaluation as a runtime task. console.sleep goes through a sleep provider so the wasm build waits on the host timer instead of tokio. CI and the Makefile build and publish @gorules/zen-engine-wasm32-wasip1 in place of the threaded package.
* ci(nodejs): test the wasm32-wasip1 binding and load test binaries in place
cli 3.10 rejects napi artifacts when any configured target is missing, so test jobs download their binary next to index.js instead of building npm dirs. A wasm test job runs the suite against the threadless binding and gates the release.
* chore(nodejs): stop tracking generated wasip1 loaders
napi build writes them alongside the wasm and CI ships them through the wasm artifact, like index.d.ts.
* ci(nodejs): build the glibc legs with cargo zigbuild directly
cli 3.10 runs cargo metadata with the requested target, which rejects the zigbuild glibc suffix. Matches the go and uniffi workflows.
* build(nodejs): keep dev dependencies installable on node 20
@octokit/request 10.0.16 (via @napi-rs/cli) pulls content-type 3, which requires node 22; pin the cli's copy to 10.0.14.
- graph input and output validation treats null optional properties as
absent (including inside anyOf/oneOf objects) and reports the real
error when validation still fails
- remove the NULLABILITY_DIVERGENCE diagnostic
- policies enforce required inputs also without goals; a path is missing
when absent or null unless a step along it is optional, checked after
reference hydration, and computed entity fields are not inputs
* feat: implement slots instead of natural language
Replace the natural-language projection (`nl`) with engine-owned slot
completion: for a cursor position the engine classifies the slot being
edited (operand, operator, literal, member access, ...) and returns typed
options, literal facts and the expected type, for policies and graphs.
- zen-expression: new `slot` module (classification, literals, operators)
and a lenient lexer mode for incomplete input; `nl` removed
- Intellisense: typed diagnostic codes with arguments, richer inspect for
hover, dedicated parser error variants (messages unchanged)
- Engine: `Workspace::cursor_scope`, `slot`, `facts`; `rename_from` and
`references_from`; editor spans in UTF-16 units; renames reach imported
policies, `$nodes` reads, child graphs and output column heads; no `$root`
completion in policies
- Node bindings: `slot`, `facts`, `cursorScope`, `slotBatch` replace
`nl`, `nlTokenize`, `nlEncodeString`, `nlTokenizeBatch`
No change to expression evaluation: the VM, compiler, functions and the
default lexer path are untouched, and parser error messages keep their text.
* fix: harden slot classification, scopes and graph expectations
- restore master execution order; slot scopes hide writes of the edited
block and its dependents instead of relying on block ranking
- token-start editing gated by slot state; operator, list and operand
spans no longer splice into neighbouring tokens
- interval-aware bracket pairing for half-open and reversed intervals
- lenient lexer recovers from unknown characters (slots only)
- graph expected type follows switch and pass-through nodes and merges
compatible output schemas
- sibling inference caps distinct values and analyses lazily
- deterministic overload return type display
* fix: order policy blocks by entity reads through closures and relationships
- record reads for `#.field` in closures so entity fields read through
lists become dependencies
- link reads through derived lists (filter/map results) to the entity
fields they carry and order the list after those fields
- evaluate entity blocks on single relationships, and demand entity
paths for plain reads through relationships
- slot scopes keep the top-level variable when hiding written fields