Skip to content

Commit 12f6cdc

Browse files
committed
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvc9vjAiGhyhnLTp34
1 parent 1f1a369 commit 12f6cdc

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the objectstack-data field-types rule states a percent field's storage scale
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
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.

‎skills/objectstack-data/rules/field-types.md‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fields: {
5151
|:-----|:------------|:-------|
5252
| `number` | Generic numeric value | `min`, `max`, `precision`, `scale` |
5353
| `currency` | Monetary amounts | `currencyConfig` (currencyMode, defaultCurrency, currencyField, homeAmount) |
54-
| `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 |
54+
| `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 |
5555

5656
## Date & Time
5757

@@ -243,15 +243,6 @@ The `format` is literal text interleaved with `{...}` tokens:
243243
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.
244244
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**.
245245
246-
### Vector (AI Embeddings)
247-
248-
```typescript
249-
{
250-
type: 'vector',
251-
dimensions: 1536, // flat sibling — OpenAI ada-002
252-
}
253-
```
254-
255246
## Incorrect vs Correct
256247
257248
### ❌ Incorrect — Autonumber interpolating an optional / adjacent field

0 commit comments

Comments
 (0)