* feat(expression): lane VM and typed-mask engine for batch and columnar evaluation Adds a register-based lane VM (core/expression/src/lane) and a typed-mask engine (core/expression/src/typed) that evaluate ZEN expressions over batches and columns, matching the stack VM's results. zen-types gains shape-backed objects and dot-path helpers; existing public APIs only grow. The lane VM has no expression size limit: deep and wide expressions are compiled and run with the same stack growth the parser uses. ZEN_EXPRESSION_CONFIG.lane (off by default) switches Isolate::run_standard and run_unary to the lane VM at runtime. Lane internals and the typed module are doc(hidden); the documented entry points are LaneProgram, LaneRunner, Session, Columns and Output. Includes an executable specification of the expression language (core/expression/tests/spec, 28,852 cases) with differential tests that run every lane path against the stack VM. zen-expression and zen-types now declare rust-version 1.88. * refactor(types): remove the shape transition cap Shapes are freed when nothing uses them, so the 4,096-children cap per shape no longer bounds memory. Shape::with, Shape::of and Shape::without now always return a shape; objects only switch to a hash map past SPILL_AT keys, as on master. * fix(expression): debug-profile stack safety and Windows test build CI runs tests in the debug profile, where frames are larger and tail recursion is not optimised. Recursive lane, typed and parser helpers now grow the stack like the rest (Const::number, the kernel builder, typed lowering and lookup, lane compile helpers, Node::member_key). The parser's closure depth counter is u32 instead of u8, so 256 nested closures no longer wrap. median([]) and empty templates no longer overflow in debug builds; release results are unchanged. The deep/wide test runs on a 256 KiB stack so unprotected recursion fails quickly in any profile. The conformance helper compares with as_str(), which is unambiguous on Windows. * fix(expression): stack checks in the lane executor, LF test data on Windows In x86-64 debug builds Executor::cold has a ~93 KB frame, so nested closures (execute -> cold -> body) could use more stack between two checks than the stack-growth margin and overflow. execute and cold now check the stack themselves; both run per instruction batch, not per row. The expression test data is checked out with LF on every platform. Windows runners converted it to CRLF, which broke multi-line spec cases.
ZEN Engine
Business logic humans can read and machines can run. One copy of your rules: the owner reads it, every system runs it.
ZEN Engine is a cross-platform, open-source Business Rules Engine (BRE) written in Rust, with native bindings for Node.js, Python, Go, Java, Kotlin and .NET, plus iOS and Android packages. Decisions evaluate in microseconds, run identically on every platform, and are stored as portable JSON. Loading the JSON is up to you: file system, database or service call.
Try it in the free Online Editor with a built-in simulator, or embed the open-source React JDM Editor in your own product.
Rules that read like sentences
Conditions are written the way the business says them, in the ZEN Expression Language. The developer view is one toggle away, and the two can never drift apart: there is only one source of truth, and this engine runs it.
Rules as graphs, or as documents
Model a decision on a visual canvas of decision tables, switches, expressions, functions and reusable sub-decisions. Or write it as a policy document with prose, typed data models and tables. Both compile to the same engine and return the same answers.
To go deeper on the decision model and each node type, see the JDM documentation and the ZEN Expression Language reference.
What's new in 2.0
Version 2.0 is the first stable release of the new engine line:
- Policy documents: model decisions as readable documents with typed data models, expressions, decision tables, match blocks and assertions. Policies compile to the same engine as graphs and return the same answers.
- Workspace analysis: static type checking across policies and graphs. Type flow, exhaustiveness checking, write-conflict detection and precise diagnostics, all available before anything runs.
- Per-column collect: decision table output columns can collect across all matching rows (
tags[]) while the rest of the table stays first-match. - Pre-compiled engine: decisions are parsed and compiled once at load; evaluation is allocation-light and repeat-safe.
- Hardened runtime: out-of-range numbers, arithmetic overflow and malformed inputs return errors or nulls instead of crashing the process.
- Unified bindings: configurable loaders, batch evaluation and consistent error envelopes across Node.js, Python, Go and FFI consumers.
Important
Migrating from 0.x (Rust crates):
arbitrary_precisionis no longer enabled by default in zen-engine, zen-expression, zen-types and zen-tmpl. If you rely on arbitrary-precision number handling, addfeatures = ["arbitrary_precision"]to your dependency. Bindings (Node.js, Python, C, UniFFI) are unaffected, they opt in automatically.
Quickstart
Rust
[dependencies]
zen-engine = "2"
use serde_json::json;
use std::sync::Arc;
use zen_engine::model::DecisionContent;
use zen_engine::DecisionEngine;
async fn evaluate() {
let decision_content: DecisionContent =
serde_json::from_str(include_str!("jdm_graph.json")).unwrap();
let engine = DecisionEngine::default();
let decision = engine.create_decision(Arc::new(decision_content)).unwrap();
let result = decision.evaluate(json!({ "input": 12 }).into()).await;
}
Node.js
npm i @gorules/zen-engine
import { ZenEngine } from '@gorules/zen-engine';
import fs from 'fs/promises';
const content = await fs.readFile('./jdm_graph.json');
const engine = new ZenEngine();
const decision = engine.createDecision(content);
const result = await decision.evaluate({ input: 15 });
Python
pip install zen-engine
import zen
with open("./jdm_graph.json", "r") as f:
content = f.read()
engine = zen.ZenEngine()
decision = engine.create_decision(content)
result = decision.evaluate({"input": 15})
Full guides, including loaders for multi-decision graphs and batch evaluation:
- Node.js - GitHub | Documentation | npmjs
- Python - GitHub | Documentation | pypi
- Go - GitHub | Documentation
- Java / Kotlin - GitHub | Maven Central
- .NET - GitHub | NuGet
- Rust (Core) - GitHub | Documentation | crates.io
The GoRules platform
The engine is open at the core; GoRules is the platform around it. Managed cloud, self-hosted, or embedded with no network hop. SOC 2 Type II.
AI that builds rules, and stays reviewable
An AI copilot and MCP server that edits rules, runs tests and explains decisions. It never deploys. Releases stay with your reviewers.
Promote like a release, run like a binary
A release moves from testing to staging to production untouched. Approvals, instant rollback, and a paper trail for every change.
Prove it before it ships
Scenario suites run on every change, coverage is measured against decision paths, and every answer comes with a replayable trace.
Support matrix
| Arch | Rust | Node.js | Python | Go | Java / Kotlin | .NET |
|---|---|---|---|---|---|---|
| linux-x64-gnu | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| linux-arm64-gnu | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| darwin-x64 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| darwin-arm64 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| win32-x64-msvc | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| linux-x64-musl | ✔️ | ✔️ | ❌ | ❌ | ❌ | ❌ |
| linux-arm64-musl | ✔️ | ✔️ | ❌ | ❌ | ❌ | ❌ |
| linux-s390x | ✔️ | ❌ | ❌ | ❌ | ✔️ | ❌ |
| wasm32 (WASI) | ✔️ | ✔️ | ❌ | ❌ | ❌ | ❌ |
Mobile: Swift (iOS XCFramework) and Android (AAR) packages are published from the same core via UniFFI.
Contribution
The JDM standard is growing and we need to keep tight control over its development and roadmap, as a number of companies use GoRules ZEN Engine and GoRules BRMS. For this reason we can't accept code contributions at this moment, apart from help with documentation and additional tests.