Repository navigation
Commit 95ba410
docs(skills): the objectstack-data field-types formula row says a formula is no dataset or cube dimension (group key) either (#30921)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoSeQ817HX43HaExq6RE7aZU)_
Fixes #30824
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:`skills/objectstack-data/rules/field-types.md` 的 `formula`
行多了一个短句:formula 既不能做聚合,也不能做 dataset / cube 的维度(分组键),两者都需要一个存储字段。新增以删掉同文件
Formula 示例里的一条站内指路注释付账。
- 为什么改:PR #30815 之后,对 formula 的 dataset 或 `analyticsCubes`
维度在作者侧就被拒(lint `dimension-virtual-field-refused`、dataset 编译 `400
DATASET_INVALID`),查询侧按它分组一律 `400 INVALID_FIELD`;但技能文本只说了不能聚合,AI
作者读完仍可能写出这样的维度。
- 风险与回滚:只改技能文本,不改 schema、键或运行时行为;文件 token 3198 → 3199(上限 3207 不动)。回滚即
revert 本 PR。
- 先看:`skills/objectstack-data/rules/field-types.md` 第 131 行(formula 行);第
204 行删掉的注释;`.changeset/30824-formula-no-group-key.md`。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs | grep
field-types`,预期 `3199 tokens (ceiling 3207; headroom 8)` 且退出 0。
- 需要你做的:本 PR 触及 `skills/**`(Tier H),席位做契约复审后,请你批准,席位落地。
## What changes
- `skills/objectstack-data/rules/field-types.md`, the `formula` row:
`virtual: not aggregatable, a dataset measure needs a stored field`
becomes `virtual: neither aggregatable nor a dataset or cube dimension
(group key); both need a stored field`. The pointer to objectstack-ui →
Dashboards → Dataset-Bound Widgets stays.
- The same file, the `### Formula` example: the trailing comment `// see
the Calculated table` on the `returnType` line is deleted — it pointed
at a table in the same file, 70 lines up, linked from the file's own
contents list, so it carried no rule. This deletion pays for the clause.
- `.changeset/30824-formula-no-group-key.md`: `'@objectstack/skills':
patch`.
Nothing else: no ratchet row moves (the count stays under its ceiling),
no other file.
## Why
Since PR #30815 (card #30773) a dataset or `analyticsCubes` dimension
over a `formula` field is refused where it is authored: the authoring
rule `dimension-virtual-field-refused`
(`packages/lint/src/validate-dataset-measure-aggregates.ts`) on `os
validate` / `os build` / `os lint` and the runtime dataset save, and the
dataset compile with `400 DATASET_INVALID` (`assertDimensionFieldStored`
in `packages/services/service-analytics/src/dataset-compiler.ts`). Since
#29304 every analytics query grouping by one answers `400 INVALID_FIELD`
at `groupBy.N`. The contract review of #30815 (should-fix 3, comment
6677341880) kept the skill line out of that PR because `skills/**` is
Tier H; this is that follow-up. The row teaches only what `main` refuses
today, in the words the rule explanation uses (`os explain
dimension-virtual-field-refused`: "A dimension is a GROUP KEY").
## Tests
No test changes: a skill text change, with no executable example added.
The touched skill's two eval fixtures
(`skills/objectstack-data/evals/*.json`) are unchanged and still parse.
## Acceptance notes
- The row keeps "not aggregatable" (the pre-existing shorthand).
Strictly, a `count` over a formula is accepted by the measure table
(`count` reads no value); the sibling rule
`objectstack-ui/rules/dashboards.md` already says so under "Total over a
computed value", which the row's pointer reaches. Not widened here;
noted, not filed (class: none of a/b/c — a reading, no wrong answer from
a public door).
- Wording: "dataset or cube dimension" follows `dashboards.md`'s own
phrase ("refused as a dataset or cube dimension and as `groupBy`"),
where the cube is the `analyticsCubes` entry.
## Verification
Readings per the skills PR rules (file before/after, bundle
before/after), measured on `origin/main` `1697d5ca` vs this head
`f89a2740`:
| Reading | Before | After |
|:--|:--|:--|
| `rules/field-types.md` lines | 252 | 252 |
| `rules/field-types.md` bytes / tokens (`ceil(bytes/4)`) | 12790 / 3198
| 12794 / 3199 (ceiling 3207, headroom 9 → 8) |
| Package (sum of every `skills/**/SKILL.md`) lines / bytes | 4525 /
226885 | 4525 / 226885 |
| Bundle total (whole shipped `skills/` tree, the ratchet's own line) |
227012 | 227013 |
Growth paid by deletion: +34 bytes for the clause (56 → 90 bytes), −30
bytes for the deleted comment; net +4 bytes = +1 token. No line was
re-wrapped; no ceiling moved.
- `node scripts/check-skills-token-ratchet.mjs` on `f89a2740`: exit 0 —
`skills/objectstack-data/rules/field-types.md is 3199 tokens (ceiling
3207; headroom 8)`; `57 authored bundle file(s) within their ceilings`.
- `node scripts/pm/dispatch-gates.mjs --tier
skills/objectstack-data/rules/field-types.md
.changeset/30824-formula-no-group-key.md`: `claude-fable-5-1` MANDATORY
(`skills/**`, no one-line exit) — the tier this thread ran on.
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` on `f89a2740` derived 43 families; the sweep
(`</dev/null` per line, exit codes landed in `gates-ran-f89a2740.list`,
reconciled with `--ran`) is reported with every exit code in the
`os-dev-report` comment on #30824, since this body is written once at
creation.
- CI: the PR's own check-runs are the record for every family CI runs.
Tier H by path (`skills/**`): draft until a governed approver's APPROVED
review; the seat's contract review precedes it; the seat lands.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(No schema touched.)
- [x] 2. Every name I added uses the casing for its kind. (No name
added.)
- [x] 3. No formatter ran; `pnpm lint` is CI's run.
- [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: n/a.
- [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.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibzWJ43paU98P99Cmu9)_
---------
Co-authored-by: os-tesla <yinlianghui@steedos.com>
Co-authored-by: Claude <noreply@anthropic.com>1 parent ae59388 commit 95ba410
4 files changed
Lines changed: 30 additions & 9 deletions
File tree
- .changeset
- scripts
- skills
- objectstack-data/rules
- objectstack-ui/rules
| 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 | |
|---|---|---|---|
| |||
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
710 | | - | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
711 | 714 | | |
712 | 715 | | |
713 | 716 | | |
| |||
863 | 866 | | |
864 | 867 | | |
865 | 868 | | |
866 | | - | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
867 | 875 | | |
868 | 876 | | |
869 | 877 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
| 41 | + | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
| |||
102 | 101 | | |
103 | 102 | | |
104 | 103 | | |
105 | | - | |
106 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
0 commit comments