From 8d785a8a8e1a3dcfa419ec32cab12e56ea78c723 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 27 Sep 2026 04:21:02 +0000 Subject: [PATCH 1/2] docs(spec): meta-read organizationId describes stop promising a supplied org is always consulted GetMetaItemRequestSchema, GetMetaItemLayeredRequestSchema and GetMetaItemCachedRequestSchema now qualify the promise ("When an org partition applies, this selects it ...") and state the negative ("Supplying a value does not by itself guarantee an org partition is consulted; where none applies, and whenever it is absent, the read is environment-wide"), the same shape as GetMetaItemsRequestSchema. The cached row's ETag sentence is kept unchanged. Prose only; no key, export, accept-set or runtime change. Claude-Session: https://claude.ai/code/session_01CiCTczDo7tGhafXjf61dUJ Co-authored-by: Claude --- .changeset/16524-meta-read-org-describes.md | 13 ++++++++ packages/spec/src/api/protocol.zod.ts | 34 +++++++++++++-------- 2 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 .changeset/16524-meta-read-org-describes.md diff --git a/.changeset/16524-meta-read-org-describes.md b/.changeset/16524-meta-read-org-describes.md new file mode 100644 index 00000000000..d81b6582dde --- /dev/null +++ b/.changeset/16524-meta-read-org-describes.md @@ -0,0 +1,13 @@ +--- +'@objectstack/spec': patch +--- + +docs(spec): the `organizationId` describes on `GetMetaItemRequestSchema`, `GetMetaItemLayeredRequestSchema` and `GetMetaItemCachedRequestSchema` no longer promise that a supplied organization is always consulted (#16524) + +Clause-②: no + +Each of the three published `describe()`s opened with "Selects the org partition in the ADR-0005 overlay read order" and closed with an absent-only statement ("Absent = environment-wide read …"). Read together, an integrator completes that as *present ⇒ consulted*, and it is not: on `getMetaItem`, `getMetaItemLayered` and `getMetaItemCached` a supplied organization is dropped for a metadata type that has no per-organization overlay, and the read resolves environment-wide exactly as if none had been sent. + +The corrected text takes the same shape as the sibling `GetMetaItemsRequestSchema.organizationId` describe: the parameter selects the org partition **when an org partition applies**, and supplying a value "does not by itself guarantee an org partition is consulted; where none applies, and whenever it is absent, the read is environment-wide". On `GetMetaItemCachedRequestSchema` the ETag sentence ("Also folded into the ETag, so a scope switch never returns a stale 304 from another scope's cached representation") is true and is kept byte-for-byte. + +Prose only. No key is added, removed or renamed, no export moves, no accept set changes and no runtime behaviour changes — a supplied `organizationId` is still accepted on all three requests, and the runtime still drops it where no org partition applies. What ships is the JSON-Schema `description` of the existing `organizationId` key on the three requests and the matching rows in the generated API reference. diff --git a/packages/spec/src/api/protocol.zod.ts b/packages/spec/src/api/protocol.zod.ts index 648a6cdf273..e0e85901e27 100644 --- a/packages/spec/src/api/protocol.zod.ts +++ b/packages/spec/src/api/protocol.zod.ts @@ -274,11 +274,13 @@ export const GetMetaItemRequestSchema = lazySchema(() => z.object({ name: z.string().describe('Item name (snake_case identifier)'), packageId: z.string().optional().describe('Optional package ID to filter items by'), organizationId: z.string().optional().describe( - 'Organization (tenant) scope for the read. Selects the org partition in the ' - + 'ADR-0005 overlay read order — org overlay wins over env-wide overlay wins ' - + 'over packaged artifact — so it decides which tenant\'s customization row ' - + 'is served as the item. Absent = environment-wide read: only env-level ' - + 'overlays apply and no org partition is consulted.', + 'Organization (tenant) scope for the read. When an org partition applies, ' + + 'this selects it in the ADR-0005 overlay read order — org overlay wins ' + + 'over env-wide overlay wins over packaged artifact — so it decides which ' + + 'tenant\'s customization row is served as the item. Supplying a value ' + + 'does not by itself guarantee an org partition is consulted; where none ' + + 'applies, and whenever it is absent, the read is environment-wide and ' + + 'only env-level overlays apply.', ), state: z.enum(['active', 'draft']).optional().describe( 'Draft-visibility switch — which lifecycle row to read (strict mode): ' @@ -444,10 +446,13 @@ export const GetMetaItemLayeredRequestSchema = lazySchema(() => z.object({ + 'resolves to the requested package\'s artifact (ADR-0048).', ), organizationId: z.string().optional().describe( - 'Organization (tenant) scope for the read. Selects the org partition in the ' - + 'ADR-0005 overlay read order, so it decides which tenant\'s customization ' - + 'row is reported as the `overlay` layer (and merged into `effective`). ' - + 'Absent = environment-wide read: `overlay` reports the env-level row only.', + 'Organization (tenant) scope for the read. When an org partition applies, ' + + 'this selects it in the ADR-0005 overlay read order, so it decides which ' + + 'tenant\'s customization row is reported as the `overlay` layer (and ' + + 'merged into `effective`). Supplying a value does not by itself guarantee ' + + 'an org partition is consulted; where none applies, and whenever it is ' + + 'absent, the read is environment-wide: `overlay` reports the env-level ' + + 'row only.', ), })); @@ -1818,11 +1823,14 @@ export const GetMetaItemCachedRequestSchema = lazySchema(() => z.object({ + 'cache validator check (issue).', ), organizationId: z.string().optional().describe( - 'Organization (tenant) scope for the read. Selects the org partition in the ' - + 'ADR-0005 overlay read order — org overlay wins over env-wide overlay wins ' - + 'over packaged artifact — exactly as on the uncached read. Also ' + 'Organization (tenant) scope for the read. When an org partition applies, ' + + 'this selects it in the ADR-0005 overlay read order — org overlay wins ' + + 'over env-wide overlay wins over packaged artifact — exactly as on the ' + + 'uncached read. Also ' + 'folded into the ETag, so a scope switch never returns a stale 304 from ' - + 'another scope\'s cached representation. Absent = environment-wide read.', + + 'another scope\'s cached representation. Supplying a value does not by ' + + 'itself guarantee an org partition is consulted; where none applies, and ' + + 'whenever it is absent, the read is environment-wide.', ), })); From 846c6840bb657a67561799fc6c04ef37c4906836 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 27 Sep 2026 04:32:41 +0000 Subject: [PATCH 2/2] docs(spec): regenerate the API reference for the corrected meta-read organizationId describes Output of `pnpm --filter @objectstack/spec check:generated --fix`, which proved content/docs/references/** the one stale artifact; three table rows in protocol.mdx change. The changeset now uses the describes' own "where no org partition applies" wording. Claude-Session: https://claude.ai/code/session_01CiCTczDo7tGhafXjf61dUJ Co-authored-by: Claude --- .changeset/16524-meta-read-org-describes.md | 2 +- content/docs/references/api/protocol.mdx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.changeset/16524-meta-read-org-describes.md b/.changeset/16524-meta-read-org-describes.md index d81b6582dde..543176adda7 100644 --- a/.changeset/16524-meta-read-org-describes.md +++ b/.changeset/16524-meta-read-org-describes.md @@ -6,7 +6,7 @@ docs(spec): the `organizationId` describes on `GetMetaItemRequestSchema`, `GetMe Clause-②: no -Each of the three published `describe()`s opened with "Selects the org partition in the ADR-0005 overlay read order" and closed with an absent-only statement ("Absent = environment-wide read …"). Read together, an integrator completes that as *present ⇒ consulted*, and it is not: on `getMetaItem`, `getMetaItemLayered` and `getMetaItemCached` a supplied organization is dropped for a metadata type that has no per-organization overlay, and the read resolves environment-wide exactly as if none had been sent. +Each of the three published `describe()`s opened with "Selects the org partition in the ADR-0005 overlay read order" and closed with an absent-only statement ("Absent = environment-wide read …"). Read together, an integrator completes that as *present ⇒ consulted*, and it is not: on `getMetaItem`, `getMetaItemLayered` and `getMetaItemCached` a supplied organization is dropped wherever no org partition applies, and the read resolves environment-wide exactly as if none had been sent. The corrected text takes the same shape as the sibling `GetMetaItemsRequestSchema.organizationId` describe: the parameter selects the org partition **when an org partition applies**, and supplying a value "does not by itself guarantee an org partition is consulted; where none applies, and whenever it is absent, the read is environment-wide". On `GetMetaItemCachedRequestSchema` the ETag sentence ("Also folded into the ETag, so a scope switch never returns a stale 304 from another scope's cached representation") is true and is kept byte-for-byte. diff --git a/content/docs/references/api/protocol.mdx b/content/docs/references/api/protocol.mdx index e578e76d0bf..e8afc33c54f 100644 --- a/content/docs/references/api/protocol.mdx +++ b/content/docs/references/api/protocol.mdx @@ -1216,7 +1216,7 @@ Enable package response | **name** | `string` | ✅ | Item name | | **cacheRequest** | `{ ifNoneMatch?: string; ifModifiedSince?: string; cacheControl?: object }` | optional | Cache validation parameters | | **locale** | `string` | optional | Resolved response locale. Folded into the ETag so a language switch never returns a stale-locale 304 — metadata is translated *after* the cache validator check (issue). | -| **organizationId** | `string` | optional | Organization (tenant) scope for the read. Selects the org partition in the ADR-0005 overlay read order — org overlay wins over env-wide overlay wins over packaged artifact — exactly as on the uncached read. Also folded into the ETag, so a scope switch never returns a stale 304 from another scope's cached representation. Absent = environment-wide read. | +| **organizationId** | `string` | optional | Organization (tenant) scope for the read. When an org partition applies, this selects it in the ADR-0005 overlay read order — org overlay wins over env-wide overlay wins over packaged artifact — exactly as on the uncached read. Also folded into the ETag, so a scope switch never returns a stale 304 from another scope's cached representation. Supplying a value does not by itself guarantee an org partition is consulted; where none applies, and whenever it is absent, the read is environment-wide. | ### Nested Shape: `GetMetaItemCachedRequest.cacheRequest` @@ -1270,7 +1270,7 @@ Enable package response | **type** | `string` | ✅ | Metadata type name | | **name** | `string` | ✅ | Item name | | **packageId** | `string` | optional | Optional package ID — scopes the `code` layer so a same-name collision resolves to the requested package's artifact (ADR-0048). | -| **organizationId** | `string` | optional | Organization (tenant) scope for the read. Selects the org partition in the ADR-0005 overlay read order, so it decides which tenant's customization row is reported as the `overlay` layer (and merged into `effective`). Absent = environment-wide read: `overlay` reports the env-level row only. | +| **organizationId** | `string` | optional | Organization (tenant) scope for the read. When an org partition applies, this selects it in the ADR-0005 overlay read order, so it decides which tenant's customization row is reported as the `overlay` layer (and merged into `effective`). Supplying a value does not by itself guarantee an org partition is consulted; where none applies, and whenever it is absent, the read is environment-wide: `overlay` reports the env-level row only. | --- @@ -1319,7 +1319,7 @@ Enable package response | **type** | `string` | ✅ | Metadata type name | | **name** | `string` | ✅ | Item name (snake_case identifier) | | **packageId** | `string` | optional | Optional package ID to filter items by | -| **organizationId** | `string` | optional | Organization (tenant) scope for the read. Selects the org partition in the ADR-0005 overlay read order — org overlay wins over env-wide overlay wins over packaged artifact — so it decides which tenant's customization row is served as the item. Absent = environment-wide read: only env-level overlays apply and no org partition is consulted. | +| **organizationId** | `string` | optional | Organization (tenant) scope for the read. When an org partition applies, this selects it in the ADR-0005 overlay read order — org overlay wins over env-wide overlay wins over packaged artifact — so it decides which tenant's customization row is served as the item. Supplying a value does not by itself guarantee an org partition is consulted; where none applies, and whenever it is absent, the read is environment-wide and only env-level overlays apply. | | **state** | `Enum<'active' \| 'draft'>` | optional | Draft-visibility switch — which lifecycle row to read (strict mode): `'draft'` opens the pending draft buffer (Studio's editor read) and fails when no draft exists; absent or `'active'` reads the live published row. Distinct from `previewDrafts`, which FALLS BACK to the active row when no draft exists. Declaration ≠ authorization: this member only selects which stored row is read — ADR-0106 masking is unaffected, and draft access is gated upstream, not by this schema. | | **previewDrafts** | `boolean` | optional | Draft-visibility switch (ADR-0033 draft-overlay preview, non-strict): when true and `state` is not `'draft'`, a pending draft row is preferred if one exists, else the read falls back to the active row — the render path degrades to the published value instead of erroring. A served draft is tagged `_draft: true` so UIs can badge it. Declaration ≠ authorization: this member only switches which row is read, and ADR-0106 masking is unaffected — draft preview is admin-gated upstream, not by this schema. |