Skip to content

Commit dd9303a

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-0xddsd
2 parents 4068ac8 + 66bf5b4 commit dd9303a

89 files changed

Lines changed: 3001 additions & 291 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
'@objectstack/metadata-core': minor
3+
'@objectstack/metadata-protocol': minor
4+
'@objectstack/objectql': minor
5+
'@objectstack/lint': minor
6+
'@objectstack/runtime': minor
7+
---
8+
9+
feat(metadata-core, metadata-protocol, objectql, lint, runtime)!: an App and the modules that declare it share one customization pair
10+
11+
Clause-②: yes (narrowing) — the ensure door refuses two asks it accepted: a package that reaches several Apps and whose namespace picks none of them (was `201` with its own pair, now `409`, merge question 11), and a module whose earlier per-package pair holds the App's pair namespace (was `201`/`200`, now `409 RESOURCE_CONFLICT` naming that pair, merge question 12); `appOf` now returns `string | undefined`. The widening half: a module of an App gets the App's pair (`200`, where it was `422 NAMESPACE_CONFLICT` when the App held the namespace), and `@objectstack/metadata-core` exports `pairsOf`, `AppOfRefusal` and `PairOfRefusal`. Ruling 6691022506; ADR-0146 D3 as amended by #31027.
12+
Metadata-protocol: semantic
13+
14+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and nothing at rest changes: a pair the ensure door created stays installed and served, and the two new refusals answer an ask without writing anything, so there is nothing for a migration to rewrite. -->
15+
16+
The customization unit is the App (ADR-0146 D3 as amended, ruling record 6691022506). `appOf` in `@objectstack/metadata-core` now reads the installed manifests: a `type: 'app'` package is its own App; any other package's App is the installed `type: 'app'` package it declares in `manifest.dependencies`, directly or through its declared parents (where it reaches several, the one holding its namespace); a package that declares no App is its own unit; a kernel package (scope `system` / `cloud`) keeps its own answer, because no platform pair is created in this version.
17+
18+
What changes for a caller:
19+
20+
- `POST /api/v1/packages/:id/ensure-customization` asked for a module of an App answers the App's one pair, `<app id>.custom` (namespace `<app namespace>_custom`, a dependency on the App at `^<major>`): `201` on the first ask from any member, `200` after, never `422` for a package of the same App. The answer's `basePackageId` is the App. HotCRM: the App and its modules all answer `app.objectstack.hotcrm.custom`.
21+
- `422 NAMESPACE_CONFLICT` stays for the pair namespace held by a package outside the App.
22+
- A per-package pair an earlier version created for a module (`<module id>.custom`) stays installed and honoured as before: its declared overrides are served at the module's address (by name, in the list and in the layered read), its list rows, translations, bundle members it added, object extensions and the served-overrides census are read beside the App's pair (`pairsOf` / `isPairOf`), it may still declare and remove its own overrides of the module's items ("Restore package original" included, for a type with no overlay channel too), and the customizations read (`GET /api/v1/packages/:id/customizations`) does not list it as another package's contribution. No reader is App-pair-only. While it holds the App's pair namespace, the ensure door answers `409 RESOURCE_CONFLICT` naming it instead of creating the App's pair beside it (merge question 12).
23+
- A package that reaches several Apps and whose namespace picks none of them has no pair: the ensure door answers `409` (merge question 11).
24+
- The App's pair's write closure reaches every member of the App, so an override or an object extension of a module's item saved into the App's pair is admitted.
25+
- The uninstall refusal for an installed pair reads the pair named for the package: uninstalling the App is refused while the App's pair is installed, uninstalling a module is not (its customizations are the App pair's), and a module whose own earlier per-package pair is installed is still refused naming that pair.
26+
- `os validate`'s `namespace-no-customization-pair` warning skips a member of a delivered App: its customizations land in the App's pair.
27+
28+
TypeScript: `appOf` now answers `string | undefined` (`undefined` = no single App), and `pairOf`'s refusal union gains `no_single_app` (`PairOfRefusal`); `pairsOf` and the `AppOfRefusal` / `PairOfRefusal` types are new exports of `@objectstack/metadata-core`.
29+
30+
**BREAKING** accept-set narrowing at `POST /api/v1/packages/:id/ensure-customization` (`@objectstack/metadata-protocol`) and a return-type change in `@objectstack/metadata-core`.
31+
32+
- **A package that reaches several Apps and whose namespace picks none.** Before: `201` with its own pair `<package id>.custom`. Now: `409 RESOURCE_CONFLICT` saying the package declares several Apps and its namespace picks no single one of them, and nothing is created. Remedy: declare the one App the package belongs to in `manifest.dependencies`, or give it the namespace of the App it belongs to.
33+
- **A module whose earlier per-package pair holds the App's pair namespace.** Before: the module's own `<module id>.custom` (`201`, then `200`). Now: `409 RESOURCE_CONFLICT` naming that pair, from the App and from every member; the pair stays installed and its customizations stay served. Remedy: keep customizing in the existing pair (its id is in the refusal), or export it (`GET /api/v1/packages/<pair>/export`), delete it, and ensure again to get the App's pair.
34+
- **`appOf` returns `string | undefined`** (was `string`). `undefined` means no single App. Remedy: handle `undefined` (`appOf(id, installed) ?? id` keeps the old reading); `pairOf`'s refusal reason may now also be `'no_single_app'` (`PairOfRefusal`).
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/i18n': patch
4+
'@objectstack/mcp': patch
5+
'@objectstack/platform-objects': patch
6+
---
7+
8+
feat(console): Connect an AI Assistant names the connected assistant and its last call; plain-words page subtitle
9+
10+
Clause-②: yes (widening)
11+
Metadata-protocol: none
12+
13+
- **`@object-ui/app-shell`**: once the signed-in person has connected, the line under the example requests on Connect an AI Assistant names what is connected and when it last made a call, the most recent call first: an authorized assistant by its name, with its last call "in the hour from" the recorded hour, or an API key by its name, with its last call as a moment; "no call yet" when none is recorded, and a pointer to the list at the bottom when more than one is connected. With nothing connected (or when it cannot be read) the line stays the try-first hint. It reads the records the "What can act as you" list reads (`oauth.authorizedClients.list()` and the person's own `sys_api_key` rows; a revoked or expired key is not a connection) through one hook, `useConnectedAccess`, and follows a Revoke made on the page.
14+
- **`@object-ui/i18n`**: `connectAgent.capabilities.connected`, `connectedKey`, `lastCallHour`, `lastCallAt`, `noCallYet` and `moreConnected` added in all eleven packs.
15+
- **`@objectstack/mcp`**: the Connect an AI Assistant page header no longer speaks of MCP-capable clients or row-level security: "Work in this system from Claude, Doubao and other AI assistants. Each one acts as you: it sees and changes only what your own permissions allow."
16+
- **`@objectstack/platform-objects`**: `pages.connect_agent.subtitle` follows in en, es-ES, ja-JP, zh-CN and zh-Hant, with the source digests re-recorded.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/plugin-auth': patch
3+
---
4+
5+
fix(plugin-auth): a refused enterprise OIDC sign-in names its cause
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The SSO callback (`/sso/callback/:providerId`) used to answer every refused ID token with the same redirect, `error=invalid_provider&error_description=token_not_verified`, so an administrator could not tell a wrong audience from an expired token, a foreign issuer or a retired signing key. `error_description` now names the cause: `id_token_expired`, `id_token_not_yet_valid`, `id_token_audience_mismatch`, `id_token_issuer_mismatch`, `id_token_signing_key_unknown` or `id_token_signature_invalid`. A refusal outside those classes keeps `token_not_verified`. `error=` is unchanged. The server writes one `warn` line per refusal with `providerId`, `protocol: 'oidc'` and `cause`, and no token content or account signal. The list is exported as `SSO_OIDC_REFUSAL_CAUSES`.
11+
12+
better-auth's own log lines now go to the `AuthManager` logger at the level better-auth chose (`error` stays `error`, `warn` stays `warn`) instead of the console. With no logger configured they still go to the console. A message that is an error object is logged as its name and message, as better-auth's console logger printed it; the vendor's further arguments pass through unchanged. The vendor's `error` line for a classified ID-token refusal is replaced by the `warn` line above.
13+
14+
SAML refusals are unchanged: `@better-auth/sso` does not expose their cause.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/spec': minor
3+
---
4+
5+
feat(spec): `RestrictionProfileSchema` — the closed shape of what a target environment does not let metadata do, published by that environment
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: added
9+
Skills-docs: none — the profile is data a target environment publishes, not a key an app author writes into a stack, and no reader ships in this release; authors meet it through `os validate --target`, whose refusals will name each rule.
10+
11+
`@objectstack/spec/system` exports `RestrictionProfileSchema` and its `RestrictionProfile` type. One source of metadata-authoring knowledge serves every build channel, and a hosted environment differs from a local one only by a restriction profile. This is that profile's shape:
12+
13+
- `allowCode` (boolean): whether metadata that carries code is allowed — object lifecycle hooks, named handler functions, code plugins.
14+
- `allowScheduledAutomation` (boolean): whether flows of `type: 'schedule'` and scheduled background jobs are allowed.
15+
- `allowedFlowNodeTypes`: the built-in flow node types a flow may use. Its items are `FlowNodeAction` ids, read from the spec's own node registry, so a type the registry does not name is refused and there is no second list to keep in step.
16+
- `versions: { spec, skills }`: the `@objectstack/spec` and `@objectstack/skills` versions the environment runs, each an exact SemVer 2.0.0 version.
17+
18+
The shape is strict at both levels and every key is required. **An absent profile means no restriction** (the local / open default): an environment with no restriction publishes no profile, and `{}` is refused rather than read as "everything allowed". The schema is data only: nothing in `@objectstack/spec` enforces it.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@objectstack/cli': patch
3+
---
4+
5+
fix(cli): `os diff` now says what a replay does to a seed dataset in mode `insert`, as it already did for `replace`: a replay inserts its records again, and a row the database refuses is that row's error. The loader's `insert` arm inserts every record without looking for a match, so the plan no longer reads an `insert` dataset as harmless.
6+
7+
Clause-②: no
8+
Metadata-protocol: none

‎content/docs/api/metadata-api.mdx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ capability changes only with a new version of the package that declares it. An
111111
sentence names that type's own route. What the reads then serve is in
112112
[Metadata lifecycle](/docs/concepts/metadata-lifecycle#customizing-an-installed-package-the-paired-custom-override-adr-0146).
113113
`POST /packages/hotcrm/ensure-customization` creates the pair when absent (Studio calls
114-
it on the first change); a kernel package (scope `system` or `cloud`) has no pair in this
114+
it on the first change); asked for a module that declares an App, it answers the App's one
115+
pair (`<app id>.custom`, `200` once it exists); a kernel package (scope `system` or `cloud`) has no pair in this
115116
version and answers `409 RESOURCE_CONFLICT`, though a pair an earlier version created keeps
116117
serving what it holds. `GET /packages/hotcrm/customizations` lists its overrides,
117118
extensions and switched-off items in one read, beside `contributions`: the fields (kind `field`)

‎content/docs/concepts/metadata-lifecycle.mdx‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,14 @@ later ships. See [ADR-0070](https://github.com/objectstack-ai/objectstack/blob/m
115115

116116
A customer's change to an installed base package — HotCRM, id `hotcrm` — is an item of
117117
the base's paired writable package **`hotcrm.custom`**, which depends on the base; the
118-
base's own items stay read-only. An item of the pair that bears a base item's name — for an
118+
base's own items stay read-only. **The unit is the App**: an App and every module or plugin
119+
that declares it (HotCRM's `app.objectstack.hotcrm` and its modules) share **one** pair,
120+
`<app id>.custom` (`app.objectstack.hotcrm.custom`, namespace `<app namespace>_custom`, depending on
121+
the App at `^<major>`), and the ensure door asked for any of them answers that one pair. A package that
122+
declares no App is its own unit, and a kernel package (scope `system` or `cloud`) has no pair in this
123+
version. A per-package pair an earlier version created for a module stays installed and keeps serving
124+
what it holds; while it holds the App's pair namespace, the ensure door answers `409` naming it rather
125+
than create the App's pair beside it. An item of the pair that bears a base item's name — for an
119126
`email_template`, one item per `(name, locale)`, the name **and** a locale the base ships — and
120127
declares in its body `overrides: { package: 'hotcrm', basedOn: '3.2.0' }` (the base's
121128
`manifest.id` and `manifest.version`; `basedOn` is recorded and never judged; schema:

‎content/docs/deployment/install-modes.mdx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ the package's paired `<package id>.custom` package
112112
([how](/docs/concepts/metadata-lifecycle#customizing-an-installed-package-the-paired-custom-override-adr-0146)).
113113
`POST /api/v1/packages/<package id>/ensure-customization` creates the pair, or
114114
answers it when it already exists, and a save naming it
115-
(`?package=<package id>.custom`) lands there:
115+
(`?package=<package id>.custom`) lands there. A module that declares its App is
116+
customized in the App's pair, `<app id>.custom`: the same door, asked for the
117+
module, answers that pair (its `packageId`), and a save names it:
116118

117119
- an item the package ships, of a type that takes an override (a `view`,
118120
`dashboard`, `flow` and the other types ADR-0146 lists), is replaced by

‎content/docs/permissions/sso.mdx‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,27 @@ caller gets **401 `UNAUTHENTICATED`** and a signed-in non-platform-admin **403
288288
cannot use these routes to probe which features an environment has enabled.
289289
</Callout>
290290

291+
### Why an OIDC sign-in was refused
292+
293+
When the identity provider's ID token is not accepted, the callback redirects to
294+
your `errorCallbackURL` (or `callbackURL`) with `error=invalid_provider`, and
295+
`error_description` names the cause. The server also writes one `warn` log line
296+
with the `providerId`, `protocol: 'oidc'` and the same `cause`. Neither carries
297+
any token content, and the answer does not depend on whether the account exists.
298+
299+
| `error_description` | What to check |
300+
| :--- | :--- |
301+
| `id_token_expired` | The token's `exp` is in the past. Check the clocks of this server and the IdP. |
302+
| `id_token_not_yet_valid` | The token's `nbf` is in the future. Check the clocks of this server and the IdP. |
303+
| `id_token_audience_mismatch` | The token's `aud` is not this provider's `clientId`. Check the client ID registered here against the IdP application. |
304+
| `id_token_issuer_mismatch` | The token's `iss` is not this provider's `issuer`. Check the issuer URL, including any trailing path or slash. |
305+
| `id_token_signing_key_unknown` | No key in the IdP's JWKS matches the token's key ID, usually after the IdP rotated or retired its signing key. Check the `jwksEndpoint`. |
306+
| `id_token_signature_invalid` | The JWKS key does not verify the token's signature. Check that the `jwksEndpoint` belongs to the same IdP as the `issuer`. |
307+
| `token_not_verified` | Any other refusal of the ID token. The server log carries the detail. |
308+
309+
The list is exported as `SSO_OIDC_REFUSAL_CAUSES` from `@objectstack/plugin-auth`.
310+
SAML refusals do not name their cause yet.
311+
291312
---
292313

293314
## Enterprise SSO (SAML 2.0)

‎content/docs/references/index.mdx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Protocol reference — every schema by module
33
navTitle: Protocol Reference
4-
description: Every schema published by @objectstack/spec — 1635 schemas across 14 protocol modules
4+
description: Every schema published by @objectstack/spec — 1636 schemas across 14 protocol modules
55
---
66

77
{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs live in the module folders under content/docs/. */}
@@ -32,9 +32,9 @@ counts are sums of the rows they head. Regenerate with
3232
| [Security Protocol](/docs/references/security) | 6 | 37 | Permission sets, row-level security, sharing rules, tenancy posture. |
3333
| [Shared Protocol](/docs/references/shared) | 10 | 31 | Primitives used across every protocol — identifiers, HTTP, expressions, error maps, enums. |
3434
| [Studio Protocol](/docs/references/studio) | 3 | 35 | Studio designer metadata — the authoring surfaces for the protocols above. |
35-
| [System Protocol](/docs/references/system) | 39 | 295 | The runtime environment — logging, jobs, cache, metrics, notifications, i18n and compliance. |
35+
| [System Protocol](/docs/references/system) | 40 | 296 | The runtime environment — logging, jobs, cache, metrics, notifications, i18n and compliance. |
3636
| [UI Protocol](/docs/references/ui) | 16 | 175 | Apps, pages, views, dashboards, reports, actions and themes — the ObjectUI layer. |
37-
| **Total** | **212** | **1635** | 14 protocol modules |
37+
| **Total** | **213** | **1636** | 14 protocol modules |
3838

3939
---
4040

@@ -329,7 +329,7 @@ Studio designer metadata — the authoring surfaces for the protocols above.
329329

330330
## System Protocol
331331

332-
**Source:** `packages/spec/src/system/` · **Import:** `@objectstack/spec/system` · **39 pages, 295 schemas**
332+
**Source:** `packages/spec/src/system/` · **Import:** `@objectstack/spec/system` · **40 pages, 296 schemas**
333333

334334
The runtime environment — logging, jobs, cache, metrics, notifications, i18n and compliance.
335335

@@ -363,6 +363,7 @@ The runtime environment — logging, jobs, cache, metrics, notifications, i18n a
363363
| [`push-config.zod.ts`](/docs/references/system/push-config) | `ApnsTransportConfig`, `FcmTransportConfig`, `PushDirectTransportConfig`, `PushRelayTransportConfig`, `PushServiceConfig`, `PushVendor` |
364364
| [`push-device.zod.ts`](/docs/references/system/push-device) | `UserDevice` |
365365
| [`registry-config.zod.ts`](/docs/references/system/registry-config) | `RegistryConfig`, `RegistrySyncPolicy`, `RegistryUpstream` |
366+
| [`restriction-profile.zod.ts`](/docs/references/system/restriction-profile) | `RestrictionProfile` |
366367
| [`search-engine.zod.ts`](/docs/references/system/search-engine) | `AnalyzerConfig`, `FacetConfig`, `SearchConfig`, `SearchIndexConfig`, `SearchProvider` |
367368
| [`security-context.zod.ts`](/docs/references/system/security-context) | `ComplianceAuditRequirement`, `ComplianceEncryptionRequirement`, `ComplianceFramework`, `DataClassification`, `DataClassificationPolicy`, `MaskingVisibilityRule`, `SecurityContextConfig`, `SecurityEventCorrelation` |
368369
| [`settings-client.zod.ts`](/docs/references/system/settings-client) | `SettingsChangeEvent` |

0 commit comments

Comments
 (0)