Skip to content

Commit 4c82d13

Browse files
committed
fix(i18n)!: declare the served-translations narrowing as Metadata-protocol narrowed, minor
The authorable-surface shards this diff moves (the served face's keys and GetTranslationsResponse:requestedLocale) make it a metadata-protocol change, so Check Changeset needs a kind other than none and at least minor on a moved package. The changeset now declares Metadata-protocol: narrowed and ships @objectstack/spec and @objectstack/runtime at minor; the ADR-0087 reason is restated for the new kind. Claude-Session: https://claude.ai/code/session_01Vy85beHdawtEtqNscYBy7V Co-authored-by: Claude <noreply@anthropic.com>
1 parent 80441cd commit 4c82d13

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
2-
'@objectstack/spec': patch
3-
'@objectstack/runtime': patch
2+
'@objectstack/spec': minor
3+
'@objectstack/runtime': minor
44
---
55

66
**BREAKING** fix(i18n)!: the translation bundle a console downloads leaves out Studio's `metadataForms`
77

88
Clause-②: yes (narrowing)
9-
Metadata-protocol: none
9+
Metadata-protocol: narrowed
1010

1111
`GET /i18n/translations/:locale` served the i18n service's whole locale tree, so every console open downloaded `metadataForms`, the translations of Studio's metadata-type authoring forms: 75 KB of the 221 KB raw zh-CN bundle on `examples/app-crm`. No browser reads that group from the bundle. Studio's forms already arrive translated, because `GET /meta` (and `/meta/types`) resolves `metadataForms.<type>` on the server, from the same i18n service, before it serves each form.
1212

1313
The route now serves every group except the ones the server resolves itself. The spec names them in `SERVER_RESOLVED_TRANSLATION_GROUPS`, which today holds only `metadataForms`. `GetTranslationsResponseSchema.translations` is now `ServedTranslationDataSchema`: the platform face without those groups, and closed, so a body that still carries one fails it. The runtime copies the tree and never edits the service's own one, which is the tree `/meta` translates from. The `ETag` still hashes the bytes served, so a warm reopen still gets `304`.
1414

15-
**Why this is breaking.** A response body that carries `metadataForms` was accepted by the published `GetTranslationsResponseSchema` and now fails it, the exported `GetTranslationsResponse` type loses that member, and the route stops serving a group it served. Nothing an author writes moves, which is why the kind is `none` and the level is `patch`.
15+
**Why this is breaking, and why `minor`.** A response body that carries `metadataForms` was accepted by the published `GetTranslationsResponseSchema` and now fails it, the exported `GetTranslationsResponse` type loses that member, and the route stops serving a group it served. The published protocol records the move: the authorable surface gains the served face's keys (`ServedTranslationData`) and `GetTranslationsResponse:requestedLocale`, and the response face a client parses against is narrower, so the kind is `narrowed` and both packages that carry it — the spec that declares the face and the runtime that serves it — ship `minor`. What an author writes into a translation bundle does not move.
1616

1717
**What to do.** Nothing, unless you read `metadataForms` from this route. Read it from `GET /meta/types` instead, which serves each form already translated into the requested locale, rather than from the bundle this route returns. Authoring is unchanged: `metadataForms` stays a group on every bundle face (`TranslationData`, `PlatformTranslationData`), in `i18n:extract` and in the i18n service.
1818

1919
Also on this route: `requestedLocale`, which the door has always served when it fell back to another locale (`zh` served as `zh-CN`), is now declared on `GetTranslationsResponseSchema`, optional. It was served undeclared, so no generated client could read it.
2020

21-
<!-- adr-0087: not-required (no-migration-prescription) No metadata moves for an upgrading author: no spec key, authorable spelling, object definition, stored row or stored shape is added, removed, renamed or re-shaped, and `metadataForms` stays declared on both authored bundle faces and in the i18n service, so there is nothing for `objectstack migrate meta` to reach or rewrite. What narrows is one HTTP answer's shape — the console bundle no longer carries a group the server resolves itself — and the affected party is a code consumer reading that answer, whose channel is the compiler and the response schema, not the metadata ledger (ADR-0087 D8). The remedy is a read from another door (`GET /meta/types`, which serves the same forms already translated), never a conversion between two metadata versions. The other categories are closed on facts: both packages publish (not unpublished); no ADR-0087 id is named or touched (not registered or already-registered); the diff touches `packages/spec/**` and a `*.zod.ts` contract face (not type-surface-only); and the narrowed declaration IS a Zod projection, `z.input<typeof GetTranslationsResponseSchema>` (not runtime-interface-only), with no export retired (not runtime-export-retired). -->
21+
<!-- adr-0087: not-required (no-migration-prescription) The narrowed face is a RESPONSE, and no stored metadata holds one: no package source, stored row or object definition carries a `GetTranslationsResponse` body, so there is nothing for `objectstack migrate meta` to reach or rewrite. What an author writes into a translation bundle is unchanged — `metadataForms` stays declared on both authored bundle faces and in the i18n service, and the authorable-surface keys this diff moves are ADDITIONS (the served face's keys and `GetTranslationsResponse:requestedLocale`), none removed or renamed. The affected party is a code consumer reading this route's answer, whose channel is the compiler and the response schema, not the metadata ledger (ADR-0087 D8), and the remedy is a read from another door (`GET /meta/types`, which serves the same forms already translated), never a conversion between two metadata versions. The other categories are closed on facts: both packages publish (not unpublished); no ADR-0087 id is named or touched (not registered or already-registered); the diff touches `packages/spec/**` and a `*.zod.ts` contract face (not type-surface-only); and the narrowed declaration IS a Zod projection, `z.input<typeof GetTranslationsResponseSchema>` (not runtime-interface-only), with no export retired (not runtime-export-retired). -->

0 commit comments

Comments
 (0)