Files
zen/core/engine/tests/data/compiled/schema-input.json
T
Stefan 8a82650fff 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
2026-11-02 15:27:19 +01:00

229 lines
3.3 KiB
JSON

{
"nodes": [
{
"id": "in",
"type": "inputNode",
"position": {
"x": 0,
"y": 0
},
"name": "Request",
"content": {
"schema": "{\"type\": \"object\", \"required\": [\"customer\"], \"properties\": {\"customer\": {\"type\": \"object\", \"required\": [\"age\", \"tier\"], \"additionalProperties\": false, \"properties\": {\"age\": {\"type\": \"integer\"}, \"tier\": {\"type\": \"string\", \"enum\": [\"gold\", \"silver\"]}, \"name\": {\"type\": \"string\"}, \"active\": {\"type\": \"boolean\"}, \"tags\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}}, \"address\": {\"type\": \"object\", \"properties\": {\"zip\": {\"type\": \"string\"}, \"floor\": {\"type\": \"number\"}}}}}, \"order\": {\"type\": \"object\", \"properties\": {\"total\": {\"type\": \"number\"}}}, \"note\": {\"title\": \"free\"}}}"
}
},
{
"id": "e1",
"type": "expressionNode",
"position": {
"x": 0,
"y": 0
},
"name": "Calc",
"content": {
"passThrough": true,
"expressions": [
{
"id": "a",
"key": "doubled",
"value": "customer.age * 2"
},
{
"id": "b",
"key": "vip",
"value": "customer.tier == 'gold'"
}
]
}
},
{
"id": "out",
"type": "outputNode",
"position": {
"x": 0,
"y": 0
},
"name": "Response"
}
],
"edges": [
{
"id": "x0",
"sourceId": "in",
"targetId": "e1",
"type": "edge"
},
{
"id": "x1",
"sourceId": "e1",
"targetId": "out",
"type": "edge"
}
],
"tests": [
{
"input": {
"customer": {
"age": 30,
"tier": "gold",
"name": "A",
"active": true,
"tags": [
"x",
"y"
],
"address": {
"zip": "1",
"floor": 2.5
}
},
"order": {
"total": 10
}
}
},
{
"input": {
"customer": {
"age": 30,
"tier": "silver"
}
}
},
{
"input": {
"customer": {
"age": 30.5,
"tier": "gold"
}
}
},
{
"input": {
"customer": {
"age": 30,
"tier": "bronze"
}
}
},
{
"input": {
"customer": {
"age": 30
}
}
},
{
"input": {
"customer": {
"tier": "gold"
}
}
},
{
"input": {
"customer": {
"age": 30,
"tier": "gold",
"extra": 1
}
}
},
{
"input": {
"customer": {
"age": "30",
"tier": "gold"
}
}
},
{
"input": {
"customer": {
"age": 30,
"tier": "gold",
"active": "yes"
}
}
},
{
"input": {
"customer": {
"age": 30,
"tier": "gold",
"tags": [
"x",
1
]
}
}
},
{
"input": {
"customer": {
"age": 30,
"tier": "gold",
"address": {
"zip": 5
}
}
}
},
{
"input": {
"customer": {
"age": 30,
"tier": "gold"
},
"order": {
"total": "x"
}
}
},
{
"input": {
"customer": {
"age": 30,
"tier": "gold"
},
"note": {
"anything": [
1,
2
]
}
}
},
{
"input": {
"order": {
"total": 1
}
}
},
{
"input": {}
},
{
"input": {
"customer": null
}
},
{
"input": {
"customer": {
"age": null,
"tier": "gold"
}
}
},
{
"input": {
"customer": {
"age": 4.0,
"tier": "gold"
}
}
}
]
}