Skip to content
Open
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
23 changes: 23 additions & 0 deletions .changeset/35707-translation-fault-warning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'@objectstack/spec': minor
'@objectstack/rest': patch
'@objectstack/runtime': patch
'@objectstack/mcp': patch
'@objectstack/metadata-protocol': patch
'@objectstack/service-analytics': patch
'@objectstack/service-storage': patch
---

feat: an answer whose translations could not be read says so, as `translationWarning`

Clause-②: yes (widening) — `GetMetaItemsResponseSchema`, `GetMetaItemResponseSchema` and `QueryDatasetOutputSchema` gain the optional string `translationWarning`; the MCP `list_objects` and `describe_object` answers gain the same optional member, and `DiagnosedObjectListing` and the dataset tools' `DatasetToolSource` gain the optional `translationWarning` they carry it in; `DatasetToolsDeps` gains an optional `logger`
Metadata-protocol: added

When the deployment's i18n service resolves but its translations cannot be read (its `getLocales` or `getTranslations` throws), the metadata and dataset answers are served in the authored language, untranslated. Until now only `list_datasets` told the caller why; every other answer looked exactly like one for a locale with no translation. These answers now carry `translationWarning`, one fixed sentence saying the translations could not be read, beside what they serve: `GET /meta/:type` and `GET /meta/:type/:name` on both HTTP hosts (the REST server and the runtime dispatcher), the MCP `list_objects` and `describe_object` tools on both transports, and `query_dataset`. It is present only on such a fault, so an answer whose translations were read is byte for byte what it was. `list_datasets` keeps the `partial` and `warning` it already serves for the same fault. Every warning sentence here, `list_datasets`' warning when the dataset catalogue itself cannot be read, and `query_dataset`'s 503 refusal when the dataset read fails, are now the platform's client-facing failure text: a fixed sentence, with the original error in the server log only. A list answered as a bare array (a protocol that answers without the `{ type, items }` envelope) has no member to carry it; the server log says the fault either way.

Three more places read the i18n service's whole catalog with no guard, so the same fault failed them with an unhandled error:

- An object save and the stored-metadata migration (its preview and its apply pass, from the REST route, the runtime dispatcher and `os migrate meta`) read the catalog to tell a translated label a Studio session sent back from one the author typed. Both are now refused as 503 `SERVICE_UNAVAILABLE`, a declared refusal whose fixed sentence reaches the HTTP caller ("The translations could not be read, … nothing was saved or migrated. Retry once the translations can be read."), and nothing is stored; the i18n error is logged on the server. Retrying once the translations read again saves the same body. Going on without the catalog would have stored translated labels as the authored ones, or counted an echoed stored row as canonical.
- A dataset query's select-option labels and the upload page's object and field labels are now served as declared, with one `warn` line saying the translations could not be read.

