Skip to content

Commit 870dcc8

Browse files
committed
docs(objectql): the judge and the door walk name the nested-relation stage
Claude-Session: https://claude.ai/code/session_01DEvba2nBuD4tWzfq8r8NFY Co-authored-by: Claude <noreply@anthropic.com>
1 parent c68e8b1 commit 870dcc8

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

‎packages/objectql/src/engine.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,13 @@ function admissionRefusalOf(
12591259
* condition.
12601260
* 2. {@link resolveWhereFilterTokens}: the placeholder resolver.
12611261
*
1262+
* [#20802] Execution then lowers each nested-relation condition by READING
1263+
* the related object (`ObjectQL.lowerRelationConditions`); that read admits the
1264+
* condition through the related object's own two stages. The judge runs those
1265+
* two stages on each condition too — as a `find` on the related object — and
1266+
* stops there: which ids the read finds, the cap and the caller's permissions
1267+
* on the related object need data and a caller, and are execution's alone.
1268+
*
12621269
* What differs by verb sits BETWEEN or AROUND those stages and judges
12631270
* something other than `where`: option-key folding and refusal, the driver
12641271
* lookup (`getDriver`, before stage 1 on the writes and between the stages on

‎packages/objectql/src/number-comparand-declared-type-door.ts‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,18 @@
141141
* no meaning for), and a platform-provisioned column the declared map omits
142142
* (`id`, …): the same walk and the same three positions, words per kind.
143143
*
144+
* ## [#20802] …and the nested-relation arm, at `where` only
145+
*
146+
* The nested-relation form is SERVED at `where` (`relation-filter-lowering.ts`).
147+
* There a no-operator object beneath a relation column is not refused by the
148+
* arm above: it is admitted against the related object's declarations
149+
* (`admitRelationCondition` — one level, declared keys, a registered related
150+
* object) or refused in words of its own. The engine then walks the admitted
151+
* `where` again with this SAME walk ({@link mapRelationConditions}) to collect
152+
* each condition and, after reading the related object, to replace it — so the
153+
* door and the lowering find a condition at the same boundaries by
154+
* construction. The per-aggregation `filter` and `having` keep the refusal.
155+
*
144156
* @see numberComparandDoorVerdict — the pure verdict (lane 1, `@objectstack/spec`).
145157
* @see https://github.com/objectstack-ai/objectstack/issues/20336 (the contract)
146158
* @see https://github.com/objectstack-ai/objectstack/issues/20351 (this door)
@@ -386,7 +398,9 @@ function judgeFieldSpec(
386398
* [#20546] It carries TWO arms, asked in order at every field key: the
387399
* no-operator-object arm (`no-operator-object-door.ts` — a plain object with
388400
* no `$` key where a scalar column's value belongs), then the number arm
389-
* ({@link judgeFieldSpec}). One traversal, one set of boundaries (the depth
401+
* ({@link judgeFieldSpec}). [#20802] At `where` the first arm hands a relation
402+
* column's object to the nested-relation admission instead, and the lowering
403+
* pass ({@link WalkContext.lowerOnly}) asks that question alone. One traversal, one set of boundaries (the depth
390404
* bound, the combinators descended, the `$` and dotted keys skipped), two
391405
* questions — the shape the spec's save-door walk takes for its own arms
392406
* (`checkFilterConditionComparands`: "One walk, one set of boundaries, `n`

0 commit comments

Comments
 (0)