Skip to content

fix(core): drill a relationship path as one nested-relation condition, pushed down by the server - #35423

Merged
objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/issue-34990-nested-relation-filter-node
Nov 19, 2026
Merged

objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/issue-34990-nested-relation-filter-node

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #34990
Part of #35447
Clause-②: yes (narrowing)
Metadata-protocol: none
Skills-docs: follow-up #35481

维护者速读

  1. 用户能看到什么变化:仪表盘和报表里按"关联对象的字段"(例如按客户的负责人)分组时,点开明细抽屉会直接列出对应记录,不再因为关联记录超过两百条而提示"太多,无法列出";但这类明细抽屉里暂不再提供"在列表中打开"按钮。
  2. 为什么做:收口上一张"按关联字段钻取明细"修复里由席位批准的临时方案——原来由浏览器先读出关联记录再筛选,现在交给服务器在数据库里一次关联查询完成。
  3. 出错会怎样:看板和报表的用户点开按关联字段分组的明细时会看到"记录加载失败"的提示,不会看到错误的数据;直接回滚本次改动即可恢复原来的行为。
  4. 要你做什么:无,席位落地。

Declaration corrected (L1-a ACCEPT 7005070933): convertFiltersToAST is a published export of @object-ui/core and now accepts the nested-relation map it used to refuse, so this PR is Clause-②: yes (widening) (was no). Metadata-protocol: none and the patch level stand. The changeset carries the same line from a7203afa.

