97 Commits
Author SHA1 Message Date
Ivan Miletic 20d88e398d fix: decision table verification and diagnostic (#537) 2026-10-02 12:20:06 +02:00
Ivan Miletic d076cab213 fix: prevent self-referencing $ in graph expression nodes from overflowing the stack (#535) 2026-09-30 19:51:46 +02:00
Ivan Miletic 35d3db620a fix: type hover on graph decision table output columns (#532) 2026-09-29 22:48:32 +02:00
stefan-gorules 39916c9d18 feat: date input (#529)
* feat: declared dates as date values

- graph format:date/date-time inputs and policy date properties arrive as
  dates that keep their original text for output, string() and string
  functions
- d() keeps the instant of offset/Z strings, resolves DST gaps and accepts
  ISO forms without offset, compact, slash-separated, YYYY-MM and YYYY
- dates compare with date strings in ==, !=, <, >, in and contains, and
  concatenate with strings; deprecated date helpers accept dates
- string(date), type() reports date, and date-to-string at string inputs

* fix: close review gaps in date inputs

- parse new date formats by exact shape; keep master formats first and
  guard DST-gap and extreme-year overflows
- text-carrying dates act as strings for object keys, in-object, index,
  slice, concatenation and bool
- deprecated helpers fall back to the date instant; time() accepts dates
- schema-less child inputs receive date text; dates satisfy string
  parameters and slicing in the type checker
- convert policy input before validation so dates are parsed once;
  share rewrite helpers between graph and policy conversion

* fix: align date text, unions, references and child inputs

- every valid date exposes a text form (original or RFC3339), so string
  functions and slicing on computed dates match the type checker
- date and string types merge to string; reference ids typed as dates
  resolve through their text
- input nodes convert declared dates and hand every other converted date
  back as its original text, following combinators only for structure
- date format checks no longer allocate
2026-09-29 09:59:44 +02:00
stefan-gorules 4aba11edd3 fix: tolerate null inputs and enforce required policy inputs (#528)
- 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
2026-09-28 22:51:47 +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 a7157f3448 fix: scope policy evaluation to the import closure (#525)
* fix: scope policy evaluation to the import closure

A policy is now analysed and evaluated together with the policies it
imports (transitively), instead of every policy connected to it by imports
in either direction. Importers and siblings no longer leak into each other:
compiled evaluate() of an imported policy used to run its importers' and
siblings' blocks.

- Evaluation gate analyses the entry's import closure as one unit, so a
  child may read fields and reference entities its importer declares when
  evaluated through that importer
- compile() reports a policy that is only valid through an importer with
  kind "policyImportOnly" instead of failing it as a plain "policy"; errors
  are computed once per key
- Scope diagnostics (duplicate writers, input overrides, data model and
  dictionary collisions, cycles) are reported for the whole closure, and
  conflicts introduced by combining imports are reported on the importer
- Single-entity scope checks run per import closure instead of workspace-wide

* fix: unknown import relationship targets and renames across imports

- An unresolved relationship/reference target inside an imported policy now
  blocks the importer's evaluation and compile(), as on master; the check was
  still limited to the policy being analysed, so the importer compiled and
  the broken child was reported as "policyImportOnly"
- Rename and find-references analyse each policy's expressions in every
  importer's context too, so reads of a field declared by an importer are
  found in the imported policy again
2026-09-28 12:17:12 +02:00
stefan-gorules e095189dd6 fix: return errors instead of panicking in memory loader and v1 functions (#524)
* fix: return errors instead of panicking in memory loader and v1 functions

- MemoryLoader recovers from a poisoned lock. Previously a panic during
  one add() (e.g. a failing content conversion) made every later
  add/get/remove/keys call panic for the rest of the process
- v1 function node returns an error when its JS bootstrap fails instead
  of unwrapping. The 500ms interrupt budget starts before the runtime and
  bundled libraries load, so a slow or loaded host could interrupt the
  bootstrap and panic

* chore: bump setup-android to v3 in uniffi workflow

Only platform-tools is installed; Gradle fetches the platform and build tools the AAR build needs.
2026-09-28 11:24:17 +02:00
stefan-gorules 0b6c6a709a fix: nested scopes and any cascade (#513) 2026-08-20 17:39:45 +02:00
stefan-gorules c615013a2d feat: graph dt column collect (#505) 2026-08-19 10:44:58 +02:00
stefan-gorules ed0c286d9f fix: v1 behaviour hardening (#502) 2026-08-07 10:30:43 +02:00
stefan-gorules fe43b4c1d7 perf: general performance improvements (#500)
* perf: general performance improvements

* remove unsafe usages, further improve perf

* perf: add table indexing
2026-08-04 11:12:37 +02:00
Ivan Miletic 7b4dc3cfbc fix: graph explain dot (#498) 2026-07-26 13:45:39 +02:00
Ivan Miletic 37d5e0baf7 fix: dt no cell defaults to true (#496) 2026-07-24 14:35:55 +02:00
stefan-gorules c3b9de695b feat: search capability (#494)
* feat: search capability

* reduce false fuzzy matches count
2026-07-22 16:23:40 +02:00
stefan-gorules 63b560c526 feat: workspace lints and type fixes (#492)
* feat: workspace lints and type fixes

* fix fmt
2026-07-22 11:17:49 +02:00
stefan-gorules e4c51b7dfc perf: improve workspace performance (#490)
* perf: improve workspace performance

* fix fmt
2026-07-21 22:19:59 +02:00
stefan-gorules 1818371c90 feat: implement new loaders across languages (#487) 2026-07-20 12:20:48 +02:00
stefan-gorules 8d1910cc4e feat: graph workspace and static analysis (#483) 2026-07-16 23:42:13 +02:00
stefan-gorules 9a11ae4f48 feat: policy table output type (#481) 2026-07-10 10:13:47 +02:00
stefan-gorules b4b59eb7c5 feat: policy dictionary (#479)
* feat: policy dictionary

* remove enum references

* improve tests

* reset index.js and package.json
2026-07-08 13:21:03 +02:00
stefan-gorules 6858c1bd04 feat: natural language (#477)
* feat: natural language

* fix cargo fmt
2026-07-07 13:12:46 +02:00
Aleksej Komnenovic 113b5de2ed fix wording in engine doc comment 2026-06-26 15:23:48 +02:00
stefan-gorules 6c0ca51354 feat: policy engine (#450)
* feat: policy engine

* fix: cargo fmt

* fix: resolve issues with miri
2026-06-23 18:51:47 +02:00
stefan-gorules 602d214b96 feat: expression static analysis (#449)
* feat: expression static analysis

* fix: cargo fmt

* fix: python workflow

* fix: python workflow

* fix: python workflow

* fix: ignore miri test bound by clock

* fix: memory leaks
2026-06-22 15:48:05 +02:00
bcrevar-gorules 63957b7010 fix(GRL-517): bump reqsign to 0.20 to drop vulnerable jsonwebtoken (#446)
* dep update

* lld fix

* lld fix 2

* lld fix 3

* lld fix 4

* lld fix 6

* lld fix 7

* lld fix 8

* lld fix 9

* lld fix 10
2026-05-29 14:16:48 +02:00
stefan-gorules 6beecb423f fix: simplify compilation (#429)
* fix: simplify compilation

* improve opcodecache structure
2026-02-11 16:07:34 +01:00
stefan-gorules f054aa876c fix: omit reserved properties in fn return (#417) 2025-11-24 12:44:32 +01:00
stefan-gorules 070a7567db fix: improve fn performance (#416)
* fix: improve fn performance

* micro optimisations
2025-11-21 21:15:24 +01:00
bcrevar-gorulesandStefan 7bfebd90fe feat: precompile decision content (#401)
* precompile first

* test

* add Opcode cache through Option<T>

* Compiled support for decisionTable,
default compile of new DecisionContent for node.js and py bindings

* format

* DecisionContent refactored to model module

* fmt

* added back BaseDecisionContent

* tests and benchmark

---------

Co-authored-by: Stefan <stefan@gorules.io>
2025-11-21 14:44:24 +01:00
bcrevar-gorules 8ebc344603 fix: DecisionLoader and downcast trait (#414) 2025-11-21 12:49:21 +01:00
stefan-gorules 1e34717c49 fix: function node serde (#412) 2025-11-20 10:16:28 +01:00
stefan-gorules de25f98a7f fix: improve fn variable conversion performance (#410) 2025-11-19 13:38:29 +01:00
stefan-gorules a6ad0a7894 fix: clean variable before validation (#409)
* fix: clean variable before validation

* bump workflow to macos-14

* move to macos latest

* update runners

* improve performance of implementation
2025-11-19 11:59:51 +01:00
stefan-gorulesandIvan Miletic 922a262e98 feat: wasm support (#404)
* feat: wasm support

* add http callback

* streamline structs

* fix: wasm workflow

* fix: wasi path

* fix: wasm

* fix: wasm path

* fix: clang dev

* fix: libclang static

* fix: build

* fix: node

* fix: wasm

* fix: wasm wasi

* fix: npm dirs

* fix: node workflow

* fix: testing

* fix: test

* update version

* fix: targets

* fix: wasm fix

* fix: commit files

---------

Co-authored-by: Ivan Miletic <vnmiletic@gmail.com>
2025-11-13 12:36:59 +01:00
stefan-gorules 07040c8a96 feat: lazy load fn nodes (#389)
* feat: lazy load fn nodes

* fix rebase, fix $nodes

* fix

* miri ignore test
2025-11-07 10:53:21 +01:00
stefan-gorules 013c1312f8 feat: http auth (#393)
* temp: http auth

* add better error handling

* improve Cargo.toml format

* add enable/disable for http auth

* make aws region optional

* add fallback for aws
2025-09-11 09:58:16 +02:00
stefan-gorules 91509821be feat: refactor engine (#390)
* temp: refactor engine

* temp

* implement remaining nodes

* resolve snapshot tests

* improve decision graph implementation

* implement changes in bindings

* implement changes in bindings

* fix function impl gaps

* update cargo.toml

* fix issues with trace
2025-09-04 18:54:32 +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
bojancrevar 8cdafa62a8 Check for null config.data value in http module 2025-07-23 15:15:29 +02:00
stefan-gorules 30b8396f3b feat: function omit nodes (#370) 2025-07-03 09:28:22 +02:00
stefan-gorules 21a1238efd fix: reference in evaluation (#363) 2025-06-18 10:42:34 +02:00
stefan-gorules f36974a8d6 feat: configurable function timeout (#367) 2025-06-18 10:39:53 +02:00
stefan-gorules de6d13e1c7 feat: date v2 (#345)
* feat: date v2

* implement more date functions

* improve type safety

* add more methods for dates

* update utc to tz and add support

* add unary node behaviour for date methods

* add tests; fix errors in bindings

* add date operators

* fix types

* change set date signature

* update nightly
2025-05-12 22:39:08 +02:00
stefan-gorules 737b9d9b69 fix: resolve root stackoverflow in expression node (#338) 2025-04-24 11:59:54 +02:00
stefan-gorules e10412c2b1 fix: improve trace (#333) 2025-04-14 12:37:07 +02:00
stefan-gorules d6f52f29c5 fix: node cache collision (#295)
* fix: node cache collision

* bump graph
2024-12-31 15:10:15 +01:00
stefan-gorules 2b73856d55 feat: schema validation (#267)
* feat: schema validation

* fix prettier

* update implementation

* add test cases

* change validator to string

* update tests
2024-12-25 13:00:04 +01:00
stefan-gorules ba288db541 fix: nested graph reset (#292) 2024-12-11 14:11:27 +01:00