You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(lint): field-typed equality/membership arm for filter-preset-comparand on declared date/datetime fields (#16347)
* feat(lint): field-typed equality/membership arm for filter-preset-comparand
On a declared date / datetime field, refuse a dashboard date-range preset
name in every comparand position (bare, $eq/$ne, $in/$nin, and the view-rule
and triple spellings), binding each authored filter to the object its
conditions address through the stack's own object graph. The field-agnostic
schema door keeps its ordering-only boundary.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T6HeZvT9wdSJD1ZxJb5Eno
* docs(lint,spec): describe the field-typed arm at the registration and in the shared message's TSDoc
The rule's registration comment said it needs no resolution context; arm 2
reads the stack's objects and datasets when present. The shared refusal
wording's TSDoc said "ordering comparand"; it is now also the wording for the
field-typed equality/membership positions. The TSDoc publishes in dist/*.d.ts
(measured), so the spec change carries a patch changeset.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T6HeZvT9wdSJD1ZxJb5Eno
* chore(changeset): grade the spec TSDoc changeset minor for the clause-② gate
Check Changeset reads clause-② at PR level and requires at least minor on
every package the PR grows. The spec diff is a TSDoc comment only; the
public-surface widening of this PR is in @objectstack/lint, already minor.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T6HeZvT9wdSJD1ZxJb5Eno
* fix(lint): bind a form field's publicPicker.filter to the referenced object, never the parent form
The public-lookup route runs a publicPicker filter on the referenced object
(picker.object, else the field's reference). The field-typed arm's binding
fell through to the view's own object, so a parent date column and a
referenced select column sharing a name produced a false refusal on a
legitimate picker filter. The picker is now a claiming reader: it resolves
the referenced object or leaves the position unjudged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T6HeZvT9wdSJD1ZxJb5Eno
---------
Co-authored-by: Claude <noreply@anthropic.com>
`filter-preset-comparand` gains a FIELD-TYPED arm (#16106, maintainer-ruled 1′): on a declared `date` / `datetime` field, a dashboard date-range preset name (`last_30_days`, `this_quarter`, …) is now refused in EVERY comparand position — bare (implicit equality), `$eq` / `$ne`, `$in` / `$nin`, and their view-rule (`equals` / `not_equals` / `in` / `not_in`) and triple (`=` / `!=` / `in` / `nin`) spellings — with the same located message and prescription the ordering positions already carry (`{ $gte: '{30_days_ago}' }` for `last_30_days`, and so on). The field type is read from the stack's own object graph: a dashboard widget or report through its `dataset` to that dataset's `object`, a view through `data.object`, a flow CRUD node through `config.objectName`, a page component through `dataSource` / `properties`, an object's own list views and `relatedListFilter`, a summary field's child object. A position the graph cannot bind, a registry-injected column, a `time` field, or a select / text column stays unjudged — equality against a picklist value that collides with a preset name is a working filter. The field-agnostic schema door in `@objectstack/spec` keeps its ordering-only boundary unchanged; this closes the authoring-time gap where `objectstack lint` and the runtime publish gate accepted a filter the engine then refused with `INVALID_FILTER` / 400 on first render.
`bareDateRangePresetComparandMessage`'s TSDoc — published in `dist/*.d.ts` — now states both moments the wording is reported at: the field-agnostic schema door in `data/filter.zod.ts` (ordering positions only: without a field type, equality on a select column is legitimate) and `@objectstack/lint`'s `filter-preset-comparand` rule, which with the field type in hand refuses every comparand position on a declared `date` / `datetime` field (#16106). The message text itself is unchanged.
0 commit comments