Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .changeset/19523-blank-endpoint-entry-carriers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'@objectstack/spec': patch
---

`packages/spec/src/migrations/registry.ts` — the shipped ADR-0087 semantic entry `filter-between-blank-endpoint-refused` told an upgrader that `FieldOperatorsSchema.safeParse` **and re-saving the document** both make the sweep mechanical, over a carrier list of six slots. Measured: re-saving is mechanical on **none** of the stored carriers, so an upgrader who re-saved every dashboard, dataset and report found no blank endpoint refused and concluded the sweep was done. The entry's `surface`, `reason` and `acceptanceCriteria` now say what is actually judged where, and the sibling entry `filter-between-field-reference-endpoint-refused` — measured to carry the identical clause in its own spelling — is corrected the same way (#19523).

Clause-②: no

No behaviour moves: nothing about what the platform refuses changes. No schema or accept set is touched, and no export is added, removed or retyped (`check:api-surface` reads the public surface unchanged); every line this change edits in `registry.ts` is a string literal inside the two step-18 entries that the exported `MIGRATIONS_BY_MAJOR` carries, so what moves in `dist` is prose. What changes is what the document tells a human to do about it.

- **The split the entry now draws.** (a) Refused at save: the enforced `FieldOperatorsSchema` / `RangeOperatorSchema` copy itself, reached by a caller that validates a filter against it directly, and the `NormalizedFilter` AST. (b) Not judged at save: every stored metadata carrier — and that is **both** authoring dialects, not only the loose one. A dashboard widget filter, a dashboard options-source filter, a dataset filter, a dataset measure filter, a report `runtimeFilter`, a rollup `summaryOperations` filter and a `relatedListFilter` are typed `FilterConditionSchema`; a view, page or component filter **rule** is `ViewFilterRuleSchema`, whose value check judges arity and not blankness. For (b) the detectors are the grep the entry already prescribes and **executing** the surface, where the engine comparand-shape door answers `INVALID_FILTER` / 400 naming the index and the side.
- **What those same slots DO judge.** `FilterConditionSchema` carries `.superRefine(checkBarePresetOrderingComparands)`, so a bare date-range preset name in an ordering position is refused on this carrier set: measured at this head, `{ close_date: { $gt: 'today' } }` is refused at `close_date.$gt` and `{ close_date: { $between: ['today', '2026-12-31'] } }` at `close_date.$between.0` — the latter through an otherwise green `DashboardWidgetSchema` document at `filter.close_date.$between.0`, where the blank endpoint on that same widget stays green. This carrier set is not the edge of the rule, because the refinement rides the schema rather than these slots: `QuerySchema` refuses `where: { close_date: { $gt: 'today' } }` at `where.close_date.$gt`, and `BlueprintSummaryOperationsSchema` refuses the same map as its `filter` at `filter.close_date.$gt`, while `$gt: '2026-01-01'` stays green through both. What these carriers never judge is a `$between` endpoint for **blankness** or for **arity**, and that narrower clause is what the entry now carries; the sibling entry `filter-preset-ordering-comparand-refused` states the same rule from its own side.
- **The card's own control was wrong in the safe direction, and it was re-derived rather than inherited.** `ViewFilterRuleSchema.safeParse({ field, operator: 'between', value })` reads green on `['2026-01-01', '2026-12-31']` and green on `['2026-01-01', '']`, and refused on `['2026-01-01']` and on `['2026-01-01', { $field: 'x' }]` — so the rule dialect admits a blank endpoint, with two firing controls proving the same door is live. The same four verdicts hold through a fully-green `ListView` document at `filter.0.value`.
- **The sibling entry carried the identical clause, and it is corrected here too.** `filter-between-field-reference-endpoint-refused` described the same `FilterConditionSchema` slots as a shape “that never judges an operator map”. Measured at this head through an otherwise-green `DashboardWidgetSchema` document: a `{ $field }` reference endpoint in `$between` parses GREEN — as do a one-element, a three-element and an empty `$between` — while a preset endpoint on that same widget is refused at `filter.close_date.$between.0` and a preset `$gt` comparand at `filter.close_date.$gt`. Its clause now names what those carriers never judge — a `$between` endpoint for a COLUMN REFERENCE or for ARITY — with the live preset rule named beside it, and its `acceptanceCriteria` stops offering “those slots are `FilterConditionSchema`” as the reason a document parses green. Reach, counted over the four bundles: the bare `never judges an operator map` read 4 before this change and 0 after, and no entry carries it any more: in the tree it survives only in this changeset, which quotes the removed clause — while `a $between endpoint for a COLUMN REFERENCE or for ARITY` and the widget sentence quoting `contract.start` each moved 0 → 4, against a dark control (`… or for BLANKNESS`) reading 0 on both sides.
- **Why this is a publishing change at all.** `src/migrations/entries/**` is generator input: it is not in this package's `files[]` (only `entries/README.md` ships) and nothing imports it but the generator and two pin tests. The registry is what `chain.ts` and `index.ts` import and what `dist` is built from, so of the two, only the registry carries the corrected prose into `dist`: measured on this branch, the old sentence read 4 hits across `dist/index.js`, `dist/index.mjs`, `dist/browser/index.js` and `dist/browser/index.mjs` before the regeneration and 0 after, and two sentences unique to the corrected text moved 0 → 4 in the same four files.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,30 @@ export const entry: SemanticMigration = {
// code span already, and a nested backtick would close it.
surface:
'either endpoint of a $between range, authored BLANK — the empty string, or an absent '
+ '(undefined) bound — on any carrier of FieldOperatorsSchema / RangeOperatorSchema: a view '
+ 'or dashboard widget filter, a dataset filter, a report runtimeFilter, a page or component '
+ 'filter, a rollup filter, and the NormalizedFilter AST the query faces validate against. '
+ 'ARITY is not what changed: a blank bound is a well-formed TWO-element range one of whose '
+ 'elements means nothing',
+ '(undefined) bound — in any filter this platform stores or executes. The carriers split '
+ 'in two, because they are DETECTED differently and only one half answers on save. '
+ '(a) REFUSED AT SAVE — the enforced FieldOperatorsSchema / RangeOperatorSchema copy '
+ 'itself, reached by a caller that validates a filter against it directly, and the '
+ 'NormalizedFilter AST. (b) NOT JUDGED AT SAVE — every stored metadata carrier, and that '
+ 'is BOTH authoring dialects, not only the loose one. A view, page or component filter '
+ 'RULE (ViewFilterRuleSchema) admits it: the rule value accepts a string and the '
+ 'operator-shape check judges ARITY alone, so a two-element range with a blank element is '
+ 'a well-formed rule. A dashboard widget filter, a dashboard options-source filter, a '
+ 'dataset filter, a dataset measure filter, a report runtimeFilter, a rollup '
+ 'summaryOperations filter and a relatedListFilter are typed FilterConditionSchema, a '
+ 'loose record intersected with the $and / $or / $not shape and carrying one refinement. '
+ '⚠️ That refinement DOES judge an operator map, so the slot is not unjudged: a bare '
+ 'date-range PRESET name in an ordering position — a $gt / $gte / $lt / $lte value, or a '
+ '$between endpoint — is refused at that position\'s own path, and it is refused through '
+ 'an otherwise GREEN document; the sibling entry filter-preset-ordering-comparand-refused '
+ 'is that rule, on this same carrier set. What these carriers never judge is a $between '
+ 'endpoint for BLANKNESS or for ARITY. Measured: a dashboard widget whose filter reads '
+ 'close_date $between 2026-01-01 and an empty string parses GREEN, as do a one-element, a '
+ 'three-element and an empty $between, while the same widget carrying a preset endpoint is '
+ 'refused at filter.close_date.$between.0. So for THIS shape every one of those documents '
+ 'parses GREEN and the endpoint is refused only when the filter is EXECUTED, at the engine '
+ 'comparand-shape door. ARITY is not what changed: a '
+ 'blank bound is a well-formed TWO-element range one of whose elements means nothing',
replacement:
'two endpoints that are present and non-empty — the bound the author meant, written out. '
+ 'If only ONE side is genuinely bounded, that is not a range at all: drop `$between` and '
Expand Down Expand Up @@ -66,25 +85,40 @@ export const entry: SemanticMigration = {
+ 'Dropping the operator would be worse than guessing: it deletes a constraint the author '
+ 'wrote and WIDENS the result set silently, the failure mode `$nin` carries in the same '
+ 'file. The read path does not re-validate stored rows, so no stored view becomes '
+ 'unreadable; what changes is that RE-SAVING one is refused, at the key\'s own path, with '
+ 'the blank side named. The objectui half — the builder stops padding a half-typed pair, so '
+ 'unreadable — and, because every stored carrier is typed loosely or judged by arity '
+ 'alone (see `surface`), re-saving one is not refused either. What changes is the enforced '
+ 'operator schema itself, which answers at the endpoint\'s own path with the blank side '
+ 'named, and the engine comparand-shape door, which refuses an executed filter carrying '
+ 'one. The objectui half — the builder stops padding a half-typed pair, so '
+ 'the console never meets this refusal mid-typing — is objectui#9695 and lands on its own '
+ 'schedule, either side of this one. ADR-0049 / ADR-0078 / ADR-0087.',
acceptanceCriteria:
'Grep every authored `$between` array — view and dashboard widget filters, dataset filters, '
+ 'report runtimeFilters, page and component filters, rollup filters, saved AST filters, SDK '
+ 'and MCP callers — and read BOTH of its elements. A range with two present, non-empty '
+ 'endpoints parses byte-identically to before, numbers, Dates, ISO days, UTC instants, '
+ 'clock times and non-temporal text included, and `[\'0\', \'9\']` and `[0, 100]` are '
+ 'untouched (the rule is blankness, not falsiness). An empty-string or absent bound now '
+ 'answers one prescriptive issue at that endpoint\'s own path (`$between.0` / `$between.1`) '
+ 'naming MIN or MAX, so `FieldOperatorsSchema.safeParse` and re-saving the document both '
+ 'make the sweep mechanical; a range blank on BOTH sides reports both positions. Nothing is '
+ 'normalised on the way through — no bound is trimmed, defaulted or copied from its '
+ 'neighbour — so an accepted range arrives byte-identical to what was written. ⚠️ Do not '
+ 'assume a converted range was previously showing the window it named: a blank bound stopped '
+ 'bounding on that side at every backend, so the surface was reading a wider set than its '
+ 'filter claimed. Decide the window from what the surface was SUPPOSED to show, and if only '
+ 'one side was ever meant, write it as `$gte` / `$lte` rather than inventing a second bound. '
+ '`null` bounds are unaffected by this entry and keep their own refusal and prescription.',
'Grep every authored `$between` array — view, page and component filter rules, dashboard '
+ 'widget and options-source filters, dataset and dataset-measure filters, report '
+ 'runtimeFilters, rollup and related-list filters, saved AST filters, SDK and MCP callers '
+ '— and read BOTH of its elements. A range with two present, non-empty endpoints parses '
+ 'byte-identically to before, numbers, Dates, ISO days, UTC instants, clock times and '
+ 'non-temporal text included, and `[\'0\', \'9\']` and `[0, 100]` are untouched (the rule '
+ 'is blankness, not falsiness). An empty-string or absent bound now answers one '
+ 'prescriptive issue at that endpoint\'s own path (`$between.0` / `$between.1`) naming MIN '
+ 'or MAX, and a range blank on BOTH sides reports both positions. ⚠️ THE DETECTOR IS NOT '
+ 'THE SAME ON EVERY CARRIER, and re-saving the document is mechanical on NONE of them. '
+ '`FieldOperatorsSchema.safeParse` is mechanical, and it is the whole of what the save '
+ 'door offers: it answers for a caller that validates a filter against that schema, or '
+ 'against the NormalizedFilter AST, directly. ⛔ Re-saving surfaces NOTHING for a stored '
+ 'document — not a dashboard, dataset, report, rollup or related list, whose filter slots '
+ 'are FilterConditionSchema, and not a view, page or component filter RULE either, whose '
+ 'value check judges arity and not blankness, so a range written `[\'2026-01-01\', \'\']` '
+ 'saves exactly as green as it always did. Measured, not assumed. For those carriers the '
+ 'detectors are the GREP above and EXECUTING the surface, where the engine '
+ 'comparand-shape door refuses with INVALID_FILTER / 400 naming the index and the side. '
+ '⛔ Do not read a clean re-save of a dashboard — or of a view — as a completed sweep. '
+ 'Nothing is normalised on the way through — no bound is trimmed, defaulted or copied '
+ 'from its neighbour — so an accepted range arrives byte-identical to what was written. '
+ '⚠️ Do not assume a converted range was previously showing the window it named: a blank '
+ 'bound stopped bounding on that side at every backend, so the surface was reading a wider '
+ 'set than its filter claimed. Decide the window from what the surface was SUPPOSED to '
+ 'show, and if only one side was ever meant, write it as `$gte` / `$lte` rather than '
+ 'inventing a second bound. `null` bounds are unaffected by this entry and keep their own '
+ 'refusal and prescription.',
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,18 @@ export const entry: SemanticMigration = {
+ 'NormalizedFilter AST the query faces validate against, plus the enforced FieldOperatorsSchema '
+ 'copy itself. (b) NOT JUDGED AT SAVE — a dashboard widget filter, a dataset filter, a report '
+ 'runtimeFilter, a rollup filter and a relatedListFilter: every one of those slots is typed '
+ 'FilterConditionSchema, a loose record intersected with the $and / $or / $not shape that never '
+ 'judges an operator map, so such a document parses GREEN and the endpoint is refused only when '
+ 'the filter is EXECUTED, at the runtime lowering door this change closes. ARITY is not what '
+ 'FilterConditionSchema, a loose record intersected with the $and / $or / $not shape and '
+ 'carrying one refinement. ⚠️ That refinement DOES judge an operator map, so the slot is not '
+ 'unjudged: a bare date-range PRESET name in an ordering position — a $gt / $gte / $lt / $lte '
+ 'value, or a $between endpoint — is refused at that position\'s own path, and it is refused '
+ 'through an otherwise GREEN document; the sibling entry '
+ 'filter-preset-ordering-comparand-refused is that rule, on this same carrier set. What these '
+ 'carriers never judge is a $between endpoint for a COLUMN REFERENCE or for ARITY. Measured: a '
+ 'dashboard widget whose filter reads close_date $between { $field: "contract.start" } and '
+ '2026-12-31 parses GREEN, as do a one-element, a three-element and an empty $between, while '
+ 'the same widget carrying a preset endpoint is refused at filter.close_date.$between.0. So '
+ 'for THIS shape every one of those documents parses GREEN and the endpoint is refused only '
+ 'when the filter is EXECUTED, at the runtime lowering door this change closes. ARITY is not what '
+ 'changed: a reference endpoint is a well-formed TWO-element range one of whose elements no '
+ 'backend resolves',
replacement:
Expand Down Expand Up @@ -86,8 +95,10 @@ export const entry: SemanticMigration = {
+ 'path ($between.0 / $between.1) — note the schema door names the INDEX, while the runtime '
+ 'door additionally names the side, MIN or MAX. ⛔ Re-saving surfaces NOTHING for a dashboard '
+ 'widget filter, a dataset filter, a report runtimeFilter, a rollup filter or a '
+ 'relatedListFilter: those slots are FilterConditionSchema and such a document parses green — '
+ 'measured, not assumed. For those carriers the detectors are the GREP above and EXECUTING the '
+ 'relatedListFilter: those slots are FilterConditionSchema, whose one refinement judges bare '
+ 'date-range preset comparands and nothing about a reference endpoint, so such a document '
+ 'parses green — measured, not assumed. For those carriers the detectors are the GREP above '
+ 'and EXECUTING the '
+ 'surface, where the runtime lowering door now refuses with INVALID_FILTER / 400 naming the '
+ 'index and the side. ⛔ Do not read a clean re-save of a dashboard as a completed sweep. A '
+ 'range whose BOTH endpoints are references reports both positions at the schema door; the '
Expand Down
Loading
Loading