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
{{ message }}
Repository navigation
Commit cb1b688
Browse filesBrowse the repository at this point in the historyBrowse files
feat(lint)!: `dashboard-filter-binding-unknown` refuses a widget `filterBindings` key that names no filter the dashboard declares, naming the widget, the key and the declared filters
7
+
8
+
Clause-②: no (narrowing) — `os validate`, `os build`, `os lint` and the metadata publish door (`422 INVALID_METADATA`) refuse a dashboard whose widget `filterBindings` carries a key that names no declared filter (`{ regoin: false }` beside a `region` filter, or a `dateRange` key on a dashboard that declares no `dateRange`), which they accepted before. A draft still saves, and its `_diagnostics` read reports the same verdict. No accept set is widened; one rule id and its exported constant `DASHBOARD_FILTER_BINDING_UNKNOWN` are added.
**BREAKING** accept-set narrowing at every authoring door for `dashboard`.
14
+
15
+
-**Before.**`PUT /api/v1/meta/dashboard/<name>?mode=draft` and the publish that followed both answered `200` for a widget binding `filterBindings: { no_such_filter: 'status' }`. The runtime reads a binding by looking up each declared filter's name, so the key was never read: a misspelled opt-out left the widget scoped by the filter it was meant to ignore, and a misspelled re-target left the filter on its default field.
16
+
-**Now.** The rule reports the key at `widgets[i].filterBindings.<key>` at `error`, naming the widget, the key and the declared filters, with the nearest declared name as a "Did you mean". A key is valid when it names a `globalFilters` entry (by its `name`, or its `field` when it has no `name`) or is `dateRange` on a dashboard that declares `dateRange`. It is not suppressible.
17
+
-**Who sees it.** A dashboard with a misspelled or stale binding key, for example one left behind after its filter was renamed or removed. No dashboard in this repository's examples or platform objects, and none in the public HotCRM app, binds an undeclared key.
18
+
-**Stored rows.** A `sys_metadata` dashboard written before this release with such a key still loads and renders as before: the rule judges the authoring path, not the load path. Its next save or publish is refused until the key is fixed.
19
+
20
+
**The remedy.** Rename the key to one of the declared filter names the finding lists, declare the filter on the dashboard, or delete the entry.
fix(skills): four objectstack-platform eval cases agree with their own `must_not_contain` assertions
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
-**Before.** In `skills/objectstack-platform/evals/config-plugins-ops.json`, four cases refused a string their own `expected_output` spelled: eval 1 `tableName`, eval 2 `data:beforeInsert` and `onInstall`, eval 4 `@objectstack/adapter-`, eval 7 `role:` and `admin_full_access`. Graded against those assertions, the reference answer itself scored wrong, so the eval could not tell a good configuration, plugin or operations answer from a bad one.
11
+
-**Now.** Judged per case from the skill text. Eval 1 narrows its assertion to the key spelling `tableName:` (the skill's own warning, "never set `tableName`", names the bare word; the wrong form is the key beside `workflows:` / `approvals:`). Eval 2 says "a `data:*` kernel hook registers and never fires" and "no install / enable / disable hooks" instead of spelling the phantom hook and method. Eval 4 says "no `adapter-*` packages exist". Eval 7 names the refused alias as `role` (the key spelling `role:` stays refused) and says "no platform set" (the skill's term for a set such as the refused platform-admin one). No assertion is deleted, no case added or removed; the file shrinks by 13 tokens under its unchanged ceiling.
Copy file name to clipboardExpand all lines: content/docs/references/ui/dashboard.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ const result = DashboardSchema.parse(data);
76
76
|**values**|`string[]`| ✅ | Measure names — Y (at least one; exactly one on the metric/kpi/gauge/solid-gauge/bullet family and on the single-series pie/donut/funnel/treemap/sankey; with no dimensions, two or more only on table/pivot/bar/column/horizontal-bar/line/area/combo) |
77
77
|**layout**|`{ x: number; y: number; w: number; h: number }`| optional | Grid layout position (auto-flowed when omitted) |
|**filterBindings**|`Record<string, string \| false>`| optional | Per-widget dashboard-filter bindings: filter name → this widget's field, or false to opt out |
79
+
|**filterBindings**|`Record<string, string \| false>`| optional | Per-widget dashboard-filter bindings: filter name → this widget's field, or false to opt out. Each key must name a filter the dashboard declares (dateRange only when declared); lint rule dashboard-filter-binding-unknown refuses any other|
80
80
|**suppressWarnings**|`string[]`| optional | Build diagnostic rule ids suppressed on this widget |
81
81
82
82
### Nested Shape: `Dashboard.dateRange`
@@ -176,7 +176,7 @@ Dashboard header action
176
176
|**values**|`string[]`| ✅ | Measure names — Y (at least one; exactly one on the metric/kpi/gauge/solid-gauge/bullet family and on the single-series pie/donut/funnel/treemap/sankey; with no dimensions, two or more only on table/pivot/bar/column/horizontal-bar/line/area/combo) |
177
177
|**layout**|`{ x: number; y: number; w: number; h: number }`| optional | Grid layout position (auto-flowed when omitted) |
|**filterBindings**|`Record<string, string \| false>`| optional | Per-widget dashboard-filter bindings: filter name → this widget's field, or false to opt out |
179
+
|**filterBindings**|`Record<string, string \| false>`| optional | Per-widget dashboard-filter bindings: filter name → this widget's field, or false to opt out. Each key must name a filter the dashboard declares (dateRange only when declared); lint rule dashboard-filter-binding-unknown refuses any other|
180
180
|**suppressWarnings**|`string[]`| optional | Build diagnostic rule ids suppressed on this widget |
Copy file name to clipboardExpand all lines: content/docs/ui/dashboards.mdx
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -466,6 +466,7 @@ They are two different namespaces:
466
466
| :--- | :--- | :--- |
467
467
|`globalFilters[].field` (after any `filterBindings` re-target) | The bound widget's `dataset.object` — a bare name against that object's own fields, a dotted `relationship.field` path hop by hop with its prefix declared in the dataset's `include`|`dashboard-filter-field-unknown`, severity **error**|
468
468
|`widgets[].dimensions[]`| The dataset's declared `dimensions`, by name |`widget-dimension-unknown`, severity **error**|
469
+
|`widgets[].filterBindings` keys | The dashboard's declared filters, by name: each `globalFilters[].name` (its `field` when unnamed), and `dateRange` only when the dashboard declares `dateRange`|`dashboard-filter-binding-unknown`, severity **error**|
469
470
470
471
Two consequences follow, and their asymmetry is the part that surprises authors:
471
472
@@ -547,6 +548,12 @@ Binding precedence: an explicit `filterBindings` entry (string override or
547
548
`false` opt-out) → the filter's legacy `targetWidgets` allow-list → the
548
549
filter's own `field`.
549
550
551
+
Each key must name a filter the dashboard declares. The dashboard looks a
552
+
binding up by the declared filter's name, so a misspelled key (`regoin` for
553
+
`region`) is never read and the widget keeps the filter it was meant to drop
554
+
or re-target. `os validate` and the publish door refuse such a key with
555
+
`dashboard-filter-binding-unknown`, naming the declared filters.
556
+
550
557
### In the Console
551
558
552
559
-**The filter bar.** The date range and each global filter render as controls above the
0 commit comments