Skip to content

Commit 0e16fc4

Browse files
claude[bot]claude
andauthored
docs: align two published passages with the schemas they describe (capabilities vocabulary, analytics fields[]) (#16234)
* docs(services-checklist): align the slot capability-flag bullet with the closed capabilities vocabulary The bullet named the retired top-level `features` map and the retired `workflow` slot, and read `there is no features.auth`. Rewrite it against `WellKnownCapabilitiesSchema` (`packages/spec/src/api/discovery.zod.ts`) and the dispatcher that fills it: name the entries that really follow slot presence, keep the measured `websockets` clause, and record the vocabulary keys that are answered from something other than a slot. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vbw3RPgdtqesx4azk9SbW8 * docs(data-api): state what the analytics query result's fields[] really declares The callout said each entry carries exactly `name` and `type` "and nothing else", and that reading `label` / `format` off a query result yields `undefined`. `AnalyticsResultResponseSchema` declares `label` / `format` / `currency` / `percentScale` / `builtinAggregate` as optional members and the `AnalyticsResult` contract mirrors them, so both sentences are false on this tree. Rewrite the callout in the conditional form the schema supports and keep the cube-metadata pointer as the declaration surface it is. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vbw3RPgdtqesx4azk9SbW8 --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 29bef09 commit 0e16fc4

2 files changed

Lines changed: 34 additions & 15 deletions

File tree

content/docs/api/data-api.mdx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -420,16 +420,23 @@ Filtering uses the canonical Query DSL `where` object (the same MongoDB-style `F
420420
```
421421

422422
<Callout type="info">
423-
**`fields[]` describes columns, not presentation.** Each entry carries exactly `name` and
424-
`type` — that is the whole descriptor `AnalyticsResultResponseSchema` declares, and every
425-
strategy answering this endpoint emits those two keys and nothing else.
426-
427-
Display name and number format live one layer up, in the **cube's metric/dimension
428-
definition** (`MetricSchema.label` / `MetricSchema.format`, `DimensionSchema.label`), and
429-
are read from cube metadata — `GET /analytics/meta` below reports each measure's and
430-
dimension's declared label as `title`. Reading `data.fields[i].label` or
431-
`data.fields[i].format` off a query result yields `undefined`; a client that renders table
432-
headers or formats amounts reads them from the cube metadata instead.
423+
**`fields[]` is the resolved presentation surface — read it first.** Each entry carries
424+
`name` and `type` and, when the producer declares them, `label`, `format`, `currency`,
425+
`percentScale` and `builtinAggregate`: the optional members
426+
`AnalyticsResultResponseSchema` declares (`packages/spec/src/api/analytics.zod.ts`),
427+
mirrored member for member by `IAnalyticsService.query`'s `AnalyticsResult` and bound to
428+
it at compile time. Optional means a given column may omit them — read them defensively,
429+
never as guaranteed present.
430+
431+
The **cube's metric/dimension definition** (`MetricSchema.label` / `MetricSchema.format`,
432+
`DimensionSchema.label`) is the *declaration* surface, not a substitute for this one.
433+
`GET /analytics/meta` below publishes a deliberately narrow projection of it — `name`,
434+
`type` and `title` (the definition's `label`) only, with `format` dropped
435+
([#6442](https://github.com/objectstack-ai/objectstack/issues/6442)). So a client that
436+
renders table headers or formats amounts takes `label` / `format` / `currency` /
437+
`percentScale` off the query result's `fields[]`: those are resolved server-side (the
438+
ADR-0053 currency chain, the percent-scale chain), and `format` is not reachable through
439+
the metadata endpoint at all.
433440
</Callout>
434441

435442
### `GET /analytics/meta`

content/docs/kernel/services-checklist.mdx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -607,12 +607,24 @@ When a plugin registers a service, the discovery endpoint automatically updates:
607607
`route``"/api/v1/auth"` (unless the instance self-declares `stub`/`degraded` via
608608
`__serviceInfo`, which is reported verbatim instead)
609609
- `routes.auth``"/api/v1/auth"` appears in routes
610-
- `features` flags follow for the slots that have one — `search`, `files`,
611-
`analytics`, `ai`, `workflow`, `notifications`, `i18n` (`websockets` does **not**
612-
follow slot presence: it is `isSubscribableChannel(services.realtime)` — `handlerReady:
610+
- the `capabilities` entries derived from that slot flip — `files` (and
611+
`chunkedUpload`, which rides the same storage surface), `analytics`, `ai`,
612+
`notifications`, `i18n`, `automation`, `cron` (the `job` slot) and `export`
613+
(`automation` **or** `queue`). `capabilities` is the canonical spelling: the top-level
614+
`features` map was renamed to it in
615+
[#4828](https://github.com/objectstack-ai/objectstack/issues/4828), and the `workflow`
616+
slot was retired in v17 ([#4451](https://github.com/objectstack-ai/objectstack/issues/4451)),
617+
so neither name is on the wire. The rest of the vocabulary does **not** follow slot
618+
presence: `websockets` is `isSubscribableChannel(services.realtime)` — `handlerReady:
613619
true` **and** a connectable route — so registering a realtime service does not flip it,
614-
and it reads `false` on every host the open framework ships, #14646; there is no
615-
`features.auth`)
620+
and it reads `false` on every host the open framework ships, #14646; `search` is stated
621+
`false` because this dispatcher mounts no `/search` route, whatever fills the slot
622+
([#7602](https://github.com/objectstack-ai/objectstack/issues/7602)); `comments` is
623+
measured from the object registry; and `transactionalBatch` is `false` on this face,
624+
which mounts no `/batch`. There is no `capabilities.auth`: the vocabulary is closed by
625+
`WellKnownCapabilitiesSchema` (`packages/spec/src/api/discovery.zod.ts`), every producer
626+
answers every key, and a capability the host does not deliver reads `enabled: false`
627+
rather than a missing key
616628

617629
---
618630

0 commit comments

Comments
 (0)