Skip to content

fix(core)!: a non-boolean $null / $exists flag is refused, and so are the object comparands the value data source cannot compare - #35832

Merged
os-zhuang merged 10 commits into
mainfrom
claude/issue-35735-filter-flag-and-comparand-edges
Nov 20, 2026
Merged

os-zhuang merged 10 commits into
mainfrom
claude/issue-35735-filter-flag-and-comparand-edges

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb

Fixes #35735
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no skill or docs page teaches a non-boolean $null / $exists flag, a { $now, addDays } anchor on the value data source, a class-instance comparand under an equality operator, or a cross-realm object; the spec's doors already refuse every one of these on the server path except the anchor, which the server resolves and this in-memory face now refuses by name, so there is nothing to un-teach

Fold group (ruled in card comment 7031136570): this PR also carries the asks of #35738 and #35533, closed into this card; each item is mapped below.

维护者速读

  1. 用户能看到什么变化:使用内嵌数据(不连服务器)的列表和看板,以及所有走前端筛选转换的页面,如果筛选条件把"是否为空"写成了非真假值(例如写成文字"no"),或把相对日期、日期库对象、来自其他窗口的对象当作比较值,以前会悄悄返回错误的记录,现在会拒绝这个筛选并说明原因;正常写法的筛选结果不变。
  2. 为什么做:收口上一张"内嵌数据源对象比较值"修复的评审遗留,让前端的筛选转换、内嵌数据源和服务器对同一个筛选给出同一个答案,合并了另外两张未开工的同类小卡。
  3. 出错会怎样:只影响写错的筛选条件,它们会显示为空列表并在浏览器控制台说明原因,而不是错误的数据;直接回滚本次改动即可恢复原来的行为。
  4. 要你做什么:这是申报的契约收窄,按 chore(governance): the guard scripts join the governed register, .claude/** lands by declared rule-change, a declared narrowing waits for the maintainer #35610 需要你在 GitHub 上点一次 Approve;之后席位自主落地。
  5. 席位意见:通过,没有必改项(席位记录见本 PR 评论)。

What changes

Three faces, one PR, so an object filter and its lowered node never answer apart: convertFiltersToAST (ui/packages/core/src/utils/filter-converter.ts), and ValueDataSource's $ arm and AST arm (ui/packages/core/src/adapters/ValueDataSource.ts). Every premise was re-measured on origin/main d9be915f4 against the built @objectstack/spec before the change (readings below).

#35735 — $null / $exists take a boolean flag

Face Before Now
convertFiltersToAST { f: { $null: 'no' } } lowered to ['f', 'is_null', true], { f: { $exists: 'no' } } to ['f', 'is_not_null', true] (truthiness) FilterOperatorError (INVALID_FILTER / 400, operator, field): The '$null' filter operator on field 'f' takes a boolean flag (true or false); received "no". Write … — one helper, refuseNonBooleanFlag, now also builds the $empty sentence (byte-identical to before for any flag JSON can render; a cyclic or bigint flag, which used to throw a raw TypeError from the message builder, is now refused in words)
ValueDataSource $ arm 'no', 1, an object read as true; 0, null as false refused per node, row excluded, filter operator '$null' on field 'f' takes a boolean flag (true or false); received … — the $empty arm's sentence, now from one helper
ValueDataSource AST arm is_null / is_not_null read no flag unchanged, by measurement: these operators carry no flag. The spec's parseFilterAST hands ['f', 'is_null', ANY] back as { f: { $null: true } }, and this arm already takes direction from the operator name. Pinned as a CONTROL rather than changed.

true / false lower and match exactly as before (CONTROL pins on both faces, plus a round-trip through parseFilterAST).

#35738 (1) — $-keyed plain objects, the { $now, addDays } anchor among them

Measured: the spec's comparand door steps around a well-formed anchor and the platform resolves it in the compared column's temporal form (resolveNowAnchor in @objectstack/formula, applyNowAnchorComparison in driver-sql). ValueDataSource has no field types, which is the reason the same file already refuses a { $field, addDays } offset; so the anchor is refused by name (the card's second option), not resolved. Any other $-keyed plain object that is not a { $field } reference ({ $foo: 1 }) is refused too, as the spec's door refuses it. Both under every operator that reads a comparand, whole or as a list member, in both dialects. An anchor is told apart by the spec's own test ($now is true or a string), so { $now: 0 } takes the $-key sentence; the anchor sentence ends in its remedy (compare with a concrete Date or ISO string here). convertFiltersToAST still lowers the anchor verbatim for the server.

#35738 (2) — a class instance under equality, negation and text operators

Measured: normalizeFilterComparandTypes refuses a class instance (a Amount instance (…), which no driver can compare) at every scalar operator and list member, orderings included. Following the door for the operators the card names, a class instance is now refused under $eq, $ne, an $in / $nin member, $contains, $notContains, $startsWith, $endsWith and their AST spellings, in one operator-free sentence so both dialects log the same line. Under $gt / $gte / $lt / $lte / $between it still compares through its valueOf when that returns a primitive, and otherwise as its text (a Map, a RegExp, a class with no valueOf); the refusal sentence and the changeset now say exactly that. $icontains keeps its own text door. The remaining difference from the door (the orderings) goes to a card the coordinator files, not changed here.

#35533

  1. Cross-realm plain object. isOperatorMap now makes the spec's isFilterNode / the engine's isNoOperatorObject test (prototype Object.prototype or null of this realm). A plain object of another realm is a comparand: the converter refuses it as the field's whole condition in a sentence of its own, ahead of the exotic-comparand refusal and in the same INVALID_FILTER / 400 envelope (The filter on field 'age' is a plain object from another realm (an iframe, a vm context). Only a plain object of this realm … is read as an operator map or a nested condition here … Rebuild the filter in this realm before filtering it: { ...condition } for each operator map, or structuredClone(filter).), which the value data source's object arm re-seats unchanged through loweringConditionRefusal; the shared builder refuses it in comparand position under every operator on both arms. Both faces decide "another realm" by ONE structural test, isForeignRealmPlainObject in the new internal module ui/packages/core/src/utils/foreign-realm-object.ts (not re-exported; the package exports only .): the prototype is neither this realm's Object.prototype nor null, its own prototype is null, and its constructor is named Object. So Object.create(somePlainObject) and Object.create(Object.create(null)) are no longer called foreign on either face. The spec's door refuses it too (measured). The existing pin a CROSS-REALM plain object is still an operator map pinned exactly the branch removed, so it is replaced by its refusal (fixture triage: replaced, not re-spelled), with a CONTROL that a null-prototype object of this realm is still an operator map.
  2. and 4. Changeset notes: corrected in place in the pending note .changeset/34990-nested-relation-filter-node.md (the null-prototype FROM, the = identity row, and the class-instance ordering sentence), not as a later erratum, so the release prints one true note. See DELIBERATE CORRECTION below.
  3. isNestedRelationCondition docblock now names the exact refused population instead of "refuses anything else".
  4. Stale related-id comments in DatasetWidget.tsx, DrillDownDrawer.tsx and DatasetReportRenderer.tsx now describe the nested-relation drill (schema reads per hop, no related id read, too-many no longer produced). Comment-only.

Producer side. All four shapes are authored filter data handed to the converter or to find; the spec already refuses three of them on the server path, and the fourth (the anchor) is a declared shape this in-memory face cannot evaluate, so it says so. No spec change, no consumer tolerance added.

Round 2: the contract review's should-fixes (comment 7037477278)

Item Where What changed
S1 34990 note, FROM line not_contains threw only once the scan reached a row holding a string, and served every row when none did; worded as the record says (quoted below)
S2 35735 note, shapes 2, 3, 4 FROM lines completed: shape 2 the right answer taken away and the orderings as text; shape 3 the null-prototype TypeError and $notContains every row; shape 4 the text operators serving rows on String() and $notContains the complement; all three the identity row on $eq / = / $in
S3 converter, changeset foreign-realm whole condition gets its own throw before the exotic one, same envelope, naming the copy; the changeset's caller's-fix paragraph names { ...condition } per operator map or structuredClone(filter)
S4 classInstanceComparandRefusalReason, both notes "through its valueOf when that returns a primitive; otherwise as its text"; prose only, the refusal itself goes to a card
S6 foreign-realm-object.ts, both faces one structural test; the two misnamed cases pinned on the converter, the $ arm and the AST arm
N1 filter-converter.test.ts one full-sentence pin per flag operator ($null, $exists, $empty)
N2 ValueDataSource.ts the anchor is the spec's test ($now === true or a string); { $now: 0 } / { $now: false } take the $-key sentence, pinned
N3 ValueDataSource.ts the anchor sentence ends in its remedy, pinned
N5 ValueDataSource.ts the unreachable ?? keys[0] dropped
N6 35735 note, ADR-0087 marker the reason names { $foo: 1 }

S5 is filed as a card by the coordinator; N4 and N7 are left as the record allows.

Round 3: contract review 7039389887 (M1, N8 to N10) and L1 7039380353 (N1, N2)

Prose only, plus one read moved inside a try; no behaviour change.

Item Where What changed
M1 34990 note the class-instance sentence says it is not refused as a relation, and is refused under an equality, membership or text operator (pair 4 below)
N9 34990 note, FROM line != served every other row, as the TO line's identity row implies (pair 1 below)
N8 35735 note (shape 4 in round 3; under item 2 since round 4); isNullRootedObject docblock a FROM / TO for Object.create(Object.create(null)); the docblock says it inherits no toString / valueOf from Object.prototype
L1 N1 isNullRootedObject docblock says it relies on the foreign-realm check running first in objectValueRefusal, instead of claiming the predicate tests it
L1 N2 objectComparandRefusal docblock the over-long line now says only what the builder does
N10 foreign-realm-object.ts Array.isArray(value) moved inside the try, so "every read is guarded" holds

Round 4: L1 7039534053 (owed item 1, N3) and contract review 7039556712 (N11)

Changeset prose only; no code change.

Item Where What changed
L1 item 1 / N11 35735 note, the Object.create(Object.create(null)) bullet FROM completed against 1d7015aee (read, not measured): $ne / != and $nin served every other row through !comparandEquals by reference, which is what this change takes away; $between (value >= target[0]) and a text operator on a row holding a string (String(target)) threw, in shape 3's null-prototype phrasing, unless the prototype defines a primitive-returning valueOf or toString; with no row holding a string, $contains / $startsWith / $endsWith served no row and $notContains every row
L1 N3 35735 note the bullet moved from item 4 to item 2, the realm item, whose operator-map test change (no second prototype hop) is what moves it; the BREAKING line's "four filter shapes" stays true

The caveat reads "a valueOf or toString" rather than valueOf alone: an ordering's ToPrimitive (hint number) tries valueOf then toString, and String() tries toString then valueOf, so either one returning a primitive avoids the throw on every listed operator.

DELIBERATE CORRECTION

This PR rewrites five sentences of a PENDING release note it did not add, .changeset/34990-nested-relation-filter-node.md (the nested-relation drill note for @object-ui/core, still unreleased on origin/main). Check Changeset reds on that by design (check-empty-changeset); the correction is declared here for the dispatching seat to confirm. No other line of that note changes. Each "Before" is the merge-base text; each "After" is this head's.

  1. The FROM line (the null-prototype population, and != served every OTHER row: the identity row of pair 2 is the one it did not serve; not_contains served that row too, since its arm reads only a string value). Judged against eed422ea2^: value > target converts the object whatever the stored value is, so an ordering threw on any non-empty source; the not_contains arm is !(typeof value === 'string' && value.includes(String(target))), so it threw only once the scan reached a string.

    Before:

    • FROM: != and not_contains served every row, and an ordering operator compared each value with the text [object Object] and served the string values that happened to sort past it.

    After:

    • FROM: != served every other row (every row but one holding the caller's own object) and not_contains every row, and an ordering operator compared each value with the text [object Object] and served the string values that happened to sort past it. That holds for an object whose prototype is Object.prototype. A null-prototype object has no toString or valueOf, so an ordering operator threw TypeError: Cannot convert object to primitive value and find rejected; not_contains threw as soon as it reached a row holding a string, and served every row when none did.
  2. The = sentence in the TO line (the identity row: comparandEquals falls to ===, and create / update copy shallowly).

    Before:

    = matched no row before and matches none now; it only gains the log line.

    After:

    = compared by reference, so it matched no row unless a row held the caller's own object (stored through create or update, which copy shallowly), and that row matched; it matches none now and gains the log line.

  3. The same identity row, where the note's ValueDataSource paragraph restates the old answer.

    Before:

    Before this, = compared the object by reference and matched no row without a word, and != matched every row.

    After:

    Before this, = compared the object by reference and matched no row without a word, unless a row held the caller's own object, and != matched every other row.

  4. The class-instance sentence. It said a class instance is not refused, and this PR refuses one under the eight equality, membership and text operators (and as a whole condition, in the converter), so both notes in one release would contradict each other (contract review 7039389887, M1). It also carried the S4 falsehood: a Map or a class with no valueOf compares as its text.

    Before:

    A class instance is not refused, even one with keys of its own such as a moment, luxon or decimal object: it is a value, and an ordering operator still compares it through its valueOf.

    After:

    A class instance is not refused as a relation, even one with keys of its own such as a moment, luxon or decimal object: it is a value. An ordering operator compares it through its valueOf when that returns a primitive, otherwise as its text; under an equality, membership or text operator it is refused, in a sentence of its own.

Tests

Round 4, on head 40527030d: changeset prose only, so no test was run. check-empty-changeset --base origin/main --head HEAD exit 1 with exactly one ::error, naming .changeset/34990-nested-relation-filter-node.md (the DELIBERATE CORRECTION); check:nul-bytes exit 0 (26353 text files, no raw control bytes). overlap-check: origin/main merges cleanly, #35129 only (structural, as before).

Round 3, on head e832ca646: @object-ui/core closure rebuilt, then vitest run over filter-converter.test.ts, filter-exotic-comparand-8567.test.ts, filter-refusal-subject-9050.test.ts, ValueDataSource.dollarFilterVocabulary.test.ts and ValueDataSource.astFilterVocabulary.test.ts (these exercise foreign-realm-object.ts through both faces): Test Files 5 passed (5), Tests 411 passed (411); pnpm type-check in @object-ui/core exit 0 (lock VERDICT command-exit 0 over the whole && chain). check-empty-changeset --base origin/main --head HEAD exit 1 with exactly one ::error, naming .changeset/34990-nested-relation-filter-node.md (the DELIBERATE CORRECTION); check-adr-0087-registration --base origin/main 0; check-changeset-no-major --base origin/main 0; check:nul-bytes 0. overlap-check before the push: origin/main merges cleanly, #35129 only (structural, as before). No dogfood rerun: no behaviour moved since d074b4af1, whose tree carries the battery below.

Round-2 readings on head d074b4af1 (measured on f76f47ec6, 20f79b60f and 50036d266, which were rebuilt before the push with model-free commit trailers only; each rebuilt commit has the identical tree, so the readings are of these trees) (the round-2 commits plus a merge of origin/main 1d7015aee, which touched other files of @object-ui/core); earlier readings are named by their head.

  • pnpm --filter @object-ui/core test: Test Files 244 passed (244), Tests 4730 passed, 27 skipped (4757). pnpm --filter @object-ui/core type-check: exit 0. Both on d074b4af1, after rebuilding the @object-ui/core^... closure.
  • Before the merge, on 2dd91cd16: the same pair, Test Files 243 passed (243), Tests 4728 passed, 27 skipped (4755); type-check exit 0. The first run on 7c1dd7fca was red in one test, filter-refusal-subject-9050.test.ts "enumerates every throw site in the converter" (14 sites, 13 rows): the new foreign-realm throw needed its row, added in 2dd91cd16 (subject: the field, as for the other operator-less arms).
  • Round-2 pins: the foreign-realm throw's whole sentence and envelope, and that { ...foreign } and structuredClone(foreign) lower (filter-exotic-comparand-8567.test.ts); Object.create(somePlainObject) and Object.create(Object.create(null)) named as what they are, not as foreign, on the converter, the $ arm and the AST arm; Object.create(Object.create(null)) refused rather than thrown on under every comparand operator; the full flag sentence for $null, $exists, $empty; { $now: 0 } and { $now: false, addDays: 7 } take the $-key sentence; the anchor sentence's remedy; the whole-condition re-seat names the copy.
  • Dogfood battery: on d074b4af1, one lock session that built the @objectstack/dogfood^... closure and then ran pnpm --filter @objectstack/dogfood test (no shard, no path): DOGFOOD_EXIT=0, which is the exit of build && test; the lock's own line is VERDICT batch-last-exit 0 because the echo was joined with ;. Test Files 482 passed, 3 skipped (485); Tests 4098 passed, 68 skipped (4166); no failure. (Round 1, on 0c86f9c32: the same counts.)
Ablations (one per changed behaviour, committed first, through scripts/ablation-replace.mjs; each restored to the HEAD blob with git diff HEAD empty)

The tests import ../ValueDataSource and ../filter-converter by relative path, so the subject resolves to src/; no build leg.

  1. Converter flag door off (if (operatorValue !== true && operatorValue !== false) { in the $null / $exists arm → if (false) {), on 8471b6061: 23 failed, 239 passed. Red: the 18 flag refusals (9 flags x 2 operators), the 2 beside-a-key cases, the cyclic case, and the value-source "converter refuses the same filter" pin for each operator; the $empty refusals and the CONTROLs stay green.
  2. Value-source $null door off (refusal → truthiness read), on 8471b6061: 7 failed, 201 passed. Red: the 7 non-boolean $null flags.
  3. Converter realm test reverted (second prototype hop restored), on 8471b6061: 2 failed, 225 passed. Red: the cross-realm converter pin and the value-source whole-condition pin.
  4. $-keyed refusal off ($now / $foo branch → return undefined), on 0c86f9c32: 36 failed, 271 passed. (Its first run, on 8471b6061, was red too, but its count line was cut by the log filter, so it was re-run.)
  5. Foreign-realm refusal off, on 8471b6061: 17 failed, 290 passed.
  6. Class-instance refusal off (byValue && → false &&), on 8471b6061: 17 failed, 290 passed. Red: 8 per-operator cases, 6 AST cases, 3 same-sentence pins; the ordering CONTROLs stay green.
  7. Round 2, S3: the foreign-realm throw deleted (if (isForeignRealmPlainObject(value)) refuseForeignRealmCondition(field);), on 7c1dd7fca: anchor 1 → 0, blob 7bfc7ad311ea → 09840c53629e; 2 failed, 347 passed. Red: "a CROSS-REALM plain object is a comparand, refused as the spec refuses it" (converter) and "a plain object of another realm as the WHOLE condition is refused in the converter's words" (value source). Restored: blob == HEAD 7bfc7ad311ea, git diff HEAD empty.
  8. Round 2, S6: the structural test's second clause deleted (if (Object.getPrototypeOf(proto) !== null) return false;, which is the converter's old constructor-name decision), on 7c1dd7fca: anchor 1 → 0, blob e578eb4e7ef8 → 892b0bbf3412; 3 failed, 346 passed. Red: the Object.create(somePlainObject) pin in each of the three files (converter, $ arm, AST arm). Restored: blob == HEAD e578eb4e7ef8, git diff HEAD empty.
Local gates (derived with dispatch-gates --commands over this diff, 39 families)

On 8471b6061: 38 exit 0 and pnpm --dir ui exec vitest run scripts/ exit 1, because unit-registry-absence-collision.test.ts could not import @objectstack/client in this fresh worktree (not built). After building the @objectstack/client closure it answered Test Files 171 passed, 2 skipped (173), exit 0. --ran: "39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED". Re-derived on 0c86f9c32: the same 39 families; the merge changed none of this diff's files. Also: check-new-cross-file-line-citations 0 new; check-nul-bytes exit 0; eslint on the changed files: 0 errors in the core files (one pre-existing react-hooks error in DatasetReportRenderer.tsx, far from the comment edit). CI runs the full farm.

Changeset-derived gates on b559fc5a5: check-adr-0087-registration --base origin/main exit 0 and --self-test exit 0; check-changeset-no-major --base origin/main exit 0; check-empty-changeset --base origin/main exit 1, its one refusal naming .changeset/34990-nested-relation-filter-node.md ("present on the merge base and CHANGED by this PR"), the DELIBERATE CORRECTION class; check-empty-changeset --self-test exit 0; pnpm check:changeset-gate-self-tests exit 0. dispatch-gates --commands re-derived on b559fc5a5: the same 39 families. overlap-check before the push: origin/main merges cleanly; overlap with #35129 only (the standing Version Packages PR, which deletes every pending changeset, the 34990 note among them).

Round 2, on d074b4af1: dispatch-gates --commands derived the same 39 families (13 paths vs merge base 1d7015aee). 37 exit 0; check-empty-changeset --base origin/main exit 1, its one refusal again naming .changeset/34990-nested-relation-filter-node.md (the DELIBERATE CORRECTION above); pnpm --dir ui exec vitest run scripts/ exit 1 first (the same unbuilt @objectstack/client import in unit-registry-absence-collision.test.ts), then exit 0 after building the @objectstack/client... closure: Test Files 171 passed, 2 skipped (173), Tests 5092 passed, 2 skipped (5094). --ran with exit codes: "39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED (a DERIVED zero — all 39 recorded an exit code and none of them is 3)". pnpm check:new-line-citations exit 0, 0 false. eslint --no-inline-config on the eight changed core files: 0 errors (52 pre-existing no-explicit-any warnings). overlap-check before the push: VERDICT overlap exit 1; origin/main merges cleanly; the only conflict is #35129 on .changeset/34990-nested-relation-filter-node.md, the same structural overlap as before.

Acceptance notes

  • Measured premises. $null / $exists: the spec's FilterConditionSchema refuses every non-boolean flag (Operator "$null" on field "f" requires a boolean comparand), the comparand door refuses an object flag, and the query faces (driver-memory, driver-mongodb, driver-sql) refuse all non-booleans. The AST null-ness operators carry no flag (parseFilterAST ignores the slot), so that leg of the card needed no change. Anchor: kept by the door, resolved by the platform. Class instance: refused by the door at every operator. Cross-realm: refused by the door as a literal.
  • Narrowing of published exports (convertFiltersToAST, ValueDataSource#find), declared: ! title, BREAKING with FROM / TO in the changeset, ADR-0087 not-required marker. Owed: one CONTRACT_REVIEW_TIER review.
  • Out of scope, noted: ValueDataSource's AST arm refuses the AST spellings null / exists (['f', 'null', true]) as "not implemented", while the spec's parseFilterAST reads them as $null / $exists; they are not in VALID_AST_OPERATORS and no producer in the tree emits them.
  • The fold's two cards were already closed into this one by the triage seat; this body names them without a closing keyword.
  • File surface, round 2. Two paths outside the claim's list: the new internal module ui/packages/core/src/utils/foreign-realm-object.ts (the one structural test S6 asks for, shared by both faces without adding a package export), and ui/packages/core/src/utils/__tests__/filter-refusal-subject-9050.test.ts (one row: that suite enumerates every converter throw site and reds on a new one without its row).
  • Merge order. If chore: version packages #35129 (Version Packages) merges before this PR, the 34990 note is consumed with its false sentences and the correction then needs a docs-only CHANGELOG amendment.

Verification

Read first, by risk:

  1. ValueDataSource.ts, objectValueRefusal / objectComparandRefusal and the two by-value operator sets: the population each refusal covers and which operators judge a class instance.
  2. filter-converter.ts, isOperatorMap and refuseForeignRealmCondition with foreign-realm-object.ts (the realm test), and the $null / $exists arm with refuseNonBooleanFlag.
  3. The new top-level describes at the end of ValueDataSource.dollarFilterVocabulary.test.ts.

Two-minute check: pnpm --dir ui exec vitest run packages/core/src/adapters/__tests__/ValueDataSource.dollarFilterVocabulary.test.ts packages/core/src/utils/__tests__/filter-converter.test.ts — expect every case green, including the non-boolean flag refusals on both faces and the CONTROL legs for true / false.


Generated by Claude Code


Body refreshed 2026-11-20T12:31Z for rework round 4 (L1 7039534053 owed item 1 + N3; contract review 7039556712 N11), head 4052703.

@github-actions github-actions Bot added size/l 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 20, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH

Seat check

L1: ACCEPT on code and tests (L1-a, for area d7-C) at head 0c86f9c328fd5807dff55e8e52aedbc4bf27a3eb, read 2026-11-20T10:33Z. This covers the fold group #35735, #35738 and #35533.

  • One changeset edit is owed before landing: a new head that changes only .changeset/, then a delta L1 (below).
  • One L2 is owed: CONTRACT_REVIEW_TIER on the head that lands. The change is declared narrowing, so the L2 covers the whole non-prose diff and must also name the correction below. d7-C has started it. Starting it now is fine, but its PASS has to be on the final head.
  • Condition: CI green on the final head. When I read, 12 runs were success, 13 skipped and 30 in progress.

Owed: correct the pending 34990 note in place, not by an erratum in a later note

The new changeset ends with "Corrections to earlier notes (the nested-relation drill note for @object-ui/core)". That note is .changeset/34990-nested-relation-filter-node.md, and it is still pending on this head. Both notes compile into the same release, so the CHANGELOG would print the 34990 FROM ("an ordering operator compared each value with the text [object Object]", "= matched no row before") and, a few entries later, a paragraph saying those sentences are wrong.

The repository's route for a pending note that a PR shows to be false is the DELIBERATE CORRECTION (check-empty-changeset, #17712 ruling D, landing-operations.md): edit the note in place and declare it on the PR. AGENTS.md's CHANGELOG row gives the same reason for released entries: a correction anywhere other than the entry itself is one the reader never reaches.

So:

  1. Rewrite the two sentences in .changeset/34990-nested-relation-filter-node.md, using the corrections' own words:
    • the ordering FROM holds for a Object.prototype object, while a null-prototype object threw TypeError: Cannot convert object to primitive value and find rejected;
    • = compared by reference, so a row holding the caller's own object matched.
  2. Delete the "Corrections to earlier notes" section from the 35735 note.
  3. Add a DELIBERATE CORRECTION section to the PR body that names the note and quotes each sentence before and after.

Check Changeset then goes red by design. The diff changes code, so the same-head at-tier L2 PASS is the confirming record and must name both sentences. Measured against the merged code, both corrections are true as stated: isPlainObject now admits only this realm's Object.prototype / null, and the drill note's FROM described the old by-reference and text comparison. ⛔ Nothing touches Version Packages #35129. If it lands first, the remedy is a docs-only PR that amends the released entry.

Declarations

  • Clause-②: no (narrowing) is right: published convertFiltersToAST and ValueDataSource#find now refuse four filter shapes they answered.
  • The breaking record is complete:
    • ! on the title and the subject;
    • a BREAKING banner with FROM / TO per shape;
    • a fix line;
    • the ADR-0087 marker not-required (no-migration-prescription);
    • Skills-docs: none with a reason that holds;
    • the dogfood battery green (482 passed, 3 skipped).
  • Ruling A (a class instance under orderings and $between keeps valueOf) is right. It keeps fix(core)!: the value data source refuses a plain-object comparand under a $ operator, as under the AST operators #35604's recorded disposition, which I accepted there, and B would need a maintainer word.

Code (L1 read; depth is the L2's)

  • isPlainObject. proto === null || proto === Object.prototype, the spec walk's and the engine's isNoOperatorObject test. A cross-realm object is now a comparand, and is refused by name ("a plain object from another realm") in the converter and the value source.
  • refuseNonBooleanFlag. One sentence for $null / $exists / $empty. It renders the received value defensively, since a cyclic flag cannot throw from the message. true / false lower exactly as before (isNull per operator).
  • AST is_null / is_not_null. Pinned as a CONTROL, not changed. The dev's measurement that they carry no flag matches parseFilterAST, which never reads the value slot. Pinning a false premise rather than "fixing" it was the right call.
  • The { $now, addDays } anchor is refused by name on the value source, for the existing { $field, addDays } reason (no field types to pick a temporal form), and is still lowered verbatim for a server source. The card allowed either.
  • The dashboard and report hunks are comment-only, as claim 7034352571 names (Nested-relation filter follow-ups from PR #35423: cross-realm plain object, null-prototype FROM line, stale related-id comments #35533 item 5). They now describe the nested-relation drill (no related-id read), and keep too-many "for compatibility".
  • Ablations. Six, each red.

Prose, sentence by sentence (35735 note, apart from the section above)

  • Each of the four FROM / TO pairs matches the converter and value-source arms, and the quoted messages match the code text.
  • "Not moved" (scalar, Date, { $field }; $empty's refusal now built by the shared helper; a this-realm null-prototype object still an operator map) holds.
  • The fix line names a working spelling for each shape.

Out-of-scope findings

  • AST 'null' / 'exists' refused as not implemented on the value source. Do not file it on its own. It is a spelling the spec's parseFilterAST reads and this face does not, so fold it into the next value-source vocabulary card if one comes. Filing it alone would fail the business test, because no named producer emits those spellings.
  • The pre-existing lint error in DatasetReportRenderer. It is not this PR's, and CI's Lint UI decides whether it is real on main. If it is red on main, the lane that owns plugin-report files it.

Gates and routing

Tier H per d7-C. After the corrected head, its delta L1, the same-head CONTRACT_REVIEW_TIER PASS naming the 34990 correction, and CI green apart from Check Changeset, landing takes os-zhuang's approval or the #35610 enqueue route.


Generated by Claude Code

…ead of a later erratum

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH

Seat check (delta)

L1: ACCEPT (L1-a, for area d7-C) at head b559fc5a567a856413ba7d2e8fee852838ff336b, read 2026-11-20T10:41Z. This closes the changeset edit owed by 7037308590. My code ACCEPT there carries forward: git diff 0c86f9c3 b559fc5a touches only .changeset/.

Conditions remaining:

  • the same-head CONTRACT_REVIEW_TIER PASS on b559fc5a, which names both corrected 34990 sentences, since it is the confirming record for a diff that changes code;
  • CI green apart from the by-design Check Changeset red.

DELIBERATE CORRECTION: .changeset/34990-nested-relation-filter-node.md

  • FROM. The [object Object] sentence is kept, and two sentences follow it: "That holds for an object whose prototype is Object.prototype. A null-prototype object has no toString or valueOf, so under not_contains and the ordering operators the comparison threw TypeError: Cannot convert object to primitive value and find rejected."
    • This is true. Coercing a null-prototype object to a primitive throws.
    • not_contains is added on the dev's probe at eed422ea2^, which I accept: its text arm coerces the comparand the same way.
  • TO. "= matched no row before" becomes "= compared by reference, so it matched no row unless a row held the caller's own object (stored through create or update, which copy shallowly), and that row matched; it matches none now and gains the log line." This is true by the by-reference compare.
  • The 35735 note. The "Corrections to earlier notes" section is removed, so each fact now has one home.
  • The PR body's ## DELIBERATE CORRECTION quotes each sentence before and after.
  • Check Changeset. Its only refusal names the 34990 file. The other changeset gates exit 0.

Routing

Tier H. Landing takes os-zhuang's approval or the #35610 enqueue route, after the same-head L2 PASS. Landing before Version Packages #35129 is preferred. If #35129 lands first, the remedy is a docs-only PR that amends the released entry. ⛔ Nothing touches #35129.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 0c86f9c328fd5807dff55e8e52aedbc4bf27a3eb
Local-runs: none
Scope: ui/packages/core/src/utils/filter-converter.ts, ui/packages/core/src/adapters/ValueDataSource.ts, ui/packages/core/src/utils/tests/filter-converter.test.ts, ui/packages/core/src/utils/tests/filter-exotic-comparand-8567.test.ts, ui/packages/core/src/adapters/tests/ValueDataSource.dollarFilterVocabulary.test.ts, ui/packages/core/src/adapters/tests/ValueDataSource.astFilterVocabulary.test.ts, ui/packages/plugin-dashboard/src/DatasetWidget.tsx, ui/packages/plugin-dashboard/src/DrillDownDrawer.tsx, ui/packages/plugin-report/src/DatasetReportRenderer.tsx, .changeset/35735-filter-flag-and-comparand-edges.md + packages/spec/src/data/filter-comparand-type.ts, packages/spec/src/data/filter-comparand-operators.ts, packages/spec/src/data/filter.zod.ts, packages/objectql/src/no-operator-object-door.ts, packages/drivers/driver-memory/src/filter-refusal.ts, packages/drivers/driver-mongodb/src/mongodb-filter.ts, .changeset/34990-nested-relation-filter-node.md, scripts/check-adr-0087-registration.mjs, ui/packages/core/src/adapters/ValueDataSource.ts at eed422ea2^
Security-touching: no

Read: cards #35735, #35738 and #35533 (each body and every comment: triage 7030501188, 7030509150, 7012617407; fold rulings 7031136570, 7031378010, 7031288627; claim 7034352571; os-dev-report 7037265653); comment 7012153506 on #35493; the L1 ACCEPT 7037308590; predecessor PR #35604 (body, records 7030429102 and 7033228118); PR #35832 (body, the 10-file list, the net diff against merge-base 65fddc843, +698/-82; origin/main was 1d7015aee); AGENTS.md (Prime Directive #12, Documentation Guardrails, Post-Task Checklist step 3) and ui/AGENTS.md (§5, §9). Code outside the diff was read on the head. The checkout has no installed dependencies, so nothing was built or run: every counterexample below is derived by reading and none is measured. Check-runs on the head when read: 19 success, 13 skipped, 23 in progress (all 16 Test UI shards, Lint UI, Type Check UI, Build & E2E UI among them), none red. Check Changeset and Dogfood Regression Gate read success.

This record covers 0c86f9c32 only. A changeset-only head is announced (L1 7037308590); its delta is a separate record.

Result: PASS. No must-fix. Open on this head: S1 to S6 (should-fix), N1 to N7 (nits). S1, S2 and S3 are changeset-only and fit the head that is already owed.

① Derived judgments

  1. The flag door ($null / $exists), both faces: the refused population is right. Refused: every value that is not true or false. The server refuses the same set, though not at the door the card names: normalizeFilterComparandTypes keeps a string, a number and null under $null (judgeLiteralComparand accepts them as types) and refuses only an object or undefined there. The full refusal is FilterConditionSchema and the drivers' own arms (driver-memory/src/filter-refusal.ts, driver-mongodb/src/mongodb-filter.ts: "requires a boolean comparand (true or false)"). The PR body states this correctly; the card body was loose. Tried, all refused on both faces: 'no', 'false', 0, 1, null, undefined, {}, { owner: 'u1' }, new Boolean(true), a cyclic object. Two values get the same verdict in another sentence on the value source, as before this PR: [] (the array-comparand sentence, the array guard runs first) and { $field: 'x' } (the reference sentence). Nothing the server serves is refused.
  2. The AST null-ness leg is false as a premise, and the CONTROL is the right answer. convertComparison returns { $null: true } / { $null: false } from the operator name and never reads the slot; matchesComparisonNode does the same and AST_NO_COMPARAND_OPERATORS keeps the builder and the array guard off the slot. Nothing to change.
  3. The $-keyed plain object (value source, both arms): right, no over-narrowing. objectValueRefusal steps around anything with a $field key (resolved or refused by resolveFieldReference, unchanged: a non-string $field, an addDays offset, a dotted path, an operator outside the six comparisons, a list member). Everything else with a $ key is refused under every operator that reads a comparand, whole or as a list member. The spec refuses { $foo: 1 } as a literal and steps around a well-formed anchor; the value source serves no row for either, and never did serve a right one.
  4. The class instance under the eight by-value operators: right against the door. judgeLiteralComparand refuses every non-plain object that is not a Date, at every scalar operator and list member. Covered by the same branch and refused: new Number(1), new String('x'), new Boolean(true), a RegExp, a Map, a cross-realm Date. Kept: a Date (valid or not), by isAcceptedFilterComparand. AST_BY_VALUE_OPERATORS holds the canonical names canonicalAstOperator returns for those eight, so every spelling (==, <>, not_in, startswith, 'not in') reaches it.
  5. The cross-realm plain object: the one place this PR takes away a right answer. { age: F } with F = { $gte: 18 } built in another realm lowered to ['age', '>=', 18] and, on the value source's object arm, answered the age >= 18 rows (loweringConditionRefusal routed it, the converter lowered it, the operator loop read it). Both now refuse. The card orders it (Nested-relation filter follow-ups from PR #35423: cross-realm plain object, null-prototype FROM line, stale related-id comments #35533 item 1: align with isFilterNode / isNoOperatorObject), the two tests are now the same prototype test, and the changeset declares the lowering. Accepted as ruled. What is owed in prose: S2 and S3.
  6. "The server refused it already" holds in process only. Every "the spec refuses" in this PR is normalizeFilterComparandTypes called on the live object. A filter that reaches the server as JSON has lost its realm and its class: a cross-realm operator map arrives plain, a moment arrives as its ISO string. So for a host that sends the object form over HTTP, the server served these. No row the value source answered correctly is lost by items 3 and 4; item 5 is the exception.
  7. Object form against lowered form: no split found. Flags: the converter refuses, so there is no lowered node; the hand-written node carries no flag. Comparands: both arms call objectComparandRefusal with the same listOperator and byValue reading, and the sentences name no operator, so the lines are equal (six pins). Whole-condition forms ({ f: instance }, { f: foreignObject }) go to the converter on both paths. One standing difference of reach, not of dialect: S5.
  8. Not moved, read in the tree: scalars, Date, { $field }; a class instance under the orderings and $between; $icontains for a class instance (its text door); a this-realm null-prototype or frozen object (an operator map; freezing does not touch the prototype); arrays as list members; undefined, a function and a symbol as comparands (still compared by ===; outside the cards).
  9. No export is added, removed or renamed. refuseNonBooleanFlag, FLAG_OPERATOR_DIRECTIONS, the two by-value sets and every new reason builder are module-private. ACCEPTED_FILTER_COMPARAND_TYPES_SENTENCE is a new value import from the module the file already imports.

② Semver level

  • Level. '@object-ui/core': patch is right: Metadata-protocol: none (no key, accepted metadata value or type moves) takes patch, and a breaking non-protocol change keeps its banner at that level.
  • Declarations. Clause-②: no (narrowing) and Metadata-protocol: none are line-initial on the claim, the PR body and the changeset. The ! is on the title and the changeset summary; the BREAKING paragraph is present.
  • ADR-0087 marker. Owed, present, exactly one: not-required (no-migration-prescription). Right category: nothing a migration could rewrite moves, and it is the predecessor's disposition for the same surface. Its reason leaves out one refused shape (N6).
  • FROM / TO, against the base code.
Shape Verdict
1 flag True. '', NaN and undefined also read false; [] was already refused on the value source and lowered by truthiness in the converter. Not worth a line.
2 cross-realm Incomplete: S2 (the right answer that is lost, the orderings, the identity row) and S3 (no fix line).
3 $-keyed Incomplete: S2 (a null-prototype one threw; the identity row; $notContains).
4 class instance Incomplete: S2 (text operators answered rows; $notContains was not "every row"; the identity row). "Not moved … through its valueOf" is false for part of the population the item names: S4.
Not moved, caller's fix True for shapes 1, 3 and 4. Shape 2 has no fix: S3.
  • Quoted sentences. Each quoted TO fragment matches the code text on the head.

③ Boundary flags

  • "Corrections to earlier notes" sits in the wrong note on this head. .changeset/34990-nested-relation-filter-node.md is still pending, so the route is an in-place DELIBERATE CORRECTION, as L1 7037308590 says. S1 carries the judgment of the two sentences against eed422ea2^.
  • Open question (class instance under the orderings): A is accepted for this PR, and it needs a carrier. Value data source: a $-keyed plain object (including the { $now, addDays } anchor) and a class instance under equality, negation and text operators are still compared by reference or as text #35738 (2) names equality, negation and text operators only, so the orderings are outside the card. But the report's ground is thinner than written: comment 7012153506 rules that a class instance is data and not an operator map; it does not rule that the value source should serve it where the door refuses. And A leaves real wrong rows: S4. B stays a maintainer word.
  • Anchor refused by name: the right option of the two. Resolving needs the column's temporal form and a zone for "today"; the value source has neither, a stored '2026-01-01' and a stored Date would need opposite readings, and the file already refuses { $field, addDays } on that ground and declines to coerce a Date against an ISO string. Guessing a form from each stored value would answer per row. No producer under ui/ emits $now (git grep on the head: none outside this file and its tests). The sentence lacks the remedy: N3.
  • Out-of-scope finding 1 (AST 'null' / 'exists'): not a card. Neither spelling is in AST_OPERATOR_MAP, so isFilterAST answers false for the node and the wire does not accept it; parseFilterAST reads it only through its $${op} fallback. The value source refuses it loudly and serves no row. Refusing an undeclared spelling is the right answer, and no producer emits it.
  • Out-of-scope finding 2 (the react-hooks/static-components error): not a card. The line is under an eslint-disable-next-line that gives its reason (DatasetReportRenderer.tsx, above the ChartComponent render). --no-inline-config reports a declared suppression. Lint UI was still in progress when read; only a red there would change this.
  • Three widget files. Comment-only; too-many is no longer produced (dataset-format.ts says the same and keeps the member deprecated). The DrillDownDrawer.tsx hunk is a JSDoc on an exported type, so it reaches that package's .d.ts; the fixed version group bumps it with core. Accepted.
  • Skills-docs: none. Holds: no page under content/docs or skills/ names ValueDataSource or these shapes.
  • File surface and author. All ten paths are inside claim 7034352571. The PR's user.login is objectstack-fleet[bot].
  • SQL push-down. No finding: no query, id read or in-app join is added.

④ Design judgment

Are the pins real?

Pin Result
Converter flag refusals (9 flags x 2 operators, envelope, beside a key, cyclic) Real for the verdict, the envelope and the first clause. The received value and the prescription are not pinned: N1.
Converter CONTROL true / false with parseFilterAST round-trip Real: four cases, node and read-back both asserted.
Value-source flag refusals (7 flags x 2 operators) and CONTROL in both forms Real: row set, one line, the sentence.
AST null-ness CONTROL Real: false and 0 in the slot still answer the IS NULL rows, cross-checked with the spec. It would red a flag door added there.
Anchor, $-keyed and foreign-realm, per operator from FILTER_OPERATORS Real. The kind table is held equal to the spec's list, so a new operator reds the test before it ships undecided.
Class instance, 8 operators, both arms; $between and between CONTROL Real for an instance with a numeric valueOf. No pin for one without (Map, RegExp) or for a boxed primitive: S4.
Cross-realm in the converter, with the spec door cross-check; null-prototype CONTROL Real. The old pin held exactly the removed branch, so replacing it is right.
Six object-form against lowered-form pins Real: toEqual on the whole line set.

Ablations. Six, each mapped to red pins: 1 converter flag door, 2 value-source $null door, 3 realm hop, 4 $-keyed and anchor branch, 5 foreign-realm refusal, 6 class-instance refusal. Two changed behaviours share an ablation or have none: the value-source $exists door (its pins exist per operator and would red; no run recorded) and the anchor apart from $foo. Minor: N7.

Design. One helper per sentence on each face and one builder for both arms is the right shape, and the order in objectValueRefusal (relation, empty, reference, anchor, other $ key, foreign realm, class instance) leaves no object unjudged under a by-value operator. What gives way is prose (S1 to S3), one population left as text (S4), a per-row refusal under $or (S5) and one inherited sentence (S6).

S1 (should-fix) — the corrections belong in the pending note, and one of them needs a condition. .changeset/35735-filter-flag-and-comparand-edges.md:33-36. Judged against ui/packages/core/src/adapters/ValueDataSource.ts at eed422ea2^ (the AST switch, find, create, update):

  • Sentence 1, "under >, >=, <, <= and not_contains the comparison threw TypeError: Cannot convert object to primitive value and find rejected". True for the four orderings on any non-empty source: value > target converts the object whatever the stored value is. For not_contains it is conditional: the arm is !(typeof value === 'string' && value.includes(String(target))), so it threw only when the scan reached a row whose value is a string, and served every row otherwise.
  • Sentence 2, "= compared by reference, so a row holding the caller's own object, stored through create or update, which copy shallowly, matched". True: comparandEquals falls to ===, create stores { ...data }, update spreads, and only the constructor clones. The same row was the one != did not serve.

Fix: move both into .changeset/34990-nested-relation-filter-node.md in place, delete the section here, declare the DELIBERATE CORRECTION on the PR body. Word the first as "an ordering operator threw … and find rejected; not_contains threw as soon as it reached a row holding a string".

S2 (should-fix) — three FROM lines repeat the two omissions this PR corrects in the other note, and two leave out rows that were served. .changeset/35735-filter-flag-and-comparand-edges.md:19, :22, :25.

  • Shape 2 (:19): the value source answered { age: foreignObject } with $gte: 18 with the right rows; say so, since this is the answer taken away. Under an ordering operator a foreign plain comparand compared as the text [object Object]; FROM gives = and != only.
  • Shape 3 (:22): a null-prototype $-keyed object threw TypeError under the orderings and $between, and under a text operator on a string row, so find rejected. $notContains also answered every row.
  • Shape 4 (:25): $contains / $startsWith / $endsWith matched on the instance's String() text and served rows (new String('ab'), a class with toString); $notContains served the complement, not every row.
  • Shapes 2, 3 and 4: $eq / = / $in matched a row holding the caller's own object, stored through create or update.

Fix: add these to the three FROM lines; no code moves.

S3 (should-fix) — shape 2 has no caller's fix, and its refusal sentence prescribes the wrong ones. .changeset/35735-filter-flag-and-comparand-edges.md:31 lists a fix for the flag, the comparand, the relative date and the class instance. An author whose whole filter was built in an iframe or a vm context wrote a valid operator map and gets none. The converter's sentence (ui/packages/core/src/utils/filter-converter.ts:874-890, the !isOperatorMap(value) throw) is the exotic-comparand one: it tells that author a comparison value must be a string, number, …, that until objectui#8567 the value was read as zero operators and the condition dropped (false for this population: until this PR it lowered), and to spell a text match or a date bound. Fix: in the changeset add "rebuild a filter object from another realm in this one ({ ...condition } per operator map, or structuredClone(filter))"; in the converter give the foreign-realm case its own throw before the exotic one, same envelope, saying only a plain object of this realm is read as an operator map or a nested condition and naming that copy. The value source's whole-condition path re-seats it unchanged.

S4 (should-fix) — a class instance with no primitive valueOf is still compared as text under the orderings, and two sentences say otherwise. ui/packages/core/src/adapters/ValueDataSource.ts:1097-1104 ($gt to $lte), $between and their AST twins. { f: { $lt: new Map() } } answers the rows sorting before [object Map]; { f: { $gt: new Money(5) } } for a class with no valueOf compares with [object Object], the defect #35493 closed for plain objects; Object.create(somePlainObject) does the same. The door refuses all of them. Yet classInstanceComparandRefusalReason (:638-643) says the matcher compares an instance "only by order (through its valueOf …)", and the changeset (:24, :27) names a RegExp and a Map and then says such an instance "is still compared through its valueOf". Fix on this PR: in the changeset say "compared through its valueOf when that returns a primitive; otherwise as its text". File the rest as one card (p3, area:data, d7-C): under the orderings and $between, refuse an instance whose valueOf() is not a primitive, and put B (refuse every instance, as the door does) to the maintainer with it. Dedupe words: class instance ordering valueOf text, value data source [object Map].

S5 (should-fix, for a card) — under $or the value source still serves rows for a filter the converter and the server refuse whole. ui/packages/core/src/adapters/ValueDataSource.ts:1147-1167 and the builder call at :1071-1080 refuse per node, per row. { $or: [{ id: 'a' }, { nickname: { $null: 'no' } }] } answers row a, and logs only if some row fails the first branch; convertFiltersToAST throws for the same object and the server answers 400. With the anchor it answers a subset of what the server serves. loweringConditionRefusal (:1475) describes this hazard and closes it for a zero-key or non-plain condition only. It is the file's standing design, $empty has it too, and it predates this PR, so it is not held against this head. But the PR's sentence "the object form and its lowered form cannot answer apart: neither one serves rows" is true at top level and under $and only. Fix: one card to judge the per-node refusals up front, as the zero-key condition is; the test comment gains "outside $or" meanwhile. Dedupe words: value data source $or refusal per row, loweringConditionRefusal walk.

S6 (should-fix) — "a plain object from another realm" is decided two ways, and each misnames a this-realm object. ui/packages/core/src/utils/filter-converter.ts:383 decides by constructor name, so Object.create(somePlainObject) (this realm, constructor Object) is called a plain object from another realm. ui/packages/core/src/adapters/ValueDataSource.ts:606-610 decides by a prototype whose prototype is null, so Object.create(Object.create(null)) gets the same words there, while the converter calls it "an object of an unrecognised type" and the value source calls the first one "a Object instance". Both are refused either way; the sentence is what is wrong. Fix: one structural test in both files (prototype not Object.prototype and not null, and the prototype's own prototype is null, and constructor?.name === 'Object'), used by describeExoticComparand and isForeignRealmPlainObject.

N1 (nit) — ui/packages/core/src/utils/__tests__/filter-converter.test.ts:232 and :259 assert message.split('; ')[0] only. FLAG_OPERATOR_DIRECTIONS (filter-converter.ts:475-479) could swap $null and $exists and stay green, and "byte-identical" for $empty rests on reading: it holds for a flag JSON can render; a cyclic or bigint flag used to throw a raw TypeError from the message builder and is now refused in words. Pin one full sentence per operator.

N2 (nit) — ui/packages/core/src/adapters/ValueDataSource.ts:658: '$now' in value calls every object with that key an anchor, so { $now: 0 } and { $now: true } with no addDays are told "the platform shifts the current instant", where the platform refuses them as malformed. Use the spec's test ($now === true or a string) and let the rest take the $-key sentence.

N3 (nit) — ui/packages/core/src/adapters/ValueDataSource.ts:582-586: the anchor sentence gives the reason and no remedy; the changeset has it. Add "compare with a concrete Date or ISO string here".

N4 (nit) — the four comparand sentences name the field and no operator, by design (one line for both dialects). refuseFilterNode dedupes by sentence, so two offending operators on one field log once. Accepted, as in #35604.

N5 (nit) — ui/packages/core/src/adapters/ValueDataSource.ts:659: ?? keys[0] cannot be reached (a non-empty plain object with no $ key returned earlier as a relation). Drop it.

N6 (nit) — .changeset/35735-filter-flag-and-comparand-edges.md:10: the marker's reason lists the flag, the foreign object, the class instance and the anchor, and leaves out a $-keyed object that is neither ({ $foo: 1 }).

N7 (nit) — no ablation is recorded for the value-source $exists door (ValueDataSource.ts:1164-1167) or for the anchor branch apart from $foo. The pins are per operator and per shape, so a run each would close it.

Implemented-by: claude/issue-35735-filter-flag-and-comparand-edges
Reviewed-by: session_01L9qibvVRcFWKrfWeG5jzPb

VERDICT: PASS

…ructural realm test, and the changeset FROM lines are completed

The converter refuses a plain object of another realm as a field's whole
condition in a sentence of its own, naming the copy that rebuilds it in this
realm, before the exotic-comparand refusal. Both faces decide "foreign
realm" by one structural test, so Object.create(plainObject) and
Object.create(Object.create(null)) are no longer named as foreign. The
value source reads a $now anchor by the spec's test, gives the anchor
sentence its remedy, and states that an ordering compares a class instance
through valueOf only when that returns a primitive. Changeset prose
completed per the L2 record.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH

L1 delta-2 — ACCEPT at d074b4af18d4f632401b955836e48fd4ec94bc65 (2026-11-20T12:19Z)

Delta reviewed: b559fc5a → d074b4af. The PR's own commits are 7c1dd7f and 2dd91cd, plus merge d074b4a of main 1d7015a. git diff d074b4af^2 d074b4af lists the same 13 files as before (34990 and 35735 changesets, ValueDataSource, filter-converter, the new foreign-realm-object.ts, the test files, and the three dashboard/report files covered by claim amendment 7039249318). The merge brings no file into the PR's net diff.

What I checked

  • The structural realm test lives in one place. isForeignRealmPlainObject (foreign-realm-object.ts) needs three things: a prototype that is neither this realm's Object.prototype nor null, that prototype's own prototype being null, and constructor.name === 'Object'. Every read sits inside a try, so a revoked Proxy gets false instead of a second throw. Both faces import it. The converter's old name === 'Object' arm in describeExoticComparand is gone, and isOperatorMap drops its getPrototypeOf(proto) === null leg, so a foreign object is no longer read as an operator map. ✔
  • The converter's refusal order. refuseForeignRealmCondition runs before the !isOperatorMap exotic throw. It uses the same INVALID_FILTER / 400 FilterOperatorError and the same { field } subject. The exact sentence is pinned in 8567 with not.toMatch(/comparand position/). The remedy is a positive control: { ...foreign } and structuredClone(foreign) lower to the same node, and the vm-built { $gte: 18 } spread lowers to ['age', '>=', 18]. 9050 lists it as a throw site, with field as its subject. ✔
  • The near-misses. Object.create({ $gte: 18 }) and Object.create(Object.create(null)) are pinned on both faces as not foreign. The converter answers "a Object instance" / "an object of an unrecognised type … in comparand position". The value source answers through the class-instance arm (by value only) and the new isNullRootedObject arm (every operator, it.each(COMPARAND_OPERATORS)). ✔
  • Flags. The $null / $exists / $empty refusal is pinned as one full sentence: the received value plus both directions. ✔
  • Anchors. isNowAnchorComparand follows the spec's test ($now === true or a string). { $now: 0 } and { $now: false, addDays: 7 } are pinned to the $-key sentence. The anchor sentence now ends with the remedy this face can compare, and that ending is pinned. ✔
  • Prose, sentence by sentence.
    • 34990: there are four corrected sentences against main 1d7015a: (1) the null-prototype FROM addition; (2) the TO = sentence; (3) "Before this … unless a row held the caller's own object, and != matched every other row"; (4) "… through its valueOf when that returns a primitive; otherwise as its text".
    • I re-derived (1) from main's matcher (ValueDataSource.ts:775 / :1004: !(typeof value === 'string' && value.includes(String(target)))). String(target) is only reached on a string row, so not_contains throws on the first string row and serves every row when there is none. ✔
    • (4) is ordinary ToPrimitive with the number hint. ✔
    • 35735: the shape 2/3/4 FROM lines and the realm remedy match the code and the pins above. ✔
  • CI at d074b4af.
    • 22 success, 15 skipped, 21 in progress (Test UI shards, Type Check UI), 2 failure.
    • Both failures are Check Changeset, which is red by design (DELIBERATE CORRECTION of the pending 34990 note, done in place).

Owed before landing (a prose rider, folded into the final head before L2)

  1. One shape that moves is not named in 35735.
    • The shape: an object whose prototype is a null-prototype object with no constructor, such as Object.create(Object.create(null)).
    • FROM (main):
      • main's isOperatorMap read it as an operator map, so with own $ keys it lowered;
      • in value-source comparand position it was compared by reference under $eq / $in;
      • under an ordering, $between or a text operator on a string row it threw TypeError: Cannot convert object to primitive value.
    • TO: both faces refuse it ("an object of an unrecognised type"), the value source under every operator.
    • The fix: add it as one FROM/TO clause in item 2 or under Not moved. It is a narrowing like the other four.

Nits (not blocking)

  • N1. The isNullRootedObject doc says "and that is not a foreign plain object". The function does not test that; the call order in objectValueRefusal (foreign first) makes it true. Either say so or add the guard.
  • N2. The objectComparandRefusal doc line "…and otherwise as its text, so it is not refused there. A Date and a { $field } reference are still compared." now runs past the wrap width.

L2 owed (unchanged route)


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: d074b4af18d4f632401b955836e48fd4ec94bc65
Local-runs: probe — node scripts/check-empty-changeset.mjs --base origin/main --head d074b4af1 (exit 1, one refusal naming .changeset/34990-nested-relation-filter-node.md), run to confirm Check Changeset is red by design and for that cause only
Scope: ui/packages/core/src/utils/foreign-realm-object.ts, ui/packages/core/src/utils/filter-converter.ts, ui/packages/core/src/adapters/ValueDataSource.ts, ui/packages/core/src/utils/tests/filter-converter.test.ts, ui/packages/core/src/utils/tests/filter-exotic-comparand-8567.test.ts, ui/packages/core/src/utils/tests/filter-refusal-subject-9050.test.ts, ui/packages/core/src/adapters/tests/ValueDataSource.dollarFilterVocabulary.test.ts, ui/packages/core/src/adapters/tests/ValueDataSource.astFilterVocabulary.test.ts, .changeset/35735-filter-flag-and-comparand-edges.md, .changeset/34990-nested-relation-filter-node.md + ui/packages/core/src/index.ts, ui/packages/core/src/adapters/ValueDataSource.ts at eed422ea2^, scripts/check-empty-changeset.mjs
Security-touching: no

Delta record, same-head, at tier. It follows record 7037477278 (PASS at 0c86f9c32) and judges the PR's own delta from that head: three commits (b559fc5a5, 7c1dd7fca, 2dd91cd16) and one merge of origin/main 1d7015aee. The merged-in main files are not judged. The net diff against origin/main is 13 files, +912/-87; the three widget files did not move since 0c86f9c32. Read: the delta of each file in Scope, the new module in full, the PR body's Round 2 table and DELIBERATE CORRECTION section, both notes on the head. Nothing was built or run except the one gate above; every counterexample is derived by reading. Check-runs on the head when read: 20 success, 15 skipped, 23 in progress, 2 failure, both Check Changeset (see ③).

Result: FAIL on one must-fix, M1: a changeset-only edit of one clause. Everything else in the round is resolved or accepted. New on this head: N8 to N10 (nits).

① Derived judgments

  1. The earlier findings, one by one.
Item Verdict on this head
S1 Resolved. The corrections sit in the 34990 note in place, the erratum section is gone from the 35735 note, and not_contains carries its condition.
S2 Resolved. Shape 2 names the right answer taken away, the orderings as text and the identity row; shape 3 the null-prototype TypeError, $notContains and the identity row; shape 4 the text operators on String(), the complement and the identity row. Each is true of the base code.
S3 Resolved. refuseForeignRealmCondition throws before the exotic throw, same envelope, with its own sentence and the copy as the remedy; the caller's-fix line names the copy.
S4 Resolved as far as this PR goes: the refusal sentence, three docblocks and both notes now say "through its valueOf when that returns a primitive; otherwise as its text". The refusal under the orderings is still owed a card; whether it is filed was not checked here.
S5 Not folded, by agreement (a card). Stands.
S6 Resolved. One structural test in foreign-realm-object.ts, used by both faces; Object.create(somePlainObject) and Object.create(Object.create(null)) are named alike on both and pinned on the converter and both arms.
N1, N2, N3, N5, N6 Resolved: a full-sentence pin per flag operator; the anchor by the spec's test with two pins; the remedy in the anchor sentence, pinned; the dead fallback dropped; { $foo: 1 } in the marker's reason.
N4, N7 Left as the record allowed.
  1. isForeignRealmPlainObject: right, with no false positive or negative that changes a verdict. Three conditions: the prototype is neither this realm's Object.prototype nor null; the prototype's own prototype is null; the prototype's constructor is named Object. Tried:
    • a vm or iframe { … }: true, as intended;
    • Object.create(somePlainObject), a class instance, a foreign Date or array: false;
    • Object.create(Object.create(null)): false (no constructor);
    • a foreign Object.create(null): false, and plain by isPlainObject, as the spec reads it;
    • a false positive needs a this-realm prototype with a null prototype and a forged constructor named Object; a false negative needs a foreign realm whose Object.prototype.constructor was removed. Both are still refused: by the exotic throw in the converter and by isNullRootedObject on the value source. Only the wording differs.
  2. Throw order in the converter: right. Array, then the accepted-comparand test (Date), then foreign realm, then exotic, then the empty map. A foreign {} gets the foreign sentence, which is the truer one. The value source's whole-condition path re-seats the same sentence (pinned).
  3. Flag refusal messages: unchanged since 0c86f9c32, now pinned whole for $null, $exists and $empty, directions included.
  4. A new refused population on the value source, the same row set as 0c86f9c32. isNullRootedObject refuses, under every operator, an object whose prototype has a null prototype and that is not a foreign plain object. At 0c86f9c32 the wider foreign-realm test refused the same objects under the wrong name, so no row moves in this round. Against the base it is undeclared: N8.
  5. No export moves. foreign-realm-object.ts is not re-exported: ui/packages/core/src/index.ts exports ./utils/filter-converter.js, which imports the function and does not re-export it.

② Semver level

Carried from record 7037477278: '@object-ui/core': patch, both declaration lines, the !, the BREAKING banner and the not-required (no-migration-prescription) marker stand. The 35735 note's FROM / TO now hold for all four shapes, and its fix line covers all four. The 34990 note's frontmatter and declarations are untouched.

③ Boundary flags

  • DELIBERATE CORRECTION of .changeset/34990-nested-relation-filter-node.md: judged here. Three sentences confirmed, one not. The note is pending on the merge base, the correction is declared on the PR body by file name with each sentence quoted, and no other line of the note moves. FROM sentences are judged against eed422ea2^, the rest against this head.

    Sentence 1 (FROM).

    • Before: "- FROM: != and not_contains served every row, and an ordering operator compared each value with the text [object Object] and served the string values that happened to sort past it."
    • After: "- FROM: != and not_contains served every row, and an ordering operator compared each value with the text [object Object] and served the string values that happened to sort past it. That holds for an object whose prototype is Object.prototype. A null-prototype object has no toString or valueOf, so an ordering operator threw TypeError: Cannot convert object to primitive value and find rejected; not_contains threw as soon as it reached a row holding a string, and served every row when none did."
    • Verdict: true. value > target converts the object whatever the stored value is; the not_contains arm calls String(target) only for a string value; find is async and has no catch. One loose word: N9.

    Sentence 2 (TO).

    • Before: "= matched no row before and matches none now; it only gains the log line."
    • After: "= compared by reference, so it matched no row unless a row held the caller's own object (stored through create or update, which copy shallowly), and that row matched; it matches none now and gains the log line."
    • Verdict: true. comparandEquals falls to ===, create stores { ...data }, update spreads, only the constructor clones; on this head the builder refuses the node on both arms.

    Sentence 3.

    • Before: "Before this, = compared the object by reference and matched no row without a word, and != matched every row."
    • After: "Before this, = compared the object by reference and matched no row without a word, unless a row held the caller's own object, and != matched every other row."
    • Verdict: true.

    Sentence 4.

    • Before: "A class instance is not refused, even one with keys of its own such as a moment, luxon or decimal object: it is a value, and an ordering operator still compares it through its valueOf."
    • After: "A class instance is not refused, even one with keys of its own such as a moment, luxon or decimal object: it is a value, and an ordering operator still compares it through its valueOf when that returns a primitive; otherwise as its text."
    • Verdict: the added clause is true; the sentence is not true of this head. M1.
  • Check Changeset is red by design. The gate, run here on this head, gives one refusal, naming the 34990 note under finding: random changeset filenames collide silently across parallel agents — a round overwrote a sibling PR's minor changeset and every gate stayed green #17712. Every other check must still finish green; 23 were in progress when read.

  • Landing order against Version Packages chore: version packages #35129. As L1 7037308590 says: if chore: version packages #35129 lands first, the 34990 hunk is dropped and the correction goes to the released entry in a docs-only PR.

  • filter-refusal-subject-9050.test.ts. One row for the new throw site, field as its subject. Right: the refusal names no operator.

  • SQL push-down. No finding.

④ Design judgment

  • foreign-realm-object.ts: a private module with one predicate is the right size for S6, and it removes the constructor-name shortcut from describeExoticComparand. Its "every read is guarded" is one read short: N10.
  • refuseForeignRealmCondition: the sentence says what is read as structure, why, and the fix, and drops the false history. Pinned whole, with a pin that the named copy lowers.
  • The new pins are real: the two misnamed objects are asserted by name and by not.toMatch(/another realm/) on three faces; Object.create(Object.create(null)) is driven through every comparand operator.

M1 (must-fix) — the corrected 34990 note still says "A class instance is not refused", and this PR refuses it. .changeset/34990-nested-relation-filter-node.md:20. The sentence stands in a paragraph about "=, != and every other operator that reads the comparand". On this head ['created', '=', someMoment], !=, in / nin members and the four text operators are refused by objectComparandRefusal (byValue), and { created: someMoment } by the converter. Both notes ship in one release, so the CHANGELOG would say "not refused" in one entry and "refused" under eight operators in the next: the contradiction the in-place route exists to remove. The gate's own text names this case ("the note you rewrote describes behaviour THIS PR changed"). Record 7037477278 did not catch it at 0c86f9c32, where it was already false. Fix, changeset only: "A class instance is not refused as a relation, even one with keys of its own such as a moment, luxon or decimal object: it is a value. An ordering operator compares it through its valueOf when that returns a primitive, otherwise as its text; under an equality, membership or text operator it is refused, in a sentence of its own." Quote the new Before / After in the PR body.

N8 (nit) — ui/packages/core/src/adapters/ValueDataSource.ts:633-641, isNullRootedObject. Against the base, such an object under an ordering threw, or compared through a valueOf its null-prototype prototype defines; now it is refused under every operator. The 35735 note does not name it, and the docblock's "It has no toString or valueOf" (:629) is false when the prototype defines one. One line in the note under shape 4 or "Not moved", and "inherits none from Object.prototype" in the docblock.

N9 (nit) — .changeset/34990-nested-relation-filter-node.md:14 says "!= … served every row" and :20 says "!= matched every other row". Use "every other row" in both, or leave the FROM as the general case.

N10 (nit) — ui/packages/core/src/utils/foreign-realm-object.ts:34: Array.isArray(value) sits outside the try and throws on a revoked Proxy, the case the docblock gives for the guard. The callers call Array.isArray on the same value first, so nothing new can throw here; move the line inside the try or drop the claim.

Implemented-by: claude/issue-35735-filter-flag-and-comparand-edges
Reviewed-by: session_01L9qibvVRcFWKrfWeG5jzPb

VERDICT: FAIL

…efused, and the null-rooted shape is declared

Changeset and docblock prose only, plus the foreign-realm predicate's
Array.isArray read moved inside its try. No behaviour change.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb
@github-actions github-actions Bot added size/xl and removed size/l labels Nov 20, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH

L1 delta-3: ACCEPT at e832ca6466dbbfdf084951cad7533c416b1f8dd6 (2026-11-20T12:27Z)

Delta reviewed: d074b4af → e832ca64, one commit, four files.

Scope of the code change: the only code change is in isForeignRealmPlainObject, where Array.isArray moved inside the try. Array.isArray on a revoked Proxy throws, so a refusal now cannot throw there. Nothing else behaves differently. ✔ (L2 N10)

What I checked

  • N1 and N2 from 7039380353.
    • The isNullRootedObject doc now says the test alone also matches a foreign plain object, and that it relies on objectValueRefusal running isForeignRealmPlainObject first. ✔
    • The objectComparandRefusal doc line is narrowed. ✔
  • 34990, re-derived against main 1d7015a's matcher.
    • FROM: "!= served every other row … and not_contains every row". This holds because $ne is !comparandEquals (by reference). not_contains is !(typeof value === 'string' && value.includes(String(target))), and for an Object.prototype object String(target) is [object Object]. So the dev's N9 deviation is right: "every row" stays for not_contains. A string row that literally contains [object Object] is the only exception, and it is not worth a clause. ✔
    • Class-instance sentence (L2 M1): "not refused as a relation … under an equality, membership or text operator it is refused, in a sentence of its own". This matches objectComparandRefusal, where the byValue arm sends a class instance to classInstanceComparandRefusalReason. That refusal ships in the sibling 35735 note of the same release. ✔
    • Correction count: five corrected sentences against main, all edited in place. This is a DELIBERATE CORRECTION and Check Changeset is red by design.
  • 35735 rider:
    • Present and right: the converter FROM. With no own key the shape was refused as an empty operator map, and with $ keys it lowered. ✔
    • Present and right: $eq / $in compared it by reference, and an ordering threw unless the prototype defines valueOf. ✔
    • Present and right: TO says both faces refuse it with "an object of an unrecognised type", and the value source does so under every operator. ✔
    • Missing: the FROM omits three rows that move (see owed item 1).

Owed (prose only; fold it into the head the L2 runs on)

  1. Complete the rider's FROM. On main 1d7015a three more rows move:
    • $ne / != and $nin served every other row, through !comparandEquals by reference. These are the rows this narrowing actually takes away.
    • $between threw TypeError, from value >= target[0] on a null-rooted member.
    • $contains, $notContains, $startsWith and $endsWith threw on a row holding a string (String(target)), and when no string row was present they served nothing or, for $notContains, every row.
    • The fix is one sentence in the same "Also moved" FROM. Shape 3's null-prototype sentence already spells it this way ("under an ordering operator, $between, and a text operator on a row holding a string").

Nit (not blocking)

  • N3. The shape count: line 12 still says "for four filter shapes", but the "Also moved" bullet under shape 4 adds a fifth moved shape. Either say "five", or move the bullet under item 2 (the realm item), where the shape is a structural neighbour.

CI at e832ca64

  • 9 success, 15 skipped, 19 in progress.
  • Nothing has failed yet. Check Changeset is in progress and is expected red by design.

L2 owed (route unchanged)


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: e832ca6466dbbfdf084951cad7533c416b1f8dd6
Local-runs: none
Scope: .changeset/34990-nested-relation-filter-node.md, .changeset/35735-filter-flag-and-comparand-edges.md, ui/packages/core/src/adapters/ValueDataSource.ts, ui/packages/core/src/utils/foreign-realm-object.ts + ui/packages/core/src/utils/filter-converter.ts (head and merge base), ui/packages/core/src/adapters/ValueDataSource.ts at the merge base and at eed422ea2^
Security-touching: no

Delta record, same-head, at tier. It follows record 7037477278 (PASS at 0c86f9c32) and record 7039389887 (FAIL at d074b4af1, on M1) and judges the one commit d074b4af1..e832ca646: four files, +15/-10. Two are notes; ValueDataSource.ts moves in two docblocks only; foreign-realm-object.ts moves one line of code. Everything else is carried from the two earlier records by blob identity: no other file of the PR's diff differs between the two heads. The merge base is still 1d7015aee. Read: the commit's diff in full, both notes on the head, the 34990 note on the merge base, the PR body's refreshed DELIBERATE CORRECTION section (four numbered pairs, the first carrying two corrections), and the base code named in Scope. Nothing was built or run. Check-runs on the head when read: 9 success, 15 skipped, 19 in progress, none red yet; Check Changeset had not finished and is expected red by design (③).

Result: PASS. M1 is closed. No must-fix, no should-fix on this head. Still open from earlier records, each with a carrier or accepted: S5 and the code half of S4 (cards), N4, N7. New: N11 (nit).

① Derived judgments

  1. The round's findings.
Item Verdict on this head
M1 Resolved. The 34990 note no longer says a class instance is not refused; see ③, sentence 5.
N8 Resolved. The null-rooted object is declared in the 35735 note ("Also moved"), and the isNullRootedObject docblock now says "inherits no toString or valueOf from it (… unless its prototype defines one)".
N9 Resolved, with a deviation that is right. != reads "every other row"; not_contains keeps "every row". On the base the arm is !(typeof value === 'string' && value.includes(String(target))): a row holding the caller's own object is not a string, so it passed. The identity row was served by not_contains and not by !=.
N10 Resolved. Array.isArray(value) is inside the try, so a revoked Proxy answers false from this function. No verdict moves: typeof does not throw on one.
L1 rider (7039380353) Resolved: the "Also moved" sub-bullet is present and true of the base, judged in ②.
L1 nits N1 / N2 Resolved. The isNullRootedObject docblock states that the test alone also matches a foreign plain object and relies on objectValueRefusal running isForeignRealmPlainObject first; that is the order in the code. The objectComparandRefusal docblock no longer restates how an ordering compares an instance.
  1. The one code change is behaviour-preserving for every value that is not a revoked Proxy. For an array it returned false before the try and returns false inside it now.
  2. No export, sentence or row set moves in this commit.

② Semver level

Carried: '@object-ui/core': patch, both declaration lines, the !, the BREAKING banner and the not-required (no-migration-prescription) marker are untouched by this commit.

The new 35735 sub-bullet ("Also moved"), against the base.

  • "convertFiltersToAST read it as an operator map (with no own key it was refused as an empty operator map; with $ keys it lowered)". True: the base isOperatorMap took the second prototype hop (Object.getPrototypeOf(proto) === null), which such an object passes; Object.entries of one with no own key is empty, so refuseEmptyOperatorMap threw; own $ keys went through the operator loop.
  • "in comparand position the value data source compared it by reference under $eq / $in". True: the base isPlainObject is false for it, so the builder passed it and comparandEquals fell to ===.
  • "under an ordering operator threw TypeError: Cannot convert object to primitive value and find rejected, unless its prototype defines a valueOf, which it then compared through". True: value > target converts the object, and the chain never reaches Object.prototype.
  • "TO: both faces refuse it as an object of an unrecognised type: the converter as the field's whole condition, and the value data source in comparand position under every operator". True on the head: isOperatorMap is false for it and describeExoticComparand finds no constructor; isNullRootedObject runs before the byValue test. Both are pinned.
  • What it leaves out is small: N11.

③ Boundary flags

  • DELIBERATE CORRECTION of .changeset/34990-nested-relation-filter-node.md: judged here, and confirmed, all five sentences. The note is pending on the merge base 1d7015aee, the PR body declares the correction by file name with each pair quoted, and no other line of the note differs from the merge base. Each Before is the merge-base text and each After is this head's. FROM statements are judged against eed422ea2^, the code before that note's change; statements about now are judged against this head.

    Sentence 1 (FROM, the row sets).

    • Before: "- FROM: != and not_contains served every row, and an ordering operator compared each value with the text [object Object] and served the string values that happened to sort past it."
    • After: "- FROM: != served every other row (every row but one holding the caller's own object) and not_contains every row, and an ordering operator compared each value with the text [object Object] and served the string values that happened to sort past it."
    • Verdict: true. != was !comparandEquals, which is === for an object; not_contains passes every value that is not a string.

    Sentence 2 (FROM, the null-prototype population; added).

    • Before: absent.
    • After: "That holds for an object whose prototype is Object.prototype. A null-prototype object has no toString or valueOf, so an ordering operator threw TypeError: Cannot convert object to primitive value and find rejected; not_contains threw as soon as it reached a row holding a string, and served every row when none did."
    • Verdict: true. value > target converts the object whatever the stored value is; String(target) runs only for a string value; find is async and catches nothing.

    Sentence 3 (TO).

    • Before: "= matched no row before and matches none now; it only gains the log line."
    • After: "= compared by reference, so it matched no row unless a row held the caller's own object (stored through create or update, which copy shallowly), and that row matched; it matches none now and gains the log line."
    • Verdict: true. create stores { ...data }, update spreads, only the constructor clones; on this head objectComparandRefusal refuses the node on both arms.

    Sentence 4 (the ValueDataSource paragraph).

    • Before: "Before this, = compared the object by reference and matched no row without a word, and != matched every row."
    • After: "Before this, = compared the object by reference and matched no row without a word, unless a row held the caller's own object, and != matched every other row."
    • Verdict: true, and now in step with sentence 1.

    Sentence 5 (the class instance).

    • Before: "A class instance is not refused, even one with keys of its own such as a moment, luxon or decimal object: it is a value, and an ordering operator still compares it through its valueOf."
    • After: "A class instance is not refused as a relation, even one with keys of its own such as a moment, luxon or decimal object: it is a value. An ordering operator compares it through its valueOf when that returns a primitive, otherwise as its text; under an equality, membership or text operator it is refused, in a sentence of its own."
    • Verdict: true of this head. nestedRelationComparandKey answers undefined for a non-plain object; the ordering arms and between are value > target and its siblings; AST_BY_VALUE_OPERATORS and DOLLAR_BY_VALUE_OPERATORS send it to classInstanceComparandRefusalReason, and icontains to its text door, which is a sentence of its own too. The two notes of this release now agree.
  • Check Changeset red is by design. On d074b4af1 the gate gave one refusal, naming the 34990 note under finding: random changeset filenames collide silently across parallel agents — a round overwrote a sibling PR's minor changeset and every gate stayed green #17712; this commit changes no other pending note. Its run on this head had not finished when read. Every other check must finish green; 19 were in progress.

  • Landing order against Version Packages chore: version packages #35129. Unchanged: if chore: version packages #35129 lands first, the 34990 hunk is dropped and the correction goes to the released entry in a docs-only PR.

  • A new head needs a new record. This one covers e832ca646 only.

  • SQL push-down. No finding.

④ Design judgment

The commit does what the FAIL asked and nothing more. Moving the array test inside the try makes the module's "every read is guarded" true. The two docblock edits remove a restatement and add the one dependency a reader of isNullRootedObject needs (the call order). No pin is added and none is owed: no sentence or row set moves.

N11 (nit) — .changeset/35735-filter-flag-and-comparand-edges.md:28, the "Also moved" FROM. Three things it does not say, all true of the base: with own keys that carry no $, the converter lowered the object as a nested-relation node; as a field's whole condition with own $ keys, the value data source answered the right rows (the same loss as the cross-realm shape); and $ne / $nin served every other row. Add them if the note is touched again; not worth a head of its own.

Implemented-by: claude/issue-35735-filter-flag-and-comparand-edges
Reviewed-by: session_01L9qibvVRcFWKrfWeG5jzPb

VERDICT: PASS

…it under the realm item

Changeset prose only.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH

L1 delta-4 — ACCEPT at 40527030d65afe4c4e6021d759eea10d4028f140 (2026-11-20T12:32Z)

Delta reviewed: e832ca64 → 40527030. It is one commit that only rewrites prose in .changeset/35735-filter-flag-and-comparand-edges.md. No code changed, so the code findings of delta-3 7039534053 still hold.

What I checked (each claim re-derived from main 1d7015a's ValueDataSource.ts matcher)

  • Owed item 1 from 7039534053 is done. The "Also moved" FROM now covers every row that moves:
    • $eq and $in members: compared by reference through comparandEquals, so no row matched unless a row held the caller's own object. ✔
    • $ne / != and $nin: served every other row, and the note names these as the rows the change takes away. ✔
    • Ordering operators, $between, and text operators on a string row: threw TypeError. The note keeps the caveat "unless its prototype defines a valueOf or toString that returns a primitive". ✔
      • The dev's change of wording here is correct. ToPrimitive tries both methods: valueOf first under the number hint (orderings, $between) and toString first under the string hint (String(target) in the text arms).
    • No string row present: $contains, $startsWith and $endsWith served no row, because each arm needs typeof value === 'string'. $notContains served every row, as the complement. ✔
  • N3 is resolved by moving the bullet. The bullet now sits under item 2, the realm item, with the reason "by the same prototype test (the operator-map test no longer takes a second prototype hop)".
    • This matches the code. On main, isOperatorMap accepted Object.getPrototypeOf(proto) === null; the head drops that leg.
    • The moved shape is therefore a sub-case of item 2's prototype test, and "four filter shapes" stays true. ✔
  • CI at 40527030: 7 success, 15 skipped, 18 in progress, and nothing has failed so far. Check Changeset is still expected to be red by design, because this is a DELIBERATE CORRECTION of the pending 34990 note, done in place.

I raise nothing new.

L2 owed


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 40527030d65afe4c4e6021d759eea10d4028f140
Local-runs: none
Scope: .changeset/35735-filter-flag-and-comparand-edges.md + ui/packages/core/src/adapters/ValueDataSource.ts and ui/packages/core/src/utils/filter-converter.ts at the merge base 1d7015aee and on the head, .changeset/34990-nested-relation-filter-node.md (blob identity only)
Security-touching: no

Delta record, same-head, at tier. It follows record 7039556712 (PASS at e832ca646) and judges the one commit e832ca646..40527030d: one file, .changeset/35735-filter-flag-and-comparand-edges.md, +1/-1, prose only. The "Also moved" sub-bullet leaves item 4, is rewritten, and sits under item 2. Read: the commit's diff in full, the note on the head, and the base code the new clauses describe. Nothing was built or run. Check-runs on the head when read: 7 success, 15 skipped, 18 in progress, none red yet; Check Changeset had not finished and is expected red by design (③).

Result: PASS. No must-fix, no should-fix. N11 of record 7039556712 is resolved in the part L1 7039534053 owed. Still open from earlier records, each with a carrier or accepted: S5 and the code half of S4 (cards), N4, N7. New: N12 (nit).

① Derived judgments

  1. Carried by identity. git diff --stat e832ca646 40527030d lists the one note and nothing else. The 34990 note is the same blob at both heads (f00e25c458), and the merge base is still 1d7015aee. So every judgment of records 7037477278, 7039389887 and 7039556712 on code, tests and the 34990 note stands on this head unchanged.
  2. The new FROM, clause by clause, against the base (1d7015aee). The subject is an object whose prototype is a null-prototype object, such as Object.create(Object.create(null)).
Clause Verdict
"convertFiltersToAST read it as an operator map (with no own key it was refused as an empty operator map; with $ keys it lowered)" True. The base isOperatorMap ends || Object.getPrototypeOf(proto) === null, which this object passes; Object.entries of one with no own key is empty, so refuseEmptyOperatorMap threw; own $ keys went through the operator loop.
"compared it by reference under $eq and as an $in member, so no row matched unless a row held the caller's own object" True. The base isPlainObject is false for it, so the builder passed it, and comparandEquals falls to ===. create and update copy shallowly.
"$ne / != and $nin served every other row" True: the negations of the same ===.
"under an ordering operator, $between, and a text operator on a row holding a string, the comparison threw TypeError: Cannot convert object to primitive value and find rejected" True for the orderings and $between on any non-empty source (value > target, value >= target[0] convert the object whatever the stored value is), and for $contains / $notContains / $startsWith / $endsWith once a string row is reached (String(target) sits behind typeof value === 'string'). One operator is covered by the words and did not throw: N12.
"unless its prototype defines a valueOf or toString that returns a primitive, which it then compared through" True, and "or toString" is the right completion. A relational comparison tries valueOf then toString; String() tries toString then valueOf. Either one returning a primitive is enough in both places, and the throw needs both to be missing or to return objects.
"with no row holding a string, $contains, $startsWith and $endsWith served no row and $notContains every row" True: the three positive arms are typeof value === 'string' && …, and $notContains is the negation of that.
TO (unchanged words) True on the head, as judged in record 7039556712.
  1. "by the same prototype test (the operator-map test no longer takes a second prototype hop)". True for the converter, where removing the hop is what moves both this object and the cross-realm one. On the value source the object is caught by isNullRootedObject, a neighbouring test; the clause does not claim otherwise.

② Semver level

Carried: '@object-ui/core': patch, both declaration lines, the !, the BREAKING banner, the not-required (no-migration-prescription) marker and the caller's-fix line are untouched by this commit.

Does "four filter shapes" stay true with the bullet under item 2? Yes. The note still numbers four items, and the bullet is a declared rider on one of them, not a fifth heading. Item 2 is the better seat than item 4:

  • it moves for item 2's reason, the prototype test, and on both faces;
  • it is refused under every operator, as item 2 is, where item 4 is refused under the by-value operators only and "Not moved" under the orderings. Under item 4 the bullet contradicted the line above it.

The cost is that item 2's heading says "of another realm" and this object is of this realm. The bullet opens "Also moved" and names the object, so a reader of item 2 meets it. Accepted.

③ Boundary flags

  • DELIBERATE CORRECTION of .changeset/34990-nested-relation-filter-node.md: carried, all five sentences confirmed as in record 7039556712. The note is byte-identical to the one judged there, and no code moved, so each After is still true of this head:
    1. FROM, the row sets ("!= served every other row … and not_contains every row …");
    2. FROM, the null-prototype addition ("That holds for an object whose prototype is Object.prototype. A null-prototype object … served every row when none did.");
    3. TO ("= compared by reference, so it matched no row unless a row held the caller's own object …");
    4. the ValueDataSource paragraph ("Before this, = compared the object by reference … and != matched every other row.");
    5. the class instance ("A class instance is not refused as a relation … under an equality, membership or text operator it is refused, in a sentence of its own.").
  • Check Changeset red is by design. This commit touches the PR's own note only, so the gate's one refusal stays the 34990 note under finding: random changeset filenames collide silently across parallel agents — a round overwrote a sibling PR's minor changeset and every gate stayed green #17712. Its run on this head had not finished when read. Every other check must finish green; 18 were in progress.
  • Landing order against Version Packages chore: version packages #35129. Unchanged.
  • A new head needs a new record. This one covers 40527030d only.
  • SQL push-down. No finding.

④ Design judgment

Prose only, and the prose is now as complete as the three sibling FROM lines: the identity row, the negations, the throw with its exact escape, and the no-string-row answers. No pin is owed: no sentence in code and no row set moves.

N12 (nit) — .changeset/35735-filter-flag-and-comparand-edges.md:21 (and the same words at :23, item 3, since d074b4af1): "a text operator on a row holding a string … threw". $icontains is a text operator and did not throw on the base: its text door (isRefusedTextComparand) refused the non-string comparand before any conversion. Say "$contains, $notContains, $startsWith or $endsWith on a row holding a string". Two things from N11 also remain unsaid and are no more than that: with own keys that carry no $ the converter lowered the object as a nested-relation node, and as a whole condition with own $ keys the value data source answered the right rows. Not worth a head of its own.

Implemented-by: claude/issue-35735-filter-flag-and-comparand-edges
Reviewed-by: session_01L9qibvVRcFWKrfWeG5jzPb

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvvVzM5KhCWkT5f45c

维护者速读

席位核对

Seat 7: hand-off for the maintainer's approval · head 40527030d65afe4c4e6021d759eea10d4028f140 · Fixes #35735 #35738 #35533 · K=15 against main · not governed · declared narrowing (Clause-②: no (narrowing)), so PR #35610's queue leg needs an authorized APPROVED review · +917/−87 · 2026-11-20T12:34Z

  • Shape.

    • ui/packages/core/src/utils/filter-converter.ts:
      • refuses a non-boolean $null / $exists flag (refuseNonBooleanFlag, one sentence for the three flag operators);
      • tightens isOperatorMap to this realm's plain objects, matching the spec's filter walk;
      • refuses a foreign-realm plain object in its own words (foreign-realm-object.ts).
    • ValueDataSource.ts (+211/−39) routes the same cases, plus the $-keyed and class-instance comparands under equality/negation, to refusals.
    • Three dashboard/report call sites adjust.
    • Five test files.
    • One new changeset.
    • A DELIBERATE CORRECTION of five sentences in the pending .changeset/34990-nested-relation-filter-node.md. The PR body lists each sentence before and after.

    The seat read the converter diff and the 34990 correction itself.

  • Gates. At this reading, 11 success, 15 skipped, 31 in progress, 2 failure. Both failures are Check Changeset, the expected foreign-note refusal for the declared correction; it is not among main's required checks. The queue still needs every required check green.

  • Reviews.

    • L1 delta-4 ACCEPT 7039640451 at this head.
    • CONTRACT_REVIEW_TIER PASS 7039654524 names this head (Head-sha: 40527030…), with no must-fix or should-fix. It carries forward the 34990 five-sentence judgement from 7039556712.
    • Round-2 L2 FAIL 7039389887 (M1, the class-instance sentence) is closed.
  • Accepted deviations / out of scope.

  • Landing. Held for the authorized APPROVED review (os-zhuang requested). Per the maintainer's standing word (2026-11-20T09:19Z), the area thread enqueues it after approval once CI is green.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 20, 2026
@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 20, 2026 12:36
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 20, 2026
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 20, 2026
Merged via the queue into main with commit 6b360ab Nov 20, 2026
70 of 75 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-35735-filter-flag-and-comparand-edges branch November 20, 2026 22:38
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/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

3 participants