From 12f6cdc6bdb8ea740b81b9e8649f1fc1a1145a29 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 1 Nov 2026 03:54:26 +0000 Subject: [PATCH] docs(skills): the percent row of the data skill's field-type table states the storage scale A `percent` field stores a fraction (0-1) unless it declares `max` above 1, then whole percentage points (`percentScaleOf` in packages/spec/src/data/percent-scale.ts); seeds, defaults and API values use that stored scale. The row used to say "Percentage values (0-100)", which had an author seed `25` on a field without `max` and read back `2500%`. Paid inside the file's token ceiling by deleting the `Vector (AI Embeddings)` example, whose one fact the Enhanced Types row already states. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L9qibvc9vjAiGhyhnLTp34 --- .changeset/28489-percent-storage-scale-skill.md | 10 ++++++++++ skills/objectstack-data/rules/field-types.md | 11 +---------- 2 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 .changeset/28489-percent-storage-scale-skill.md diff --git a/.changeset/28489-percent-storage-scale-skill.md b/.changeset/28489-percent-storage-scale-skill.md new file mode 100644 index 00000000000..e3b3f21b175 --- /dev/null +++ b/.changeset/28489-percent-storage-scale-skill.md @@ -0,0 +1,10 @@ +--- +'@objectstack/skills': patch +--- + +docs(skills): the objectstack-data field-types rule states a percent field's storage scale + +Clause-②: no +Metadata-protocol: none + +The `percent` row of the field-type table no longer says "Percentage values (0-100)". It states the storage rule the platform applies: a `percent` field stores a fraction (0-1) unless it declares `max` above 1 (for example `max: 100`), in which case it stores whole percentage points; seeds, defaults and API values use that stored scale. An author who followed the old text seeded `25` on a field without `max` and read back `2500%`. Paid inside the file's token ceiling by deleting the `Vector (AI Embeddings)` example, whose one fact (`dimensions` is the flat key) the Enhanced Types row already states. diff --git a/skills/objectstack-data/rules/field-types.md b/skills/objectstack-data/rules/field-types.md index ee9aff8cec5..edcf01d3aaa 100644 --- a/skills/objectstack-data/rules/field-types.md +++ b/skills/objectstack-data/rules/field-types.md @@ -51,7 +51,7 @@ fields: { |:-----|:------------|:-------| | `number` | Generic numeric value | `min`, `max`, `precision`, `scale` | | `currency` | Monetary amounts | `currencyConfig` (currencyMode, defaultCurrency, currencyField, homeAmount) | -| `percent` | Percentage values (0-100) | `min`, `max`, `precision`, `percentDisplay` — the read-only face: unset or `'bar'` draws a progress bar, `'plain'` the number alone, for a rate or a probability | +| `percent` | Percentage; stored as a fraction (0-1) unless the field declares `max` above 1 (`max: 100`), then whole points; seeds, defaults, API values use that scale | `min`, `max`, `precision`, `percentDisplay` — the read-only face: unset or `'bar'` draws a progress bar, `'plain'` the number alone, for a rate or a probability | ## Date & Time @@ -243,15 +243,6 @@ The `format` is literal text interleaved with `{...}` tokens: 3. **Pad width is a MINIMUM, not a cap.** `{000}` → `001`…`999`, then `1000` (it grows, never wraps). Size it for readability, not as a ceiling. 4. **Only known tokens are interpolated.** Date tokens are **case-sensitive** — `{yyyy}` parses as a `{field}` reference and renders **empty** (rule 1 applies). Only a spelling no field could have — `{ YYYY }`, `{YYYY-MM}` — is emitted **literally**. -### Vector (AI Embeddings) - -```typescript -{ - type: 'vector', - dimensions: 1536, // flat sibling — OpenAI ada-002 -} -``` - ## Incorrect vs Correct ### ❌ Incorrect — Autonumber interpolating an optional / adjacent field