Skip to content

Commit 0dca581

Browse files
committed
docs(changeset): list-view chart bindings refused at the view and object doors
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziFPBpGc76tAFHbB8v
1 parent 45ada0d commit 0dca581

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/lint': minor
3+
---
4+
5+
fix(lint)!: the view and object publish doors refuse a list-view chart whose dataset, dimension or measure does not resolve
6+
7+
Clause-②: no (narrowing) — a list view whose `chart.dataset` names no declared dataset, or whose `chart.dimensions` / `chart.values` names a dimension or measure its dataset does not declare, is refused at publish (`PUT /api/v1/meta/view`, `PUT /api/v1/meta/object`); it published `200` before. `os validate` / `os build` already refused it, and still do. Nothing is widened.
8+
Metadata-protocol: narrowed
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped: an existing author-time rule now also runs at the view and object publish doors. There is no mechanical rewrite to prescribe, because only the author knows which declared dataset or measure the chart meant. -->
11+
12+
**BREAKING** accept-set narrowing at the runtime publish door: `validateChartBindings` (`@objectstack/lint`) joins the reference-integrity suite's `view` and `object` writes.
13+
14+
- **Why.** A Studio or MCP author who mistyped a dataset name, or named a measure the dataset lacks, got a saved view whose chart rendered empty or broken, with nothing saying why, while the CLI refused the same file.
15+
- **Before.** Measured on the real `PUT /api/v1/meta/view` route over a real `sys_metadata` store: a chart list view naming `no_such_dataset`, or a `values` entry naming no measure of its dataset, answered `200` and was stored, as a view item (`config`), as a flattened list overlay and as a container `listViews` member alike.
16+
- **Now.** Each is refused `422 INVALID_METADATA` with the verdict `os validate` gives: `chart-dataset-unknown` at `chart.dataset`, `chart-measure-unknown` at `chart.values[i]`, and `chart-dimension-unknown` at `chart.dimensions[i]`. The rule's list-view walk now opens the two standalone view shapes the door carries (the flattened list overlay and the ViewItem `config`), and an object's own `listViews` is judged on an object write. A draft save is not gated, as for every author-time rule.
17+
- **Who moves.** No view or object in `examples/**` or `packages/platform-objects` is refused: measured at the door's own snapshot shape, the two chart list views in the showcase app bind declared datasets and measures.
18+
19+
**The remedy.** Bind a dataset the stack or package declares, and name its declared dimensions and measures (a measure name such as `amount_sum`, never the base field `amount`), or declare the missing dimension or measure on the dataset.

‎content/docs/data-modeling/analytics.mdx‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,13 @@ and list-view charts to it **by name**. Presentations reference a dataset by its
285285
`name` string — the shipped presentation schemas carry no inline/anonymous
286286
dataset shape, so even a one-off single-object KPI is a small named dataset.
287287

288+
A list-view chart's binding must resolve. A `dataset` no package declares, or a
289+
`dimensions` or `values` entry the dataset does not declare, is refused at
290+
publish, for a view and for an object's own `listViews` alike, and fails
291+
`os validate` (`chart-dataset-unknown`, `chart-dimension-unknown`,
292+
`chart-measure-unknown`). A `values` entry names a dataset **measure**, never
293+
the base field it aggregates.
294+
288295
A list-view chart draws the rows of its dataset's base `object`, never the
289296
list's own records: the list's filter does not reach the dataset query. So a
290297
list view's chart must bind a dataset whose `object` is the object the list

0 commit comments

Comments
 (0)