Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/35970-catalog-units.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@objectstack/skills': patch
---

Clause-②: no
Metadata-protocol: none

The platform catalog (`objectstack-project/references/platform-catalog.md`) now lists units of measure as shipped. `sys_unit` has a row beside `sys_exchange_rate`, and the row names the declaration that uses it: `unitConfig` on a `number` field (`unitMode: 'fixed'` with `unit`, or `'record'` with `unitField`) or on a `text` field that holds a unit code (`unitMode: 'code'`). A stored code is a standard UN/ECE Rec 20 code or one of the organization's own units, added in Setup, so an app no longer builds a unit table or a unit picklist. The Planned row narrows to what is still missing: showing the unit beside a quantity, totals per unit and conversion. The page no longer describes an interim unit field, and `objectstack-data` eval 22 expects the shipped answer.
23 changes: 11 additions & 12 deletions packages/spec/scripts/lib/platform-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export const APP_FACING_OBJECT_GROUPS: readonly { readonly title: string; readon
title: 'Money, imports and approvals',
rows: [
{ name: 'sys_exchange_rate', builds: 'an exchange-rate table', reach: '`currencyConfig.homeAmount` converts at write; Setup edits rates; data API' },
{ name: 'sys_unit', builds: 'a unit table or picklist', reach: '`unitConfig` on a `number` field (`unitMode: \'fixed\'` with `unit`, `\'record\'` with `unitField`) or a `text` field (`\'code\'`); a stored code is standard (UN/ECE Rec 20: `KGM`, `H87`) or a row added here in Setup; data API, no delete' },
{ name: 'sys_work_calendar', builds: 'a business-hours calendar', reach: 'kept per organization in Setup; an approval\'s `escalation.clock: \'working_time\'` reads it; data API' },
{ name: 'sys_work_calendar_exception', builds: 'a holiday table', reach: 'a calendar\'s holidays and make-up workdays, kept in Setup; data API' },
{ name: 'sys_import_job', builds: 'a bulk-import job table', reach: '`POST /api/v1/data/OBJECT/import/jobs`; data API read' },
Expand Down Expand Up @@ -184,10 +185,10 @@ export const CAPABILITY_ROWS: Readonly<Record<string, string>> = Object.freeze({
settings: 'the settings store',
webhooks: 'outbound webhooks',
'hierarchy-security': 'hierarchy-relative permission scopes',
'ai-seat': 'the cloud AI-seat tier',
governance: 'the cloud governance tier',
'audit-compliance': 'the cloud audit-compliance tier',
'access-policy-console': 'the cloud access-policy console',
'ai-seat': 'the AI-seat tier',
governance: 'the governance tier',
'audit-compliance': 'the audit-compliance tier',
'access-policy-console': 'the access-policy console',
});

/** Master data each suite keeps, matched across suites by key contract. */
Expand All @@ -199,8 +200,8 @@ export const NOT_PLATFORM_ROWS: readonly { readonly concept: string; readonly ru
/** Carded, not shipped. Each row is **not available**; the shipping PR moves it into the main table. Capped at a few rows. */
export const PLANNED_ROWS: readonly { readonly concept: string; readonly state: string; readonly link: string }[] = [
{
concept: 'Units of measure (a standard unit table, organization units, a quantity field with its unit)',
state: 'contract accepted, nothing shipped',
concept: 'Unit display, totals and conversion',
state: 'contract accepted; a quantity shows and sums as a bare number',
link: 'https://github.com/objectstack-ai/objectstack/blob/main/docs/adr/0158-units-of-measure-standard-unit-table-org-units-quantity-unit-declaration-base-quantity.md',
},
{
Expand All @@ -223,8 +224,8 @@ export const PROSE = Object.freeze({
'> (not runnable in an installed app). Names come from `@objectstack/spec`.',
],
intro: [
'Read this before adding an object, a field or a flow (objectstack-project §0,',
'question 3). `list_objects` over MCP hides system objects, so look here.',
'Read this before adding an object, a field or a flow. `list_objects` over MCP',
'hides system objects, so look here.',
],
objects: [
'"Data API" means the generic `/api/v1/data/OBJECT` routes, as the object',
Expand All @@ -249,10 +250,8 @@ export const PROSE = Object.freeze({
'platform" here.',
],
planned: [
'Each row is **not available**: nothing below can be declared or installed.',
'The app may build its own meanwhile, marked `// PLATFORM-CANDIDATE:` with',
'the link; an interim unit field stores the contract\'s UN/ECE Rec 20 codes',
'(`H87`, `KGM`) as option values, the business\'s spellings as labels.',
'Nothing below can be declared or installed. The app may build its own',
'meanwhile, marked `// PLATFORM-CANDIDATE:` with the link.',
],
});

Expand Down
10 changes: 5 additions & 5 deletions skills/objectstack-data/evals/objects-fields-relationships.json
Original file line number Diff line number Diff line change
Expand Up @@ -385,18 +385,18 @@
{
"id": 22,
"prompt": "Add a `uom` text field to our `product` object for the unit of measure (pcs, kg, box, …).",
"expected_output": "Does not add a free-text unit. Checks the platform catalog (objectstack-project §0, question 3): units of measure are a Planned row there, not available yet, with the accepted contract linked. Builds the smallest thing the app needs meanwhile, a `select` field whose option values are the contract's UN/ECE Rec 20 codes in exact uppercase (`H87` for a piece, `KGM`, `XBX`) with this business's spellings (pcs, kg, box) as the labels, so the platform unit table later adds validation and leaves stored values unchanged, and marks it `// PLATFORM-CANDIDATE: <link>` so the bump sweep replaces it when that table ships. If the request only wanted a quantity, says the quantity stays a `number` and the unit lives on the field, not inside the value.",
"expected_output": "Adds `uom` as a `text` field that declares what it holds, `uom: Field.text({ unitConfig: { unitMode: 'code' } })`, neither a bare free-text field nor a `select`: the platform catalog (objectstack-project §0, question 3) lists `sys_unit` and `unitConfig` as what the platform ships, so the app declares no unit object and no option list. The field stores a unit code in exact uppercase: a standard UN/ECE Rec 20 code (`H87` for a piece, `KGM`, `XBX` for a box) or one of the organization's own units, which an administrator adds in Setup. The write path refuses any other value, so pcs, kg and box are what people say, not what is stored. If a quantity sits beside it, the quantity is a `number` field with `unitConfig: { unitMode: 'record', unitField: 'uom' }`, and `uom` then carries no `unitConfig` of its own; a quantity with one unit declares `unitMode: 'fixed'` with `unit`. Showing the unit beside a quantity, totals per unit and conversion are in the catalog's Planned section, not available yet.",
"files": [],
"assertions": {
"must_contain": [
"PLATFORM-CANDIDATE",
"select",
"unitConfig",
"unitMode",
"H87",
"KGM"
],
"must_not_contain": [
"uom: Field.text(",
"uom: { type: 'text'"
"uom: Field.select(",
"type: 'select'"
]
}
},
Expand Down
21 changes: 10 additions & 11 deletions skills/objectstack-project/references/platform-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
> `pnpm --filter @objectstack/spec gen:skill-refs`
> (not runnable in an installed app). Names come from `@objectstack/spec`.

Read this before adding an object, a field or a flow (objectstack-project §0,
question 3). `list_objects` over MCP hides system objects, so look here.
Read this before adding an object, a field or a flow. `list_objects` over MCP
hides system objects, so look here.

## Platform objects an app would otherwise build

Expand Down Expand Up @@ -50,6 +50,7 @@ a seed) without declaring it.
| Object | Mounted by | What you would otherwise build | How the app reaches it |
|:--|:--|:--|:--|
| `sys_exchange_rate` | every boot | an exchange-rate table | `currencyConfig.homeAmount` converts at write; Setup edits rates; data API |
| `sys_unit` | every boot | a unit table or picklist | `unitConfig` on a `number` field (`unitMode: 'fixed'` with `unit`, `'record'` with `unitField`) or a `text` field (`'code'`); a stored code is standard (UN/ECE Rec 20: `KGM`, `H87`) or a row added here in Setup; data API, no delete |
| `sys_work_calendar` | every boot | a business-hours calendar | kept per organization in Setup; an approval's `escalation.clock: 'working_time'` reads it; data API |
| `sys_work_calendar_exception` | every boot | a holiday table | a calendar's holidays and make-up workdays, kept in Setup; data API |
| `sys_import_job` | every boot | a bulk-import job table | `POST /api/v1/data/OBJECT/import/jobs`; data API read |
Expand Down Expand Up @@ -126,10 +127,10 @@ whether or not the stack lists it. Declare what the app uses
| `settings` | the settings store | open | every boot |
| `webhooks` | outbound webhooks | open | on `requires` |
| `hierarchy-security` | hierarchy-relative permission scopes | enterprise | on `requires` |
| `ai-seat` | the cloud AI-seat tier | cloud | on `requires` |
| `governance` | the cloud governance tier | cloud | on `requires` |
| `audit-compliance` | the cloud audit-compliance tier | cloud | on `requires` |
| `access-policy-console` | the cloud access-policy console | cloud | on `requires` |
| `ai-seat` | the AI-seat tier | cloud | on `requires` |
| `governance` | the governance tier | cloud | on `requires` |
| `audit-compliance` | the audit-compliance tier | cloud | on `requires` |
| `access-policy-console` | the access-policy console | cloud | on `requires` |

## Not owned by the platform

Expand All @@ -143,12 +144,10 @@ platform" here.

## Planned: carded, not shipped

Each row is **not available**: nothing below can be declared or installed.
The app may build its own meanwhile, marked `// PLATFORM-CANDIDATE:` with
the link; an interim unit field stores the contract's UN/ECE Rec 20 codes
(`H87`, `KGM`) as option values, the business's spellings as labels.
Nothing below can be declared or installed. The app may build its own
meanwhile, marked `// PLATFORM-CANDIDATE:` with the link.

| Concept | State | Contract |
|:--|:--|:--|
| Units of measure (a standard unit table, organization units, a quantity field with its unit) | **not available** (contract accepted, nothing shipped) | https://github.com/objectstack-ai/objectstack/blob/main/docs/adr/0158-units-of-measure-standard-unit-table-org-units-quantity-unit-declaration-base-quantity.md |
| Unit display, totals and conversion | **not available** (contract accepted; a quantity shows and sums as a bare number) | https://github.com/objectstack-ai/objectstack/blob/main/docs/adr/0158-units-of-measure-standard-unit-table-org-units-quantity-unit-declaration-base-quantity.md |
| Working-day formulas | **not available** (contract accepted; no formula reads a calendar yet) | https://github.com/objectstack-ai/objectstack/blob/main/docs/adr/0157-working-calendars-are-org-editable-runtime-data-resolved-by-code-or-refused.md |
Loading