| @@ -2034,3 +2034,83 @@ |
| 2034 | 2034 | |
| 2035 | 2035 | - **Fixtures ingested:** `0106-feel-ternary-logic` (compliance-level-2) — 18 cases, `exact`; |
| 2036 | 2036 | `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.** |