|
48 | 48 | * value (multi-option, `multiple: true`) is the evaluators' own question |
49 | 49 | * beneath the door, not this table's. |
50 | 50 | * - **Deferred** — no verdict, the filter proceeds unchanged: a `formula` |
51 | | - * whose `returnType` is absent (unreadable at the seam), and a DOTTED key |
| 51 | + * whose `returnType` this table cannot read (absent, or a spelling the |
| 52 | + * schema does not declare — but see the formula note below: at the engine |
| 53 | + * seam NO formula reaches this door at all, whatever its `returnType`), and |
| 54 | + * a DOTTED key |
52 | 55 | * (`address.city`), which is `filter-dotted-head`'s subject — its |
53 | 56 | * structured-JSON heads are deliberately unjudged there (live on two of |
54 | 57 | * three backends, #8371), and this door reading the head's declared type |
|
61 | 64 | * passes and the other three are refused through the same sets — no second |
62 | 65 | * vocabulary ({@link FORMULA_RETURN_TYPE_AS_FIELD_TYPE}). |
63 | 66 | * |
| 67 | + * ⚠️ THE FORMULA ROWS ARE A JUDGEMENT NO CONSUMER CURRENTLY REACHES. The |
| 68 | + * sentence above states what {@link textOperatorDoorVerdict} answers, and it |
| 69 | + * is the ruling's answer; it does NOT describe what an author observes today. |
| 70 | + * At this door's only consumer — the engine's field-aware seam — a filter over |
| 71 | + * a `formula` field never arrives: `assertFilterIsMaterializable` (#8296 / |
| 72 | + * #4419) refuses EVERY one of them one door earlier, with `INVALID_FIELD` 400, |
| 73 | + * for the broader reason that no driver materialises a column for a formula. |
| 74 | + * Measured on the fixture below, `$contains` over each of the five formula |
| 75 | + * fields — `returnType` `number` / `text` / `boolean` / `date` / absent — |
| 76 | + * answers `INVALID_FIELD` 400 alike, so the `returnType` is never the deciding |
| 77 | + * fact and none of the three verdicts above is observable. The non-formula |
| 78 | + * rows of this table ARE observed at that seam, with this door's own |
| 79 | + * `INVALID_FILTER` 400; the formula rows are the exception, not the rule. |
| 80 | + * |
| 81 | + * The rows are kept, not retired, and nothing here moves: the verdict function |
| 82 | + * is still consulted through its `formula` branch by the engine door, so the |
| 83 | + * day formula fields become filterable the answer is already correct, and the |
| 84 | + * divergence is pinned by name in the engine package |
| 85 | + * (`engine-text-operator-declared-type-door.test.ts`) so it goes red on that |
| 86 | + * day. Making this door overtake #8296 for formula would answer ONE condition |
| 87 | + * ("a formula field cannot be filtered") with TWO wire codes chosen by |
| 88 | + * `returnType`, and would reopen #8296's recorded code assignment — a |
| 89 | + * maintainer decision, deliberately not taken here. |
| 90 | + * |
64 | 91 | * `multiple: true` does not change a verdict: the class is the ruling's axis. |
65 | 92 | * |
66 | 93 | * ## Beneath the door: #14079's row stays (the two are one contract) |
|
108 | 135 | * Every case passes the SYNTAX door (`parseFilterAST` accepts each filter — |
109 | 136 | * pinned in this module's test), so a refusal can only be this door's. |
110 | 137 | * |
| 138 | + * ⚠️ EXCEPT the `formula` cases, which neither branch above describes: at the |
| 139 | + * engine seam every one of them is refused by the EARLIER #8296 door with |
| 140 | + * `INVALID_FIELD` 400 (see the formula note above), so the refusal is not this |
| 141 | + * door's and no driver read runs either. A suite driving this table at that |
| 142 | + * seam must therefore partition the formula cases out and assert the |
| 143 | + * divergence deliberately, rather than fold them into the two branches above — |
| 144 | + * which is what `engine-text-operator-declared-type-door.test.ts` does. |
| 145 | + * |
111 | 146 | * ## Deliberately NOT a driver case-set |
112 | 147 | * |
113 | 148 | * `scripts/check-driver-conformance.mjs` enrols every `*_CASES` export of a |
@@ -219,9 +254,13 @@ export const FORMULA_RETURN_TYPE_AS_FIELD_TYPE: ReadonlyMap<string, string> = ne |
219 | 254 | * - `door-refusal` — refused before any driver runs (`INVALID_FILTER` / 400). |
220 | 255 | * - `passes` — a string-valued declared type; the filter proceeds unchanged. |
221 | 256 | * - `deferred` — the door records NO verdict and the filter proceeds |
222 | | - * unchanged: the declared type is not readable at the seam (a `formula` |
223 | | - * without `returnType`), or the key is not this door's subject (a dotted |
224 | | - * path — `filter-dotted-head`'s). |
| 257 | + * unchanged: the declared type is not readable here (a `formula` without |
| 258 | + * `returnType`), or the key is not this door's subject (a dotted path — |
| 259 | + * `filter-dotted-head`'s). |
| 260 | + * |
| 261 | + * These are the answers of THIS function. For `formula` they are not what an |
| 262 | + * author observes at the engine seam, where the earlier #8296 door refuses |
| 263 | + * every formula filter first — see the module header's formula note. |
225 | 264 | */ |
226 | 265 | export type TextOperatorDoorVerdict = 'door-refusal' | 'passes' | 'deferred'; |
227 | 266 |
|
@@ -350,7 +389,7 @@ export const TEXT_OPERATOR_DOOR_TYPE_CLASSES: readonly TextOperatorDoorTypeClass |
350 | 389 | name: 'formula', |
351 | 390 | types: new Set(['formula']), |
352 | 391 | verdict: 'by-return-type', |
353 | | - note: 'Judged as the FieldType its declared `returnType` names (`text` passes; `number` / `boolean` / `date` are refused through the same sets); `returnType` absent ⇒ deferred, the declared type is not readable at the seam.', |
| 392 | + note: 'Judged as the FieldType its declared `returnType` names (`text` passes; `number` / `boolean` / `date` are refused through the same sets); `returnType` absent ⇒ deferred. ⚠️ Unreachable at the engine seam: the earlier #8296 door refuses EVERY formula filter with INVALID_FIELD 400 whatever the `returnType`, so this row states the contract\'s answer, not an observable one — see the module header.', |
354 | 393 | }, |
355 | 394 | ]; |
356 | 395 |
|
@@ -509,7 +548,7 @@ function caseFor( |
509 | 548 | verdict, |
510 | 549 | note: dotted |
511 | 550 | ? 'A dotted path into a structured-JSON field is filter-dotted-head\'s subject (deliberately unjudged there, #8371); this door must not re-close that carve-out by reading the head\'s declared type.' |
512 | | - : 'The declared return type is not readable at the seam — the ruling judges formula only when it is.', |
| 551 | + : 'The declared return type is not readable here — the ruling judges formula only when it is. ⚠️ Unreachable at the engine seam: #8296 refuses every formula filter one door earlier (INVALID_FIELD 400) — see the module header.', |
513 | 552 | }; |
514 | 553 | } |
515 | 554 | } |
|
0 commit comments