Repository navigation
fix(core)!: the value data source refuses a plain-object comparand under a $ operator, as under the AST operators - #35604
Conversation
…der a $ operator, as under the AST operators One builder, nestedRelationComparandRefusal, serves both arms: the whole comparand for every declared operator that reads one, and each member of an in / nin / between list. A class instance as a field's whole condition is routed to the converter as a value instead of being read as an operator map. Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb Final green head: |
|
repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH 席位核对L1: ACCEPT (L1-a, for area d7-C) at head Checklist (
Contract review. The |
|
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb Contract reviewServed-tier: Narrowing face: PR #35604 for card #35493, ① Derived judgmentsWhat the head newly refuses, read from
Not moved, each read in the tree — right: scalar, Public surface — right: no export is added, removed or renamed. Width. No wider than the platform: every filter in 1–4 is refused by one of the two spec doors, so nothing the platform serves is taken away at this consumer. No wider than the card's ruling: the title names seven operators, but the Done-when is the AST arm's refusal from one builder, and that arm judges every operator that reads the slot. The seven operators beyond the title move no row on a whole comparand; the only rows they move are the ② Semver level
③ Boundary flags
④ Design judgmentAgainst the card's Done-when and comment 7012153506: one builder for both arms, a pin per operator, CONTROL legs for a scalar, a
No must-fix.
Nits:
For a card (outside this diff's population, ungraded; the seat dedupes and files). After this head the value source still compares, by reference or as text: (a) Implemented-by: VERDICT: PASS |
…rand in both dialects
The shared builder, now plainObjectComparandRefusal, refuses {} as a whole
comparand or a list member in a sentence of its own, gated on the same
operator set. The changeset names the refused population exactly and the
list-member and class-instance row movements the contract review found.
Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb
Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb Final green head: |
|
repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH Seat check — deltaL1 delta: ACCEPT (L1-a, for area d7-C) at head Delta read (
|
|
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb Contract reviewServed-tier: Delta review, narrowing face: PR #35604 for card #35493 at its rework head, after the round on ① Derived judgmentsWhat the delta newly refuses, read from
Not moved by the delta, each read in the tree — right: Public surface — right: no export is added, removed or renamed. Width. No wider than the platform: the empty object in every position of 1–3 is refused by one of the two spec doors, and neither door reads a field's type, so there is no column type for which the platform serves what this consumer now refuses. Emptiness is read with ② Semver level
③ Boundary flags
④ Design judgment
S1: closed. S2: closed. How each closed. S1 by route (a): the builder refuses the zero-key plain comparand, whole and as a list member, in both dialects, in a sentence of its own, with cases on each arm; the changeset's BREAKING paragraph, FROM, TO and "Not moved" say the same thing the code does. S2 on the changeset alone: (i) FROM now gives the No must-fix, no should-fix. Nits of record 7030429102: N1 answered in the jsdoc (the set is ALL of Nits:
For a card (outside this diff's population, ungraded; the seat dedupes and files). Residual (a) of record 7030429102 is closed in place by this head. Residuals (b) and (c) stand as written there: a plain object with a Implemented-by: VERDICT: PASS |
…lue-source-operator-map-comparand
|
repo:objectstack#7 · os-tesla · session_01L9qibvvVzM5KhCWkT5f45c 维护者速读
席位核对Seat 7: hand-off for the maintainer's approval · head
|
|
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb Contract reviewServed-tier: Carry record, narrowing face: PR #35604 for card #35493. This head is one merge of
① Derived judgmentsCarried unchanged. The refused population, the "not moved" list, the public surface and the width judgment of record 7031655339 rest on the five diff files, blob-identical here, and on cited code that ② Semver levelCarried unchanged: the changeset is blob-identical, so ③ Boundary flags
④ Design judgmentCarried unchanged for each of the five files: none of them moved, and nothing they cite moved in code. S1: closed. S2: closed. No must-fix, no should-fix. Nits N6, N7 and N8 of record 7031655339 stand as written; none is addressed on this head (the five blobs and the PR title are unchanged), and none has to be. Implemented-by: VERDICT: PASS |
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb
Requested by Tesla · project thread
Fixes #35493
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no skill or docs page teaches a plain-object comparand under a
$operator on the value data source; the spec's comparand door already refuses that comparand on every server face, so there is nothing to un-teach维护者速读
.claude/**lands by declared rule-change, a declared narrowing waits for the maintainer #35610 需要你在 GitHub 上批准一次;批准后席位落地。What changes
ValueDataSource(ui/packages/core, the in-memoryprovider: 'value'source) now refuses a comparand that is a plain object (prototypeObject.prototypeornull) with no$key, NON-EMPTY or EMPTY ({}), as the whole comparand or as a list member, in both its object ($) and its AST dialect, from one builder.One builder, both arms.
plainObjectComparandRefusal(new, besidenestedRelationComparandKeyandnestedRelationRefusalReason) judges the WHOLE comparand and, for a list operator, each MEMBER. A non-empty object gets the nested-relation sentence, which names its first key; an empty one, which has no key to name, gets its own:filter comparand on field 'f' is an empty object ({}), which is neither a comparison value nor a nested relation constraint(contract review S1, route a).matchesComparisonNode(AST arm) andmatchesDollarOperator($arm) both call it; the$arm calls it after the two array guards and before the{ $field }resolution, the AST arm's order.{ f: {} }as a field's WHOLE condition is untouched: it is the zero-key condition the converter already refuses, and a pin holds that.Operator set, per operator. Measured on
b65488a8before the change, with{ owner: { OP: { id: 'u1' } } }(the rows for{}are the same, except where noted):$ne,$notContains(whole)$gt/$gte(whole)[object Object]$lt/$lte(whole)[object Object]$eq,$contains,$startsWith,$endsWith(whole)$in,$nin,$between(object as the whole comparand)$nin(object as a list member)$in(object as a list member)$between(object as an endpoint)[object Object]to the other endpoint ([{ id: 'u1' }, 'zzz']answers a'zeta'row)in/nin/between(object as a list member), AST any operator with{}whole$twins above$icontainsicontainsalready was$empty$null,$existsFILTER_OPERATORS($regex,$like, a non-$key)defaultarmThe set is the spec's
FILTER_OPERATORSminus the three flag operators, the$twin of the AST arm'sAST_NO_COMPARAND_OPERATORSexclusion; a test pins it equal.Class instance (card comment 7012153506). A class instance given as a field's WHOLE condition,
{ created: someMomentDate }, is data:loweringConditionRefusal(renamed fromzeroKeyConditionRefusal) now routes an object that is not plain to the converter, as it already routed a zero-keyRegExp/Map/Set, so the whole filter is refused up front in the converter's exotic-comparand sentence instead of a nested-relation sentence per own key, per row. Alone it answered no row before too; inside$orit moves:{ $or: [{ owner: 'Alpha' }, { age: new Amount(30) }] }answered the'Alpha'row and now answers none, as the zero-key condition and the server do. The prototype test is the new sharedisPlainObject, whichnestedRelationComparandKeynow calls too. A class instance under an operator still compares throughvalueOf(ruled).Bounded in-place fix (declared). The AST arm had the same list-member hole (
['owner', 'nin', [{ id: 'u1' }]]answered every row) and the same empty-object hole (['owner', '!=', {}]answered every row). It is the same defect class, in the same file, from the same builder, in the same gate family, so it is fixed here rather than filed; the four conditions of the in-place exemption hold.Producer side. The comparand is authored data (a
$filterhanded tofind); the spec's comparand doornormalizeFilterComparandTypesalready refuses it on the server path, so this is the consumer face failing open where the contract refuses, not a consumer tolerance. No spec or converter change.Compile surfaces (filter semantics)
Each face was checked for a plain-object comparand under a
$operator. The server faces all sit behind the spec's comparand door, cited by symbol (no line addresses, perui/AGENTS.md#11):applyFilterCondition(sqlite-wasm, turso local inherit)wherepasses the engine's door first:lowerWhereFilterArrayinpackages/objectql/src/engine-top-level.tscallsnormalizeFilterComparandTypeson the object form, andparseFilterASTruns the same walk on the array formbuildWhereSQLlowerWhereFilterArray)compileScopedFilterToSqlread-scope-sql.tscallsnormalizeFilterComparandTypes(scope, undefined, 'readScope')lowerAnalyticsWherefilter-normalizer.tsnormalizeWhereComparandTypeshands every field entry tonormalizeFilterComparandTypesmatchesFilterCondition$ne,$notContains,$gtand a$ninmember with{ owner: 'u1' }all answerfalseagainst a text row (no row served)applyHaving/matchesHavingengine-delete-and-aggregate.tspassesquery.havingthroughnormalizeFilterComparandTypes(…, 'having')checkConditionlowerWhereFilterArray)translateFieldOperatorslowerWhereFilterArray)Measured with the spec doors directly:
normalizeFilterComparandTypesanswersINVALID_FILTERfor{ f: { $ne: { owner: 'u1' } } },$gt,$null, for{}under$ne/$notContains/$gt, and for a plain-object member ({ owner: 'u1' }or{}) under$in/$nin/$between; a WHOLE object under a list operator ({ f: { $in: {} } }) passes that door and is refused byassertListComparandShapeswithINVALID_FILTER. The formula face answersfalsefor the{}cases too.Tests
All readings are on head
e543630cunless named.pnpm --filter @object-ui/core test: Test Files 243 passed (243), Tests 4577 passed, 27 skipped (4604).pnpm --filter @object-ui/core type-check: exit 0 (bothtsc --noEmitandtsc -p tsconfig.test.json; the edited test files are in the test program).ValueDataSource.dollarFilterVocabulary.test.ts— for a non-empty plain object 14 per-operator whole-comparand refusals and 3 list-member refusals; for{}the same 14 + 3 in its own sentence; a pin that{ owner: {} }as a WHOLE condition keeps the converter's zero-key refusal; 6 object-form vs lowered-AST-form same-sentence pins ($ne {},$nin [{}],$ne,$notContains,$gt,$ninmember); CONTROL legs for scalars,Date,{ $field }, a class instance with own keys under$gt/$gte/$lt/$lte; the class instance as a whole condition (alone and in$or);$empty's own sentence; a non-operator key's own sentence. InValueDataSource.astFilterVocabulary.test.ts: 3 list-member refusals and 5{}refusals (!=,>,not_containswhole;nin,betweenmember). The source exposes nocode/status(refusals are logged sentences), so each pin asserts the row set and the refusal sentence.e543630c, closure built first:os-verify-lock: VERDICT command-exit 0, Test Files 482 passed, 3 skipped (485), Tests 4092 passed, 68 skipped (4160), no failure. (Round 1 on1bc51be2: the same counts.)Ablations (one per changed behaviour, committed first, through scripts/ablation-replace.mjs; each restored to the HEAD blob with an empty git diff HEAD)
The tests import
../ValueDataSourceby relative path, so the subject resolves tosrc/, notdist/; no build leg.$arm refusal off (anchorDOLLAR_COMPARAND_OPERATORS.has(operator)replaced byfalse), on1bc51be2: 21 failed, 161 passed. Red: all 14 whole-comparand cases, all 3 list-member cases, all 4 same-sentence pins.listOperatorargumentAST_LIST_COMPARAND_OPERATORS.has(operator)replaced byfalse), on1bc51be2: 4 failed, 178 passed. Red: the 3 AST list-member cases and the$nin membersame-sentence pin.... > 0 && isPlainObject(condition)) continue;back to... > 0) continue;), on1bc51be2: 1 failed, 105 passed. Red: the class-instance whole-condition case.if (isPlainObject(value) && Object.keys(value).length === 0) {replaced byif (false) {), one543630c: 24 failed, 183 passed. Red: the 14 + 3${}cases, the 5 AST{}cases and the 2{}same-sentence pins; the whole-condition{ owner: {} }pin stays green, so that path does not run through the builder.Local gates (derived with dispatch-gates --commands over this diff, 38 families)
On
e543630c: all 38 exit 0, reconciled with--ran: "38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED (a DERIVED zero — all 38 recorded an exit code and none of them is 3)".pnpm --dir ui exec vitest run scripts/first answered exit 1 in this fresh worktree:unit-registry-absence-collision.test.tscould not resolve@objectstack/client, which was not yet built (only the@object-ui/coreclosure was); re-run after thecheck:type-check-debtclosure build, it answered Test Files 171 passed, 2 skipped (173), exit 0. CI runs the full farm.Acceptance notes
$null/$existsread a non-boolean flag for its truthiness on the value source ({ f: { $null: { owner: 'u1' } } }answers the IS NULL rows), andconvertFiltersToASTlowers it the same way (['f', 'is_null', true]), while the spec's door refuses it withINVALID_FILTER. Refusing it here alone would split the object form from its lowered form, so a boolean door for both flags (as$emptyhas) belongs on its own card across converter and both arms.$in/$nin/$betweenthat is not an object ({ f: { $nin: 'x' } }) still answers no row in silence on the value source; the spec leaves that shape to the engine's list-shape gate, not the comparand door.e543630c: S1 by route (a), the empty plain object refused by the shared builder on both arms; S2 in the changeset (the$in/$betweenlist-member movements, both dialects, and the class-instance$ormovement replacing the false "same row set" sentence) and in the table above; nits N1 (theDOLLAR_COMPARAND_OPERATORSjsdoc says it holds all ofFILTER_OPERATORSand the call site subtracts the flags), N2 (the AST test comment forbetween), N3 ($lt/$lteanswered the rows sorting before the text), N4 (a whole object under a list operator is refused server-side byassertListComparandShapes). N5 left as the record asks.ValueDataSource.nonStringStoredValue.test.ts's "a comparand JSON cannot serialise is refused" case used a cyclic PLAIN object under$icontains; the new builder refuses that earlier, as a nested relation, so the case now uses a cyclic class instance, which still reaches the text door's comparand description it exists to pin.valueOf, as ruled on the card. Recorded, not re-opened.CONTRACT_REVIEW_TIERreview (narrowing of a published export).Verification
Read first, by risk:
ui/packages/core/src/adapters/ValueDataSource.ts,plainObjectValueRefusal/plainObjectComparandRefusaland the block inmatchesDollarOperatorafter the list-member{ $field }guard: the population (non-empty and empty plain objects with no$key) and the operator set it judges (DOLLAR_COMPARAND_OPERATORSminusDOLLAR_FLAG_OPERATORS).loweringConditionRefusal: the routing line now also routes a non-plain object with own keys.ValueDataSource.dollarFilterVocabulary.test.ts.Two-minute check:
pnpm --dir ui exec vitest run packages/core/src/adapters/__tests__/ValueDataSource.dollarFilterVocabulary.test.ts— expect every case green, including the 14 per-operator whole-comparand refusals and 3 list-member refusals for a non-empty object, the same 14 + 3 for{}, and the CONTROL legs.Generated by Claude Code
Body refreshed 2026-11-20T05:32Z for rework round 1 (S1, S2 and nits of contract review 7030429102), head e543630.