Repository navigation
Commit ebe0a98
docs(spec): upgrade-guide entry for a dataset or cube dimension over a formula field (#30925)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoEYgj6SzALKLMB6zCkz6wQZ)_
Fixes #30822
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:升级指南(`os migrate meta` 与协议升级文档)新增一条语义迁移条目
`dataset-dimension-virtual-field-refused`:数据集或 `analyticsCubes`
的维度指向公式字段(不落库的虚拟字段)现在在编写时就被拒,条目告诉作者怎么改。
- 为什么改:#30773 已让数据集编译(`400 DATASET_INVALID`)和
lint(`dimension-virtual-field-refused`)拒绝这种维度,但升级指南没有对应条目,作者升级后只会在数据集突然编译失败时才知道;度量侧的同类收窄早已有条目。
- 风险与回滚:只加一条指南文字和它的相关性登记,不改任何 schema、导出或接受集;回滚即 revert。
-
先看:`packages/spec/src/migrations/entries/semantic/18.dataset-dimension-virtual-field-refused.ts`(条目正文,引用两道拒绝的原文);`packages/spec/src/migrations/semantic-relevance.test.ts`(相关性登记表
+1)。
- 两分钟验证:`pnpm --filter @objectstack/spec exec tsx
scripts/build-upgrade-guide.ts --out /tmp/g.md && grep -n
dataset-dimension-virtual-field-refused /tmp/g.md`,预期在协议 18
一节看到该条目及其「Why not automatic / Done when」两行。
- 需要你做的:无,席位落地。
## What changes
- **New semantic migration entry**
`dataset-dimension-virtual-field-refused` (protocol 18 step), the
dimension-side sibling of
`dataset-measure-aggregate-field-type-refused`, for a
`datasets[].dimensions[].field` or an
`analyticsCubes[].dimensions.KEY.sql` naming a `formula` field
(`SEARCH_VIRTUAL_TYPES`).
- No automatic rewrite: which stored field should carry the value is the
author's judgement.
- Replacement, as the card words it: store the value in a field of its
own on the object (written by a hook or a flow when its source changes)
and point the dimension at that field, or remove the dimension.
- `acceptanceCriteria` quotes both refusals as PR #30815 shipped them:
the dataset compile's `400 DATASET_INVALID` text from
`assertDimensionFieldStored` (`dataset-compiler.ts`), and the lint
finding's message and hint from `virtualDimensionFinding`
(`validate-dataset-measure-aggregates.ts`), with placeholders for the
names. It also carries the two scope facts from that PR's changeset: the
whole dataset stops compiling (not only the member), and the compile
does not judge a dotted dimension while lint does.
- `relevantWhen: { kind: 'stack-declares', keys: ['datasets',
'analyticsCubes'] }`.
- **`semantic-relevance.test.ts`**: the reviewed ENUMERATION table gains
the entry; the count pins move 26 → 27 overall and 21 → 22 for protocol
18.
- **Changeset** `@objectstack/spec` patch with both declaration lines.
## Why
The upgrade guide is the only channel that reaches an author upgrading
across the release that ships #30773 before their dataset stops
compiling. The narrowing PR registered `not-required
(no-migration-prescription)`, so no conversion exists to replay; this
entry is the prescription. The card asks for it to land before that
release.
## Verification
All runs on head `012839b6` in a dedicated worktree, base `origin/main`
`6ff27b34` (`main` has moved since with no change under
`packages/spec/src/migrations`).
<details><summary>Tests</summary>
- `pnpm --filter @objectstack/spec build` :: exit 0
- `vitest run src/migrations scripts/upgrade-guide-docs.test.ts
scripts/upgrade-guide-surface-span.test.ts` (spec): Test Files 7 passed
(7), Tests 228 passed (228)
- `pnpm --filter @objectstack/spec test`: Test Files 818 passed (818),
Tests 25838 passed, 1 todo
- `pnpm --filter @objectstack/spec typecheck` :: exit 0
- Rendered guide (`build-upgrade-guide.ts --out`): the entry appears in
protocol 18's section, its surface in one intact code span, with its
"Why not automatic" and "Done when" lines.
</details>
<details><summary>Derived gates</summary>
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 81 families for the 3-path change
set; all 81 ran with exit 0. `--ran` reconciliation: 81 derived, 81 run,
0 NOT-MEASURED, 0 UNRUN. Four first runs answered exit 3 (prerequisite,
nothing measured) and were re-run green after the prerequisite:
`check-plugin-teardown-shape --self-test` (clone deepened),
`check:doc-formula-expressions`, `check:lean-entry-closure`,
`check:dual-build-cjs-loads` (dependency builds). Record:
`/mnt/project-files/spec-seat-1/r2026-11-06/out/30822-gates-ran-012839b6.list`.
</details>
Dogfood: n/a (no `!` in the title, no `(narrowing)` arm).
## Acceptance notes
- `relevantWhen` names only `datasets` and `analyticsCubes`, as the card
rules. Measured on `packages/spec/src`: `DatasetSchema` is reachable
from the stack only through `datasets` (`stack.zod.ts`), and
`CubeSchema` only through `analyticsCubes`, so no third key carries the
surface.
- A dataset stored at runtime (Studio, `/meta`) is outside the relevance
question by its own definition (`SemanticRelevance`: runtime-stored
metadata is not part of the stack it reads), so a deployment whose only
datasets are stored rows sees this entry counted as absent under `os
migrate meta` and listed under `--all`. The entry's sweep is
source-first (`os validate`); it names the runtime save's `422` only as
one of the doors that refuse.
- No ablation: the diff changes no tested behaviour, only registry data
and its enumeration pin (the pin itself goes red without the table row,
which is the reviewed-edit design).
- The PR assignee is left to the seat at hand-over.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes (CI-owned).
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed (none committed for an entry: `registry.ts`
and the guide are generated, not tracked).
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L9qibvg2LHxbiRKsqRA6iR
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibvg2LHxbiRKsqRA6iR)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 256a4b7 commit ebe0a98
3 files changed
Lines changed: 69 additions & 3 deletions
File tree
- .changeset
- packages/spec/src/migrations
- entries/semantic
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 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 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
86 | | - | |
| 87 | + | |
87 | 88 | | |
88 | | - | |
| 89 | + | |
89 | 90 | | |
90 | | - | |
| 91 | + | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| |||
0 commit comments