Repository navigation
Commit 21b2a10
docs(skills): a dataset measure's currency no longer always wins over a fixed field; teach the two fixed-currency refusals (#28015)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDr1qV3x1ZEoUX6f9g6WuLJ)_
Fixes #27994
Clause-②: no
Metadata-protocol: none
Cross-domain exception: triage 6516910471 grants this one
`domain:skills` PR the two devx pages
`content/docs/data-modeling/currency.mdx` and
`content/docs/api/data-api.mdx`; claim 6517255606 declares them.
## 维护者速读
- 改了什么:两份 skills 和两页文档补上 #27991 新增的两条 `fixed` 币种拒收:度量的 `currency` 与字段的
`fixed` 币种不同会被拒(删掉度量的 `currency` 即可,写同一币种照收);派生度量的金额操作数落在两个不同 `fixed`
币种会被拒(改用同一币种的度量,或去掉另一币种的操作数)。两种不判的情况也写明了。
- 为什么改:这四处原来教「度量自己的 `currency` 总是优先」,#27991 合入后这句对冲突的 `fixed` 币种已不成立,AI
按旧文写出的数据集会在编译时被拒。
- 风险与回滚:只改文字,无 schema、键或行为变化。两份 skills 的 token
天花板按常设裁决先删同文件重复、余额按实测提高(+49、+41)。回滚即撤本 PR。
- 先看:`skills/objectstack-data/rules/field-types.md` 的 Currency
resolution 段,`skills/objectstack-ui/rules/dashboards.md` 的数据集币种注释。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs` 预期全绿;对照
`packages/services/service-analytics/src/measure-currency-coherence.ts`
的两个 `fixed` 分支读四处文字。
- 需要你做的:这是 `skills/**` 受管面(Tier H),契约复审与 ACCEPT 后需要审批人批准。
## What changes
Each file states, in its own words, the two `fixed`-currency refusals PR
#27991 added to dataset compile (`DATASET_INVALID` / 400), each fix, and
the two cases that stay unjudged:
1. **Shape 1**: a measure `currency` other than its field's `fixed` code
is refused. Fix: delete the measure's `currency`, and the column takes
the field's code. Restating the code is accepted.
2. **Shape 2**: a derived measure, any op, whose monetary operands
resolve to two different `fixed` codes is refused. Fix: derive from
measures in one currency, or drop the operand in the other.
3. **Not judged**: a `fixed` code against the tenant currency; a measure
`currency` over a `dynamic` field.
- `skills/objectstack-data/rules/field-types.md` (Currency resolution):
the sentence "Under `'fixed'`/`'dynamic'` a measure's own `currency`
wins" is replaced by the `dynamic` / `fixed` split, the two refusals and
their fixes, and the not-judged tenant case.
- `skills/objectstack-ui/rules/dashboards.md` (the dataset currency
comment in the date-granularity example): the two refusals, their fixes
and both not-judged cases follow the record-mode sentence.
- `content/docs/data-modeling/currency.mdx` (Roll-ups and datasets):
three bullets after the record-mode ones, including that a derived `sum`
/ `difference` over one `fixed` code carries that code, so a measure
built on it is judged the same way.
- `content/docs/api/data-api.mdx` (the currency chain): one paragraph
after the chain.
- `.changeset/27994-fixed-currency-measure-refusals.md`:
`@objectstack/skills` patch.
### `skills/**` token budget (standing path)
Ruling quoted (maintainer, 2026-10-27, skills-lane decision card,
verbatim and untranslated): 「A:先削重复,余额按实测提高」; the gate-recognised path
per ruling record 6513306068 on #27847.
- `field-types.md` 3158 -> 3207 (+49). Paid down first: the Formula
example's `returnType` comment, which restated the Calculated table's
return types, becomes a pointer to that table.
- `dashboards.md` 6221 -> 6262 (+41). Paid down first: the metric
example's `colorVariant` comment no longer restates that the measure's
`format` / `currency` drive the number (Widget `options` says it), and
the measure example in the currency comment shrinks to its `currency`
key (the `defineDataset` above shows the measure shape).
- Both rows pinned AT the measurement, with the deletion and the ruling
recorded beside each row in `scripts/check-skills-token-ratchet.mjs`.
## Why
After #27991 (#27579, ruling 6486427200, ADR-0144 Open item 12 letter A)
the four texts taught a rule the compiler now refuses for a
contradicting `fixed` code, and they named only the record-mode refusals
from #27338. Taught from the merged `measure-currency-coherence.ts` and
`record-currency-analytics.test.ts`, not from the card summary.
## Verification
Head `946f6b44` (commit `0776905e` plus a plain merge of `origin/main`,
which touches none of these files; the derivation is identical after the
merge).
- `node scripts/pm/dispatch-gates.mjs --commands`: 85 derived families,
all run. `--ran`: "85 derived, 84 run, 1 NOT-MEASURED, 0 UNRUN". 84
exited 0, including `check-skills-token-ratchet`, `check:skill-examples`
(the edited `os:check` block in `dashboards.md`), `check:docs`,
`check:doc-anchors`, `check:doc-authoring`,
`check:docs-transcript-drift` and `check-docs-section-name`. NOT
MEASURED: `check:dual-build-cjs-loads`, exit 3 (needs every package's
dist). CI runs it.
- Docs build: `pnpm turbo run build --filter=@objectstack/docs` (the
`apps/docs/vercel.json` production command), exit 0.
- Artifact-roster families whose roster sits under a path of this diff:
`check-published-list-mirrors`, `check:changeset-fixed`,
`check:engine-double-contract`, `check:i18n-stale-fill`,
`check-affected-docs` exit 0; `check:published-readme-exports` exit 3
(needs built dists, not measured).
- The offline lychee link check was not run locally: this diff adds no
link.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind. (no names)
- [ ] 3. No formatter ran; `pnpm lint` passes. (No formatter ran; `pnpm
lint` was not run locally, the diff carries no code. CI runs it.)
- [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. (not touched)
- [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 with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_016WV4czgqyQbG9VgmyNYDNt
Co-authored-by: Claude <noreply@anthropic.com>1 parent 99fa527 commit 21b2a10
6 files changed
Lines changed: 63 additions & 9 deletions
File tree
- .changeset
- content/docs
- api
- data-modeling
- 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
505 | 513 | | |
506 | 514 | | |
507 | 515 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
174 | 186 | | |
175 | 187 | | |
176 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
682 | | - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
683 | 691 | | |
684 | 692 | | |
685 | 693 | | |
| |||
827 | 835 | | |
828 | 836 | | |
829 | 837 | | |
830 | | - | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
831 | 847 | | |
832 | 848 | | |
833 | 849 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
185 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
186 | 189 | | |
187 | 190 | | |
188 | 191 | | |
| |||
243 | 246 | | |
244 | 247 | | |
245 | 248 | | |
246 | | - | |
| 249 | + | |
247 | 250 | | |
248 | 251 | | |
249 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
299 | | - | |
| 298 | + | |
300 | 299 | | |
301 | 300 | | |
302 | 301 | | |
303 | 302 | | |
304 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
305 | 308 | | |
306 | 309 | | |
307 | 310 | | |
| |||
0 commit comments