Skip to content

Client filter grammar: a non-boolean $null / $exists flag (an object, a string) is read by truthiness in convertFiltersToAST and the value data source, where the spec door refuses it #35735

Closed

Description

@objectstack-fleet

repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb

Filing gate ①, Source: fleet. Out-of-scope finding of the #35493 dev (os-dev-report 7030059306), confirmed fileable with a wider reach by the CONTRACT_REVIEW_TIER review of PR #35604 (record 7030429102, §③). Dedupe: $null $exists truthiness (2 open hits: #35493, the comparand card this came from, and the triage seat post), value data source comparand reference (no card on this).

What happens (read at origin/main a3a74f27)

SpecialOperatorSchema declares $null and $exists as z.boolean() flags, and the spec's comparand-type door refuses a non-boolean flag (both operators are in SCALAR_COMPARAND_OPERATORS). Two client faces read the flag by truthiness instead:

  • convertFiltersToAST (ui/packages/core/src/utils/filter-converter.ts, the $null / $exists arm, about :880–888) lowers { f: { $null: { owner: 'u1' } } } to ['f', 'is_null', true] and { f: { $exists: 'no' } } to ['f', 'is_not_null', true]. On every route that lowers through it, a server-backed source answers the null-ness rows and the server's door never sees the flag.
  • ValueDataSource's matchesDollarOperator (ui/packages/core/src/adapters/ValueDataSource.ts) answers the same filters by truthiness: the dev's probe at b65488a8 read { f: { $null: { owner: 'u1' } } } → the IS NULL row, $exists with an object → the non-null rows.

