* 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
* fix(expression): copy values that read the node's own output on the compiled path
* fix(expression): match a date against every text cell naming it
* test(engine): cover the fixed version differences on every evaluation path
* fix(engine): keep the table index and compiled plan off tables whose cells read the last tested value
* fix(engine): give batch rows the node values and replaced fields a single row sees
* test(engine): cover the batch and table differences on every evaluation path
* fix(engine): read declared date inputs in the evaluation's time zone
* fix(engine): keep script dates right beyond 2099, at extreme years and for object arguments
* fix(engine): name script modules alike on every traced batch row
* fix(expression): keep typed batch results and errors equal to the row engine
* fix(engine): keep loop items, traced table fields and batch node values equal to version 1
* fix(engine): record table references in batch traces when a rule has a description
* fix(nodejs): convert decision results, policy traces and handler values without aborting on large integers
* fix(nodejs): reject fractional engine versions
* test(engine): cover null leaves in multi-row batches
* fix(engine): keep a null written under a missing or scalar parent in multi-row batches
A layer over an upstream patched shape treated every null leaf as absent,
so obj.a = null over a row without obj (or with obj = 1) never created
{obj: {a: null}} for downstream reads, and an all-null column was dropped
outright. A dotted null leaf now stays present on the rows whose parent
is not an object before the write, matching version 1's merge.
* fix(engine): merge a parent reached by duplicate edges once in multi-row batches
Version 1 merges a node's output onto itself as a no-op when two edges
from the same node meet at a target, so nested nulls survive. The batch
path gathered the parent twice as separate copies and re-applied the
patch, deleting those nulls and letting a dangling node's value win over
a null written on the twice-connected branch. Consecutive duplicate
parents now merge once.
* fix(engine): let a later table output replace an earlier one under it in batches
A rule writing res, res.k and then res again keeps only the last res in
version 1, because the final write replaces the object that res.k went
into. The compiled table folded the duplicate paths into one slot per
path and re-inserted res.k on top. Non-collect outputs that a later
non-collect output of the same rule replaces are now left out.
* fix(engine): share common ancestry when batch rows merge related parents
Version 1 merges parent outputs copy-on-write: a pass-through node shares
every subtree it did not change with its input, and merging two values
that share an object skips it. So a nested null written once and reached
through two branches survives the join, and an input null survives a
pass-through that changed nothing. The batch path rebuilt each parent's
rows separately, lost that sharing and deleted those nulls. When parents
share a base or leading layers and the merged parent can hold a null,
the join now derives their rows from the shared prefix with the same
copy-on-write merge; other joins stay columnar. Traced batch rows derive
pass-through outputs from their merged input the same way.
* fix(engine): keep one materialization per node so batch joins see shared rows
Gathering a node's rows for each consumer, and clearing a table's
unmatched rows before a pass-through, materialized the same node output
more than once, so a pass-through built from one copy no longer shared
objects with the copy merged at the join, and the version 1 rule that a
shared object merges as a no-op could not apply. Gathered copies of a
node on the same rows now share one materialization, a cleared copy
reuses its source's rows, layers keep their identity when picked to a
row subset, and input rows match by object identity. The final output
still materializes its own copy, since cleaning it mutates in place.
* test(engine): cover policy columns for a tested value that fails
* fix(engine): return column traces in the legacy format when it is requested
* fix(engine): return an error instead of building a cyclic value when an expression entry writes an object into itself on version 2
An entry such as `a.c = obj` after `a = obj` wrote the object into itself,
and merging, cloning, comparing, tracing or serialising the result then
overflowed the stack. The hosted expression node now checks, before each
write, whether the value reaches the object it is written into and fails the
row with "cyclic value at <key>". Compiled nodes that write a possibly
container value under a key an earlier entry set are routed through the same
row evaluation, so every path (first call, repeated, compiled, batch,
columnar, traced) reports the error for that row only.
* test(engine): cover a script returning a cyclic object on version 2
Ignored until the version 2 JS runtime rejects cyclic results; it hangs today.
* fix(engine): match version 1 in script globals and dates, stop idle or cyclic scripts, and load date support lazily
* fix(engine): leave version 1 table indexes as released and give version 2 its own
* fix(engine): show the tested value under its key when a table reads the whole root
* fix(engine): copy values read through $ and leave written-back keys alone, as version 1 merges them
* perf(engine): keep tables whose outputs read the tested value on the compiled plan
* test(engine): record pinned Date results across zones, DST gaps and far years
* perf(engine): pin Date in Rust instead of a JavaScript shim on version 2
Function nodes on version 2 replaced Date with a JavaScript module whose
local getters, setters and string methods rebuilt every field through
native calls and allocations, and whose lazy half cost about 45 us to
load on the first Date use of each evaluation.
The pinned constructor, Date.now, Date.parse, Math.random and the zone
dependent prototype methods are now callable Rust classes built with the
safe rquickjs API. They read the time value through the native getTime,
compute fields and offsets with chrono-tz in Rust (fixed offset zones
skip the lookup, the last instant's fields are cached per evaluation)
and keep QuickJS's Date for storage and everything zone independent.
The constructor is a bound function so calls and constructions are
told apart exactly. The prototype methods are still installed on the
first construction or parse, now in about 6 us.
Results are unchanged: recorded per-zone results, version parity and
the isolation spec pass as before.
* fix(engine): keep the machine time zone out of parsed script dates
* refactor(engine): carry the depth limit on the evaluation handle
* refactor(engine): name the per-row evaluation handles
* refactor(engine): pass one invocation through the compiled entry points
* refactor(engine): track nesting depth on the evaluation handle
* refactor(engine): drop argument-count allowances that no longer apply
* refactor(engine): pass context and trace probe as one lane value
* refactor(engine): hand the invocation to the policy entry
* refactor(engine): read function timeout and nodes-in-context once per evaluation
* refactor(expression): pass the evaluation context to comparison and table-cell helpers
* 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
* feat(trace): trace format v1 with TraceCollector on the compiled engine
Adds trace format v1 to the compiled engine, recorded by explicit trace
recorders and written natively. The interpreted engine keeps the legacy
trace.
- EvaluationOptions.trace is a TraceFormat (off, v1, legacy). Legacy
traces are produced directly from the same recording.
- zen_engine::trace exposes convert, restore and inspect for
stored documents, with redaction and truncation markers.
- The trace header takes evaluatedAt, timezone and seed from the
evaluation context, so an evaluation replays from its own trace.
- Batch and columnar evaluations record events as columns and write one
document per row.
- Bindings accept the trace format (true, 'v1', 'legacy'); the Node
binding ships TypeScript types for the v1 document.
- Golden, fixture and damaged-document tests cover byte identity with the
legacy trace, restore, interop with the reference fixtures and
malformed input.
* perf(trace): build columnar request rows once with precomputed paths
* perf(trace): write a node's edits from its written columns
* perf(trace): capture node columns instead of row values in the columnar plan
* perf(trace): reuse a node's rendered body for rows with the same rule and cell values
* perf(trace): size the batch trace buffer up front, key node bodies on typed column words, share request rows as the input
* perf(trace): read the request from input columns and build request rows only on demand
* perf(trace): key node bodies on per-column codes and precompute node heads and result labels
* perf(trace): keep first-hit table facts and their referenced fields as columns
* perf(trace): write per-row expression results in the batch writer
* perf(columnar): write result rows as JSON straight from output columns
* perf(trace): keep collect-policy rule hits as columns and reuse hit text
* perf(trace): pack loop results from columns and resolve result column accessors once per batch
* perf(trace): share row-wise node outputs with the trace when nothing can alias them
* perf(trace): pack lists without a string per distinct item
* perf(trace): write new lists from columns and decide references by where a list came from
* perf(trace): write wide list items from columns while the list has never been built
* perf(trace): read list cells once while rendering
* feat(trace): list table inputs once per node and key rule cells by column id
* feat(trace): name matched policy table rows by rule id
* feat(trace): store loop results as one column per key
* build: optimise test builds
* 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.
* feat(engine): explicit evaluation context with now, timezone and seed
The compiled engine evaluates against an explicit EvaluationContext
instead of the host clock, host zone and an unseeded random source.
- zen_expression::context: EvaluationContext holds now (read once on
first use, shared by every row of a batch), the time zone (supplied
or the host zone cached per process), the locale, the seed (drawn on
the first draw) and per-row and per-item random streams created only
when a row or item draws. rows/picked/items/item/at narrow it with an
Rc clone; at and item allocate nothing. RowContext is the borrowed
per-row view builtins, kernels and function hosts read.
- the context is passed explicitly through the lane VM (LaneRunner,
Session, kernels, cells, builtins), typed Program::run, graph state,
rows, loops, sub-decisions, hosted rows, the columnar plan, policies
and their plans. There are no thread-locals for context data.
- rand draws once per lane, row and item from the row's stream, so
map(xs, rand(100)) draws per item. rand is never pure, folded,
memoised or compiled into kernels as a constant; Math.random is no
longer pure in the function purity analysis.
- function hosts (v1 and v2) install Date, Math.random and a minimal
Intl.DateTimeFormat once per runtime and read a per-call slot:
Date.now, new Date, local-time getters and setters, toString,
toLocale*String and getTimezoneOffset use the context's now, zone and
locale.
- EvaluationOptions and EvaluationSerializedOptions gain now, timezone,
seed and locale (en-US by default). Workspace gains evaluate_pinned,
evaluate_batch_pinned and evaluate_columns_pinned. In a batch, row i
draws with row_seed(seed, i) and replays alone with that seed.
- bindings: Node and Python accept and validate now, timezone, seed and
locale; C and uniffi pass them through and ignore invalid values.
- d('...') is folded at compile time only for texts with an explicit
zone; an invalid __ZEN_MOCK_UTC_TIME is ignored by the context.
- the interpreted engine and the stack VM are unchanged and ignore the
new options.
* refactor(engine): name evaluation context parameters ctx and context
* feat(engine): derive random draws from their location
A draw is now a pure function of (seed, stream, scope, field, site, n)
instead of a running counter per stream, so reordering, short-circuiting,
dead-code elimination or an extra rand elsewhere in a decision no longer
shifts other draws.
- site: occurrence index of rand( in source order, numbered at compile
time and carried on the lane call op
- field: stable label from node/rule/column/key/statement/block ids,
baked into multi-root programs at compile time or set on the context
by per-source (session) paths
- scope: chained per sub-decision call (caller node + key) and per
function node; JS Math.random uses a fixed site in that scope
- n: counter per (stream, address) for repeated evaluation only
Tables with draws run on the exact row path; fused cells and fused rules
refuse draws; object-literal expansion is skipped for drawing sources.
* refactor(expression): own the rand integer mapping
Map a draw to 0..=upper with Lemire multiply-shift and rejection, taking
further words from the same address on retry, so a dependency update can
never change rand(n) for a given seed. A negative upper bound now returns
"Invalid upper range" on both VMs instead of panicking, and the unseeded
root seed comes from a hashed counter, which drops fastrand.
* test(engine): keep evaluation context tests independent under cargo test
cargo test runs a crate's tests as threads of one process, so tests that
share process state raced:
- pinned.rs switched the global ZEN_CONFIG.compiled on and off; each
decision now picks its engine with compiled_engine() / interpreted().
- clock_reads() counted reads from every thread; it now counts the
current thread only.
- typed exact tests relied on __ZEN_MOCK_UTC_TIME, which is cached on the
first clock read by any test; they now pin now in the context.
* ci: pin Rust 1.99 for the Windows Node and UniFFI builds
Rust 1.100 makes Cargo's new build-dir layout permanent: every
dependency gets its own directory and its own -L dependency= flag.
For zen-engine with --target x86_64-pc-windows-msvc the rustc command
line passes Windows' 32,767-character limit, and sccache fails to spawn
rustc with os error 206. Cargo itself falls back to an argument file,
but sccache does not.
Other matrix entries stay on stable. Remove the pin once sccache
handles long command lines.
* refactor(engine): remove locale from the evaluation context
The locale option did not make evaluations more reproducible: QuickJS has
no ICU, so function nodes never picked up a host locale. It only added
approximate locale-aware date formatting from a hand-written table, as new
public API in every binding.
Function nodes keep the time zone of the context. toLocaleString,
toLocaleDateString and toLocaleTimeString return QuickJS's fixed format in
that zone and ignore a locale argument, as before. Intl is reduced to
DateTimeFormat().resolvedOptions(), which reports the time zone.
Drops the icu_locale_core dependency.
* test(engine): compare interpreted draws with the pinned ones
The interpreted engine's Math.random is QuickJS's own, seeded from the
clock in microseconds when a context is created. On Windows the clock is
coarser, so two evaluations in a row can get the same seed and the same
numbers. Assert instead that the interpreted engine does not return the
compiled engine's draws for the same seed.
* 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
* fix(engine): bound table gap analysis memory, analyse expression columns
Missing-case detection built the full atom/row partition for every column
before charging the work budget. Nested ranges (`> 1`, `> 2`, ...) make that
partition quadratic, so large tables (tens of thousands of rows) allocated
gigabytes before giving up, exhausting the 1GB WASM memory. The partition
size is now counted first and the budget checked before building it; results
are unchanged (50k rows: ~10GB/28s -> ~650MB/1s natively).
Columns without a field whose filled cells are all conditions on one field
(`age > 50`, `age > 30`) are now analysed like field columns on that field:
duplicates, unreachable rows, missing cases and compression. Compressed and
missing-case cells are written back as full expressions (`age > 30`).
Columns mixing fields or using non-analysable expressions stay opaque.
* chore(engine): remove comments from table analysis changes
* 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.
* 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
- 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
* 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
* 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.