Repository navigation
Commit b8f4acc
feat(spec)!: retire the never-consumed CurrencyValueSchema / CurrencyValue export (ADR-0104 D1) (#27233)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBKtW8fybSYYTNn9GAARes3G)_
Fixes #27182
Ruling-ref: 6465431966
Claim: 6467480691
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — REASON: no authoring surface. `git grep
CurrencyValue -- skills` on base finds only the generated
`skills/*/references/_index.md` export lists (regenerated here by
`gen:skill-refs`, which now name `UniqueScopeSchema` in its place); no
rule, example or table teaches the shape.
## 维护者速读
- **改了什么:** 删除 `field.zod.ts` 仍导出的 `CurrencyValueSchema` 与
`CurrencyValue` 类型;登记 `RETIRED_DEFS_BY_MAJOR[18]` 的 `data/CurrencyValue`
与 D3 语义条目 `currency-value-schema-retired`(FROM `{value, currency}` →
裸数字,币种写在 `currencyConfig.defaultCurrency`)。
- **为什么改:** ADR-0104 D1 早已裁定删除,18.2.0 仍导出;多币种史诗 #8345
开工前必须清掉,免得作者把它当成「记录币种」的形状。
- **风险与回滚:** 零读者(只剩自身测试和生成基线),运行时行为不变;只影响 TypeScript 导入(TS2305)。回滚 =
revert 本 PR。
- **先看:**
`packages/spec/src/migrations/entries/semantic/18.currency-value-schema-retired.ts`、`packages/spec/src/data/currency-value-retirement.test.ts`。
- **两分钟验证:** `git grep -n CurrencyValueSchema -- packages
':!**/CHANGELOG.md'` → 只剩登记条目、退役 pin 和散文;`pnpm --filter
@objectstack/spec exec vitest run --project repo
src/data/currency-value-retirement.test.ts` 全绿。
- **需要您做的:** 本 PR 触及 Tier H(`docs/adr/0104`、生成的
`skills/*/references/_index.md`),按治理需 os-zhuang 或 hotlong 的批准,之后由席位落地。
## What changes
- **Spec (`@objectstack/spec`, minor, BREAKING for TypeScript imports
only).** `CurrencyValueSchema` and `export type CurrencyValue` are
deleted from `packages/spec/src/data/field.zod.ts`. Route 3 of the
`spec-property-retirement` kit (the `ApiKeySchema` and document-family
precedent): no carrier key and no metadata type ever held the shape, so
there is no `retiredKey()` tombstone, no `UNKNOWN_KEY_GUIDANCE` entry
and no D2 conversion.
- **ADR-0087: registered.** `retired-defs/18.data__CurrencyValue.ts` and
the D3 semantic entry `semantic/18.currency-value-schema-retired.ts`,
which carries the card's note: a currency value is a bare number (`{
value: 1000.5, currency: 'USD' }` → `1000.5`), the code is
`currencyConfig: { currencyMode: 'fixed', defaultCurrency: 'USD' }`, and
`valueSchemaFor(field, 'stored')` types a value. No `STEP18_RATIONALE`
fragment (the `identity-api-key-schema-retired` precedent has none).
- **Generated.** `json-schema.manifest/data.json` loses
`data/CurrencyValue` and `authorable-surface/data.json` its two rows
(both deliberate, as the build's manifest and gate (a) deletion checks
require); `api-surface`, `export-origins`, `declaration-map`, the
reference docs, the strictness-ledger counts (`data/` 165 → 164 sites,
`field.zod.ts` 14 → 13) and `skills/*/references/_index.md` regenerated
by `check:generated --fix`. `authorable-surface.base.json` (the released
anchor) is untouched.
- **Liveness / ledger.** `CurrencyValue` never had a liveness-ledger row
(never walked). The strictness-ledger `field.zod.ts` row is re-graded
with a dated note: `CurrencyValueSchema` deleted,
`LocationCoordinatesSchema` the one site left under the existing
verdict; the #8562 follow-up line now says one.
- **ADR-0104 (Tier H).** A dated note under the "Reality wins"
paragraph: the deletion landed in this PR, and where the FROM → TO note
lives.
- **Pins that move.** `field.test.ts` drops its `CurrencyValueSchema`
block; `type-alias-convention.pin.test.ts` drops
`Iso_data_field__CurrencyValueSchema` and its census goes 798 → 797
(title, header, `toHaveLength` with the history line). The
`field-value.zod.ts` docblock now says the object shape is deleted.
- **New pin** `packages/spec/src/data/currency-value-retirement.test.ts`
(added to `vitest.repo-tests.json`): the def and D3 entry are
registered; the export is gone from `/data` and the root entry,
`CurrencyConfigSchema` survives (lit control); `valueSchemaFor({ type:
'currency' })` accepts `1000.5` and refuses `{ value, currency }`;
tree-scoped absence over the declared radius with an anti-vacuity
matcher test.
## Why
ADR-0104 D1 decided "`currency` is a scalar number —
`CurrencyValueSchema` is deleted", but the export shipped through 18.2.0
as `@deprecated`. The multi-currency epic #8345 (shape C′, ruling
6465431966 on #27119) needs it gone first, so that no author or AI reads
`{value, currency}` as the way a record keeps its currency.
## Verification
Base `origin/main` `fd73f2b39`; head `bf9ae4435`.
<details><summary>Measure first (base)</summary>
`git grep -n CurrencyValue` outside CHANGELOGs: `field.zod.ts`
(declaration and alias), `field.test.ts`, the `Iso_` pin row,
`api-surface` / `export-origins` / `declaration-map` /
`json-schema.manifest` / `authorable-surface` /
`authorable-surface.base.json`, generated reference docs, and prose
(`field-value.zod.ts` docblock, `field-value.test.ts` test name,
`content/docs/protocol/objectql/types.mdx`, ADR-0104, the strictness
ledger). Nothing under `ui/` or `skills/**` rules. Control:
`CurrencyConfigSchema` has live readers (validator, formula, ui i18n).
</details>
<details><summary>Gates</summary>
- `pnpm --filter @objectstack/spec build` → exit 0 (after the deliberate
manifest and authorable-surface deletions; the build refused each first,
as designed).
- `pnpm --filter @objectstack/spec check:generated` → 14 of 14 fresh
after `--fix`.
- `pnpm --filter @objectstack/spec test` → Test Files 740 passed | 1
skipped (741), Tests 22240 passed | 1 skipped | 1 todo.
- `pnpm --filter @objectstack/spec test:repo` → Test Files 82 passed
(82), Tests 1331 passed.
- `pnpm --filter @objectstack/spec typecheck` → exit 0.
- `check:liveness`, `check:empty-state`, `check:exported-any`,
`check:dual-source-exports` → exit 0. `check:skill-examples` → exit 3
(prerequisite: needs a full-repo build; not measured).
- `node scripts/check-adr-0087-registration.mjs --base origin/main` → ✓
`registered currency-value-schema-retired (new here)`.
- `check-changeset-no-major` (pull_request event) → ✓ narrowing ships
`minor`; `check-spec-parsed-alias` → 797 pinned, OK;
`check-cross-package-test-inputs`, `check-doc-authoring`,
`check-role-word`, `check-skills-token-ratchet` → OK.
</details>
## Serial note
Seat 3's #27218 (#27157) narrows `CurrencyConfigSchema` about 30 lines
above this edit in `field.zod.ts` and touches
`migrations/registry.ts.template`. Whichever lands second merges main
(no rebase) and re-runs the generated files.
## 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.
- [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.
- [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_01WGufziAkt9vZhLphG64TmD)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 6d7634a commit b8f4acc
26 files changed
Lines changed: 337 additions & 118 deletions
File tree
- .changeset
- content/docs
- protocol/objectql
- references
- data
- docs
- adr
- audits
- 2026-07-unknown-key-strictness-ledger.counts
- packages/spec
- api-surface
- authorable-surface
- declaration-map
- export-origins
- json-schema.manifest
- src
- data
- migrations/entries
- retired-defs
- semantic
- skills
- objectstack-ai/references
- objectstack-data/references
- objectstack-i18n/references
- objectstack-platform/references
- objectstack-ui/references
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
318 | | - | |
| 317 | + | |
| 318 | + | |
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 35 | | |
48 | 36 | | |
49 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
167 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
173 | 190 | | |
174 | 191 | | |
175 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1263 | 1263 | | |
1264 | 1264 | | |
1265 | 1265 | | |
1266 | | - | |
| 1266 | + | |
1267 | 1267 | | |
1268 | 1268 | | |
1269 | 1269 | | |
| |||
1807 | 1807 | | |
1808 | 1808 | | |
1809 | 1809 | | |
1810 | | - | |
| 1810 | + | |
1811 | 1811 | | |
1812 | 1812 | | |
1813 | 1813 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | | - | |
148 | 146 | | |
149 | 147 | | |
150 | 148 | | |
| |||
0 commit comments