Skip to content

Commit 746ae96

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/area-A5b-34143
2 parents 8883cc9 + 571cf90 commit 746ae96

163 files changed

Lines changed: 5643 additions & 471 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: 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/console': patch
4+
---
5+
6+
fix(app-shell): Home sends the deployment notice, authorized-clients and API-key reads once per load
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
On a built Console, a cold load of Home sent `GET /api/settings/deployment/notice` twice and `GET /api/v1/auth/authorized-clients` and the `sys_api_key` list three times each. The repeats were not concurrent, so sharing an in-flight request could not remove them. Each had its own cause:
12+
13+
- **Home was mounted twice.** Home waits on the launcher's `pending` flag so that it never draws an app tile that `/me/apps` then hides. The `LauncherAppsProvider` set that flag from its effect, which runs after the first commit. So the first frame had nothing pending and nothing narrowed: Home drew its page, then switched to its loading state, then drew the page again. Everything inside it mounted twice, and the deployment notice and the Connect an AI Assistant card sent their reads twice. The first read is now `pending` from the render that makes it due. Home draws its page once, after the answer, and a hidden app's tile is never drawn in that first frame.
14+
- **Two readers of one answer.** Home draws the Connect an AI Assistant card and the administrator's first-run checklist together. Both read "has this person connected an assistant" through `useConnectedAccess`, and each sent its own two requests. Every reader mounted at the same time now shares one pair of reads. A change to either record re-reads it once for all of them. The shared answer is dropped with its last reader, so a page mounted later reads afresh.
15+
16+
A list page load already read every URL once on a built Console, so nothing changes there.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/console': patch
4+
---
5+
6+
fix(app-shell): a list view authored `navigation.preventNavigation: true` opens no record and draws no link face
7+
8+
Clause-②: no — an authored key starts being honoured; no surface added
9+
Metadata-protocol: none
10+
11+
The spec describes `navigation.preventNavigation` as "Disable standard navigation entirely". The Console's object list did not read it: a `drawer` view with the flag still opened the record drawer on a row click (it wrote `?recordId=`), and a ⌘, Ctrl or middle click still opened the record in a new tab. Its rows also kept their link face: the first column drew as the record link and the right-click menu offered Open and Open in new tab.
12+
13+
On a desktop, the Console's object list now resolves such a view the way it resolves a view authored `navigation: { mode: 'none' }`, whatever mode the view names. A row click opens nothing, a modifier click included. The record-link column draws plain text, and the right-click menu offers no Open items. The row's actions stay. A view without the flag, or with `preventNavigation: false`, opens its records as before. On a phone the list is unchanged: a tap still opens the record's page.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@object-ui/plugin-form': patch
3+
'@object-ui/plugin-view': patch
4+
'@object-ui/app-shell': patch
5+
'@object-ui/console': patch
6+
---
7+
8+
perf(console): the first load stops downloading the form and view packages; `@object-ui/plugin-form/core` and `@object-ui/plugin-view/core` publish their pure helpers without registering anything
9+
10+
Clause-②: yes (widening) — two new published `exports` subpaths, `@object-ui/plugin-form/core` and `@object-ui/plugin-view/core`, join what the packages accept; nothing is removed or renamed, and the package roots export the same names as before
11+
Metadata-protocol: none
12+
13+
`@object-ui/plugin-form` and `@object-ui/plugin-view` register their renderers with `ComponentRegistry` when their root entry is evaluated, and each root reaches every surface of its package. A host that imported one pure helper from the root therefore kept the whole package. Each package now publishes a `/core` subpath that registers nothing:
14+
15+
- `@object-ui/plugin-form/core`: `filterSystemFields`, `isAutoGeneratedFieldType`, `isWideFieldType`, `inferColumns`, `containerGridColsFor`, `resolveInlineMode`, `omitServerResolvedDefaults`, `optionListDefault`, `resolveSectionGroupReferences`, `useInitialFieldFocus`, and the parameter types they take (`InlineMode`, `FieldDefaultsSchemaLike`, `OptionListFieldLike`, `ResolveSectionGroupsOptions`).
16+
- `@object-ui/plugin-view/core`: `deriveRecordSurface`, `deriveRecordFlowSurface`, `overlayWidthFor`, `toFilterGroup`, `deriveFieldOptions`, `isImageLikeField`, `isGeoLikeField`, `pickPreferredField`, `KANBAN_GROUP_PREFERRED`, `PRIMARY_DATE_PREFERRED`, `END_DATE_PREFERRED`, and the types `RecordSurface`, `RecordFlowSurface`, `FieldOption`.
17+
18+
The same names stay exported from each package root, unchanged; nothing to migrate. The subpath ships ESM only (`import`), as `@object-ui/plugin-chatbot/core` does.
19+
20+
The console (`@object-ui/console`, and the shell it draws, `@object-ui/app-shell`) takes these helpers from the subpaths, draws the global record form, the action modal's form and a flow's object-form screen through `lazy()`, and registers the tags the two packages register (`object-form`, `view:form`, `embeddable-form`, `object-master-detail-form`, `record:line_items`, `object-view`, `view:simple`, `view-switcher`, `filter-ui`, `sort-ui`) as lazy stubs with the namespaces those registrations declare. Neither package is downloaded on the first load any more; each loads, and registers once, the first time a form or a view is drawn. What every page draws is unchanged; the first record form or action form opened in a session waits for the form chunk before it shows.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the error-code ledger's `OS_PROTOCOL_INCOMPATIBLE` comment says when the refusal carries a `migrateCommand` and when it does not
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Comment only; no schema, type, code or export changes. The comment on the `OS_PROTOCOL_INCOMPATIBLE` row in `src/api/error-code-ledger.zod.ts` said the remedy is `objectstack migrate meta --from N` and listed `migrateCommand` among the `error.details` members unconditionally. It now matches the shipped refusal. `requiredRange`, `rangeSource`, `protocolVersion` and `targetMajor` are on every refusal. `migrateCommand` is present only from the migrate-meta support floor (16, ADR-0087 D3) up to the runtime's major, and is bare when the target major cannot be determined. It is absent for a package ahead of the runtime and for one below the floor, and in both cases the message names the remedies that apply.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/core': minor
4+
'@objectstack/runtime': minor
5+
'@objectstack/service-i18n': minor
6+
'@objectstack/rest': minor
7+
'@objectstack/objectql': minor
8+
'@objectstack/plugin-email': minor
9+
'@objectstack/service-analytics': minor
10+
'@objectstack/service-storage': minor
11+
---
12+
13+
feat(i18n): the serving layer reads `i18n.sourceLocale` as the authored label's language
14+
15+
Clause-②: yes
16+
Metadata-protocol: semantic
17+
18+
`II18nService` (`@objectstack/spec/contracts`) gains an optional `getSourceLocale()` / `setSourceLocale(locale)` pair, shaped like the fallback pair; `FileI18nAdapter` and the kernel's in-memory fallback implement both.
19+
20+
An app authored in one language that defaults its users to another now serves its inline labels to a request in the authored language. Take `defaultLocale: 'zh-CN'`, `sourceLocale: 'en'`, English inline labels, a `zh-CN` bundle and no `fallbackLocale`:
21+
22+
- Before: an `en` request was not treated as the authored language, walked the fallback chain (`zh-CN`) ahead of the inline text and was served the Chinese bundle row, unless the stack also declared `fallbackLocale: 'en'`.
23+
- Now: an `en` request answers the English inline label; a `zh-CN` request answers the `zh-CN` row; any other locale walks the declared fallback chain exactly as before.
24+
25+
`AppPlugin` threads the declared `i18n.sourceLocale` into the i18n service, and every metadata-document translation (the REST metadata reads, a formula's `label()`, an email template's `option` hole, analytics select-option labels and the upload-link page) passes `getSourceLocale()`, else `getDefaultLocale()`, as `ResolveOptions.defaultLocale`. A stack that declares no `sourceLocale` is served exactly as before. A `fallbackLocale: 'en'` added only to work around this can stay; it is no longer needed for the `en` request.
26+
27+
Writing your own i18n provider: implement `setSourceLocale` to receive the declaration and `getSourceLocale` to report it, answering `undefined` when nothing was declared — never `defaultLocale`; the serving layer does that collapse itself.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
'@objectstack/driver-sql': patch
3+
'@objectstack/driver-turso': patch
4+
---
5+
6+
feat(driver-sql, driver-turso): schema sync builds the `(created_at, id)` and `(owner_id)` indexes without a declaration
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
Schema sync now builds two indexes on system columns that no object has to declare:
12+
13+
- `(created_at, id)`, named `idx_<table>_created_at_id`, on every table that has both columns. This is the default list order, `created_at desc, id desc`. Without the index, every default-ordered page sorted all of its filtered rows. On PostgreSQL 16 with 1M rows, the admin list statement takes 1.3 ms instead of 317 ms.
14+
- `(owner_id)`, named `idx_<table>_owner_id`, on an object whose fields include a single-valued `owner_id`. This is the column a private-OWD read filters on. An object with no `owner_id` gets no such index.
15+
16+
Both indexes are non-unique. They follow the #31882 rule for reference columns. If a declared index's key already starts with the same columns, it serves instead, and no second index is built. If an author declares the same key, it gets the same name, so the two converge. On an existing database, `os migrate plan` lists each missing index as a `safe` `create_index`. The next sync builds it, and on PostgreSQL it is built `CONCURRENTLY`. A second sync makes no changes. An existing table that has no `created_at` column gets no default-order index and no error line.
17+
18+
Turso's remote face (`libsql://`) now builds the full implicit set too: these two keys and the #31882 reference-column indexes. Until now it built only declared indexes, so the drift plan on a remote database showed a `create_index` for each implicit index after every sync.
19+
20+
On SQLite, the index does not speed up a default-ordered page yet. While the engine adds the empty controlled-by-parent chain to the query, the SQLite planner still sorts in a temporary B-tree. When the query has no chain, the same page takes 0.16 ms instead of 1.6 s at 1M rows.
21+
22+
Widening: `@objectstack/driver-sql` now exports `implicitReferenceIndexes` from its main entry. Its arguments take an optional `physicalColumns` set, and when one is given, a key over a column the table lacks is left out.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/objectql': patch
4+
'@objectstack/runtime': patch
5+
---
6+
7+
feat(spec): the server-constructed in-product AI path can name itself on `ExecutionContext.performedBy`, and hooks see it on `HookContext.provenance`
8+
9+
Clause-②: yes — widened: `ExecutionContext.performedBy` accepts three new optional keys beside `clientId`: `agentId` (the in-product AI agent that performed the write for the signed-in person), `conversationId` (the AI conversation) and `confirmationId` (the id of the pending item the person approved). `clientId` is now optional, and a `performedBy` must name at least one of `clientId` and `agentId`, so `{ agentId }` parses where only `{ clientId }` did; a `performedBy` naming neither is refused at parse exactly as before, and the published JSON Schema states that rule as an `anyOf`. `HookContext.provenance` accepts `performedByAgentId`, `performedByConversationId` and `performedByConfirmationId`, each copied from its `performedBy` sibling by the engine the way `performedByClientId` is copied from `clientId`, and a sandboxed hook body reads them on `ctx.provenance` too.
10+
Metadata-protocol: none
11+
12+
Before this, the in-product AI had no place on the write context: it writes as the person, and `ObjectQL#createContext` parses the envelope, so an `agentId` a host put on `performedBy` was dropped there and the write looked like the person's own. The attribution stays server-constructed and never client-supplied, no security middleware reads it, and it never becomes the subject a write is authorized as; the write still runs as the person, with `userId` theirs and no `onBehalfOf`. The OAuth `/mcp` door is unchanged: it still sets `performedBy.clientId` alone, and hooks still see `provenance.performedByClientId`.
13+
14+
What to do: nothing, unless your TypeScript reads `ExecutionContext['performedBy']` and assumes `clientId` is there. It is now `string | undefined`, because the in-product AI path names `agentId` instead; check it before use, as `performedBy?.clientId` readers already do. Recording these keys in `sys_audit_log` is a separate change to the audit writer.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
fix(metadata-protocol): a seed `owner_id` naming a person resolves on an object that relies on the injected owner column
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The seed loader builds its reference graph from the object definition the metadata service serves, which is the one the author wrote. An object that does not declare `owner_id` gets the column from the platform at registration, so the graph had no reference for it. A seed value naming a person there (`owner_id: 'Zhang Wei'`) was stored as that text, with no error and no log line, while a declared person field on the same row (`Field.user()`, `Field.lookup('sys_user')`) resolved the same name to the user's id. This happened on every load: the single-organization boot, the per-organization replay, the organization-create replay and a package install into an organization.
11+
12+
The graph now reads the injected `owner_id` as the `sys_user` lookup the platform registers. The value resolves like any person reference: across the database on a load with no organization, and through the organization's membership on an organization's own load. A person who is not a member of that organization is not resolved. The column is left NULL, and the load reports the same "not a member of organization" error a declared person field gets. The first-admin handoff can then claim the NULL owner. Before, a row with the name stored as text stayed owned by a user id that does not exist, and the handoff never claimed it because the value was not NULL.
13+
14+
A declared `owner_id` is unchanged: the author's field is read as before, whatever its type. An object that gets no injected owner (`ownership: 'org'`, `'none'` or `'business_unit'`, `managedBy`, a `sys_*` name, `systemFields: false`) gets no owner reference added. This change itself rewrites no stored row: a row that already holds a name in `owner_id` keeps it until a later seed write or an edit sets its owner.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/platform-objects': patch
4+
---
5+
6+
fix(spec): the hook form's refusal catalogue help names the handler beside the JavaScript body
7+
8+
Clause-②: no — help text only
9+
Metadata-protocol: none
10+
11+
The Studio hook form's `refusals` row ended its help with "JavaScript (L2) bodies only", while `HookSchema` answers a refusal catalogue on a sandboxed `js` body and on an in-process `handler` alike, and refuses it on an `expression` body. The help now reads "For a JavaScript (L2) body or a handler; refused on an expression body", and says the code is the one the hook throws rather than the body. The translated copies in the ten metadata-form bundles of `@objectstack/platform-objects` carry the same correction. No behaviour changes: what a hook may declare, and what is refused, is exactly as before.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
Clause-②: no
6+
Metadata-protocol: none
7+
8+
The registry heal after a metadata delete no longer registers a picked holder's item in the bare slot. A `dashboard`, `report` or other type addressed by `(package, name)` that the metadata service stores by name alone keeps only the item registered last, and answers it to a read naming any package. When two or more packages held the name in the registry, the heal's baseline read took that answer and registered it in the bare slot, so every bare registry lookup answered the last-registered holder's item and the registry listed it twice (ADR-0150 D3: a bare read never picks between holders). The heal now reads no baseline there: the bare slot stays empty and a read naming no package answers the refusal naming every holder, as the boot leaves it. A name one package holds heals as before.

0 commit comments

Comments
 (0)