Nothing to migrate.
1 change: 1 addition & 0 deletions content/docs/references/ai/dataset-tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ const result = DatasetNextStepSchema.parse(data);
| **totalGroups** | `integer` | optional | How many groups the selection formed before `offset` and `limit` cut them: the rows the same selection answers with no window. The same name and meaning as `aggregate_records`' `totalGroups`. Never paid for with a read. Where the window is pushed into the one SQL statement that grouped the answer, the database counts the groups with a window count in that statement. Where the window is applied in memory, it is the length of the grid before the window: an order by a display label (the tool's own order when none is sent sorts every selected dimension, so any select or reference dimension brings it in; an order by measures alone does not), a grid assembled from several queries (a measure with its own filter, a derived measure, `compareTo`), and a query the engine's aggregate serves, such as a date bucket, a field-to-field filter, an external object or a driver with no raw SQL. That grid is counted only when every read that built it came back whole: a grid that any cap or row guard cut before the window answers no count. Equals `rowCount` when the answer was not cut. Absent otherwise, which is when: the window was pushed down and the SQL dialect is not one the tool knows, or a selected member is itself named `__os_group_count`, or the page came back empty after an `offset`; a read was served by a strategy that does not vouch for its grid, such as one a host adds, or was cut by a cap under it; or the dataset's object is missing and the answer is the empty one served for it |
| **delegationNarrowed** | `true` | optional | Present, and `true`, when the caller acts as an agent whose authority narrows what it may read on the dataset's object; `warning` states the narrowing (ADR-0090 D10) |
| **warning** | `string` | optional | The narrowing statement; present exactly when `delegationNarrowed` is |
| **translationWarning** | `string` | optional | Present only when the translations this answer is labelled with could not be read (the deployment's i18n service failed while they were read): the dataset, member and option labels are then served as authored, untranslated, and this is the server's sentence saying why. Absent on every answer whose translations were read, including one that found no translation for the caller's locale. Independent of `warning`, which states a delegation narrowing only |

### Nested Shape: `QueryDatasetOutput.fields[number]`

Expand Down
15 changes: 10 additions & 5 deletions content/docs/references/api/app-bundle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ const result = AppMetadataBundleResponseSchema.parse(data);

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **app** | `{ type: string; name: string; item: any; sortability?: object; … }` | ✅ | The app, as `GET /meta/app/{appId}` answers it to this caller (its navigation pruned to what the caller may open). |
| **objects** | `{ type: string; name: string; item: any; sortability?: object; … }[]` | ✅ | The objects the app's navigation reaches and the objects whose relationship fields reference them, in the object list's order, each as `GET /meta/object/{name}` answers it. An object the caller may not read is absent. |
| **views** | `{ type: string; name: string; item: any; sortability?: object; … }[]` | ✅ | The views the navigation names and the views bound to the bundled objects, each as `GET /meta/view/{name}` answers it. A view the caller may not read is absent. |
| **pages** | `{ type: string; name: string; item: any; sortability?: object; … }[]` | ✅ | The pages the navigation names and the pages bound to the bundled objects, each as `GET /meta/page/{name}` answers it. A page the caller may not read is absent. |
| **dashboards** | `{ type: string; name: string; item: any; sortability?: object; … }[]` | ✅ | The dashboards the navigation names, each as `GET /meta/dashboard/{name}` answers it. A dashboard the caller may not read is absent. |
| **app** | `{ type: string; name: string; item: any; translationWarning?: string; … }` | ✅ | The app, as `GET /meta/app/{appId}` answers it to this caller (its navigation pruned to what the caller may open). |
| **objects** | `{ type: string; name: string; item: any; translationWarning?: string; … }[]` | ✅ | The objects the app's navigation reaches and the objects whose relationship fields reference them, in the object list's order, each as `GET /meta/object/{name}` answers it. An object the caller may not read is absent. |
| **views** | `{ type: string; name: string; item: any; translationWarning?: string; … }[]` | ✅ | The views the navigation names and the views bound to the bundled objects, each as `GET /meta/view/{name}` answers it. A view the caller may not read is absent. |
| **pages** | `{ type: string; name: string; item: any; translationWarning?: string; … }[]` | ✅ | The pages the navigation names and the pages bound to the bundled objects, each as `GET /meta/page/{name}` answers it. A page the caller may not read is absent. |
| **dashboards** | `{ type: string; name: string; item: any; translationWarning?: string; … }[]` | ✅ | The dashboards the navigation names, each as `GET /meta/dashboard/{name}` answers it. A dashboard the caller may not read is absent. |

### Nested Shape: `AppMetadataBundleResponse.app`

Expand All @@ -86,6 +86,7 @@ const result = AppMetadataBundleResponseSchema.parse(data);
| **type** | `string` | ✅ | Metadata type name |
| **name** | `string` | ✅ | Item name |
| **item** | `any` | ✅ | Metadata item definition |
| **translationWarning** | `string` | optional | Present only when this answer's translations could not be read (the deployment's i18n service failed while they were read): the labels and descriptions are then served as authored, untranslated, and this is the server's sentence saying why. Absent on every answer whose translations were read, including one that found no translation for the caller's locale, so its absence never means "translated". A non-empty string, never an empty one. Beside the served documents, never inside one. |
| **sortability** | `{ fields: Record<string, object> }` | optional | Per-column sortability projection — present exactly when `type` is `object`, on every serving branch. Computed at serve time from the served document via the spec's own storage predicates; consumers render sort affordances from this signal and never re-derive it from field `type`. See `ObjectSortabilitySchema` for the closed category set. |
| **lock** | `Enum<'none' \| 'no-overlay' \| 'no-delete' \| 'full'>` | optional | Resolved lock verdict for this item (ADR-0010 §3.3). `none` means unlocked; `no-overlay` / `no-delete` / `full` mean the write doors refuse the corresponding write with 403. Joins two refusals: the document's own `_lock` (`ITEM_LOCKED`; the packaged artifact wins over any overlay), and the locked packaged base — an item a code package ships, on a type with no per-org overlay channel (`NOT_OVERRIDABLE`, or `ITEM_LOCKED` when the write names the read-only package). |
| **lockReason** | `string` | optional | Human-readable explanation shown next to a refused write. Present only when the resolved item declares `_lockReason`. |
Expand All @@ -110,6 +111,7 @@ const result = AppMetadataBundleResponseSchema.parse(data);
| **type** | `string` | ✅ | Metadata type name |
| **name** | `string` | ✅ | Item name |
| **item** | `any` | ✅ | Metadata item definition |
| **translationWarning** | `string` | optional | Present only when this answer's translations could not be read (the deployment's i18n service failed while they were read): the labels and descriptions are then served as authored, untranslated, and this is the server's sentence saying why. Absent on every answer whose translations were read, including one that found no translation for the caller's locale, so its absence never means "translated". A non-empty string, never an empty one. Beside the served documents, never inside one. |
| **sortability** | `{ fields: Record<string, object> }` | optional | Per-column sortability projection — present exactly when `type` is `object`, on every serving branch. Computed at serve time from the served document via the spec's own storage predicates; consumers render sort affordances from this signal and never re-derive it from field `type`. See `ObjectSortabilitySchema` for the closed category set. |
| **lock** | `Enum<'none' \| 'no-overlay' \| 'no-delete' \| 'full'>` | optional | Resolved lock verdict for this item (ADR-0010 §3.3). `none` means unlocked; `no-overlay` / `no-delete` / `full` mean the write doors refuse the corresponding write with 403. Joins two refusals: the document's own `_lock` (`ITEM_LOCKED`; the packaged artifact wins over any overlay), and the locked packaged base — an item a code package ships, on a type with no per-org overlay channel (`NOT_OVERRIDABLE`, or `ITEM_LOCKED` when the write names the read-only package). |
| **lockReason** | `string` | optional | Human-readable explanation shown next to a refused write. Present only when the resolved item declares `_lockReason`. |
Expand All @@ -134,6 +136,7 @@ const result = AppMetadataBundleResponseSchema.parse(data);
| **type** | `string` | ✅ | Metadata type name |
| **name** | `string` | ✅ | Item name |
| **item** | `any` | ✅ | Metadata item definition |
| **translationWarning** | `string` | optional | Present only when this answer's translations could not be read (the deployment's i18n service failed while they were read): the labels and descriptions are then served as authored, untranslated, and this is the server's sentence saying why. Absent on every answer whose translations were read, including one that found no translation for the caller's locale, so its absence never means "translated". A non-empty string, never an empty one. Beside the served documents, never inside one. |
| **sortability** | `{ fields: Record<string, object> }` | optional | Per-column sortability projection — present exactly when `type` is `object`, on every serving branch. Computed at serve time from the served document via the spec's own storage predicates; consumers render sort affordances from this signal and never re-derive it from field `type`. See `ObjectSortabilitySchema` for the closed category set. |
| **lock** | `Enum<'none' \| 'no-overlay' \| 'no-delete' \| 'full'>` | optional | Resolved lock verdict for this item (ADR-0010 §3.3). `none` means unlocked; `no-overlay` / `no-delete` / `full` mean the write doors refuse the corresponding write with 403. Joins two refusals: the document's own `_lock` (`ITEM_LOCKED`; the packaged artifact wins over any overlay), and the locked packaged base — an item a code package ships, on a type with no per-org overlay channel (`NOT_OVERRIDABLE`, or `ITEM_LOCKED` when the write names the read-only package). |
| **lockReason** | `string` | optional | Human-readable explanation shown next to a refused write. Present only when the resolved item declares `_lockReason`. |
Expand All @@ -158,6 +161,7 @@ const result = AppMetadataBundleResponseSchema.parse(data);
| **type** | `string` | ✅ | Metadata type name |
| **name** | `string` | ✅ | Item name |
| **item** | `any` | ✅ | Metadata item definition |
| **translationWarning** | `string` | optional | Present only when this answer's translations could not be read (the deployment's i18n service failed while they were read): the labels and descriptions are then served as authored, untranslated, and this is the server's sentence saying why. Absent on every answer whose translations were read, including one that found no translation for the caller's locale, so its absence never means "translated". A non-empty string, never an empty one. Beside the served documents, never inside one. |
| **sortability** | `{ fields: Record<string, object> }` | optional | Per-column sortability projection — present exactly when `type` is `object`, on every serving branch. Computed at serve time from the served document via the spec's own storage predicates; consumers render sort affordances from this signal and never re-derive it from field `type`. See `ObjectSortabilitySchema` for the closed category set. |
| **lock** | `Enum<'none' \| 'no-overlay' \| 'no-delete' \| 'full'>` | optional | Resolved lock verdict for this item (ADR-0010 §3.3). `none` means unlocked; `no-overlay` / `no-delete` / `full` mean the write doors refuse the corresponding write with 403. Joins two refusals: the document's own `_lock` (`ITEM_LOCKED`; the packaged artifact wins over any overlay), and the locked packaged base — an item a code package ships, on a type with no per-org overlay channel (`NOT_OVERRIDABLE`, or `ITEM_LOCKED` when the write names the read-only package). |
| **lockReason** | `string` | optional | Human-readable explanation shown next to a refused write. Present only when the resolved item declares `_lockReason`. |
Expand All @@ -182,6 +186,7 @@ const result = AppMetadataBundleResponseSchema.parse(data);
| **type** | `string` | ✅ | Metadata type name |
| **name** | `string` | ✅ | Item name |
| **item** | `any` | ✅ | Metadata item definition |
| **translationWarning** | `string` | optional | Present only when this answer's translations could not be read (the deployment's i18n service failed while they were read): the labels and descriptions are then served as authored, untranslated, and this is the server's sentence saying why. Absent on every answer whose translations were read, including one that found no translation for the caller's locale, so its absence never means "translated". A non-empty string, never an empty one. Beside the served documents, never inside one. |
| **sortability** | `{ fields: Record<string, object> }` | optional | Per-column sortability projection — present exactly when `type` is `object`, on every serving branch. Computed at serve time from the served document via the spec's own storage predicates; consumers render sort affordances from this signal and never re-derive it from field `type`. See `ObjectSortabilitySchema` for the closed category set. |
| **lock** | `Enum<'none' \| 'no-overlay' \| 'no-delete' \| 'full'>` | optional | Resolved lock verdict for this item (ADR-0010 §3.3). `none` means unlocked; `no-overlay` / `no-delete` / `full` mean the write doors refuse the corresponding write with 403. Joins two refusals: the document's own `_lock` (`ITEM_LOCKED`; the packaged artifact wins over any overlay), and the locked packaged base — an item a code package ships, on a type with no per-org overlay channel (`NOT_OVERRIDABLE`, or `ITEM_LOCKED` when the write names the read-only package). |
| **lockReason** | `string` | optional | Human-readable explanation shown next to a refused write. Present only when the resolved item declares `_lockReason`. |
Expand Down
Loading
Loading