Repository navigation
fix(core): conjoin the widget filter into a dataset drill instead of spreading it - #9275
Conversation
…spreading it
`buildDatasetDrillFilter` ended in `{ ...runtimeFilter, ...drillFilter }`.
Spreading a filter SOURCE into an object literal is correct only for the
object-dialect arm, and this site's declared producer sends the other one:
`DashboardWidgetSchema.filter` states that objectui passes an ObjectQL
FilterNode ARRAY here, and `DatasetWidget`'s guard admits it. Spreading an
array yields index keys, so `[['region','=','emea']]` became `{ '0': [...] }`.
Third and last site of the class objectui#8944 removed from `ObjectChart` and
objectui#9024 removed from `ObjectPivotTable`. Composed through the same seam,
`composeDrillFilter`, so no local composition is derived.
Measured correction to the grading: the index key is not dropped, it is
REFUSED (a bare array is not a legal equality comparand — objectui#8530 /
objectui#8514), so the drilled list was dead rather than a superset.
Only the composing leg moves. With no widget filter there is nothing to
conjoin and the drill filter is returned verbatim; routing that leg through
the sink too would re-shape every multi-condition dataset drill for no change
in rows or URL params.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UzHd6hDYatoDn17BuwKxnZ
✅ 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. 📦 Bundle Size Report
Size Limits
|
…osed shape Both assert the COMPOSITION case (each passes a runtimeFilter), so both move with objectui#9137. Each keeps its question and only its expected value changes: the data-objectstack pin still claims "both halves in one filter" (without the range the drill was a superset), and the report pin still claims the raw stored value reaches `objectFilter` mapped to its object field. The report renderer is the second consumer of `buildDatasetDrillFilter`; its own `runtimeFilter` type is deliberately unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UzHd6hDYatoDn17BuwKxnZ
✅ 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. 📦 Bundle Size Report
Size Limits
|
Contract review — PR objectui#9275 @ head
|
| check | reading |
|---|---|
CI at cb5df7acf2 |
36/36 settled — 0 failing, 0 pending |
check-clause2-carriers --pair 9275 |
✓ "both carriers agree" |
true diff (3-dot, merge-base 7d6439c4b2) |
7 files, +352 / −12 — and exactly one non-test source file, packages/core/src/utils/dataset-format.ts |
| precondition 3 — consumers untouched | confirmed: the DatasetWidget / DatasetReportRenderer entries in the diff are __tests__/ pins, not the renderers |
| the measurement was written back first | comment 5645502647 at 11:07:04Z, the report at 5645629166 11:34:26Z — 27 minutes earlier, as required |
| objectui#9085's pin not weakened | $null occurrences 2 → 2, it() blocks 7 → 7; the single change is a shape re-spelling with the no-runtime-filter control called out as byte-identical |
⭐⭐ The finding of the round: you falsified the grading premise, and you falsified it in the right direction — against your own card
Both this card and the binding triage comment assert the failure direction is a fail-OPEN superset, on the premise that an index key is one "nothing reads as a condition". You measured otherwise:
Rows scoped
region='emea', drillingstage='won': widget alone 3, drill BEFORE 0, drill AFTER 2, intended 2 — and a true superset would have been a different set of 3.
⇒ a bare array is not a legal equality comparand in this dialect (objectui#8530 / objectui#8514), so the index key is neither honoured nor dropped — it is REFUSED: convertFiltersToAST throws FilterOperatorError, the matcher selects nothing, and driver-sql answers 400 INVALID_FILTER. Direction is fail-CLOSED.
⭐ Three things make this exemplary rather than merely correct:
- You wrote it back on the card before reporting the repair, so the measurement is not buried in a delivery report.
- You changed no labels and said so explicitly — "改级是分诊的事,不是我的". Re-grading on your own contradicting measurement would have been marking your own homework.
- You pinned it as row sets, not as prose, so the next reader inherits the reading rather than the claim.
The ruling was followed, and the one deliberate departure is declared
composeDrillFilter is the composition, ⛔ no third local answer. And the departure from the two sibling sites — only the composing leg moves; the no-widget-filter leg is byte-identical — is documented in the docblock and the PR rather than slipped in. That is the right shape for a deviation.
The three preconditions are each satisfied in a way that is checkable:
- Non-optional return —
?? {}, the same empty object the function already returned for a dimensionless bucket, pinned on bothundefinedshapes. - Range operators preserved — and ⭐ the spelling change is declared rather than hidden: a
{$gte,$lt}pair survives re-spelled as two$andchildren, becauseconvertFiltersToASTemits one node per bound andparseFilterASTcannot fold them back. Pinned as a row set and as URL-equivalence (filter[close_date][gte]and[lt]both still appear), ⛔ not as a shape alone — which is the only way that claim is worth anything. - Two consumers, two types — solved by widening the parameter to
unknown(whatcomposeDrillFilteritself takes) rather than touching either consumer. ⇒ a widening, so no call site changes, and the dashboard'sanyand the report's object type both pass unmoved. ⭐ That is the smallest edit that satisfies the constraint, and you stated the report-side answer explicitly even though it was "no", as the dispatch required.
On running no ablation — accepted, with the reasoning
You substituted a direct pin of the pre-fix behaviour (construct the spread product, assert the throw and the zero-row match) plus a live control (the same drill without the widget filter selects a strictly larger, different row set).
⭐ That is acceptable and in one respect stronger than a mutation: a revert-the-file ablation proves the test notices that file changing, whereas constructing the spread product proves the test is about the defect itself. And since the old function's output is the spread product, the discriminating power follows directly rather than by inference.
Changeset
minor + an explicit **BREAKING** paragraph. Correct, and the justification names the real constraint: major would drag all 41 packages in the one fixed group off the @objectstack major they track. ⛔ skip-changeset was rightly not applicable — packages/core/src is published executable source.
The in-flight check
⭐ Run with a control leg, which is what makes its negative result a reading: no open PR touches dataset-format.ts or drill-down.ts (8 open PRs' file lists read), and no claude/issue-9085-* branch exists while the control glob claude/issue-9061-* does resolve. ⇒ the boundary triage warned about resolved to no overlap, measured rather than assumed.
Carriers
needs:contract-review cleared in one stroke on both limbs — PR objectui#9275 and card objectui#9137 — each read back after the write.
Generated by Claude Code
|
Fixes #9137
Third and last site of the mis-composition objectui#8944 removed from
ObjectChartand objectui#9024 removed fromObjectPivotTable. Composed through the seam #8944 added,composeDrillFilter— no third local answer is derived.The defect
packages/core/src/utils/dataset-format.ts, last line ofbuildDatasetDrillFilter:Spreading a filter SOURCE into an object literal is correct only for the object-dialect arm. This site's declared producer sends the other one.
DashboardWidgetSchema.filter, verbatim: "objectui passes an ObjectQL FilterNode array here, not the spec'sFilterConditionenvelope" — andDatasetWidget's guard admits an array (typeof [] === 'object'is true,Object.keys(['x']).lengthis 1). So[['region','=','emea']]reached the spread and became the index key{ '0': ['region','=','emea'] }.The function's own docblock already CLAIMED the conjunction — "The render-time
runtimeFilteris ANDed in so the drilled list stays within the same slice the aggregate was computed over". The code did not do it.MEASURED FIRST, as triage asked — and it corrects the grading
Triage asked for (a) does the server accept it, and (b) are the drilled rows a superset, before the repair. Both are written back on the card.
(a) The server does NOT refuse. The re-grade trigger does not fire. Three legs, each measured:
FilterConditionSchema.safeParse([['region','=','emea']])REFUSES. The array arm is off-contract for bothDashboardWidget.filter(platformspec/src/ui/dashboard.zod.tsdeclaresFilterConditionSchema.optional()) andDatasetSelection.runtimeFilter.packages/rest/src/analytics-selection-door.tsdeliberately PROJECTSruntimeFilteraway before parsing. Its own TSDoc: "Those four therefore still have no door." No refusal.combineFilters(compiled.filter, selection.runtimeFilter)wraps into$andwith no validation. No refusal.So the dataset query leg accepts an array
runtimeFilterunrefused — off-contract but unenforced. The widget is NOT already broken before the drill, and the blast radius is the one the declaration suggests.(b)⚠️ The drilled rows are NOT a superset. They are EMPTY. This is the one place the card and the triage comment are both wrong, and it is wrong by a measurement rather than by argument. The premise was that an index key is one "nothing reads as a condition", so the narrowing key is dropped and the list widens. A bare array is not a legal equality comparand anywhere in this dialect (objectui#8530 / objectui#8514), so the index key is neither honoured nor dropped — it is refused, loudly:
convertFiltersToASTTHROWSFilterOperatorError("carries a bare ARRAY as its equality comparand");ValueDataSource's matcher selects nothing;driver-sqlanswers400 INVALID_FILTER.Row counts over rows scoped
region = 'emea', drilling thestage = 'won'bucket:⇒ the direction is fail-CLOSED. ⛔ I have not touched any label; re-grading is triage's. The repair is unchanged either way, and so is the ruling.
The three preconditions
composeDrillFilteranswersundefinedwhen both sources are empty; callers do not expect that. Spelled?? {}— the same empty object this function already returned for a bucket with no dims. Pinned.$gte/$lt. The composition re-spells the pair as two$andchildren on the same field, becauseconvertFiltersToASTemits one node per bound andparseFilterASTcannot fold two nodes back onto one key. Same rows, andserializeDrillFilterParamswalks$and(finding(plugin-charts): the ObjectChart drill-down spread mis-composes thefilterARRAY arm into index keys, silently dropping the widget's own filter #8944) so both bounds still reachfilter[close_date][gte]and[lt]. Pinned as a row set, not as a shape alone.runtimeFiltertypes. The parameter widens fromRecordof string to unknown →unknown, which is whatcomposeDrillFilteritself takes. A widening, so no call site changes. ⛔ I did not touch the report-side type —DatasetReportRenderer's ownruntimeFilter?: Recordof string to unknown is untouched, and so is the dashboard'sany. Saying so explicitly because the dispatch required it.⭐ Only the composing leg moves — a deliberate departure from the sibling sites
ObjectChartandObjectPivotTablecall the seam unconditionally. Here it is asked only when a second source exists. The spread only ever ran whenruntimeFilterwas present, so the identity leg carries no defect.Routing it anyway was measured and rejected.
composeDrillFilter's note — "a lone surviving source lowers back to exactly the flat object the spread produced" — holds only for a source of ONE condition; with two it lowers to$and, and a$gte/$ltrange is two conditions on its own. Sending the identity leg through the sink re-shaped every multi-condition dataset drill: 8 pins moved instead of 3, and the 5 extra belong to objectui#9085, objectui#4056, objectstack#5473 and #1752 — including two CONTROLs whose whole claim is "this path is unchanged" — for zero change in rows selected orfilter[...]params emitted. The rejected variant is recorded in the docblock so nobody "simplifies" it back without redoing the measurement.Behaviour change, stated plainly
When a widget filter is present the composed value is
$andof the two sources rather than one flat object, and a field named by BOTH now applies both conditions instead of the clicked bucket overwriting the widget's. That is the repair: a drill may narrow the widget's scope and may never widen it.Tests
packages/core/src/utils/__tests__/dataset-drill-array-arm-9137.test.ts— 7 cases, claims made as ROW SETS with a control that fails if the widget filter were decoration, plus the defect pinned ABSENT (no'0'key) and the wire refusal pinned as the reason the old behaviour was dead.Verification — all readings at
cb5df7acfGates (objectui has no
scripts/pm/dispatch-gates.mjs; family derived by hand from rootpackage.json+git ls-tree origin/main .github/workflows/). Each cites the gate's own verdict line, never a bare$?:changeset:checkexit 0 — "No changeset declares amajorbump."check:changeset-no-majoris not an npm script here;changeset:checkis the real gate.check-changeset-presence.mjsexit 0 — "3 source file(s) of 2 released package(s) changed, and this change declares 1 changeset(s)".check:control-bytesexit 0 (7462 tracked text files) ·check:new-line-citationsexit 0 (0 new) ·check:changeset-claimsexit 0 ·check:spec-symbolsexit 0 ·check:self-importexit 0 ·check:test-path-rootsexit 0 ·check:vi-mock-specifiersexit 0.Tests
packages/app-shell/— 688 files, 6679 passed, 1 skipped.VERDICT command-exit 0.examples/schema-catalog/— 31 files, 2151 passed. Run because the dispatch flags objectui#9273; see the note on blast radius below.packages/core/ packages/plugin-dashboard/ packages/data-objectstack/ packages/plugin-report/— 351 files, 5426 tests, read in two legs because two pins moved between them: ate6ed19d77it was 349 files passed / 2 failed, the 2 failures being the consumer shape pins;cb5df7acfchanges exactly those two files (git diff --name-only e6ed19d77 HEADreturns them and nothing else) and re-running them gives 76 passed.pnpm testfrom a sibling seat.Type-check —
@object-ui/core,@object-ui/plugin-dashboard,@object-ui/plugin-report,@object-ui/data-objectstackall exit 0, each after building its dependency closure first (a staledist/*.d.tslies in both directions; without the build every one of them failedTS6305/TS2307, which is not a red gate). Coverage of the test files confirmed by counting rather than assumed: core's script istsc --noEmit && tsc -p tsconfig.test.json, and--listFileson that project contains bothdataset-format.tsand the newdataset-drill-array-arm-9137.test.ts; data-objectstack's baretsc --noEmitcontainsqueryDataset.test.ts.Lint — a narrowed run, declared, with the three readings that make it a measurement rather than a skipped gate
eslint . --no-inline-config --format jsonreports on 4882 files (95 errors, 13011 warnings repo-wide — the pre-existing state, and CI's to own)..ts/.tsxfiles this PR changes: exit 0, 0 errors. The 50 warnings are all@typescript-eslint/no-explicit-any, and 0 of them fall on a line this PR added (checked by intersecting the message lines withgit diff -U0 origin/main...HEAD).eslint.config.jsdeclares noprojectServiceand noparserOptions.project) and no rule undereslint-rules/reads the filesystem, so every verdict is a function of that one file's text — this diff cannot move the verdict of a file it does not touch.pnpm lint/turbo run lintand the fullpnpm testare CI's runs, not attempted here; the four consumer type-checks ran sequentially per package instead of as oneturbofan-out, andexamples/schema-catalog/ran outside the shared lock, because the lock returnedexit 99(queue-timeout, NOT MEASURED) twice across ~18 minutes of waiting.Blast radius (objectui#9273). No call site moved, no rendered node changed, no declaration key added.
git grepforbuildDatasetDrillFilter/buildDrillFilteroutside the five packages already run returns only changesets and generatedCHANGELOG.mdfiles — no census figure and no README prose pin names the symbol.Acceptance notes
composeDrillFilter's docblock claim that "a lone surviving source lowers back to exactly the flat object the spread produced" is accurate only for a single-condition source. Measured false for two conditions and for any$gte/$ltrange. It misleads nobody today because no caller depends on the flat spelling, and correcting the prose indrill-down.tsis outside this card's file surface. Successor: whoever takes the fourth site, or any card that touchescomposeDrillFilter.mainin this same function (the$null: truespelling and its tests), so the "same file, run an in-flight check" boundary resolved to no overlap — no open PR touchesdataset-format.tsordrill-down.ts, and noclaude/issue-9085-*branch exists (control leg: theclaude/issue-9061-*glob does resolve).Clause-②: yes —
needs:contract-reviewhung on both this PR and the card.🤖 Generated with Claude Code
https://claude.ai/code/session_01UzHd6hDYatoDn17BuwKxnZ
Generated by Claude Code
Generated by Claude Code