Repository navigation
Commit 579b857
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
File tree
- .changeset
- docs/adr
- packages/spec/src/kernel
- ui/packages/app-shell/src/views/studio-design
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
180 | 182 | | |
181 | 183 | | |
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
187 | | - | |
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
| |||
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
198 | | - | |
| 199 | + | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| |||
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| 211 | + | |
| 212 | + | |
210 | 213 | | |
211 | 214 | | |
212 | 215 | | |
| |||
454 | 457 | | |
455 | 458 | | |
456 | 459 | | |
457 | | - | |
| 460 | + | |
458 | 461 | | |
459 | 462 | | |
460 | 463 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
547 | 566 | | |
548 | 567 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
974 | 974 | | |
975 | 975 | | |
976 | 976 | | |
977 | | - | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
978 | 983 | | |
979 | 984 | | |
980 | 985 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| |||
328 | 329 | | |
329 | 330 | | |
330 | 331 | | |
| 332 | + | |
331 | 333 | | |
332 | 334 | | |
| 335 | + | |
333 | 336 | | |
334 | 337 | | |
335 | 338 | | |
| |||
341 | 344 | | |
342 | 345 | | |
343 | 346 | | |
| 347 | + | |
344 | 348 | | |
345 | 349 | | |
| 350 | + | |
346 | 351 | | |
347 | 352 | | |
348 | 353 | | |
349 | 354 | | |
350 | 355 | | |
351 | 356 | | |
| 357 | + | |
352 | 358 | | |
353 | 359 | | |
354 | 360 | | |
355 | 361 | | |
356 | 362 | | |
357 | 363 | | |
358 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
359 | 394 | | |
360 | 395 | | |
361 | 396 | | |
| |||
512 | 547 | | |
513 | 548 | | |
514 | 549 | | |
515 | | - | |
| 550 | + | |
516 | 551 | | |
517 | 552 | | |
518 | 553 | | |
519 | 554 | | |
520 | 555 | | |
521 | | - | |
| 556 | + | |
522 | 557 | | |
523 | 558 | | |
524 | 559 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
246 | 247 | | |
247 | 248 | | |
248 | 249 | | |
| |||
262 | 263 | | |
263 | 264 | | |
264 | 265 | | |
| 266 | + | |
265 | 267 | | |
266 | 268 | | |
267 | 269 | | |
| |||
406 | 408 | | |
407 | 409 | | |
408 | 410 | | |
409 | | - | |
| 411 | + | |
| 412 | + | |
410 | 413 | | |
411 | 414 | | |
412 | 415 | | |
| |||
0 commit comments