* perf(engine): run graph expressions and tables typed on the columnar path
Lower most expression and table shapes found in graphs to typed programs:
fallible membership, mixed-type equality, computed table fields, collect
tables and first-hit collect columns, number() and type(), objects and
arrays produced by expressions, index access, split text, member chains
on computed values, list literals written by tables, and fields of
unknown shape or object lists written by earlier nodes.
Fix the typed results that differed from version 1 along the way:
errors kept through contains, filters, bool() and `?? []`, missing text
against missing dates, fractional division, set items written earlier in
the node, oversized list indexes.
* perf(engine): choose typed plans without timing and run them per distinct key
Replace timing-based path choice with static rules for graphs and
policies, so the same input always takes the same path. Run typed units
once per distinct key with constant key parts left out, re-run one row
per key when a deduplicated unit fails, fall back to the lane when a
64-row sample fails typed, and stop key sampling early on distinct data.
Add faster kernels for numeric ranges, text classes, mixed-scale
comparisons, bool folds, rounding, ASCII trim, legacy date text, wide
decimals between nodes and table choice masks.
* perf(engine): keep policy rows on the columnar path
Validate date columns, dictionary properties and nested lists by column,
delegate a refused block for its own rows instead of sharing every row,
keep blocks whose lazy reads have no writers in one step, run declared
date inputs and strict tables with empty output cells typed, and resolve
references to a pool by columns.
Rows whose delegated block fails are re-run on the row engine, and a
resolved reference stays missing where its key is missing. Rows are
shared again by a static rule when most member blocks would be
delegated.
* feat(expression): borrow Arrow Decimal128 and temporal buffers as columns
Add Values::Decimal128 and Values::Temporal (date32, date64, timestamp,
time32, time64) so Arrow buffers can be handed over without copying.
Values behave exactly like the same data given as decimals or ISO text.
* perf(engine): convert float and date columns once
Convert f64 columns to decimals without printing them, through the new
Values::Float64. Read declared policy dates once per distinct text with
the version 2 parser, type declared date fields of list items, parse
timestamps without a zone on the fast path, and render foreign columns
only when a graph reads them.
* perf(engine): validate and convert policy lists by field
Convert declared dates of entity lists once per field and only when
first read, validate list columns field by field, keep policy columns
when every re-run row fails, and run member blocks that read their own
or another list typed.
* perf(engine): run policy relationships and date methods typed
Run blocks on a single relationship as root blocks under the
relationship's path, keeping version 1's required-input errors for
every goal set. Resolve lists of references onto the pool's columns.
Run date methods with fixed units as typed kernels and share one parse
per date text between validation and typed programs.
* perf(engine): run policy tables typed and cut per-row validation
Run strict collect tables and collect tables with first-hit outputs as
typed units, read optional fields that mix values with nulls as typed
columns, keep selects whose cells read already demanded fields in one
segment, lower powers with computed integer exponents, run membership
in another list of the row typed, and keep lifted declared dates typed.
Validate enums and primitive arrays without the row validator, shred
lists without copying their items, and remember settled selects and
table typability per plan.
* perf(engine): build objects and read validity without converting columns
Build objects from dictionary columns with one shared value per code
and read the validity of float columns without converting them, which
removes the regressions float columns had introduced on graphs that
write coded text or never read a float input.
* style(engine): format with cargo fmt
* feat(engine): compiled engine for columnar graphs and policies
New engine for decisions and policies built on the lane VM: a compiled
graph plan that evaluates batches column-wise (typed kernels where
expressions allow, lane programs otherwise), a row runner for batch and
single-row evaluation, and a compiled policy runtime with a columnar pass.
- Decision::evaluate_columns / Workspace::evaluate_columns return one
ColumnarOutput type; diagnostics live in zen_engine::diagnostics
- rows the plan cannot finish are deferred to the row runner and never
re-run nodes; sub-decisions run inside the parent plan; date input
schemas stay on the plan
- DecisionEngine keeps compiled graphs, sub-decisions and policies per key
while the loader returns the same content
- failed $dictionary imports are retried, not cached
- the old engine stays available behind the driver feature for
comparisons; there is no fallback to it
- benchmark harness (tests/bench_matrix.rs) comparing old and new across
the spec corpus, fixtures and policies
* refactor(engine): isolate compiled engine from release node and graph code
Release code outside core/engine/src/compiled is restored to release/2.2.
The compiled engine keeps its own copy of the node, graph and JS function
implementation under compiled/host and reaches release only through types
and pure helpers. Release files gain only additive hooks: the
ZEN_CONFIG.compiled runtime flag (off by default), per-instance
interpreted()/compiled_engine() on Decision, DecisionEngine and
PolicyWorkspace, and the batch and columnar entry points.
- the driver feature and the modified old engine are removed; tests compare
the compiled engine against the unmodified release engine
- compiled-only behaviour (#7 empty collect columns, #16 collect order,
BC1 thrown-object message) is allowlisted in the comparisons
- #14 (policy whitespace cells) is dropped: release analysis rejects it
- goldens re-recorded from the release engine
- spec 42 nested-chain case lowered to depth 200: the release engine's JS
conversion overflows a 2 MB debug thread at depth 500
* fix(engine): keep interpreted engines interpreted and tighten engine comparisons
- DecisionEngine::interpreted() now holds while ZEN_CONFIG.compiled is on:
decisions it creates (get_decision, create_decision, evaluation) carry its
engine, and its release path runs in an interpreting scope so the
Workspace built by the lazy policy path stays interpreted too
- policy batches (DecisionEngine and PolicyWorkspace) deep-copy their inputs
like graph batches, so callers' contexts are no longer written into
- release test files run on the release engine again: the compiled-by-default
ctor moved out of tests/support into tests/compiled_default, included only
by the compiled test suites
- spec `engines` notes are structured ({modes, intended, why}); unlisted modes
are still compared with the reference, intended modes are checked against
the spec, and open differences fail once they match the reference again.
Stale notes found this way were removed; golden skips are per mode, and
generated rows no longer inherit the first case's note
* fix(engine): platform-independent spec suite ids and rustfmt
- spec suite file paths are joined with '/', so suite ids and golden keys
match on Windows (backslash paths missed every recorded golden)
- engine spec json5 files are checked out with LF line endings
- cargo fmt
* 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
* 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