Commit Graph
19 Commits
Author SHA1 Message Date
Stefan 38d11a7934 chore: merge master into release/2.2 2026-11-23 19:15:55 +01:00
stefan-gorules 2a65cbde3d fix(engine): accept the string and reference trace modes again (#578) 2026-11-23 18:53:49 +01:00
stefan-gorules 3a25f4f5c3 feat: engine version (#574)
* feat(engine): select the engine with a version option

* ci: run the two feature sets as parallel jobs

* refactor(engine): drop the global compiled switch

* feat(engine): pin the clock through options instead of the environment

The __ZEN_MOCK_UTC_TIME variable and the ZEN_EXPRESSION_CONFIG lane flag are
gone. Isolate takes with_now and with_lane, and the interpreted engine now
honours the now option in expressions, so tests pass the instant explicitly.

* test(engine): count trace paths per thread and drop the trace test lock

* ci: run tests with nextest

* test(engine): share golden trace outcomes between variants
2026-11-21 20:09:14 +01:00
stefan-gorules 1944ebe01f fix: table analysis memory (#570)
* fix(engine): keep decision table analysis memory and time in proportion to the table

Schema queries no longer run table verification; graph table checks are deferred to diagnostics.

Gap search and unreachable-rule cover run on per-dimension bitsets when the table is small enough to index densely, and on the set-based path otherwise. Missing cases are merged on interned ids and rendered lazily.

Compression works on borrowed rows and interned cell ids, assigned once per round. Small string sets are held inline or as a sorted list instead of a tree.

Findings are unchanged: the previous implementations stay as test-only references and are compared on generated tables, and tests/table_scaling.rs bounds peak memory with a counting allocator.

* fix(nodejs): accept bytes and JSON text in Workspace setDocument, setPolicy and enhanceGraphTrace

Documents with more than one million JSON values were rejected by the object conversion limit, which a two-column decision table reaches at 250,000 rows. Buffers and strings are parsed directly, and objects are converted without that limit.

* ci: pin Rust to 1.99.0

Rust 1.100 passes one -L dependency directory per dependency, which pushes the rustc command for zen-engine past the Windows command-line limit when sccache spawns it (os error 206). Every workflow that installed stable now installs 1.99.0; miri stays on nightly.

* ci: pin the UniFFI native build to Rust 1.99.0

actions-rust-cross installs its own toolchain and defaults to stable, so the Windows and macOS UniFFI builds were still on 1.100.
2026-11-19 16:06:29 +01:00
stefan-gorules 96af373b62 fix(nodejs): accept ZenDecisionContent returned from the loader (#547)
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.
2026-10-13 17:55:09 +02:00
Ivan Miletic 20d88e398d fix: decision table verification and diagnostic (#537) 2026-10-02 12:20:06 +02:00
stefan-gorules ffdfd807d1 feat: implement slots instead of natural language (#527)
* 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
2026-09-28 21:47:40 +02:00
stefan-gorules 8d1910cc4e feat: graph workspace and static analysis (#483) 2026-07-16 23:42:13 +02:00
bojancrevar 740b0fd0bc dispose references removed 2025-09-12 15:25:02 +02:00
Stefan 0eca9ff071 switch to weak tsfn references 2025-09-09 17:25:46 +02:00
stefan-gorulesandbojancrevar 80fe4021c2 feat: compact trace (#384)
* feat: compact trace

* align with changes

* add deserialization

* add tests and deserializer

* fix bindings

* first draft

* mock time; update snapshots

* fix

* Node.js test fix

* fix merge

* fix utc override

* fix cross-env

* fix workflow

* fix

---------

Co-authored-by: bojancrevar <bojan.crevar@gorules.io>
2025-08-25 12:33:07 +02:00
bcrevar-gorulesandStefan 4a59f222db feat: add snapshot tests (#385)
* first draft

* mock time; update snapshots

* fix

* Node.js test fix

---------

Co-authored-by: Stefan <stefan@gorules.io>
2025-08-20 16:30:28 +02:00
stefan-gorules 0a4178156e tests: increase bindings coverage (#249)
* tests: increase bindings coverage

* fix spacing
2024-10-01 12:25:23 +02:00
stefan-gorulesandIvan Miletic 2a2d0d35d3 feat: add nodejs dispose function (#146)
* fix: add nodejs dispose function

* fix: readme

---------

Co-authored-by: Ivan Miletic <vnmiletic@gmail.com>
2024-04-11 17:43:34 +02:00
stefan-gorules 921caeb497 feat: improve nodejs bindings (#145) 2024-04-11 11:20:22 +02:00
stefan-gorules daecf901e6 feat: custom node (#138)
* feat: custom node

* add zen template, expose $nodes and $root

* add custom handler to go and nodejs

* add support for python, improve bindings, add error to zen template

* fix: correct binding exports for nodejs and python

* fix benchmark

* improve rust api, trim template in zen templates

* update cargo action

* update expression version

* compile action

* fix action format
2024-04-03 16:09:51 +02:00
stefan-gorules 1b0ff9f6f1 feat: expose expressions through bindings; (#86)
* feat: expose expressions through bindings;

* fix fmt
2023-09-14 16:07:55 +02:00
Ivan Miletic c5c518eeb5 feat: nodejs and python pipelines (#2)
feat: nodejs and python pipelines
2023-04-02 21:10:05 +02:00
Team GoRules 768175994b Initial commit 2023-03-29 22:14:37 +02:00