Public repository: timo / feel

Reader

An interpreter of FEEL, written in Rust, with integrations for PostgreSQL, WASM, Lua, and Python.

docs: ADR-44 + ROADMAP/README — boxed-expression element-form coverage

public

docs: ADR-44 + ROADMAP/README — boxed-expression element-form coverage

ADR-44 documents the ingester extension for the six DMN 1.5 boxed-expression
element forms (1150–1154, 1161), the three deviation-skips (ADR-24/13/14), and
the parse_value_elem string-type bug fix.  ROADMAP and README updated to reflect
the new totals: 3003 cases / 105 files.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Changesetf2bc7bbd468a9af41a75b88e54f30f2fc79feae1
Author (claimed)Timo Stolz <timo.stolz@gmail.com>,
Parentsb1495b8ed618
Children
Pushlog
by timo via ssh

modified DECISIONS.md +80 −0

@@ -2034,3 +2034,83 @@
20342034
 
20352035
 - **Fixtures ingested:** `0106-feel-ternary-logic` (compliance-level-2) — 18 cases, `exact`;
20362036
   `0107-feel-ternary-logic-not` (compliance-level-2) — 3 cases, `exact`. **Suite 2964 → 2985.**
2037
+
2038
+## ADR-44: 1150–1154 & 1161 — boxed-expression element forms (compliance-level-3)
2039
+
2040
+- **Context:** The compliance-level-3 suites `1150-boxed-conditional`,
2041
+  `1151-boxed-filter`, `1152-boxed-for`, `1153-boxed-some`, `1154-boxed-every`, and
2042
+  `1161-boxed-list-expression` exercise the DMN 1.5 **boxed-expression *element* forms**
2043
+  (spec §10.2.1.5 / §10.2.1.8–10): structured XML elements (`<conditional>`,
2044
+  `<filter>`, `<for>`, `<some>`, `<every>`, `<list>`) rather than the
2045
+  `<literalExpression>` FEEL text that all earlier suites use.  Each element form maps
2046
+  directly to an existing FEEL construct: `<conditional>` → `if/then/else`, `<filter>`
2047
+  → `L[predicate]`, `<for iteratorVariable>` → `for v in L return …`, `<some/every
2048
+  iteratorVariable>` → `some/every v in L satisfies …`, `<list>` → `[e1, e2, …]`.
2049
+  The six suites contribute 21 active test cases (commented-out decisions, pending PR
2050
+  #602 RTF, are invisible to ElementTree and excluded naturally).  The 1150–1154 suites
2051
+  are contributed by "StrayAlien"; 1161 is a KIE/jbpm-authored model with three
2052
+  `<inputData>` nodes (`A: number`, `B: boolean`, `C: string`) and a `typeRef=stringList`
2053
+  list literal.
2054
+
2055
+- **Decision:** Ingester-only change — the engine needed no modification.  Four new
2056
+  parser functions were added to `tools/ingest_tck.py` (each follows the direct-children
2057
+  `_first_child` pattern of the existing `parse_invocation_decisions` /
2058
+  `parse_context_result_decisions`):
2059
+
2060
+  - `parse_conditional_decisions` → translates `<conditional><if><then><else>` to
2061
+    `if (IF) then (THEN) else (ELSE)`.
2062
+  - `parse_filter_decisions` → translates `<filter><in><match>` to `(IN)[MATCH]`
2063
+    (the predicate references `item`, already an allowed implicit name).
2064
+  - `parse_iterator_decisions` → handles all three iterator tags in one function;
2065
+    translates `<for iteratorVariable="v"><in><return>` to `for v in (IN) return (BODY)`
2066
+    and `<some/every iteratorVariable="v"><in><satisfies>` to
2067
+    `some/every v in (IN) satisfies (BODY)`.
2068
+  - `parse_list_decisions` → translates `<list>` of direct `<literalExpression>` children
2069
+    to `[row1, row2, …]`.
2070
+
2071
+  Each assembled expression is validated once through `fits_slice_grammar`.  The four
2072
+  new dispatch branches (forms 5–8) follow the `invocation_decisions` branch in
2073
+  `extract_cases`, before the final `else: continue`.
2074
+
2075
+  **Three documented deviations** (new skip set `BOXED_PREDICATE_DEVIATION_SKIPS`):
2076
+
2077
+  - `1151-boxed-filter:004:decision004` — `([1,2,3,4,5])["not a boolean"]`.  TCK
2078
+    expects `null`; feel-core returns `[]`.  **ADR-24** deliberately drops non-`true`
2079
+    filter predicate results (`eval_filter`, `eval.rs`, lines 900–906) rather than
2080
+    escalating a non-boolean predicate to error-null.
2081
+  - `1151-boxed-filter:005:decision005` — `([1,2,3,4,5])[if (item<=3) then true else "not a boolean"]`.
2082
+    TCK expects `null`; feel-core returns `[1,2,3]`.  Same ADR-24 rule.
2083
+  - `1153-boxed-some:006:decision006` — `some element in ([1,2]) satisfies (if (element=2) then true else "not a boolean")`.
2084
+    TCK expects `null`; feel-core returns `true` because `some` short-circuits on
2085
+    the first `true` (`quant_product`, `eval.rs`, line 953), per the
2086
+    sticky-provenance / strong-Kleene design of **ADR-13/ADR-14** (`true` dominates
2087
+    before the later non-boolean taint is seen).  Notably `1154-boxed-every:006`
2088
+    (*passes*) because for `every` the `false`-dominating value is never hit, the
2089
+    taint survives exhaustion, and the result is error-null → null.
2090
+
2091
+  Reversing these deviations would require changing ADR-24 and ADR-13/14, risking
2092
+  regressions in `0001-filter` and the `0106/0107` ternary-logic fixtures.  The
2093
+  house style is to document divergences in a skip set rather than chase them.
2094
+
2095
+  **Also fixed**: a latent bug in `parse_value_elem` where the text-heuristic boolean
2096
+  check (`text in ("true", "false")`) fired before the explicit-string-type check,
2097
+  causing `<value xsi:type="xsd:string">true</value>` to be mis-parsed as the boolean
2098
+  `true` rather than the string `"true"`.  Fixed by promoting the `xsi_type.endswith("string")`
2099
+  guard to run first (before the boolean check), consistent with the existing code
2100
+  comment "a declared string type is authoritative".  The fix was surfaced by 1161's
2101
+  `string(B)` cell whose expected TCK value is `"true"` (string).  All 2985 pre-existing
2102
+  fixture cases still pass, confirming no prior fixture was affected.
2103
+
2104
+- **Consequence:** The four boxed-expression element forms are now ingested and covered
2105
+  by TCK-sourced fixtures.  The engine needed zero changes — `if/then/else`,
2106
+  `list[predicate]`, `for/some/every`, and list literals were all already implemented.
2107
+  All 18 kept cases use `comparison: "exact"`.
2108
+
2109
+- **Fixtures ingested:**
2110
+  `1150-boxed-conditional` (compliance-level-3) — 3 cases, `exact`;
2111
+  `1151-boxed-filter` (compliance-level-3) — 2 cases, `exact` (2 deviation-skips);
2112
+  `1152-boxed-for` (compliance-level-3) — 2 cases, `exact`;
2113
+  `1153-boxed-some` (compliance-level-3) — 4 cases, `exact` (1 deviation-skip);
2114
+  `1154-boxed-every` (compliance-level-3) — 5 cases, `exact`;
2115
+  `1161-boxed-list-expression` (compliance-level-3) — 2 cases, `exact`.
2116
+  **Suite 2985 → 3003.**

modified README.md +6 −2

@@ -137,7 +137,7 @@
137137
 `context put` *overloads* whose name is absent from the single-row table
138138
 (`date(from: …)`, `context put(…, keys: …)`; see `NAMED_ARG_OVERLOAD_SKIPS`).
139139
 
140
-The fixtures used by the test (99 files, ~2985 self-contained cases) are
140
+The fixtures used by the test (105 files, ~3003 self-contained cases) are
141141
 regenerated by pointing the script at each TCK dir, e.g.:
142142
 
143143
 ```sh
@@ -158,7 +158,11 @@
158158
   -o crates/feel-core/tests/fixtures/0070-instance-of.json
159159
 ```
160160
 
161
-The other ingested dirs include `0106-feel-ternary-logic` and
161
+The other ingested dirs include `1150-boxed-conditional`, `1151-boxed-filter`,
162
+`1152-boxed-for`, `1153-boxed-some`, `1154-boxed-every`, and
163
+`1161-boxed-list-expression` (compliance-level-3, DMN 1.5 boxed-expression
164
+element forms — `<conditional>/<filter>/<for>/<some>/<every>/<list>`; ADR-44),
165
+`0106-feel-ternary-logic` and
162166
 `0107-feel-ternary-logic-not` (compliance-level-2, context-bound three-valued
163167
 and/or/not; ADR-43), `0009-invocation-arithmetic` (compliance-level-2, BKM
164168
 invocation + arithmetic, canonical §10.6.5 calculation pattern; ADR-42),

modified ROADMAP.md +9 −1

@@ -7,7 +7,7 @@
77
 without re-deriving the analysis.
88
 
99
 Coverage figures are case counts from `tools/ingest_tck.py` over the DMN-TCK
10
-compliance-level-3 suites. Today the fixture suite is **2985 cases / 99 files**
10
+compliance-level-3 suites. Today the fixture suite is **3003 cases / 105 files**
1111
 (`cargo test -p feel-core --test fixtures_test -- --nocapture`).
1212
 
1313
 ---
@@ -274,6 +274,14 @@
274274
   wrapper. First suite combining BKM inlining with positional invocation and arithmetic
275275
   (canonical §10.6.5 "Calculation" pattern). No engine or ingester change needed.
276276
   **Suite 2961 → 2964.**
277
+- **Boxed-expression element forms — `1150–1154` & `1161`** ✅ **shipped (ADR-44).**
278
+  Six compliance-level-3 suites covering DMN 1.5 `<conditional>`, `<filter>`,
279
+  `<for>/<some>/<every>`, and `<list>` element forms — 18 cases across 6 files.
280
+  Ingester extended with four new parsers; engine needed no changes (all constructs
281
+  already implemented). Three deviation-skips documented (`BOXED_PREDICATE_DEVIATION_SKIPS`,
282
+  ADR-24 / ADR-13/14). Also fixed a latent `parse_value_elem` bug where an explicit
283
+  `xsi:type="xsd:string"` with text `"true"` was mis-parsed as boolean.
284
+  **Suite 2985 → 3003.**
277285
 - **Emoji / non-XID names** as bare context keys (`{🐎: "bar"}`,
278286
   `0083-feel-unicode`) — the lexer accepts XID identifiers only; 2 cases skipped
279287
   (`NON_XID_NAME_SKIPS`).