Repository navigation
docs(spec): upgrade-guide entry for a dataset or cube dimension over a formula field - #30925
Conversation
…a formula field The dataset compile and the authoring rules now refuse a dataset or analyticsCubes dimension over a virtual (formula) field. Register the semantic migration entry that tells an upgrading author what to do: store the value in a stored field and point the dimension at it, or remove the dimension. No automatic rewrite; relevant when the stack declares datasets or analyticsCubes. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvg2LHxbiRKsqRA6iR
📓 Docs Drift CheckThis PR changes 1 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 3 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 170 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 9f6e6e1876184130521c0a0850c4043138f08430 && git checkout 9f6e6e1876184130521c0a0850c4043138f08430
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0e882086b9d289fdcc18d5c841237a151404f419 012839b62658f75173cfa3a3e7d2c970f6ad3443 && git checkout -B drift-repro 0e882086b9d289fdcc18d5c841237a151404f419 && git merge --no-ff 012839b62658f75173cfa3a3e7d2c970f6ad3443
node scripts/docs-audit/affected-docs.mjs --json 0e882086b9d289fdcc18d5c841237a151404f419
|
|
domain:spec#1 · os-tesla · session_01L9qibzzqHZdAVqgBAvxXKB 维护者速读
席位意见:可以落地。 席位核对ACCEPT · seat
|
|
domain:spec#1 · os-tesla · session_01L9qibzzqHZdAVqgBAvxXKB Landing · seat
|
Requested by Tesla · project thread
Fixes #30822
Clause-②: no
Metadata-protocol: none
维护者速读
os migrate meta与协议升级文档)新增一条语义迁移条目dataset-dimension-virtual-field-refused:数据集或analyticsCubes的维度指向公式字段(不落库的虚拟字段)现在在编写时就被拒,条目告诉作者怎么改。400 DATASET_INVALID)和 lint(dimension-virtual-field-refused)拒绝这种维度,但升级指南没有对应条目,作者升级后只会在数据集突然编译失败时才知道;度量侧的同类收窄早已有条目。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
dataset-dimension-virtual-field-refused(protocol 18 step), the dimension-side sibling ofdataset-measure-aggregate-field-type-refused, for adatasets[].dimensions[].fieldor ananalyticsCubes[].dimensions.KEY.sqlnaming aformulafield (SEARCH_VIRTUAL_TYPES).acceptanceCriteriaquotes both refusals as PR fix(service-analytics, lint)!: a dataset or cube dimension over a formula field is refused where it is authored, instead of on the first query that groups by it #30815 shipped them: the dataset compile's400 DATASET_INVALIDtext fromassertDimensionFieldStored(dataset-compiler.ts), and the lint finding's message and hint fromvirtualDimensionFinding(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.@objectstack/specpatch 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
012839b6in a dedicated worktree, baseorigin/main6ff27b34(mainhas moved since with no change underpackages/spec/src/migrations).Tests
pnpm --filter @objectstack/spec build:: exit 0vitest 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 todopnpm --filter @objectstack/spec typecheck:: exit 0build-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.Derived gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 81 families for the 3-path change set; all 81 ran with exit 0.--ranreconciliation: 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.Dogfood: n/a (no
!in the title, no(narrowing)arm).Acceptance notes
relevantWhennames onlydatasetsandanalyticsCubes, as the card rules. Measured onpackages/spec/src:DatasetSchemais reachable from the stack only throughdatasets(stack.zod.ts), andCubeSchemaonly throughanalyticsCubes, so no third key carries the surface./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 underos migrate metaand listed under--all. The entry's sweep is source-first (os validate); it names the runtime save's422only as one of the doors that refuse.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses (CI-owned).main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed (none committed for an entry:registry.tsand the guide are generated, not tracked).content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibvg2LHxbiRKsqRA6iR
Generated by Claude Code