Skip to content

Commit 579b857

Browse files
feat(studio): a dataset is a data type; datasets and positions are always listed in the menu (#37599)
<!-- claude-projects-attribution: {"github_login":"os-bill"} --> _Requested by **Bill** · [project thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg2QYE8ncGrwckXw5L9fxrXY)_ repo:objectstack#5 · os-bill · session_01Utp6CbgELiNQU6e7me1RQy Fixes #37564 Clause-②: no Metadata-protocol: none Container & model: `M`, `mode:thread`, `model: CONTRACT_REVIEW_TIER (dispatch-gates --tier: MANDATORY docs/adr/**; served at tier, read from the thread's session record)`, `effort: xhigh (reason: ADR-0084 revision plus a spec registry value, standing ADR-revision order)` ## 维护者速读 - 用户能看到什么变化:在 Studio 左侧菜单里,「数据集」从「界面」组的「高级」折叠里挪到「数据」组,紧跟在「对象」后面;「岗位」从「高级」折叠里挪到「访问」组,紧跟在「权限集」后面。两项始终显示,软件包里一个都没有也显示。 - 为什么做:属于「Studio 是开发软件包的入口」这一轮菜单整理,落实你 11 月 26 日对架构记录 ADR-0084 的裁定:数据集是图表和 AI 问数共用的语义层,归数据;数据集和岗位都是常用项。记录里的类型归组表同步改成和菜单一致。 - 出错会怎样:只影响这两类在菜单、类型目录里的位置和分组徽标,数据集本身的读写、图表、问数都不受影响,可以直接撤回。有一个对外可见的值变了:类型列表接口里数据集的归组由「界面」变成「数据」,按归组挑数据集的外部代码要跟着改。 - 要你做什么:批准并合入(改了架构记录,属于受管文件,需要 os-zhuang 和 hotlong 批准)。没有需要你裁定的问题。 ## What changes Nine files, +192 / −34 against `main` (merge base `9a65a48f`: `main` has been merged in twice, each time for a neighbour that landed; head `d2c2cb98`). This PR carries out ADR-0084's [Amendment (2026-11-26), "Placements, and what moves to Setup"](https://github.com/objectstack-ai/objectstack/blob/main/docs/adr/0084-application-builder-information-architecture.md#amendment-2026-11-26-moves) for two rows, `dataset` and `position`, and decides nothing. | Where | What changes | |---|---| | `packages/spec/src/kernel/metadata-plugin.zod.ts` | One value: the `dataset` row of `DEFAULT_METADATA_TYPE_REGISTRY` reads `domain: 'data'`; it was `'ui'`. A comment above the row says why. The row keeps its place in the block and its `loadOrder` (55). | | `ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.ts` | `dataset` and `position` move into the common rows, **by name**: `dataset` directly after `object`, `position` directly after `permission`. Each row carries its reason in a comment: a dataset's schema requires one object, and a position is one slot per name in the environment (ADR-0150 D7), so the rule's tests alone would sort each of them advanced. Twelve common rows, twenty advanced. | | `docs/adr/0084-application-builder-information-architecture.md` | The type-to-group table: `dataset` is row 2 of 数据 Data, tier 常用, and the five data types behind it are each one place later; its 界面 UI row is gone; `position` keeps its place and its tier reads 常用. One note under the table and one dated mark on the amendment's "not redrawn today" paragraph say the two rows are rewritten and that `datasource` and `form` still wait for their own changes. Nit N8 of the contract record on PR #37470: the 2026-11-24 top note's 2026-11-26 mark now links `#amendment-2026-11-26-position`. Still 32 rows of the pinned shape, in one table. | | Four test files under `ui/packages/app-shell/src/views/studio-design/` and `packages/spec/src/kernel/metadata-plugin.test.ts` | The pins, below. | | `.changeset/37564-dataset-data-domain-common-tier.md` | `@objectstack/spec` patch, `@object-ui/app-shell` patch. | **What follows from the registry value, with no edit.** The menu, the type directory and the type page's group badge read the served `domain`, so all three show datasets under 数据 Data. `studioMenuModel.ts` and `StudioMenu.tsx` are not touched: the model reads the placement list and needs no special case. **A served value changes.** `GET /api/v1/meta/types` answers `domain: "data"` for the `dataset` entry, and the listing is ordered by domain and then by type, so the entry now sits first among the data types. Read on a live showcase backend built from this branch: `data:dataset data:field data:hook data:mapping data:object …`. Code that finds the entry by `type` sees no difference. The changeset says this in the release note. **Why `Clause-②: no` and `Metadata-protocol: none`.** No accepted set widens or narrows: the `domain` enum keeps its six values, no author writes the registry, and a `*.dataset.ts` item validates and loads as it did. No export, key or type is added, and the constant's declared type is the same. `pnpm --filter @objectstack/spec check:generated` reads "All 14 generated artifacts are up to date", so neither the API surface nor the authorable surface moved. **Not touched, as the card says.** The `datasource` row, and `form` (ADR-0159): `form` is not registered at this base, so it has no row. The `typescript-serializer.ts` entry that maps `dataset` to `['Dataset', 'ui']` is the spec subpath the schema is imported from, not the domain; the schema still lives in `ui/dataset.zod.ts`. **Read first**, by risk: 1. `packages/spec/src/kernel/metadata-plugin.zod.ts`, the one-value hunk on the `dataset` row: it changes a served value. 2. `docs/adr/0084-application-builder-information-architecture.md`, the table hunk: governed text, and the order of the 数据 Data rows is what the pin test compares to the placement list. 3. `ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.ts`, the two rows that move into the common block. **Two-minute verification**: after `pnpm --filter @objectstack/spec build`, run `pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts` and expect `Tests 17 passed (17)`. It reads the registry, the placement list and ADR-0084's table, and fails if any two of the three disagree. ## Tests - `packages/spec/src/kernel/metadata-plugin.test.ts`: a new case pins `dataset` under `data`, `dashboard` and `report` under `ui`, and the six-value domain set. 41 of 41. - `studioMenuPlacement.test.ts`: the literal lists (twelve common, twenty advanced), a case for the two placements by name, and a new block that reads the three groups this change touches as ADR-0084 lists them. The existing block that compares the list with the ADR's Order and Tier columns, row by row, passes against the rewritten rows. 17 of 17. - `studioMenuModel.test.ts` and `StudioMenu.test.tsx`: the served fixture gains `dataset` under `data`; the common tier, the always-listed set and the fold are pinned with both types above the fold; a new block in `StudioMenu.test.tsx` asserts that 数据 draws object then dataset, 访问 draws permission then position, neither is inside the fold, and each links to its type page on an empty package, with a control (`hook` stays in the fold). - `StudioPaletteGroups.surfaceScope-36900.test.tsx`: the command palette draws the menu's entries, so `position` now follows `permission` there and its list is read. Two expectations, test only. - The four UI files together: 92 of 92 on `c2e09545`. On the merged head `2762c831` the affected run (every test file that reads the placement list, the directory grouping or the package overview) is 85 files, 730 tests, all passed, and the spec pin is 41 of 41. After the second merge, on `d2c2cb98`: the same selection is 85 files, 747 tests, all passed (the 17 tests more are `main`'s), and the spec pin is 41 of 41. **Reverse verification**, read on `c2e09545` (neither merge changes the registry row, the placement list, or a line this PR adds to or removes from these pins), each mutation made with `scripts/ablation-replace.mjs` on a committed tree and restored to `HEAD` (blob equal to `HEAD`, `git diff HEAD` empty after each): | Mutation | Reading | |---|---| | Registry: `dataset` back to `domain: 'ui'`, spec rebuilt, `dist` read back as `ui` | spec pin: 1 failed, 40 passed. `studioMenuPlacement.test.ts`: 5 failed, 12 passed (the ADR's group against the served domain, the order inside the group, and the new group block). | | Placement list: `position` back to `advanced` | 14 failed, 78 passed, in all four UI files. | | Placement list: `dataset` back to `advanced` | 12 failed, 80 passed, in three UI files. The palette file stays green: its fixture serves no dataset. | After the registry leg the package was rebuilt from the restored source and `scripts/ablation-dist-preflight.mjs … --absent` read the marker gone from all 614 built files; both pins passed again (41 of 41, 17 of 17). ## Acceptance notes - **The card's acceptance, line by line.** The menu draws dataset under 数据 directly after 对象, and position under 访问 directly after 权限集, both outside the 高级 fold: read off a live Console on the showcase package in zh-CN, light and dark (`数据: 对象 24 · 数据集 4`, `访问: 权限集 9 · 岗位 10`; the opened fold lists 18 entries and neither of the two). The dataset page's group badge reads 数据. The pin test is green against the rewritten rows. A spec test covers the registry value. - **Screenshots.** Eight PNGs, light and dark: the dataset list with the menu, the menu alone, the menu with the fold opened, and the position list. They are in the project's shared files under `objectstack-seat5/topic-37424/cards/shots-37564/` and attached in the project thread; the relay cannot upload images to a PR. - **One test outside the two the claim named.** The affected-test run named `StudioPaletteGroups.surfaceScope-36900.test.tsx`, which pins the entries a package always lists. The area confirmed it is inside the claim's class before the edit was pushed. - **The claim was posted by the area**, not by this thread (comment 7193675575 on the card). The dispatch order asked the thread to write it; `os-dev.md` says a dispatched executor writes no claim and no assignee, and that file wins over an order. - **Neighbours.** `main` has been merged into this branch twice, each time because a neighbour landed in a shared test file. - First, at `4e10d4bf`, after PR #37546 (card #37454) landed at 16:13Z. One conflict, in `StudioMenu.test.tsx`: `main` asserts that the overview row leads the menu, and this branch's list of common types holds `dataset` and `position`; both are kept. - Second, at `9a65a48f`, after PR #37602 (card #37565) landed and the merge queue removed this PR at 19:13Z for a merge conflict. One conflict, in `studioMenuModel.test.ts`, on two adjacent lines of one test: `main` builds the environment's menu with the Setup directory, and this branch's comment on the next line no longer calls `position` an advanced type. `main`'s call and this branch's comment are kept. `StudioMenu.test.tsx` and the palette test merged without a conflict. - PR #37422 shares the registry file; `overlap-check.mjs` reads it as merging cleanly with this head. - **Contract record.** Comment 7196507657 on this PR reads PASS on `c2e09545`, and the delta record 7198537944 reads PASS on `2762c831`, each with no must-fix and no should-fix. Nit N1 is closed (the mark on the "not redrawn today" paragraph opens with its date); N2 stays as the accepted deviation the record names. Since the delta record, the lines this PR adds and removes against its merge base are byte-identical in all nine files (`git diff 4e10d4b 2762c83` against `git diff 9a65a48 d2c2cb9`, per file, added and removed lines only): the second merge changed only what `main` brought. - **Tier H by path.** `docs/adr/**` (AGENTS.md Prime Directive #14): approvers os-zhuang and hotlong, and the maintainer merges. The PR stays a draft. The `Rule-change` line is left out, as the template asks for a diff that does not touch `.claude/**`. - **No docs page is owed.** No page under `content/docs/`, no skill and no README places `dataset` in a Studio group or describes the menu's tiers. The Docs Drift Check lists three pages that name `DEFAULT_METADATA_TYPE_REGISTRY` (`concepts/metadata-lifecycle.mdx`, `plugins/adding-a-metadata-type.mdx`, `protocol/objectui/concept.mdx`); each was re-read, and none states `dataset`'s domain. ## Verification - Head `d2c2cb98`: six commits on the branch, of which two are merges of `main` (at `4e10d4bf` and at `9a65a48f`) and one dates the mark. No message names a card. - Gate list derived on `d2c2cb98`: `node scripts/pm/dispatch-gates.mjs --commands` prints 98 commands, line for line the 98 derived on the two earlier heads. - All 98 exited 0 on `d2c2cb98`, each exit code captured before any pipe, after `pnpm install --frozen-lockfile` and a full rebuild of the merged tree (123 of 123 tasks, none cached). `--ran` reconciliation: `98 derived famil(ies) accounted for — 98 run, 0 NOT-MEASURED`. - The same list was 98 of 98 on `2762c831` (after the first merge) and on `c2e09545`. Two reds of the very first pass were the container, not the diff, and each passed when run again alone: `check-plugin-teardown-shape.mjs --self-test` needs a pinned fixture commit that a shallow clone lacks; `pnpm --dir ui exec vitest run scripts/` was killed by the container's memory limit while another test run shared the box. - Tests on `d2c2cb98` under the verify lock: spec pin 41 of 41; affected UI run 85 files, 747 tests, all passed. On `2762c831`: 85 files, 730 tests, all passed. On `c2e09545`: 82 files, 664 tests; 662 passed on the first run and the 2 that failed were the palette expectations above, fixed in that head. - Type checks were run locally on `c2e09545` (`pnpm --filter @objectstack/spec run typecheck`, `pnpm --filter @object-ui/app-shell run type-check`, `eslint` on the seven changed source and test files, `pnpm --dir ui run check:new-line-citations`: each exit 0). They were not run again locally on either merged head; the type-check lanes are this PR's check-runs. The three reverse verifications were not run again either, for the reason given above them. - `overlap-check.mjs` on `d2c2cb98`: clean against `origin/main` `1dbf19a1` and the one open PR head that shares a file. - `dispatch-gates --tier`: `docs/adr/**` is the mandatory contract tier; changed lines 226 against the human-merge threshold 3000: under. - `check-prior-rulings --paths` on the ADR, the registry file and the placement list (read on `c2e09545`; neither merge changed the ADR): the 2026-11-24, 2026-11-25 and 2026-11-26 amendments of ADR-0084 are the rulings in force; this PR changes no decision of any of them. - CI was green on `c2e09545` and on `2762c831` (72 check-runs: 60 success, 12 skipped, none failed). CI on `d2c2cb98` is this PR's check-runs; the third report on the card cites them. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Utp6CbgELiNQU6e7me1RQy <!-- signed: repo:objectstack#5 · os-bill · session_01Utp6CbgELiNQU6e7me1RQy --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 61a6544 commit 579b857

9 files changed

Lines changed: 192 additions & 34 deletions
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@object-ui/app-shell': patch
4+
---
5+
6+
feat(studio): a dataset is a data type — Studio lists it under Data, directly after objects, and always shows datasets and positions
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
`DEFAULT_METADATA_TYPE_REGISTRY` registers `dataset` under `domain: 'data'`; it was `'ui'`. A dataset is the semantic layer that charts and an AI's data questions both read, so it is data and not interface (ADR-0084, amended 2026-11-26). Nothing an author writes changes: a `*.dataset.ts` item validates and loads as it did, the `domain` enum keeps its six values, and the registry's declared type is the same. `dashboard` and `report` stay `ui` types.
12+
13+
What changes is a served value. `GET /api/v1/meta/types` answers `domain: "data"` for the `dataset` entry, and because that listing is ordered by domain and then by type, the entry now sits among the data types. Code that finds the entry by its `type` sees no difference; code that selected datasets by `domain === 'ui'`, from the listing or from the exported registry, reads `'data'` instead.
14+
15+
In Studio the left menu, the type directory and a dataset page's badge follow the registry, so datasets are found under Data. `STUDIO_MENU_PLACEMENT` places `dataset` and `position` in the common tier by name: a package's menu always lists both above the Advanced fold, whether the package holds one or not — dataset directly after object, position directly after permission set.

‎docs/adr/0084-application-builder-information-architecture.md‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
> area, and the line that kept the Platform and AI types out of the builder no longer describe the surface. Each
1616
> sentence the amendment replaces is struck or marked where it stands and points to
1717
> [Amendment (2026-11-24)](#amendment-2026-11-24); everything not marked stands. *(Amended 2026-11-26: "the
18-
> development surface of one app" is reworded — Studio is the entry for developing a package; the note below.)*
18+
> development surface of one app" is reworded — Studio is the entry for developing a package:
19+
> [Amendment (2026-11-26)](#amendment-2026-11-26-position).)*
1920
2021
> **Amendment (2026-11-25) — the menu draws two tiers, 常用 Common and 高级 Advanced.** The six groups stand. On a
2122
> package the menu lists the 常用 types under their groups, and one collapsed 高级 fold beneath them holds every other
@@ -172,19 +173,19 @@ Every type the spec registers, enumerated at `origin/main` `151e8123` from `pack
172173
| Group | `domain` | Order | Registered type | Tier |
173174
|---|---|---|---|---|
174175
| **数据 Data** | `data` | 1 | `object` 对象 | 常用 |
175-
| **数据 Data** | `data` | 2 | `picklist` 选项列表 | 高级 |
176-
| **数据 Data** | `data` | 3 | `hook` 钩子 | 高级 |
177-
| **数据 Data** | `data` | 4 | `mapping` 字段映射 | 高级 |
178-
| **数据 Data** | `data` | 5 | `object_extension` | 高级 |
179-
| **数据 Data** | `data` | 6 | `seed` | 高级 |
176+
| **数据 Data** | `data` | 2 | `dataset` 数据集 | 常用 |
177+
| **数据 Data** | `data` | 3 | `picklist` 选项列表 | 高级 |
178+
| **数据 Data** | `data` | 4 | `hook` 钩子 | 高级 |
179+
| **数据 Data** | `data` | 5 | `mapping` 字段映射 | 高级 |
180+
| **数据 Data** | `data` | 6 | `object_extension` | 高级 |
181+
| **数据 Data** | `data` | 7 | `seed` | 高级 |
180182
| **数据 Data** | `data` | — | `field` | — |
181183
| **界面 UI** | `ui` | 1 | `app` 应用 | 常用 |
182184
| **界面 UI** | `ui` | 2 | `page` 页面 | 常用 |
183185
| **界面 UI** | `ui` | 3 | `dashboard` 仪表盘 | 常用 |
184186
| **界面 UI** | `ui` | 4 | `report` 报表 | 常用 |
185187
| **界面 UI** | `ui` | 5 | `view` 视图 | 高级 |
186188
| **界面 UI** | `ui` | 6 | `action` 操作 | 高级 |
187-
| **界面 UI** | `ui` | 7 | `dataset` 数据集 | 高级 |
188189
| **自动化 Automation** | `automation` | 1 | `flow` 流程 | 常用 |
189190
| **自动化 Automation** | `automation` | 2 | `job` | 高级 |
190191
| **平台 Platform** | `system` | 1 | `doc` 文档 | 高级 |
@@ -195,7 +196,7 @@ Every type the spec registers, enumerated at `origin/main` `151e8123` from `pack
195196
| **平台 Platform** | `system` | 6 | `datasource` | 高级 |
196197
| **平台 Platform** | `system` | 7 | `external_catalog` | 高级 |
197198
| **访问 Access** | `security` | 1 | `permission` 权限集 | 常用 |
198-
| **访问 Access** | `security` | 2 | `position` 岗位 | 高级 |
199+
| **访问 Access** | `security` | 2 | `position` 岗位 | 常用 |
199200
| **访问 Access** | `security` | 3 | `assignment_rule` 分配规则 | 高级 |
200201
| **访问 Access** | `security` | 4 | `sharing_rule` 共享规则 | 高级 |
201202
| **访问 Access** | `security` | 5 | `queue` | 高级 |
@@ -207,6 +208,8 @@ Every type the spec registers, enumerated at `origin/main` `151e8123` from `pack
207208

208209
*(Amended 2026-11-25: the table is redrawn one row per type and gains two columns, **Order** and **Tier** — [Amendment (2026-11-25)](#amendment-2026-11-25). Read again at `origin/main` `a33691e567`: 33 entries — the 32 of the first reading, each in the domain it had, and `ai_context`, registered `ai` on 2026-11-25 ([ADR-0160](./0160-record-scoped-ai-inquiry.md) D1). No type changed group, and the rows count 数据 Data 7 · 界面 UI 7 · 自动化 Automation 2 · 平台 Platform 7 · 访问 Access 6 · AI 4.)*
209210

211+
*(Rewritten 2026-11-26, card [#37564](https://github.com/objectstack-ai/objectstack/issues/37564), which carries out [Amendment (2026-11-26)](#amendment-2026-11-26-moves) for two rows and decides nothing: `dataset` and `position`. `dataset` is registered `data` by the same change, so its row leaves 界面 UI, where it was seventh, for 数据 Data, where it is second, directly after `object`; each 数据 Data type behind it is one place later, and its tier is 常用. `position` keeps its place, and its tier is 常用. The registry holds the same 33 entries, and the rows now count 数据 Data 8 · 界面 UI 6 · 自动化 Automation 2 · 平台 Platform 7 · 访问 Access 6 · AI 4. The `datasource` row is not touched and `form` has no row yet: each is rewritten, or written, by the change that moves it.)*
212+
210213
The rows are in the menu's order: by group, then by **Order**, which counts inside a group. **Tier** is 常用 Common or 高级 Advanced. The Chinese word beside a registered name is the one the ruling or its proposal uses for that type; a type neither names in Chinese has none. `field` carries no order and no tier because it draws no row (the second reading below).
211214

212215
The table is the registry read at one commit. **The rule above is what binds**: a type added to the registry, or given another domain there, moves in the menu without this table being edited, and where the two disagree the registry is right. *(Amended 2026-11-25: that sentence is about the Group and `domain` columns. The Order and Tier columns are read from no registry — they are decided in this record, and a type the table has no row for is drawn in 高级 Advanced, at the end of its group: [Amendment (2026-11-25)](#amendment-2026-11-25).)*
@@ -454,7 +457,7 @@ When the registry and the placement list have changed, the three groups these mo
454457

455458
That makes thirteen 常用 types: the ten of 2026-11-25, and these three.
456459

457-
**The [type → group table](#type-to-group) is not redrawn today.** A test pins it, row by row, to the registry and to the placement list (`ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts`), and both still hold `dataset` under `ui`, `datasource` with a row, no `form`, and every tier as ruled on 2026-11-25. A row is rewritten, or written, in the change that moves it — the same pull request, since the pin fails otherwise: `dataset`'s with its registry change and its tier, `position`'s with its tier, `datasource`'s with the menu's, and `form`'s when the type is taken off the directory's hidden types. Each of those carries out this section and needs no further ruling. Until then the table is what the menu draws.
460+
**The [type → group table](#type-to-group) is not redrawn today.** A test pins it, row by row, to the registry and to the placement list (`ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts`), and both still hold `dataset` under `ui`, `datasource` with a row, no `form`, and every tier as ruled on 2026-11-25. A row is rewritten, or written, in the change that moves it — the same pull request, since the pin fails otherwise: `dataset`'s with its registry change and its tier, `position`'s with its tier, `datasource`'s with the menu's, and `form`'s when the type is taken off the directory's hidden types. Each of those carries out this section and needs no further ruling. Until then the table is what the menu draws. *(Amended 2026-11-26: since rewritten — `dataset`'s row and `position`'s, by card [#37564](https://github.com/objectstack-ai/objectstack/issues/37564), with the registry change and the placement list. `datasource`'s and `form`'s still wait for their changes — the [note under the table](#type-to-group).)*
458461

459462
### Organization-level content {#amendment-2026-11-26-org}
460463

‎packages/spec/src/kernel/metadata-plugin.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,5 +544,24 @@ describe('MetadataPluginProtocol', () => {
544544
expect(byDomain('ai')).toContain('tool');
545545
expect(byDomain('ai')).toContain('skill');
546546
});
547+
548+
// ADR-0084, amended 2026-11-26 ("Placements, and what moves to Setup"): a
549+
// dataset is the semantic layer that charts and an AI's data questions both
550+
// read, so it is registered `data`. One type changes domain; the two types
551+
// that bind to it stay `ui`, and no seventh domain is made for analytics.
552+
it('registers `dataset` under `data`, and leaves `dashboard` and `report` under `ui`', () => {
553+
const domainOf = (type: string) => DEFAULT_METADATA_TYPE_REGISTRY.find(e => e.type === type)?.domain;
554+
555+
expect(domainOf('dataset')).toBe('data');
556+
expect(domainOf('dashboard')).toBe('ui');
557+
expect(domainOf('report')).toBe('ui');
558+
expect(new Set(DEFAULT_METADATA_TYPE_REGISTRY.map(e => e.domain))).toEqual(
559+
new Set(['data', 'ui', 'automation', 'system', 'security', 'ai']),
560+
);
561+
// The move changes where the type is listed and nothing about how it loads.
562+
const dataset = DEFAULT_METADATA_TYPE_REGISTRY.find(e => e.type === 'dataset')!;
563+
expect(dataset.loadOrder).toBe(55);
564+
expect(dataset.loadOrder).toBeLessThan(DEFAULT_METADATA_TYPE_REGISTRY.find(e => e.type === 'report')!.loadOrder);
565+
});
547566
});
548567
});

‎packages/spec/src/kernel/metadata-plugin.zod.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,12 @@ export const DEFAULT_METADATA_TYPE_REGISTRY: MetadataTypeRegistryEntryParsed[] =
974974
{ type: 'report', label: 'Report', filePatterns: ['**/*.report.ts', '**/*.report.yml'], supportsOverlay: true, allowEnvironmentOverlay: true, allowRuntimeCreate: true, supportsVersioning: true, executionPinned: false, loadOrder: 60, domain: 'ui' },
975975
// ADR-0021: dataset is the analytics semantic layer that report/dashboard bind to.
976976
// loadOrder 55 < report/dashboard (60) so datasets register before their consumers.
977-
{ type: 'dataset', label: 'Dataset', description: 'Analytics semantic layer — dimensions & measures', filePatterns: ['**/*.dataset.ts', '**/*.dataset.yml', '**/*.dataset.json'], supportsOverlay: true, allowEnvironmentOverlay: false, allowRuntimeCreate: true, supportsVersioning: true, executionPinned: false, loadOrder: 55, domain: 'ui' },
977+
// ADR-0084 (amended 2026-11-26, "Placements, and what moves to Setup"): a
978+
// dataset is a `data` type — the semantic layer that charts and an AI's data
979+
// questions both read — so its `domain` is `data` and Studio lists it under
980+
// 数据 Data, directly after `object`. The row stays in this block because the
981+
// overlay notes above name it, and its schema still lives in `ui/dataset.zod.ts`.
982+
{ type: 'dataset', label: 'Dataset', description: 'Analytics semantic layer — dimensions & measures', filePatterns: ['**/*.dataset.ts', '**/*.dataset.yml', '**/*.dataset.json'], supportsOverlay: true, allowEnvironmentOverlay: false, allowRuntimeCreate: true, supportsVersioning: true, executionPinned: false, loadOrder: 55, domain: 'data' },
978983

979984
// Automation Protocol — flow is executionPinned (ADR-0009).
980985
// ADR-0019: there is no `approval` metadata type — approvals are Approval

‎ui/packages/app-shell/src/views/studio-design/StudioMenu.test.tsx‎

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ beforeEach(() => {
153153
setWidth(1280);
154154
reads.entries = SERVED;
155155
// The package holds objects, flows, permission sets and hooks; no app, page or position.
156+
// (A position is 常用 since objectstack#37564: drawn on a package all the same, dimmed.)
156157
reads.sweep = {
157158
countsByType: { object: 3, flow: 2, permission: 1, hook: 27 },
158159
packagesByType: { object: [PKG], flow: [PKG], permission: [PKG], hook: [PKG] },
@@ -328,8 +329,10 @@ describe('a package that holds nothing yet (objectstack#37201)', () => {
328329
it('lists every served 常用 type, holding one or not; a 高级 type only when held', () => {
329330
reads.entries = [
330331
...SERVED,
332+
{ type: 'dataset', domain: 'data' },
331333
{ type: 'dashboard', domain: 'ui' },
332334
{ type: 'report', domain: 'ui' },
335+
{ type: 'assignment_rule', domain: 'security' },
333336
{ type: 'agent', domain: 'ai' },
334337
{ type: 'tool', domain: 'ai' },
335338
{ type: 'skill', domain: 'ai' },
@@ -341,21 +344,53 @@ describe('a package that holds nothing yet (objectstack#37201)', () => {
341344
const all = links(screen.getByTestId('studio-menu'));
342345
expect(all[0]).toBe('overview');
343346
const common = all.slice(1).filter((k) => !links(foldRegion()).includes(k));
347+
// objectstack#37564 — dataset and position are 常用 by name (ADR-0084, amended 2026-11-26).
344348
expect(common).toEqual([
345349
'type:object',
350+
'type:dataset',
346351
'type:app',
347352
'type:page',
348353
'type:dashboard',
349354
'type:report',
350355
'type:flow',
351356
'type:permission',
357+
'type:position',
352358
'type:agent',
353359
'type:tool',
354360
'type:skill',
355361
]);
356362
for (const k of common) expect(entry(k)).toHaveAttribute('data-empty', 'true');
357363
expect(screen.queryByTestId('studio-menu-entry-type:hook')).toBeNull();
358-
expect(screen.queryByTestId('studio-menu-entry-type:position')).toBeNull();
364+
expect(screen.queryByTestId('studio-menu-entry-type:assignment_rule')).toBeNull();
365+
});
366+
});
367+
368+
describe('dataset and position are 常用, placed by name (objectstack#37564, ADR-0084 amended 2026-11-26)', () => {
369+
const keysIn = (testId: string) =>
370+
within(screen.getByTestId(testId))
371+
.queryAllByRole('link', { hidden: true })
372+
.map((a) => a.getAttribute('data-testid')!.replace('studio-menu-entry-', ''));
373+
374+
it('dataset is drawn under Data directly after object, position under Access directly after permission set, both above the fold', () => {
375+
// Served as the registry serves it: a dataset is a `data` type.
376+
reads.entries = [{ type: 'dataset', domain: 'data' }, ...SERVED];
377+
renderAt(`/studio/${PKG}/data`);
378+
expect(keysIn('studio-menu-group-data')).toEqual(['type:object', 'type:dataset']);
379+
expect(keysIn('studio-menu-group-security')).toEqual(['type:permission', 'type:position']);
380+
expect(foldRegion().contains(entry('type:dataset'))).toBe(false);
381+
expect(foldRegion().contains(entry('type:position'))).toBe(false);
382+
// The package holds none of either: drawn all the same, as any empty 常用 type is.
383+
expect(entry('type:dataset')).toHaveAttribute('data-empty', 'true');
384+
expect(entry('type:position')).toHaveAttribute('data-empty', 'true');
385+
expect(entry('type:dataset')).toHaveAttribute('href', `/studio/${PKG}/metadata/dataset?package=${PKG}`);
386+
expect(entry('type:position')).toHaveAttribute('href', `/studio/${PKG}/metadata/position?package=${PKG}`);
387+
});
388+
389+
it('CONTROL: a type the rule sorts 高级 stays inside the fold, and the UI group draws no dataset', () => {
390+
reads.entries = [{ type: 'dataset', domain: 'data' }, ...SERVED];
391+
renderAt(`/studio/${PKG}/data`);
392+
expect(foldRegion().contains(screen.getByTestId('studio-menu-entry-type:hook'))).toBe(true);
393+
expect(keysIn('studio-menu-group-ui')).toEqual(['type:app', 'type:page']);
359394
});
360395
});
361396

@@ -512,13 +547,13 @@ describe('全部类型 All types (objectstack#37360, ADR-0084 amended 2026-11-25
512547
});
513548

514549
it('CONTROL: the fold still leaves out a 高级 type the package holds none of', () => {
515-
reads.entries = [...SERVED, { type: 'email_template', domain: 'system' }];
550+
reads.entries = [...SERVED, { type: 'email_template', domain: 'system' }, { type: 'assignment_rule', domain: 'security' }];
516551
renderAt(`/studio/${PKG}/data`);
517552
fireEvent.click(fold());
518553
expect(entry('allTypes')).toBeVisible();
519554
expect(entry('type:hook')).toBeVisible();
520555
expect(screen.queryByTestId('studio-menu-entry-type:email_template')).toBeNull();
521-
expect(screen.queryByTestId('studio-menu-entry-type:position')).toBeNull();
556+
expect(screen.queryByTestId('studio-menu-entry-type:assignment_rule')).toBeNull();
522557
});
523558

524559
it.each([

‎ui/packages/app-shell/src/views/studio-design/StudioPaletteGroups.surfaceScope-36900.test.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ describe("on a package, the palette lists the left menu and the package's items
243243
// The menu's six groups, in the menu's order, then the packages and the
244244
// theme commands. No cross-package Objects / Flows. objectstack#37201 —
245245
// AI is drawn: its 常用 agent type is listed on a package that holds none.
246+
// objectstack#37564 — so is `position`, 常用 by name, directly after `permission`.
246247
expect(headings()).toEqual([
247248
group('data'),
248249
group('ui'),
@@ -262,6 +263,7 @@ describe("on a package, the palette lists the left menu and the package's items
262263
'studio-entry type:datasource',
263264
'studio-entry diagnostics',
264265
'studio-entry type:permission',
266+
'studio-entry type:position',
265267
'studio-entry owd',
266268
'studio-entry type:agent',
267269
]);
@@ -406,7 +408,8 @@ describe("on a package, the palette lists the left menu and the package's items
406408
it("CONTROL — opened, it reads each listed type's list", async () => {
407409
mount(PKG);
408410
await itemsListed();
409-
expect([...reads.state.calls].sort()).toEqual(['agent', 'dashboard', 'flow', 'hook', 'object', 'permission']);
411+
// objectstack#37564 — `position` is listed on every package, so its list is read; this package holds none.
412+
expect([...reads.state.calls].sort()).toEqual(['agent', 'dashboard', 'flow', 'hook', 'object', 'permission', 'position']);
410413
});
411414
});
412415

0 commit comments

Comments
 (0)