L2 S1 folded in (seat pick, contract review 7005257036; card #35447, claimed on its thread 7006104820): from def1213f, ValueDataSource's AST matcher refuses a nested-relation comparand (a non-empty object with no $ key) for every operator that reads it, with the object arm's sentence through one shared builder (nestedRelationRefusalReason). Before, = matched no row silently and != matched every row. Pin: new top-level describe in ValueDataSource.astFilterVocabulary.test.ts (AST and object forms refused alike, != refused, CONTROL scalar =). The data-objectstack README lowering table gains the node's row (its example runs in readme-filter-operator-table.test.ts).

Declared as a narrowing (delta contract review 7006192304, M1; changeset from 694b6011): the refusal turns a no-$ object comparand under !=, not_contains and the ordering operators from serving every or some rows into a named refusal on the published ValueDataSource#find. The changeset carries the BREAKING paragraph (FROM / TO) and the ADR-0087 marker not-required (no-migration-prescription): the spec's comparand door already refuses that comparand and no saved view filter can hold it. patch stays (non-protocol). Full dogfood on 694b6011: 482 passed, 3 skipped files, 0 failures. Skills-docs: follow-up #35481 is the drill drawer's "Open in list" link, which this PR drops for a relationship-path dimension; the narrowing itself is taught by no skill.

Narrowing contract review S2 folded in (from b950ae60): the AST arm treats a comparand as a nested-relation condition only when it is a PLAIN object (prototype Object.prototype or null) with no $ key, so a class instance with its own keys (a moment / luxon date, a decimal) compares through valueOf again under the ordering operators. Pins: not_contains and > refusal legs beside = / !=; CONTROL legs for a class instance under > and < and a Date under > (ablation of the prototype check turns the two class-instance legs red). The changeset now names the exact refused population instead of "refuses anything else". Full dogfood on b950ae60: 482 passed / 3 skipped files, 4092 tests, 0 failures (os-dev-report 7011424436).

What changes

  • Client filter grammar: the nested-relation node. convertFiltersToAST (@object-ui/core) now lowers the nested-relation form the spec already declares on FilterCondition (form 4: { account: { owner: 'u1' } }, a plain object with no $ key beneath a field) to one equality node, ['account', '=', { owner: 'u1' }]. The spec's parseFilterAST reads that node back as the same nested condition, which the server serves. It used to refuse the shape as an unknown operator. The recognised population is the engine's own isNoOperatorObject (no $ key), so client and server name one shape; a map that mixes $ operators with plain keys is still refused. Nothing on the client judges the inner condition: whether the field is a relationship is decided by the server, which refuses anything else with INVALID_FILTER / 400. The engine-internal semi-join leaf (ADR-0139 / ADR-0155) is never spelled.
  • resolveDatasetDrillFilter: the two-step is removed. A relationship-path dimension (account.owner, up to ADR-0071's three hops) now drills as one nested condition, one level per hop ({ account: { parent: { kind: VALUE } } }), instead of reading up to 200 related ids per hop and filtering on $in them. No related record is read and nothing is capped. Unchanged: the per-hop schema read that confirms each hop is a single-valued relationship, the hop limit, the empty-bucket refusal, and the plain-dimension-on-the-relationship-field case (it becomes an id key inside the nested condition).
  • The PD5 exception docblock is retired (seat ruling 6961225798, bounded exception (a) whose exit is this node): the "resolved here because the grammar has no nested-relation node yet" paragraph and the "read in two steps" section are replaced by the nested-condition description.
  • DATASET_DRILL_RELATED_ID_CAP and the too-many member of DatasetDrillResolution are no longer produced. They stay exported, marked @deprecated, because removing them is a narrowing of @object-ui/core's published surface and their consumers (the drawer's too-many notice and its locale strings) sit outside this claim's file surface (see Acceptance notes).

Tests

At head 0ff1d0ab (origin/main 0967cbe6 merged; the incoming commits touch none of the packages below). dba9da83 adds one comment-only commit restoring the objectstack#17469 citation the plugin-detail pin requires; a7203afa changes only the changeset's Clause-② line.

  • pnpm --filter @object-ui/core test: Test Files 243 passed (243), Tests 4482 passed, 27 skipped.
  • pnpm --filter @object-ui/core type-check: exit 0. pnpm --filter @object-ui/plugin-dashboard --filter @object-ui/plugin-report type-check: exit 0.
  • Focused, verbose: the four touched test files, Test Files 4 passed (4), Tests 168 passed (168).
  • New pins: filter-converter.test.ts gains a top-level describe('the nested-relation node (objectstack#34990)') (lowering + spec round trip, a deeper relation with inner operators, beside plain keys and under $or, CONTROL mixed map refused with INVALID_FILTER/400 naming owner/account, CONTROL operator map and empty map unchanged).
  • Flipped legs of the fix(dashboard): drill a relationship-path dimension through its related ids, and localize a failed drill #34968 pins (only those that asserted the two-step): in dataset-drill-relationship-path-34907.test.ts the 1-hop/2-hop/id-cap/empty-$in legs became 1-, 2- and 3-hop nested-condition legs with zero find calls, a drawer-lowering leg (convertFiltersToAST + parseFilterAST round trip), the shared-hop leg and a plain-dimension id leg; in DatasetWidget.test.tsx the first leg and the too-many notice leg; in DatasetReportRenderer.test.tsx the first leg. Hop-limit, unknown/multi-valued relationship, empty bucket, CONTROL single-object drill and builder refusal legs are unchanged.
Ablation (one per changed behaviour, each via scripts/ablation-replace.mjs, restored blob == HEAD and git diff HEAD empty)
  • Converter node disabled (if (isNestedRelationCondition(...)) to if (false && ...), anchor 1 to 0, blob 53704b04 to d69c22c6): 5 failed / 23 passed, each failure Unknown filter operator 'owner'/'owner_id'/'parent'; restored to 53704b04.
  • Resolver's nested write replaced with { $in: [] } (blob 8c335150 to 2783b612): 6 failed / 3 passed in the 34907 file; restored to 8c335150.

Both suites import the module under test from source by relative path, so no dist leg applies.

Acceptance notes

Verification

A1: the server takes the client's wire spelling and pushes it down (SQLite, real engine, throwaway test, not committed)

Real ObjectQL + SqlDriver (better-sqlite3) + SecurityPlugin + RestServer, GET /api/v1/data/:object with ?filter= set to the AST JSON the client sends, knex query log captured:

  • ['owner','=',{region:'NA'}]: 200, ids d1, d3; 1 statement: select from the ledger where owner in (select id from the owner table where region = ? and the owner's row-scope predicate).
  • ['ledger','=',{owner:{region:'NA'}}] (two hops): 200, id n1; 1 statement with two nested in-subqueries, each carrying its object's row scope.
  • ['and',['id','!=','zz'],['ledger','=',{title:'a',owner:{region:'NA'}}]]: 200, id n1; 1 statement.
  • CONTROL the old id form ['owner','in',['u1']]: 200, ids d1, d3; 1 statement with a bound id list.

No statement reads related ids before the main read. A2: before this change convertFiltersToAST refused the nested form (the converter ablation above shows the refusal text). A3: 7 files, +207 / -128.

Gates

Local families: derived with node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at 0ff1d0ab (39 commands) and run in full; results are in the report comment on the card. node scripts/pm/overlap-check.mjs: VERDICT clean exit 0 before each push. CI-owned families (lint, type-check programs, Test UI) are read from this PR's check-runs.


Generated by Claude Code

convertFiltersToAST lowers the spec's nested-relation form (a plain
object with no `$` key beneath a field) to one equality node that
parseFilterAST reads back as the nested condition. resolveDatasetDrillFilter
writes a relationship-path dimension as that condition, one level per hop,
instead of reading related ids on the client, so the server matches it with
an in-database subquery. The id cap and the too-many answer are no longer
produced; the exports stay, deprecated.

Claude-Session: https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 19, 2026
…pec predicate to the driver

Claude-Session: https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB

Final head for review · area data-2 · 2026-11-19T09:22Z
Head: dba9da83ab5d93f83ca71bdf4fae7405219d46e3 — every check suite on it completed, none failed. (The PR body cites 0ff1d0ab; dba9da83 adds one comment-only commit restoring the objectstack#17469 citation the plugin-detail pin requires, which Test UI 14/16 caught on 0ff1d0ab.)
Fixes #34990 · Clause-②: no · Metadata-protocol: none · client only (@object-ui/core + two consumer test files) · +207/−128 over 7 files · K = 10 · not governed.
Seat 5 picked A on the Open-in-list question (seat note on #34990); follow-ups #35438 (URL spelling) and #35439 (narrowing residue).
Review route: L1-a thread. Landing after its ACCEPT, by the area; L2 only if L1-a finds a contract face.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 用户能看到什么变化:仪表盘点进“按关联对象分组”的数字时,不再先在浏览器里取最多两百条关联记录,而是交给数据库一次查完。关联记录再多也能列出,不再提示“关联记录太多”。这种钻取的抽屉里不再显示“在列表中打开”。
  • 为什么做:原来的做法是临时例外,有上限,大数据量时会打不开。现在改为由服务器在数据库里过滤,并按权限过滤。
  • 出错会怎样:最坏是这类钻取列出的记录不对或打不开,普通钻取不受影响。撤回即可。
  • 要你做什么:无。

席位核对 — ACCEPT (L1-a) · repo:objectstack#5 · head dba9da83ab · 2026-11-19T09:25Z

… as Clause-② yes

L1-a ACCEPT 7005070933: convertFiltersToAST is a published @object-ui/core export and
now accepts the nested-relation map it refused, so the declaration is a widening.
Metadata-protocol stays none; level stays patch.

Claude-Session: https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

Contract review

Served-tier: TIER_DEFAULT
Head-sha: a7203afabb3e0e10ff381944036b7597fa759990
Local-runs: none
Security-touching: no
Client-only filter lowering and drill resolution; no auth, permission, tenant or row-scope code is in the diff, and the related object's read scope is now applied by the server's nested-relation subquery (dev's A1 shows each subquery carrying it) where the client's own related read applied it before.

① Derived judgments

Read against the net diff 0967cbe6..a7203afa (7 files, +207/-128), card #34990 with its three comments (claim, os-dev-report 7004645702, seat note 7004740847), and L1 ACCEPT 7005070933. The delta since the L1 head dba9da83 is one changeset line (Clause-②: no to yes (widening)).

  • convertFiltersToAST accept set widens — named right. A non-empty plain map with no $ key beneath a field used to throw FilterOperatorError (unknown operator); it now lowers to [field, '=', condition]. The gate sits after isAcceptedFilterComparand, the exotic-object refusal (isOperatorMap) and the empty-map refusal, so a Date, a RegExp/Set/Map and {} keep their old answers. isNestedRelationCondition (every key lacks $) is the key half of the engine's isNoOperatorObject (packages/objectql/src/no-operator-object-door.ts); the prototype half is already enforced by isOperatorMap one arm up. The function is module-private, so nothing new is exported.
  • Round trip with the spec's parseFilterAST holds for the whole widened set. convertComparison's equality arm returns { field: value } unless the comparand is a $field reference or a $now anchor. Both predicates need a $ key, which this population never has, so every no-$ map comes back verbatim. assertListComparandShapes descends non-$ keys, so inner $in/$nin/$between are still shape-checked. normalizeFilterComparandTypes does not descend a no-$ object and leaves it to the engine. isFilterAST takes the node (operator =), and FilterArraySchema types the value slot as unknown. Pins in filter-converter.test.ts: 1-hop, deeper with inner operators, beside a plain key, under $or. Each asserts parseFilterAST(node) equals the input.
  • Still refused — named right. A map mixing $ and plain keys stays an operator map. It is refused naming the first non-$ key, which is the same verdict the engine gives. The empty map is refused too. CONTROLs pin both with INVALID_FILTER/400 and field/operator. The inner condition travels unjudged, so an off-spec inner key or operator is refused by the server with INVALID_FILTER/400 rather than at lowering time. That moves the refusal later but keeps it loud, on the face this lowering targets.
  • resolveDatasetDrillFilter output changes — named right. A path dimension's output changes from { rel: { $in: [ids] } } to a nested condition, one level per hop. too-many is no longer produced. DatasetDrillDataSource keeps find in its Pick, so no consumer stops compiling. The hop limit, isMultiValueField refusal, empty-bucket refusal and the plain-dimension id merge are unchanged. extractRecords and relatedIds were internal.
  • Published surface, nothing narrowed. DATASET_DRILL_RELATED_ID_CAP (still 200) and the too-many member of DatasetDrillResolution stay exported, marked @deprecated. Their removal is the narrowing card Dashboard drill: remove the unreachable too-many related-ids notice and DATASET_DRILL_RELATED_ID_CAP (narrowing) #35439. buildDatasetDrillFilter changes refusal prose only. Consumer sources (DatasetWidget, DatasetReportRenderer, DrillDownDrawer, app-shell) are untouched; only their fix(dashboard): drill a relationship-path dimension through its related ids, and localize a failed drill #34968 two-step test legs flip.
  • Other faces of the widened set, by code reading.

② Semver level

  • The changeset is '@object-ui/core': patch, carrying line-initial Clause-②: yes (widening) and Metadata-protocol: none. The PR body carries the same pair, line-initial.
  • Clause-② is right. A published export (@object-ui/core . re-exports filter-converter.js whole) now accepts input it refused, and nothing in the diff narrows.
  • none is right. packages/spec is untouched. FilterCondition already declares the nested form (form 4), so no authorable key, value or meaning changes.
  • patch is right. AGENTS.md Post-Task step 3: none takes patch, and a non-protocol widening ships patch. No other package's source changes, so no second changeset is owed.
  • No BREAKING banner or ADR-0087 marker is owed, since this is not a narrowing. The changeset's prose matches the code sentence by sentence, including the deprecations and the hidden "Open in list".

③ Boundary flags

S1 (should-fix) — the widened node reaches ValueDataSource's AST arm silently. Its object arm refuses a nested relation by name ("the in-memory matcher does not descend into a nested relation constraint"). Before this PR, toFilterNode threw on the same filter, so a value-provider surface composing a view filter through toFilterNode/toFilterNodeSafely (ListView, ObjectGrid, ObjectChart and other composers) was told. Now ['rel', '=', { … }] lands in matchesComparisonNode, whose = arm compares the plain object by reference: no row matches and nothing is logged. The row set is the empty set the value face always gave, so nothing narrows. What regresses is one filter's diagnosis across two dialects on the same face, the "fails as an empty list" outcome the converter's README says lowering-time refusal exists to prevent. Fix: give matchesComparisonNode the object arm's refusal for a no-$ plain-object comparand. That is a ui/packages/core/src/adapters/ValueDataSource.ts card outside this claim's surface; it does not hold this PR.

Implemented-by: claude/issue-34990-nested-relation-filter-node
Reviewed-by: isolated-l2-35423

VERDICT: PASS

…T arm by name

convertFiltersToAST now lowers { rel: { field: value } } to
['rel', '=', { field: value }]. The in-memory matcher's object arm already
refused the nested condition by name; its AST arm compared the condition
object by reference, so `=` matched no row in silence and `!=` matched
every row. matchesComparisonNode now gives a comparand that is a non-empty
object with no `$` key the object arm's refusal, through one shared
sentence builder, for every operator that reads the comparand.

Also adds the nested-relation row to the data-objectstack README lowering
table and extends the existing changeset's prose.

Claude-Session: https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

Contract review

Served-tier: TIER_DEFAULT
Head-sha: def1213f06526448ce6bc1386086c6b87a6aeafd
Local-runs: none
Security-touching: no
The delta changes how the in-memory ValueDataSource matcher answers one filter shape; no auth, permission, tenant or row-scope code is in it, and every changed answer moves toward fewer rows.

① Derived judgments

This is a delta record on contract review 7005257036 (head a7203afa). It reads a7203afa..def1213f: one commit, 4 files, +96/-6. The other inputs are the claim amendment 7005284308, os-dev-report 7006042871, card #35447 and the head's check-runs.

S1 of record 7005257036 is closed.

  • matchesComparisonNode now refuses before its switch when the comparand is a non-empty plain object with no $ key, for every operator except the four no-comparand ones (is_null, is_not_null, is_empty, is_not_empty).
  • These are still accepted:
    • a Date, which isAcceptedFilterComparand excludes;
    • a { $field } reference, excluded by the $-key test and still resolved by the arm below;
    • an array, refused one arm up as before;
    • {}.
  • A nested-relation filter on a value source is now refused by name in both dialects, instead of answering silently in the AST one.

The shared builder keeps both lines byte-identical.

  • Both arms call nestedRelationRefusalReason(field, key) through the same refuseFilterNode.
  • The object arm's old literal is the builder's body unchanged.
  • The key both arms name is the condition's first own key: the AST arm takes keys[0], and the object arm refuses on the first entry of its loop.
  • Neither arm can be pre-empted by another branch for a non-$ key. Every case label in matchesDollarOperator starts with $, and RETIRED_FILTER_OPERATORS holds only $regex and $options.
  • The pin asserts astLine equals objectLine and contains the sentence. The != leg asserts an empty row set. The CONTROL scalar = asserts no log. The dev's ablation turned 2 legs red with the CONTROL still green, and the blob was restored.

The delta narrows a published accept set. ValueDataSource is published: @object-ui/core . re-exports adapters/index.js, which exports the class. A comparison node with a no-$ object comparand changes as follows:

Operator Before Now
= matched no row, logged nothing refused, no row, logged
!= !comparandEquals, so every row (the dev's own ablation measured this) refused, no row, logged
not_contains every row whose value does not contain the text [object Object], in practice every row refused, no row, logged
the four ordering operators (greater and less than, strict or inclusive) ran a string-versus-object comparison and selected rows (a lowercase string compares above the text [object Object]) refused, no row, logged
  • The = change leaves the row set as it was, so it is no narrowing.
  • The other rows are input the published find served and now refuses.
  • The pre-fix answers were wrong: the spec's own door refuses an object comparand under $ne and the other scalar operators (normalizeFieldSpec sends them through judgeLiteralComparand). So the delta makes the spec's refusal real at this consumer.
  • That makes the narrowing legitimate, but it is still a narrowing.
    • "拉回已声明契约不触它" is outweighed by "收窄已发布接受集的卡是 Clause-②: no…入队前欠一次契约审核档 L2 审核" (execution-duties).
    • This package's own precedent agrees: 4c5023a and 5c083e8 aligned a published export to the spec's definition and shipped Clause-②: no (narrowing), BREAKING, with an ADR-0087 not-required (no-migration-prescription) marker.
  • Metadata-protocol: none still holds. ViewFilterRuleSchema.value admits no object, and the spec's comparand door already refuses the operator-form spelling, so no form an author can save changes.

Nothing else moved.

  • The README row ({ account: { owner: 'u1' } } lowers to ['account', '=', { owner: 'u1' }]) matches the converter. The dev reports it executed by readme-filter-operator-table.test.ts.
  • The changeset's new paragraph matches the code, the != reversal included.

② Semver level

  • The declaration lines are unchanged: Clause-②: yes (widening) and Metadata-protocol: none, in the PR body and the changeset; the changeset level is '@object-ui/core': patch.
  • The arm is now wrong. The PR widens convertFiltersToAST and narrows ValueDataSource#find. Precedent for a mixed diff is Clause-②: yes (narrowing): ADR-0153's P2-spec row, and core CHANGELOG entries a260556 and the yes (narrowing + widening) dataset entry.
  • patch stays right. AGENTS.md Post-Task step 3 says a non-protocol change, widening or breaking, ships patch and keeps its BREAKING banner and ADR-0087 disposition.
  • Metadata-protocol: none stays right, as argued in ①.
  • With the narrowing arm, the changeset owes three things, none of them present:
    • a BREAKING paragraph;
    • its FROM to TO mapping, roughly: a value-source filter putting an object comparand under !=, not_contains or an ordering operator is refused; the spec refuses it too; spell a relation condition only against a server source;
    • exactly one ADR-0087 marker, presumably not-required (no-migration-prescription) after 4c5023a, which check:adr-0087-registration reads beside the arm.
  • Skills-docs: is also owed in the PR body, because the PR now carries a (narrowing) arm.

③ Boundary flags

  • Open questions and deviations. The dev report has no open questions. Its three deviations are answered as follows.
    • The pin sits in the existing harness file, which is right under ruling record 6583487846.
    • Refusing every comparand-reading operator, not only =: right on the merits, and it is the source of the narrowing in ②.
    • The partial rerun of the ui/scripts family is disclosed. CI owns that family.
  • The dev's "no (narrowing) arm, so n/a" for the dogfood battery no longer holds. With the arm, .claude/agents/os-dev.md owes one full dogfood run on the final head.
  • Tier routing. A Clause-② line carrying (narrowing) puts this PR on the narrowing face. That face is CONTRACT_REVIEW_TIER over the whole diff outside the prose faces, with ④. This TIER_DEFAULT record cannot discharge it. The record at that tier is owed on the head that carries the corrected declaration.
  • Alternative route. Scope the AST refusal to = alone. That is no narrowing, since the row set is unchanged and only the log line is added. The !=, not_contains and ordering fail-open would then go to its own narrowing card. I recommend keeping the fix and declaring it instead: the fail-open is a real defect, and its pin and ablation are already in place.
  • SQL push-down. The delta adds no id read and no in-app join. ValueDataSource is the in-memory face with no SQL under it, so the check is answered as not applicable. Record 7005257036's push-down reading of the drill path stands unchanged.
  • Check-runs on def1213f.
    • 62 runs: 46 success, 15 skipped, 1 failure; none still in progress.
    • The failure is PR-body guards (claim · duplicate · Part-of · single-writer path). Its check:closing-target-claim step says Fixes #35447 has no Claim: naming the branch.
    • That Claim: (7006104820) was posted after the guard ran. The red is stale and clears on the guard's next run, but it is red now.
    • Every one of the eleven required contexts is success or skipped.

M1 (must-fix) — the declaration under-states the diff. def1213f narrows ValueDataSource#find, a published @object-ui/core export, from serving every or some rows to refusing them, for an object comparand under !=, not_contains and the ordering operators. Yet the PR body and changeset still read Clause-②: yes (widening). Fix:

  1. Change both lines to Clause-②: yes (narrowing).
  2. Add the BREAKING paragraph with its FROM to TO mapping and one ADR-0087 marker to the changeset.
  3. Add Skills-docs: to the PR body.
  4. Run the dogfood battery.
  5. Route the CONTRACT_REVIEW_TIER narrowing-face L2.

The alternative is to scope the refusal to = and keep the current declaration.

S1 of record 7005257036 — closed on def1213f (refusal by name in both dialects, one builder, byte-identical lines, pinned and ablated).

Implemented-by: claude/issue-34990-nested-relation-filter-node
Reviewed-by: isolated-l2-35423

VERDICT: FAIL

The AST-arm refusal in ValueDataSource turns a comparison whose comparand
is a plain object with no `$` key from served rows into a refusal under
`!=`, `not_contains` and the ordering operators. That narrows the accept
set of a published @object-ui/core export, so the changeset's direction
line reads `Clause-②: yes (narrowing)` (the converter half widens), and it
gains a BREAKING paragraph with its FROM / TO mapping and one ADR-0087
`not-required (no-migration-prescription)` disposition. The level stays
patch and `Metadata-protocol: none` stays: no form an author can save
changes, since the spec's comparand door already refuses that comparand.

Claude-Session: https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: a5945f2aa44664a1214ccf6fb6ba8dd90ff6471f
Local-runs: none
Scope: ui/packages/core/src/utils/filter-converter.ts, ui/packages/core/src/adapters/ValueDataSource.ts, ui/packages/core/src/utils/dataset-format.ts, ui/packages/core/src/utils/tests/filter-converter.test.ts, ui/packages/core/src/adapters/tests/ValueDataSource.astFilterVocabulary.test.ts, ui/packages/core/src/utils/tests/dataset-drill-relationship-path-34907.test.ts, ui/packages/plugin-dashboard/src/tests/DatasetWidget.test.tsx, ui/packages/plugin-report/src/tests/DatasetReportRenderer.test.tsx, ui/packages/data-objectstack/README.md + packages/spec/src/data/filter.zod.ts, packages/spec/src/data/filter-comparand-type.ts, packages/spec/src/data/filter-comparand-operators.ts, packages/spec/src/ui/view.zod.ts, packages/objectql/src/no-operator-object-door.ts, packages/objectql/src/relation-filter-lowering.ts, packages/objectql/src/relation-semi-join.ts, packages/objectql/src/relation-group-join.ts, packages/objectql/src/engine-nested-relation-lowering.test.ts, packages/rest/src/data-nested-relation-permission.test.ts, content/docs/protocol/objectql/query-syntax.mdx, ui/packages/app-shell/src/views/useOpenRecordList.ts, ui/packages/core/src/utils/drill-down.ts, ui/packages/data-objectstack/src/index.ts, ui/packages/data-objectstack/src/readme-filter-operator-table.test.ts, scripts/check-adr-0087-registration.mjs, docs/adr/0087-metadata-protocol-upgrade-contract.md

① Derived judgments

This is a whole-PR record on the narrowing face. It reads the net diff of a5945f2a against main 6f36818f (10 files, +311/-134), cards #34990 and #35447 with every comment, the PR body and thread (L1 ACCEPT 7005070933, records 7005257036 and 7006192304), and the check-runs on the head. Every path outside the changeset is in scope; the + files were read in the tree at the head, which holds main.

Widening: convertFiltersToAST — named right.

  • A non-empty plain map with no $ key beneath a field used to throw FilterOperatorError (unknown operator). It now lowers to [field, '=', map], the map by reference.
  • The new arm sits after the Date arm (isAcceptedFilterComparand), the exotic-object refusal (isOperatorMap) and the empty-map refusal. So a Date, a RegExp / Set / Map / class instance in implicit position and {} keep their answers.
  • A map mixing $ and plain keys is still read as an operator map and refused on its first plain key. The four retired lowercase aliases all start with $, so they still get their named refusal.
  • The accepted population is the engine's isNoOperatorObject less {}: the prototype half is isOperatorMap one arm up, the key half is isNestedRelationCondition.
  • The same widening reaches toFilterNode, toFilterNodeSafely, mergeFilterNodes and composeDrillFilter, which all lower through it. Nothing new is exported.

Round trip with the spec's parseFilterAST — holds for the whole widened set.

  • convertComparison's equality arm answers { field: value } unless the comparand is a $field reference or a $now anchor. Both need a $ key, which this population cannot hold, so every lowered map comes back as written.
  • assertListComparandShapes then descends plain keys, so an inner $in / $nin / $between is still shape-checked. normalizeFieldSpec hands a no-$ object back whole and leaves its inside to the engine. isFilterAST takes the node, since = is a valid operator.
  • Pinned in filter-converter.test.ts (one hop, a deeper relation with inner operators, beside a plain key, under $or) and in the 34907 file's drawer-lowering leg. Each asserts parseFilterAST(node) equals the input. composeDrillFilter is the in-repo caller that makes this round trip, and its shared-hop leg pins the composed shape.

Where the widened node goes, by code reading.

  • A server source: data-objectstack's convertQueryParams and translateFilterToAST send it. main already pins that the engine serves this exact array spelling: engine-nested-relation-lowering.test.ts lowers [['owner', '=', { region: 'NA' }]] to the same semi-join as the object form.
  • exactRecordListFilter (useOpenRecordList.ts): collect meets the plain key inside the condition, no arm takes it, and it answers null. So "Open in list" and a related list's "View all" are hidden for such a filter, never widened.
  • The analytics filter route passes an object filter through untouched (lowerAnalyticsFilterForWire), so this lowering changes nothing there.
  • ValueDataSource: the narrowing below. I found no other evaluator of lowered nodes under ui/.
  • An inner condition is no longer judged on the client. A typo such as { age: { gte: 18 } } used to fail at lowering with the supported-operator list; it now travels and the engine's no-operator-object door answers INVALID_FILTER / 400 naming the field and the $eq spelling. Later, still loud.

Narrowing: ValueDataSource#find, array dialect — named right, with one gap (S2).

  • matchesComparisonNode refuses, before its switch, a comparand that is a non-array object with at least one own key, none starting with $, and that is not a Date. It does so for every operator except the four that never read the slot.
  • Unchanged: a Date, a { $field } reference, a $now anchor, an array (refused one arm up as before) and {}.
  • For a plain object the row sets move as the changeset says. = keeps its empty answer and gains the log line. != and not_contains go from every row to none. The four ordering operators go from the string values that sort past the text [object Object] to none. in, nin and between answered no row before and answer none now, and so in practice do contains, starts_with and ends_with, which matched only a value holding that literal text.
  • Both dialects print one sentence through nestedRelationRefusalReason. The pin asserts the two log lines are equal, the != leg asserts an empty row set, and the CONTROL scalar = logs nothing.
  • The predicate has no plain-object test, so it also takes a class instance that carries its own keys: see S2.

resolveDatasetDrillFilter — named right.

  • A relationship-path dimension resolves to one nested condition, one level per hop, where it resolved to the relationship field $in up to 200 ids read per hop. lowerNode no longer calls find; the only reads left are getObjectSchema, one per walked object.
  • Unchanged, by the diff: the hop limit, the empty-bucket refusal, the isMultiValueField refusal, the plain-dimension-on-the-relationship-field case (an id key inside the nested condition, which the engine admits as a platform-provisioned column), and buildDatasetDrillFilter's composition.
  • too-many is no longer produced. DATASET_DRILL_RELATED_ID_CAP (still 200) and the too-many member stay exported and marked deprecated, and DatasetDrillDataSource keeps find in its Pick, so no consumer stops compiling. Nothing is removed from the published surface.
  • The client's three-hop limit equals the engine's RELATION_CONDITION_MAX_HOPS.

Tests. The cap leg and the empty-$in leg assert behaviour this PR removes. They are replaced by the one-, two- and three-hop legs with zero find calls and by the no-cap leg in DatasetWidget.test.tsx; no leg that still holds was dropped. The README row's example is executed by readme-filter-operator-table.test.ts.

② Semver level

  • Changeset: '@object-ui/core': patch, with line-initial Clause-②: yes (narrowing) and Metadata-protocol: none. The PR body carries the same pair, line-initial, and Skills-docs: follow-up #35481.
  • yes (narrowing) is right. The diff widens one published export (convertFiltersToAST) and narrows another (ValueDataSource#find). That is the mixed spelling, and its arm routes this face.
  • none is right. packages/spec is untouched.
    • The widening: the spec already declares the nested form on FilterCondition, so nothing an author can write changes.
    • The narrowing: ViewFilterRuleSchema.value admits a string, number, boolean, null or a list of strings and numbers, never an object. FilterConditionSchema refuses a plain-object comparand under a scalar operator at its save door (checkFilterConditionComparands, on a node's own field entries). So no saved metadata holds the refused comparand.
  • patch is right. AGENTS.md Post-Task step 3: kind none takes patch, and a non-protocol change, widening or breaking, ships patch and keeps its BREAKING banner and ADR-0087 disposition.
  • BREAKING paragraph: present. It names the host, gives FROM and TO, and gives the fix in a sentence (spell a relation condition against a server-backed source; on a value source filter on the row's own fields). The spec claim under it holds: SCALAR_COMPARAND_OPERATORS covers $ne, $notContains and the four ordering operators, and judgeLiteralComparand refuses a plain object there with INVALID_FILTER / 400. Its accuracy gap is S2.
  • ADR-0087 marker: exactly one, not-required (no-migration-prescription). Its reason is true for the reasons under none: no key, value or type moves and no stored row can hold the comparand, so objectstack migrate meta has nothing to rewrite. The category is open because the changeset declares none, not narrowed. The changeset's FROM and TO bullets describe behaviour before and after, not a spelling to rewrite, which is how the stock on main holds the same category for a behavioural narrowing (changesets 34465 and 35028). Lint & Repo Gates and Check Changeset are green on the head.
  • No second changeset is owed: the only other package the diff touches is @object-ui/data-objectstack, by one README row.

③ Boundary flags

  • Open questions. The newest os-dev-report (7006042871) has none. The first report's question (Open in list hidden for a relationship-path drill) is answered by seat note 7004740847: pick A, follow-up Dashboard drill: give the list URL a nested-relation filter spelling so a relationship-path drill can offer Open in list #35438.
  • Dev deviations, round 2.
    • The pin sits in the existing harness file as a top-level describe: right under ruling record 6583487846.
    • The refusal covers every operator that reads the comparand, not only =: this is the narrowing, and it is now declared.
    • The ui/scripts family was rerun for one file only: CI owns it, and Test UI was green on 694b6011.
  • Dogfood battery: escalated to the seat. The record the landing gate reads is missing.
    • The arm owes one full dogfood run on the final head, counted in the os-dev-report's dogfood_battery (.claude/agents/os-dev.md). label-write --land reads the card's newest trusted os-dev-report for it.
    • That report is 7006042871. It names def1213f and says n/a: no ! in the PR title and no (narrowing) arm. No os-dev-report names 694b6011 on filter grammar: a client node for the nested-relation form, so a dataset drill-through pushes one nested condition down instead of the bounded two-step id resolution (exit for #34907's PD5 exception) #34990, ValueDataSource: refuse a nested-relation condition in the filter AST arm instead of matching no rows silently #35447 or the PR.
    • The run is asserted in two places only, the PR body and claim amendment 7007655943: "482 passed, 3 skipped files, 0 failures", with no test count and no VERDICT line. I could not check it from the inputs.
    • Coverage of the head, were the report there: a5945f2a has parents 694b6011 and 6f36818f, the tip of main. The ten PR files are byte-identical between 694b6011 and the head, and the head differs from main in those ten files alone. So the head reaches 694b6011 through a merge of the base only, and a battery pinned to 694b6011 covers it. The 25 merged commits touch nothing under ui/packages/core, data-objectstack, plugin-dashboard, plugin-report, the spec filter files or the engine's relation lowering.
    • CI ran no dogfood on this PR: the three shards are skipped on the head and on 694b6011, and run in the merge queue.
    • Owed before landing: an os-dev-report whose dogfood_battery pins 694b6011 with its file and test counts. That is a comment, not a commit.
  • SQL push-down. The PR removes a client id materialisation (up to 200 ids per hop, three hops) and sends one nested condition. No new id read or in-app join is added.
    • The engine serves it on a read verb as one statement, an in-database subquery per hop under each related object's planned read scope. main pins this: engine-nested-relation-lowering.test.ts (two and three hops, one driver call, the array spelling alike) and data-nested-relation-permission.test.ts (the second hop carries its own object's row scope and field check).
    • Where ids are still read, the reason is given in relation-semi-join.ts: a related object with an object-scoped middleware or an afterFind hook, another datasource, a federated object, or another tenancy class. The server reads them itself under its 1,000 cap and refuses past it, never truncating. The drawer then shows the load-failure sentence where the old 200 cap showed a localized notice; the PR body discloses this.
    • A driver without readableIdsLeaf (MongoDB, OData) refuses the form up front with INVALID_FILTER / 400. That takes nothing from the drill: the same bit refuses the related-attribute group itself (relation-group-join.ts), so no such bucket exists to click. It is also the direction Prime Directive 5 rules for those drivers.
  • Check-runs on the head. 58 runs, all completed: 45 success, 13 skipped, 0 failed. All 16 Test UI shards, Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Test Core, TypeScript Type Check, Lint & Repo Gates, Check Changeset, PR-body guards and Governed Surface Queue Guard are success; Build Core and the dogfood shards are skipped. Every one of the eleven required contexts is success or skipped. 694b6011 read 62 runs, 47 success, 15 skipped, 0 failed.
  • Follow-up cards. Dashboard drill: give the list URL a nested-relation filter spelling so a relationship-path drill can offer Open in list #35438 (URL spelling) and Dashboards skill: say the drill drawer offers no "Open in list" link for a relationship-path dimension #35481 (skill bullet) are open. Dashboard drill: remove the unreachable too-many related-ids notice and DATASET_DRILL_RELATED_ID_CAP (narrowing) #35439 (remove the unreachable too-many residue) was closed as not planned by triage (7005794295).

④ Design judgment

The narrowing makes the spec's refusal real; it takes no declared capability away. The spec accepts six comparand types and two $-keyed object shapes (a field reference, a $now anchor). A plain object under $ne, $notContains or an ordering operator is refused by its type door, and no view filter rule can hold one. The rows the value source served for it were a wrong answer: every row for !=, an accident of string ordering for the others. Refusing them aligns this consumer with a refusal the spec already makes on every query face. The nested-relation form itself is declared and delivered where it can be: a server source joins it, and a value source holds flat rows with no related object to read, which the object dialect already said by name.

The widening closes the gap the card was filed for. The spec declares form 4, the engine serves it, and the client refused to send it. That was the implementation gap, and it is implemented here at the one lowering door rather than worked around at the drill. The bounded Prime Directive 5 exception (ruling 6961225798) is retired with its docblock, and the old two-step is not kept behind a flag.

Tried and held.

  • A $field reference, a $now anchor and a Date cannot be mistaken for a nested condition on either side: each carries a $ key or is taken one arm earlier.
  • The inner condition's values and operators are judged by the related object's own doors on the server, not skipped: admitRelationCondition refuses an undeclared key, a dotted key and a fourth hop before any read.
  • A mixed map cannot slip a plain key past the operator loop.
  • The drill's nested condition counts the rows the bucket counted: the analytics join and the subquery both read the related object under the caller's scope, and the empty and restricted buckets stay refused.
  • The Open-in-list link fails closed.

S2 (should-fix) — the AST refusal takes more than the plain object the changeset declares. nestedRelationComparandKey has no plain-object test, though its own docblock says the shape is the one convertFiltersToAST lowers, and that converter lowers plain objects only (isOperatorMap), as does the engine's isNoOperatorObject. A class instance that carries own keys, none starting with $, is therefore refused too: a moment or luxon date, a decimal object. Under an ordering operator such a comparand used to compare through its valueOf and serve the right rows against Date or number values, for example a node ['due', OP, someLuxonDate] with OP any ordering operator. It now serves none and logs that the date "carries the non-operator key" and is a "nested relation constraint". The object dialect's { due: { $gte: someLuxonDate } } still compares as before, and toFilterNode lowers exactly that filter to the refused node (the converter judges a class instance in implicit position only, never under an operator). So one authored filter now has two answers on one value source where it had one. The spec refuses a class instance as a comparand, so refusing it is a defensible end state, but it is not what is declared: the BREAKING paragraph says "a plain object", and its FROM line says the ordering operators compared against the text [object Object], which is false for this population. Fix, either way:

  1. Give nestedRelationComparandKey the plain-object test (prototype Object.prototype or null), with a CONTROL leg that a class-instance comparand under an ordering operator still compares. The code then matches its docblock, the converter and the changeset.
  2. Or keep the predicate and declare it: name the class-instance population in the BREAKING paragraph, correct the FROM line for it, and give it a sentence that does not call a date a relation.

Nits (no effect on correctness or the contract of this PR; none holds it):

Out of the diff, for cards (read, not reviewed; neither is graded on this PR):

  • The object dialect's twin is still fail-open on the value source. matchesDollarOperator compares a no-$ object comparand as before: { account: { $ne: { owner: 'u1' } } } serves every row, $notContains likewise, the ordering operators compare against [object Object], and an object member of an $nin list serves every row in both dialects. The spec's type door refuses each. The code predates this PR, and after it the array spelling of the same filter is refused, so the two dialects answer differently until the object arm follows. The changeset speaks of the lowered node only, so it claims nothing false. A reproducible defect by code reading: file it. It can ride the S2 fix through the same builder; the BREAKING paragraph then names the object dialect too.
  • The spec's own prose on form 4 is behind the engine. The FilterCondition docblock in packages/spec/src/data/filter.zod.ts says "One level", that a relation condition beneath one "is refused", and that the field is matched against the ids the related read returns. The engine serves three hops as subqueries, pins it, and content/docs/protocol/objectql/query-syntax.mdx documents it. This PR's two- and three-hop drill stands on the delivered and documented behaviour, so it is correct; the docblock is what is wrong. A published schema file, so its own card and review.

M1: closed
S1: closed

M1 (record 7006192304) is closed on this head: both declaration lines read yes (narrowing), the changeset carries the BREAKING paragraph with FROM and TO and one ADR-0087 marker, the PR body carries Skills-docs:, and this record is the narrowing-face review. The battery M1 asked for is asserted but not yet recorded where the landing gate reads it (③). S1 (record 7005257036) stays closed as record 7006192304 found it.

Implemented-by: claude/issue-34990-nested-relation-filter-node
Reviewed-by: isolated-l2-35423-n

VERDICT: PASS

…tion comparand

nestedRelationComparandKey now treats an AST comparand as a nested
relation condition only when it is a plain object (prototype
Object.prototype or null) with no $ key, the spec's own filter-structure
test. A class instance with keys of its own (a moment, luxon or decimal
object) is a value again: under an ordering operator it compares through
its valueOf instead of being refused with the nested-relation sentence.

Pins: the not_contains and > refusal legs beside = and !=, and CONTROL
legs for a valueOf-bearing class instance under > and < and for a Date
under >. The changeset names the exact refused population, and a stale
comment in queryDataset.test.ts no longer says a path dimension is
resolved through the related ids.

Claude-Session: https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l and removed size/m labels Nov 19, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: ef7fb6259644e70c3cb5043be077d41b3ca106cf
Local-runs: none
Scope: ui/packages/core/src/utils/filter-converter.ts, ui/packages/core/src/adapters/ValueDataSource.ts, ui/packages/core/src/utils/dataset-format.ts, ui/packages/core/src/utils/tests/filter-converter.test.ts, ui/packages/core/src/adapters/tests/ValueDataSource.astFilterVocabulary.test.ts, ui/packages/core/src/utils/tests/dataset-drill-relationship-path-34907.test.ts, ui/packages/plugin-dashboard/src/tests/DatasetWidget.test.tsx, ui/packages/plugin-report/src/tests/DatasetReportRenderer.test.tsx, ui/packages/data-objectstack/README.md, ui/packages/data-objectstack/src/queryDataset.test.ts + packages/spec/src/data/filter-comparand-type.ts, packages/spec/src/data/filter.zod.ts, packages/objectql/src/no-operator-object-door.ts, packages/objectql/src/relation-filter-lowering.ts, scripts/pm/label-write.mjs, scripts/pm/record-recognisers.mjs, scripts/pm/check-half-states.mjs, .claude/agents/os-dev.md

① Derived judgments

This is the delta record for the narrowing-face review of a5945f2a (record 7008152912). It reads the one commit b950ae60 (4 files, +80/-11) on top of that head, the merge that makes the new head, the card threads and PR body as they now stand, and the check-runs on the new head.

What the head is.

  • ef7fb625 has two parents: b950ae60 and 0d9d9820, which was the tip of main when it was merged. The merge resolves nothing by hand: every PR file is byte-identical between b950ae60 and the head, and the head differs from 0d9d9820 in the PR's eleven files alone.
  • Between a5945f2a and the head, four PR files moved: the changeset, ValueDataSource.ts, its astFilterVocabulary test and queryDataset.test.ts. The other seven are as record 7008152912 read them, so its whole-PR judgments on the widening, the round trip with parseFilterAST and resolveDatasetDrillFilter carry to this head unchanged.
  • The 25 merged base commits touch none of the eleven PR files and none of the spec, engine or REST files the earlier record cites. In ui/packages/core they move dashboard-filters.ts, date-macros.ts and filter-tokens.ts with their tests (feat(spec): {current_iso_week} defaults a week-keyed filter to the current ISO week #35391, a new date token); no hunk there calls the converter, the value source or the drill resolver. One merged commit concerns the same route: 819c067 (fix(metadata-protocol)!: $expand and a relation condition stop serving a disabled package's object #35444) makes the server refuse a relation condition whose target belongs to a disabled package (404 OBJECT_PACKAGE_DISABLED). It adds a refusal on the server and takes nothing from this PR: the drill then shows its load-failure sentence, as it does for every other server refusal.

The predicate, nestedRelationComparandKey — named right now.

  • It reads a comparand as a nested-relation condition only when it is a non-array object whose prototype is Object.prototype or null, with at least one own key and none starting with $.
  • The line it replaces, isAcceptedFilterComparand(target), is subsumed: for an object that predicate is true for a Date alone, and a Date fails the prototype test.
  • The new set is a strict subset of the old one. Nothing is refused at this head that a5945f2a served; what leaves the refusal is exactly the class-instance population S2 named.
  • This is the spec's own structure test (isFilterNode in filter-comparand-type.ts, isDataObject in filter.zod.ts) and the engine's (isNoOperatorObject, less {}). The docblock says so and the code agrees.
  • A class instance under an ordering operator reaches the switch, whose arms compare with the language's own operators and so through valueOf. The AST arm and the object dialect's operator arm answer one row set for it again, so the filter S2 cited no longer has two answers on one value source.

The pins.

  • CONTROL, a class instance with an own key (Amount, key units) under greater-than against 22 and less-than against 26, over age 30 / 25 / 20: rows a, b and rows b, c, nothing logged. Each leg first asserts the instance does carry the own key, so the leg cannot pass on a keyless stand-in.
  • CONTROL, a Date under greater-than: one row, nothing logged. This leg does not discriminate the prototype line (a Date has no own keys); the report says the same. It guards the population the removed line used to name.
  • Refusal legs for not_contains and greater-than over text rows zeta / Alpha, where the answer without the arm is non-empty (every row, and zeta alone): the empty set plus the one logged sentence.
  • The area reports one ablation on b950ae60: deleting the prototype line turns the two class-instance legs red with an empty row set, and leaves the Date leg green. Not re-run here. It is what the code gives: without that line Amount has an own key with no $, so the arm refuses it.

The changeset.

  • The BREAKING paragraph and the ADR-0087 marker now say "a plain object", and the paragraph gives the prototype test in words. The ValueDataSource paragraph states the carve-out: a class instance is a value and still compares through valueOf.
  • The sentence on what the server refuses is now the engine's own list, checked against the code: an object under a column that stores a scalar or a structured-JSON value (no-operator-object-door.ts), and under a relationship an undeclared key, a dotted key, or a relation past the hop limit (admitRelationCondition). The list is true and does not claim to be whole.

queryDataset.test.ts. A comment only: it now says a path dimension drills as one nested-relation condition.

② Semver level

Unchanged by the delta, and still right.

  • Changeset: '@object-ui/core': patch, line-initial Clause-②: yes (narrowing) and Metadata-protocol: none. The PR body carries the same pair and Skills-docs: follow-up #35481.
  • Exactly one ADR-0087 marker, not-required (no-migration-prescription). Its reason still holds: no key, value or type moves, and no stored filter can hold the refused comparand.
  • The BREAKING paragraph keeps FROM, TO and the fix sentence, and its population now equals the code's.
  • queryDataset.test.ts is a test comment in @object-ui/data-objectstack; no second changeset is owed.
  • Against main the delta makes the net narrowing smaller, so no new declaration is owed for it.

③ Boundary flags

④ Design judgment

The fix is the first of the two S2 offered, and it is the right one. The refusal now takes exactly the population the changeset declares and the spec calls filter structure. A class instance is data on every face of the platform: the spec's filter walk reads it as data, not structure, and the engine's door does not judge it. The value source no longer calls a date a relation, and the object dialect and its lowered node agree on it again. The narrowing still makes the spec's refusal real and still takes no declared capability away.

Tried and held.

  • A plain object made with a null prototype is still refused; a Date, a Map, a Set and an array are still not this arm's.
  • A $field reference and a $now anchor carry a $ key and pass through, as before.
  • = and != against a class instance answer as they do on main (by reference). The PR neither adds nor removes anything there.
  • No comparand that a5945f2a served is refused at this head.

No must-fix, no should-fix.

Nits (no effect on correctness or the contract of this PR; none holds it):

  • A plain object from another realm. convertFiltersToAST lowers it (the third arm of isOperatorMap admits a prototype whose own prototype is null), and the matcher's test does not take it as plain. So for that one population the lowered node is not refused: = matches nothing without a word and != every row, as before this PR. The matcher agrees with the spec and the engine here and the converter is the wider one; the changeset states the matcher's test exactly, so nothing declared is false. The report says no producer in the tree hands a value source such an object; that was not checked here. The docblock's "the shape is the one convertFiltersToAST lowers" is one arm short of true. For a card if anyone meets it, and the fix belongs at the converter.
  • The FROM line and a null-prototype object. The BREAKING paragraph now names prototype null in its population, and FROM says the ordering operators compared against the text [object Object]. That holds for Object.prototype. A null-prototype object has no toString, so the comparison threw. The TO is right for both. Changeset prose.
  • "Refuses anything else" survives in two places the delta did not touch: the isNestedRelationCondition docblock in filter-converter.ts and the first bullet of the PR body's "What changes". The changeset, which is what ships, is corrected.
  • The = sentence in the changeset is unchanged: "matched no row before" leaves out the identity match on a row written with the caller's own object. No host can rely on that match.
  • Comments with no carrier. DatasetWidget.tsx, DrillDownDrawer.tsx and DatasetReportRenderer.tsx still describe the related-id read. They are outside the diff, and the PR body speaks only of the too-many arm and exports riding the next major. The comments are prose and need no major; a small card would carry them.
  • The PR body's Tests and Verification sections still describe an earlier head (0ff1d0ab, seven files). The delta paragraphs above them are current.

S2: closed
M1: closed
S1: closed

Record 7008152912 raised S2; it is closed on this head by the prototype test and its two CONTROL legs, with the changeset stating the carve-out. M1, raised by record 7006192304, and S1, raised by record 7005257036, stay closed as record 7008152912 found them. What M1 asked of the battery is now recorded with counts in os-dev-report 7011424436; the two things the landing gate still needs are in ③ and are a body edit and a comment.

Implemented-by: claude/issue-34990-nested-relation-filter-node
Reviewed-by: isolated-l2-35423-n

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB

Landing · area data-2 · 2026-11-19T14:34Z

reading value
L1-a ACCEPT comment 7005070933 (Clause-② correction folded since)
Contract review (narrowing face, CONTRACT_REVIEW_TIER) 7008152912 PASS at a5945f2a; delta 7012075575 PASS at ef7fb6259644e70c3cb5043be077d41b3ca106cf (= current head); M1, S1, S2 closed
Battery os-dev-report 7012134259: b950ae60 (first parent of the head; the head is a base-only merge) · VERDICT command-exit 0 · 482 passed / 3 skipped files · 4092 tests · no failures
CI on head all completed; 0 failed
check-governed-merges --pr 35423 NOT governed; +383/−137 ≤ 3000; K = 4
Body Fixes #34990, Part of #35447 (the gate's single card); Clause-②: yes (narrowing), Metadata-protocol: none, Skills-docs: follow-up #35481

State: draft → ready + auto-merge (merge queue). #34990 closes on merge via Fixes; the area closes #35447 after the merge. Follow-ups: #35438 #35481 #35493 #35494 #35533.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants