This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(core): ValueDataSource reads its array and { $field } comparands instead of comparing them by reference - #8529
Merged
os-justin merged 3 commits intoSep 8, 2026
Conversation
`{ tags: ['a','b'] }` took `matchesFilter`'s simple-equality branch — the
operator loop is guarded by `!Array.isArray(condition)` — and `!==` compares
REFERENCES, so it excluded every row including the deep-equal one, silently.
The repair is a refusal, not a deep-equality reading, because the census says
there is no protocol answer to implement. `assertListComparandShapes`
(`@objectstack/spec/data`) lists arrays outside `$in`/`$nin`/`$between` among
the positions its comparand door deliberately does NOT judge: the ruling does
not name it, the matrix did not measure it, and it is left to the layers that
already answer it. Those layers disagree, and the two nearest to this adapter
both refuse — `@objectstack/formula`'s record-at-a-time `matchesFilter` answers
`false` structurally on the comment "a bare array value is not a valid field
spec (must be `{ $in: [...] }`)", and `driver-sql` refuses it with its own
message. Only the document stores give it array-equality, as a native store
behaviour rather than a ruled contract. Inventing one here would be the
lenient-consumer fallback AGENTS.md #0.1 forbids: a second de-facto contract a
`provider: 'value'` list would honour and the same filter on the wire would not.
Every producer in this repo already spells a multi-value comparand
`{ $in: [...] }` — across every `$filter` literal in the packages' and apps'
source trees the only array-valued comparands are `$in` / `$nin` members — so
the refusal costs no caller a working filter, and its message names the
spelling that works.
For the equality positions this moves no rows: `===` against a fresh array
already excluded everything, so the repair is the diagnostic. The NEGATIONS are
the exception and the reason the guard covers the operator positions too:
`$ne` / `!=` against an array is always true, so an array comparand there
selected EVERY row in silence — objectui#8447's fail-open direction surviving
inside the arm this card was filed about.
The `!Array.isArray(condition)` guard STAYS. Routing an array into the operator
loop would read its INDICES as operator names, the exact shape `$not` had.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
…ialects
`@objectstack/spec/data` declares a field-reference comparand and both platform
evaluation paths execute it — `@objectstack/formula`'s `matchesFilter` resolves
it in `resolveValue`, `driver-sql` compiles it to a same-table column-to-column
comparison (objectstack#5222), and a shared conformance corpus holds the two to
the same rows. Neither of this adapter's matchers dereferenced it: `$eq` ran
`value === target` against the reference OBJECT (never equal) and the orderings
bound an object. Both dialects answered no rows, and said nothing.
Refusing it here would have made this adapter the one face answering a declared,
executed shape with "no rows" on a filter that looks like it works — the outcome
ruled worse than the bug on the sibling card. So the reference is resolved, on
exactly the six scalar comparisons `FieldReferenceSchema` declares it for
($eq/$ne/$gt/$gte/$lt/$lte and their AST spellings), in both arms.
Four positions are refused instead, each on a recorded ruling rather than this
adapter's convenience:
- A reference inside an `$in` / `$nin` list or a `$between` range —
objectstack#7596 REMOVED those positions after finding no backend resolved
them. The `$nin` direction is why the refusal is loud: an unresolved member
drops an exclusion the author wrote, so the row passes and the set widens.
- An `addDays` offset (objectstack#14104) — it is defined against the referenced
column's temporal class, and SQL push-down compiles it only between two
temporal columns of the same class. This matcher has no field types to read a
class from. Silently ignoring the offset would compare against an unshifted
column and return WRONG rows, which is worse than the defect being fixed.
- A dotted path — this matcher addresses the left side as `record[field]`, flat,
so resolving dots only on the right would make the two sides of a comparison
disagree about what a dot means. SQL push-down refuses one too, under the
same-table ruling. `@objectstack/formula` does walk dots; the divergence is
named in the code rather than papered over.
- A non-string `$field`, which the spec's own lowering predicate treats as "not
a field reference on any path".
The hand-authored implicit form `{ amount: { $field: 'budget' } }` keeps the
fail-closed fate objectstack#7597 ruled for it — it is an operator spec named
`$field`, not a comparand. Merged `main` already excluded it; only the message
changes, to name the explicit `$eq` spelling that works, as driver-sql's does.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
…ngeset
Covers both cards in one commit because they share one table: the refusal list
in "What `$filter` executes, and what it refuses" gains a row for the array
comparand (objectui#8514) and four for the `{ $field }` positions that stay
refused (objectui#8515), and a new "Cross-field comparands" paragraph states
the half that is now EXECUTED and where.
The changeset is a real one — `skip-changeset` is not a mechanism in this repo
— and declares `minor`, since `.changeset/config.json`'s fixed group must not
be pushed across a major.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
Contributor
❌ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. Which half objected:
📦 Bundle Size Report
Size Limits
|
os-justin
marked this pull request as ready for review
September 8, 2026 06:58
os-justin
enabled auto-merge
September 8, 2026 06:58
This was referenced Sep 8, 2026
os-justin
deleted the
claude/issue-8514-valuedatasource-comparand-shapes
branch
September 8, 2026 07:24
This was referenced Sep 8, 2026
os-justin
pushed a commit
that referenced
this pull request
Sep 8, 2026
… shape PR #8529's own header records that a document store reads the array comparand natively; "no backend honoured" overstated it. The changeset now says no RULED contract ever answered the shape. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
This was referenced Sep 8, 2026
os-justin
pushed a commit
that referenced
this pull request
Sep 8, 2026
…ertFiltersToAST and pin it The README's "Supported Filter Operators" table was a hand-written mirror of convertOperatorToAST's operatorMap and had drifted from the code three ways: `$nin` / `$notin` documented as lowering to `notin` (the map says `nin`, and the worked example's output was a node the server refuses); `$regex` documented as lowering to `contains` (it has been refused with a FilterOperatorError since PR #8512); only the non-spec `$startswith` spelling listed. Re-deriving every row found four supported operators with no row at all — `$notContains`, `$endsWith`, `$null`, `$exists`, the ones the code's own "Supported operators" message enumerates — and no mention of `$and` / `$or` or the `$not` refusal. Every row is corrected against the file as it stands after PRs #8512, #8529 and #8551, the missing rows are added, and two small tables document the combinators and the refusals. A new pin, src/readme-filter-operator-table.test.ts, reconciles the tables against the code on every run: each worked example is executed through convertFiltersToAST and must produce exactly its documented output (or throw the INVALID_FILTER / 400 envelope the refused table promises), each spelling must lower to the operator its row names, and the supported table must carry a row for every key of the operator map (read from source, aliases included) and for every operator the unknown-operator error calls supported. The package tsconfig names `types: ["node"]` so the pin's node:fs / node:url reads type-check in the program that already compiles this package's tests (measured: TypeScript 6.0.3 does not see the root @types/node from here without it). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
This was referenced Sep 8, 2026
os-justin
pushed a commit
that referenced
this pull request
Sep 8, 2026
…g raise could not (objectui#8542) `fa9e76ccd` raised `PER_CHUNK_GZIP_CEILINGS.framework` to 100,000 and recorded, honestly, that it could not say what the bytes bought: "the commits in that window have never been bisected — this checker is a two-build predicate over them and no one has run it." That is the one sentence this change replaces. The bisect has now been run — one `apps/console` build per point, each from the repo ROOT, `framework` read out of the `apps/console/dist/eager-closure.json` the build itself writes: | build | landed by | `framework` gzip | moved by | | `40a7c538a` | #8503 | 70,999 | last GREEN, 1 byte under | | `512c84b16` | #8519 | 70,999 | 0 | | `f76f43628` | #8512 | 71,261 | +262 | | `e76634cc8` | #8529 | 72,245 | +984 | | `e411c3e58` | #8562 | 72,248 | +3 | Two commits own the overage, not one, and the LARGER one is outside the window every card bounded its reasoning to: `e76634cc8` landed after the red had already started and carries 984 of the 1,246 bytes the pair added. A repair scoped to that window would have left `main` red. `512c84b16` emitted a byte-identical chunk to `40a7c538a` — the same `framework-nDOJv2Ij.js` content hash — so the three commits between them moved this chunk by zero, and `270f2825b` touches no file under `packages/(core|react|types)` at all. What the bytes buy is therefore sayable, which is what the gate's own failure message asks of a raise: both contributors are silent-wrong-answer fixes on one file's filter path. `f76f43628` stopped an unrecognised `$` operator adding no constraint and matching every row; `e76634cc8` stopped an array comparand and a `{ $field }` reference being compared by reference, which selected every row under `$ne` and no rows under `$eq` without saying so. No constant moves. The prose that records what the raise COSTS is kept intact, including that the attribution arrived after the ceiling did. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
akarma-synetal
pushed a commit
to akarma-synetal/objectui
that referenced
this pull request
Sep 9, 2026
…ctstack-ai#8551) * fix(core): refuse a bare array comparand in convertFiltersToAST `{ tags: ['a', 'b'] }` used to reach the simple-equality arm and lower to `['tags', '=', ['a', 'b']]` — an array in a scalar-equality slot that the spec's doors pass through unjudged, driver-sql refuses with 400 INVALID_FILTER, and every in-memory matcher answers with an empty list. The author learned nothing at lowering time. It is now refused HERE with a FilterOperatorError (INVALID_FILTER / 400) that names the field, prints the comparand, says it is deliberately not read as membership, and prescribes `{ $in: [...] }` / `{ $nin: [...] }` / `{ $between: [min, max] }` — the third member of the family `$regex` and `$not` already belong to. `$in` / `$nin` / `$between` members, `$and` / `$or` groups and stored ViewFilterRule values keep lowering untouched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S * docs(changeset): say precisely which backends answered the bare-array shape PR objectstack-ai#8529's own header records that a document store reads the array comparand natively; "no backend honoured" overstated it. The changeset now says no RULED contract ever answered the shape. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S --------- Co-authored-by: Claude <noreply@anthropic.com>
akarma-synetal
pushed a commit
to akarma-synetal/objectui
that referenced
this pull request
Sep 9, 2026
…ertFiltersToAST and pin it (objectstack-ai#8565) The README's "Supported Filter Operators" table was a hand-written mirror of convertOperatorToAST's operatorMap and had drifted from the code three ways: `$nin` / `$notin` documented as lowering to `notin` (the map says `nin`, and the worked example's output was a node the server refuses); `$regex` documented as lowering to `contains` (it has been refused with a FilterOperatorError since PR objectstack-ai#8512); only the non-spec `$startswith` spelling listed. Re-deriving every row found four supported operators with no row at all — `$notContains`, `$endsWith`, `$null`, `$exists`, the ones the code's own "Supported operators" message enumerates — and no mention of `$and` / `$or` or the `$not` refusal. Every row is corrected against the file as it stands after PRs objectstack-ai#8512, objectstack-ai#8529 and objectstack-ai#8551, the missing rows are added, and two small tables document the combinators and the refusals. A new pin, src/readme-filter-operator-table.test.ts, reconciles the tables against the code on every run: each worked example is executed through convertFiltersToAST and must produce exactly its documented output (or throw the INVALID_FILTER / 400 envelope the refused table promises), each spelling must lower to the operator its row names, and the supported table must carry a row for every key of the operator map (read from source, aliases included) and for every operator the unknown-operator error calls supported. The package tsconfig names `types: ["node"]` so the pin's node:fs / node:url reads type-check in the program that already compiles this package's tests (measured: TypeScript 6.0.3 does not see the root @types/node from here without it). Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S Co-authored-by: Claude <noreply@anthropic.com>
akarma-synetal
pushed a commit
to akarma-synetal/objectui
that referenced
this pull request
Sep 9, 2026
…g raise could not (objectui#8542) (objectstack-ai#8579) `fa9e76ccd` raised `PER_CHUNK_GZIP_CEILINGS.framework` to 100,000 and recorded, honestly, that it could not say what the bytes bought: "the commits in that window have never been bisected — this checker is a two-build predicate over them and no one has run it." That is the one sentence this change replaces. The bisect has now been run — one `apps/console` build per point, each from the repo ROOT, `framework` read out of the `apps/console/dist/eager-closure.json` the build itself writes: | build | landed by | `framework` gzip | moved by | | `40a7c538a` | objectstack-ai#8503 | 70,999 | last GREEN, 1 byte under | | `512c84b16` | objectstack-ai#8519 | 70,999 | 0 | | `f76f43628` | objectstack-ai#8512 | 71,261 | +262 | | `e76634cc8` | objectstack-ai#8529 | 72,245 | +984 | | `e411c3e58` | objectstack-ai#8562 | 72,248 | +3 | Two commits own the overage, not one, and the LARGER one is outside the window every card bounded its reasoning to: `e76634cc8` landed after the red had already started and carries 984 of the 1,246 bytes the pair added. A repair scoped to that window would have left `main` red. `512c84b16` emitted a byte-identical chunk to `40a7c538a` — the same `framework-nDOJv2Ij.js` content hash — so the three commits between them moved this chunk by zero, and `270f2825b` touches no file under `packages/(core|react|types)` at all. What the bytes buy is therefore sayable, which is what the gate's own failure message asks of a raise: both contributors are silent-wrong-answer fixes on one file's filter path. `f76f43628` stopped an unrecognised `$` operator adding no constraint and matching every row; `e76634cc8` stopped an array comparand and a `{ $field }` reference being compared by reference, which selected every row under `$ne` and no rows under `$eq` without saying so. No constant moves. The prose that records what the raise COSTS is kept intact, including that the attribution arrived after the ceiling did. Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8514
Fixes #8515
Two comparand-side defects in
ValueDataSource's matchers, dispatched together because both edit the same function. One commit each, plus a docs/changeset commit.objectui#8514 — an ARRAY comparand, refused
{ tags: ['a', 'b'] }tookmatchesFilter's simple-equality branch and!==compares references, so it excluded every row including the deep-equal one, silently.The repair is a refusal, not a deep-equality reading, and the census is why. The card and the brief both framed this as "which deep-equality semantics is right". Reading
@objectstack/spec/datasays the question is not the spec's to answer:assertListComparandShapeslists arrays outside$in/$nin/$betweenamong the positions its comparand door deliberately does not judge — "the matrix did not measure it and the ruling does not name it", left "to the layers that already answer it". Those layers disagree, and the two nearest this adapter both refuse:{ tags: [ ... ] }@objectstack/formulamatchesFilter(record-at-a-time, the closest sibling)if (Array.isArray(spec)) return false;, on the comment "a bare array value is not a valid field spec (must be{ $in: [...] })"@objectstack/driver-sqlSo there is no protocol answer to implement, and inventing one here is the lenient-consumer fallback AGENTS.md commandment 0.1 forbids — a second de-facto contract a
provider: 'value'list would honour and the same filter on the wire would not. Every producer in this repo already spells a multi-value comparand{ $in: [...] }: measured over every$filterliteral in the packages' and apps' source trees, the only array-valued comparands are$in/$ninmembers (2 hits, both$in; lit control on the same regex and path set fires on 12 files).Result-set impact, stated plainly. For the equality positions this moves no rows — a reference comparison already excluded everything, so the repair is the diagnostic. The negations are the exception and the reason the guard covers the operator positions too:
$ne/!=against an array is always true, so it had been selecting EVERY row in silence. That is objectui#8447's fail-open direction surviving inside the arm this card was filed about; the card describes the defect as failing "in the opposite direction" from #8447, and half of it does not.The
!Array.isArray(condition)guard stays — routing an array into the operator loop would read its indices as operator names, the shape$nothad. A dedicated case pins that.objectui#8515 — dereferencing a
{ $field }comparandThe spec declares it,
@objectstack/formula'scompileCelToFilteremits it, and both platform evaluation paths execute it. This adapter compared the reference object: no rows, no diagnostic. Refusing would have made it the one face answering a declared, executed shape with "no rows" — the outcome ruled worse than the bug. So it is dereferenced against the record, on exactly the six scalar comparisonsFieldReferenceSchemadeclares it for, in both dialects.Four positions are refused instead, each on a recorded ruling rather than this adapter's convenience:
$in/$ninmember or$betweenendpoint — objectstack#7596 removed those positions after finding that no backend ever dereferenced one.$ninis why the refusal is loud: an unresolved member drops an exclusion the author wrote, so the row passes and the set widens.addDays(objectstack#14104) — defined against the referenced column's temporal class; SQL push-down compiles it only between two temporal columns of the same class. This matcher has no field types. Silently dropping the offset would return wrong rows where the defect returned none.record[field], flat. SQL push-down refuses one too under the same-table ruling.@objectstack/formuladoes walk dots; the divergence is named in the code rather than papered over.$field— the spec's own lowering predicate treats it as "not a field reference on any path".The hand-authored implicit form
{ amount: { $field: 'budget' } }keeps the row-excluding fate objectstack#7597 ruled for it. Mergedmainalready excluded it loudly — only the message changes, to name the explicit$eqspelling, as driver-sql's refusal does.Bounded in-place widening, declared
Both cards name the implicit-equality position. Both repairs also cover the
$-operator and AST scalar positions, because the mechanism is identical there and leaving them would knowingly keep two fail-open holes ($newith an array;$ninwith a reference member) in the function this PR is about. Same defect class, same file, same gate family, no new verification surface.Verification
Every ablation restored by state (
git diff HEADempty andgit hash-objectequal togit rev-parse HEAD:PATH), each mutation proved on disk by injected-marker count in both directions,trap ... EXIT INT TERMwith absolute paths.JSON.stringifydeep-equality['equal'],['reordered'],['superset'],['shorter']each vs[]— naming which invented semantics was implemented. The 4 that pass are exactly the 4 CONTROLs.record[ref.$field]everywhereaddDays/ dotted checkaddDayscase readsexpected [ 'eq', 'under' ] to deeply equal []— the wrong-rows direction, demonstrated.!Array.isArray(condition)dropped$filterignored entirelyexpected [ 'equal', 'reordered', ...(3) ]— textually distinct from every other leg. The 3 survivors are the unfiltered-population CONTROLs.Reported against the brief: the brief asked for a leg for the plausible wrong fix and said to say so if it turned out byte-identical to what shipped. It did not — both wrong-fix legs are strongly discriminating. But one assertion of mine was not:
expect(message).not.toMatch(/operator '.d.'/)was written inside a block whose earlier assertion already caught that leg, so it had never run. Measured, moved into its own case with a regex that matches what the hazard actually emits, and re-measured red. That is objectui#8506's lesson landing on this PR.Gates (final commit
0b4fe1133):@object-ui/coresuite 128 files / 2724 tests pass;type-checkboth programs (tsc --noEmitandtsc -p tsconfig.test.json) after building the dependency closure;check:control-bytes,check:doc-fences,check:doc-types,check:doc-examples,check:doc-snippets,check:readme-exports,check:unreferenced-sources,check:comment-mask-corpus,check:doc-example-readersall exit 0; changeset presence and no-major both green.The first run of
check:doc-snippets/check:doc-examples/check:readme-exportsexited non-zero reading PRECONDITION NOT MET and "the population COLLAPSED — this run proves nothing". Those are not measurements; the scoped 36-package build they name was run and all three then exit 0.Declared narrowing on lint. Ran the whole
@object-ui/coreeslint project — the exact unitturbo run lintruns for the only package this diff touches — not the repo-wide farm. Population 227 files, read from--format json, 0 errors, 531 warnings (all pre-existingno-explicit-anystyle in this deliberatelyany-typed adapter;lint.ymlsets no--max-warnings). Invariance for the untouched packages:eslint --print-configreportslanguageOptions.parserOptionswith noprojectand noprojectService, so type-aware linting is off and this diff cannot move the verdict on any file it does not itself contain.Manual unicode sweep of the diff (the cover
check:control-bytesdoes not give, sinceno-irregular-whitespacecarriesskipStrings: true): 0 suspect code points across all five changed files, with a synthetic ZWSP+NBSP lit control confirming the sweep fires.Draft on purpose, and auto-merge is not armed.
Generated by Claude Code