reach: published @object-ui/core exports (convertFiltersToAST, ValueDataSource#find): a filter the platform refuses with INVALID_FILTER / 400 answers rows instead. Measured by the dev's probe on the value source; the converter arm read from code.

Done when

$null / $exists take a boolean flag on all three faces (converter, value source $ arm, value source AST arm), as $empty already does: a non-boolean flag is refused with a named sentence, a pin per face, CONTROL true / false unchanged. One PR across the converter and both arms, so the object form and its lowered form never split. Narrowing of published exports: Clause-②: no (narrowing) with BREAKING and an ADR-0087 marker.

Business rationale

Developers and AI agents build list and dashboard filters in the console and in previews; a typo'd flag ($null: 'true', an object) silently answers rows instead of telling them the filter is wrong, while the same filter is refused on a server-backed object. Reader: the area:data lane seat that holds the client filter grammar (d7-C), one PR.

Grade: p2 · area:data · Bug · developers and previews, sometimes · evidence measured (value source) and read (converter); same class as #35493 (p2).

Activity

  1. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:ui (@object-ui/core filter conversion) · pm:queue; rationale: area:data · Bug · Severe·data wrong (a non-boolean $null / $exists flag, an object or a string, is read by truthiness, so the filter matches the opposite rows) · builders writing such filters, rare → p2 as set.

  2. added
    domain:ui
    pm:queue
    on Nov 20, 2026
  3. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Ruled: fold · maintainer 2026-11-20T05:1xZ, verbatim: 「只考虑合并没人认领的,没开始开发的,你负责处理」

    2026-11-20T05:14Z · This card now carries a fold group. Shared mechanism: client filter grammar and the in-memory ValueDataSource take different paths for edge comparands (non-boolean flags, $-keyed objects, cross-realm and null-prototype objects). The cards below, unclaimed and unstarted, are closed into this one so a single claimant fixes them in one PR. Each row's source card keeps its full body; this card closes when every row below and its own ask are done. Grade stays the highest of the group.

  4. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb

    Claim: PM loop round 1
    Session: session_01L9qibvVRcFWKrfWeG5jzPb
    Account: os-tesla
    Branch: claude/issue-35735-filter-flag-and-comparand-edges
    Worktree: objectstack-issue-35735
    Domain: domain:ui
    Seat: repo:objectstack#7
    Area: d7-C
    Fold group (ruled 7031136570): this card's own ask, #35738 and #35533, in one PR.
    File surface: ui/packages/core/src/utils/filter-converter.ts, ui/packages/core/src/adapters/ValueDataSource.ts, their tests under ui/packages/core/src/**/__tests__/ or beside them, comment-only edits in ui/packages/plugin-dashboard/src/DatasetWidget.tsx, ui/packages/plugin-dashboard/src/DrillDownDrawer.tsx and ui/packages/plugin-report/src/DatasetReportRenderer.tsx (#35533 item 5), and one .changeset/35735-*.md (stop on breach; explain in the report)
    Container & model: M, mode:subagent, model: opus (default tier; no path-derived mandate for ui/packages/core), effort: high
    Clause-②: no (narrowing)
    Metadata-protocol: none
    Responsibility: ui/packages/core filter converter + ValueDataSource in objectstack | the spec's comparand door already refuses a non-boolean $null / $exists flag and resolves the { $now, addDays } anchor; the client faces read the flag by truthiness and compare the anchor as text | developers and previews on provider: 'value' views and every route that lowers through convertFiltersToAST, reachable today
    Thread-read: 7031136570
    Also read: triage 7030501188; the #35738 and #35533 bodies
    Premise: holds (converter arm read at origin/main ccded86, filter-converter.ts :883-888 still operatorValue ? … : …)
    Serial constraints cleared: predecessor PR #35604 (#35493, same file) merged; overlap-check probe over the five files at origin/main ccded86: VERDICT clean, 0 open PR heads share them
    Pre-claim lane: all paths are ui/** (domain:ui); area:data, seat 7 d7-C per Tesla 「5号只处理在手任务」.
    Pre-claim deps: no Blocked-by:; #35493 closed by #35604.
    Prior rulings read: client,filter,grammar,non-boolean,null,exists,flag,object,string,read,truthiness,convertfilterstoast (+6 more) → 481 hits; ADR-0061 D2, ADR-0155 D1, ADR-0068 D1, ADR-0027 Decision §12, ADR-0129 D1, ADR-0139 D1; thread: none; repo: objectstack-ai/objectstack. Card comment 7012153506 on #35493 (a class instance is data; orderings compare through valueOf) stands; #35738 (2) asks the dev to measure the spec door and follow it, and to stop and report if it needs a product choice.
    Owed review: narrowing ⇒ one CONTRACT_REVIEW_TIER review before the queue; L1 by L1-a; ! title ⇒ dogfood battery.

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 20, 2026
  6. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb
    os-dev-report

    {
      "issue": 35735,
      "status": "done",
      "branch": "claude/issue-35735-filter-flag-and-comparand-edges",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/35832",
      "session": "session_01L9qibvVRcFWKrfWeG5jzPb",
      "premise_still_valid": true,
      "summary": "Fold group #35735 + #35738 + #35533 in one PR. (#35735) convertFiltersToAST and the ValueDataSource $ arm refuse a non-boolean $null / $exists flag with the $empty sentence shape (converter: FilterOperatorError INVALID_FILTER/400 via one helper refuseNonBooleanFlag that now also builds the byte-identical $empty sentence); the AST-arm leg of the premise is false by measurement (is_null/is_not_null carry no flag; parseFilterAST ignores the slot), so it is pinned as a CONTROL, not changed. (#35738) the shared builder (plainObjectComparandRefusal renamed objectComparandRefusal) now also refuses, on both arms, a $-keyed plain object that is no { $field } reference (the { $now, addDays } anchor by name: the platform resolves it in the column's temporal form and this face has no field types, the same reason it refuses a { $field, addDays } offset) and, under equality/membership/text operators only, a class instance, following the spec comparand door, which refuses it at every operator; orderings and $between keep valueOf, $icontains keeps its text door. (#35533) isOperatorMap now makes the spec isFilterNode / engine isNoOperatorObject prototype test, so a cross-realm plain object is a refused comparand on both faces (old pin replaced, CONTROL for a this-realm null-prototype object), the isNestedRelationCondition docblock names the refused population, the changeset carries the two corrections (null-prototype FROM measured: TypeError and find rejected at eed422ea2^; the = identity row), and the three widget files' related-id comments are corrected (comment-only).",
      "tests": "On head 0c86f9c32 (merge of origin/main 1a21ce93a; core files byte-identical to 8471b6061): pnpm --filter @object-ui/core test answered Test Files 243 passed (243), Tests 4701 passed, 27 skipped (4728); pnpm --filter @object-ui/core type-check answered exit 0 (tsc --noEmit && tsc -p tsconfig.test.json). Narrowed 5 suites answered 380 passed. Ablations via scripts/ablation-replace.mjs, committed first, each restored to the HEAD blob with git diff HEAD empty (relative src imports, no build leg): 1 converter flag door off 23 failed/239 passed; 2 VDS $null door answered truthiness 7 failed/201; 3 converter realm second hop restored 2 failed/225; 4 $-keyed/anchor refusal off 36 failed/271 (rerun on 0c86f9c32 after the first run's count line was cut by my log filter); 5 foreign-realm refusal off 17 failed/290; 6 class-instance refusal off 17 failed/290 (ordering CONTROLs stay green). Pre-change behaviour probe for the changeset correction: eed422ea2^ ValueDataSource with a null-prototype comparand answered the orderings gt / gte / lt / lte and not_contains rejected find with TypeError: Cannot convert object to primitive value; != every row; = no row.",
      "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack: 39 families on 8471b6061, re-derived identical on 0c86f9c32. 38 exit 0; pnpm --dir ui exec vitest run scripts/ exit 1 first (unit-registry-absence-collision could not import unbuilt @objectstack/client), after building the @objectstack/client closure: Test Files 171 passed, 2 skipped (173), exit 0. --ran: '39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED'. Also check-new-cross-file-line-citations 0 new (exit 0), check-nul-bytes exit 0, control-byte grep clean, overlap-check VERDICT clean exit 0 (before push and before pr_create). CI check-runs on 0c86f9c32 at report time: Check Changeset, Check PR Size, Governed Surface Queue Guard, Lint (ESLint, CI/release/engine gates, PM dispatch-gates, docs & code guards, repo & tooling gates, scoped x3), PR-body guards, Type Check (consumer, debt ledger, source, workspace): in_progress; opt-in/queue/schedule jobs skipped. UI jobs and Test Core not yet listed.",
      "dogfood_battery": "0c86f9c32 · os-verify-lock: VERDICT command-exit 0 (session; DOGFOOD_EXIT=0) · Test Files 482 passed, 3 skipped (485) · Tests 4098 passed, 68 skipped (4166) · no failure",
      "mcp_calls": "0",
      "api_writes": "2 — relay stroke fw-20261120T102856Z-2850f4 pr_create (POST /repos/objectstack-ai/objectstack/pulls draft + POST /repos/objectstack-ai/objectstack/issues/35832/assignees os-tesla; read-back identical, 13097 bytes); post-stamped os-dev-report comment on #35735 (POST /repos/objectstack-ai/objectstack/issues/35735/comments). git push is not counted.",
      "open_questions": [
        {
          "question": "A class instance (moment, decimal) is still compared through valueOf under $gt/$gte/$lt/$lte/$between on ValueDataSource, while the spec comparand door refuses it at those operators too. Follow the door there as well?",
          "options": [
            "A keep valueOf under the orderings, as PR #35604 recorded and #35738 left standing",
            "B refuse it under every operator, as the door does (one more narrowing on ValueDataSource#find)"
          ],
          "recommendation": "A for now: it is the recorded reading and no producer is traced; B only on a maintainer word, since it reverses a recorded disposition"
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed — 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 absent from VALID_AST_OPERATORS and no producer in the tree emits them · dedupe words: ast null exists spelling, value data source not implemented, parseFilterAST null",
        "carrier: none · noted, not filed — eslint --no-inline-config reports one pre-existing react-hooks/static-components error in ui/packages/plugin-report/src/DatasetReportRenderer.tsx (component created during render), unrelated to this PR's comment edit; CI's Lint UI is the authority · dedupe words: DatasetReportRenderer static-components, cannot create components during render"
      ],
      "deviations": "The final locked session (install, closure build of @object-ui/core^... and @objectstack/dogfood^..., core test, type-check, ablation 4 rerun, dogfood) held the shared lock 45m22s; the core test itself was short, the dogfood battery is mandated full and was not narrowed. The pre-change null-prototype probe (one temp test file over a copy of eed422ea2^ ValueDataSource, deleted after) ran unlocked for about 2s. Dispatch said to put the '{ $now, addDays }' choice to follow the platform: the platform resolves it, but this face refuses it by name (the card's allowed second option) for lack of field types, consistent with the file's existing { $field, addDays } refusal."
    }
  7. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb

    Claim amendment 1 · #35735 · 2026-11-20T12:13Z

    File surface (amended): adds, as PR #35832 carries them at d074b4af:

    • ui/packages/core/src/utils/foreign-realm-object.ts (new, internal, not re-exported): the one structural foreign-realm test both faces share, as the CONTRACT_REVIEW_TIER record 7037477278 asks (S6).
    • ui/packages/core/src/utils/__tests__/filter-refusal-subject-9050.test.ts: one row for the new converter throw site (S3), which that test enumerates.
    • .changeset/34990-nested-relation-filter-node.md: a DELIBERATE CORRECTION in place (L1 7037308590), declared on the PR body.
      Ruling on the dev's open question: A. Keep all four corrected 34990 sentences, so the note does not contradict its own TO line.
  8. removed
    pm:dispatched
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:datadomain:uipriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions