Skip to content

Commit 1f1f43c

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-32vsaq
2 parents 3c25103 + 8436f67 commit 1f1f43c

172 files changed

Lines changed: 9705 additions & 655 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: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/i18n': patch
4+
'@object-ui/auth': patch
5+
'@objectstack/platform-objects': minor
6+
'@objectstack/spec': minor
7+
'@objectstack/plugin-auth': minor
8+
---
9+
10+
feat(console): a Mobile App page in the account app shows the code that connects the ObjectOS mobile app to this server
11+
12+
Clause-②: yes (widening) — a new account-app navigation entry and component (`account:mobile_app`), a new `mobileApp` namespace in the `@object-ui/i18n` packs, and a new optional `features.publicBaseUrl` served on `GET /api/v1/auth/config` (declared in `AuthFeaturesConfigSchema`, registered in `PUBLIC_AUTH_CONFIG_NON_FLAG_KEYS`, typed on `AuthPublicConfig`); nothing that worked before is refused
13+
Metadata-protocol: added
14+
15+
The account app (avatar menu → Profile) gains a **Mobile App** entry after Profile. Its page shows a QR code that encodes `objectos://connect?server=<this server's public base URL, URL-encoded>`, the same link as copyable text, and one line saying the code holds only the server's address, never the account.
16+
17+
`GET /api/v1/auth/config` now serves `features.publicBaseUrl`: the base URL the auth layer builds every link from (`OS_AUTH_URL`, then `BETTER_AUTH_URL`, then `OS_BASE_URL`), with any sub-path mount, as an address only (scheme, host and path; a credential, query or fragment in the setting is never served). The page encodes that URL. The page normalises it the same way again before use, so the code carries the server's address and nothing else. The browser's own address is never used, because it can be an internal or proxied host. When that URL names `localhost` or a private address, or a public host on plain `http:` (the mobile app signs in through it, so it must be HTTPS), the page shows no code and says how to fix it: set `OS_AUTH_URL` on the server to its public `https://` address and restart it. A server that does not publish the field gets a page saying it does not offer this yet.
18+
19+
No app-store links are shown: no setting carries them today.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
'@objectstack/rest': patch
4+
'@objectstack/runtime': patch
5+
---
6+
7+
fix(metadata-protocol,rest,runtime)!: a name only disabled packages hold answers 404 at `_env`, and an environment customization of such a name is hidden until a holder is enabled again (ADR-0150 D3, D4)
8+
9+
Clause-②: no (narrowing)
10+
Metadata-protocol: none
11+
Skills-docs: updated here — content/docs/data-modeling/import-mappings.mdx (no `skills/**` file teaches an `_env` answer)
12+
13+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no export changes shape. The moved answers are by-name reads under a reversible package state: no stored row is changed or deleted, so there is nothing for a migration to rewrite and no tombstone. -->
14+
15+
**BREAKING** for a read of an environment customization of a name whose every holding package is disabled. Such a customization is a row saved without a package, for a name an installed package holds. It belongs to that package (ADR-0150 D4), and a disabled package holds no name (ADR-0150 D3).
16+
17+
- **The read that names no package (`GET /meta/:type/:name`, and the execution read).** When every package holding the name is disabled, this read now answers as if the customization were not saved: `404`, where it served the row. That includes a translation the package never shipped, such as an email template's `fr-FR` that only the environment wrote. A customization at a member the package ships was already hidden.
18+
- **The list and the execution list (`GET /meta/:type`).** They now leave out the same customization, so they agree with the read of the name: while every package holding the name is disabled, neither list carries any item of it. Enable a holder again and both list it again.
19+
- **A save or delete naming no package while every holder is disabled.** A save at a member the package never ships is accepted and kept, as before, but it is now hidden from the reads above until a holder is enabled again. A delete of it still removes the row. A save at a member the package ships is still refused `403 NOT_OVERRIDABLE`.
20+
- **`GET /meta/:type/_env/:name`.** When every package holding the name is disabled, the environment address now answers `404`, as for a name no package holds, on both the REST server and the runtime dispatcher. It used to refuse `409 RESOURCE_CONFLICT` naming the disabled packages. It still refuses `409` in three cases: an enabled package holds the name; a package holds it through a saved metadata row that the read of the name serves; or the read carries `?state=draft`, `?preview=draft` or `?layers=`, which read other rows than the plain read. That `409` names only the disabled package the registry holds the name for, as before; it does not name an enabled package that holds the name through a saved row. On a composition whose metadata engine has no package-scoped resolver for the type (its registry lacks the by-name reads), `_env` of a name only disabled packages hold now answers `501 NOT_IMPLEMENTED`, the refusal of a read that engine cannot judge, where it answered `409`. Refusal to refusal; no production composition lacks those reads.
21+
- **The import door's `mappingName: "_env/NAME"`.** The same move, as `GET /meta/mapping/_env/NAME` answers it: `404 MAPPING_NOT_FOUND`, naming no package, where it was refused `409` naming the disabled package.
22+
23+
**Not moved.** With an enabled holder, every answer is unchanged. That includes an enabled package that holds the name only through a saved row the registry has not read yet: the customization is still served and listed, whether the list or the read of the name comes first. A customization of a name no installed package holds is the environment's own item and is still served.
24+
25+
**No migration.** Nothing is deleted or rewritten. Enable the package again and the customization is served again, unchanged. The fix for a caller who needs the row while the package is disabled is to re-enable the package.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
'@objectstack/objectql': patch
3+
'@objectstack/spec': patch
4+
---
5+
6+
perf(objectql)!: a cascade delete removes a relation's children as one predicate delete per chunk
7+
8+
Clause-②: no (narrowing) — the published hook dispatch shape for cascaded children changes (`dispatch.mode` 'record' → 'per-row', `options.multi`, before-hooks run before the set delete); BREAKING banner + ADR-0087 disposition in the changeset; one CONTRACT_REVIEW_TIER review owed before the queue
9+
Metadata-protocol: none
10+
11+
<!-- adr-0087: not-required (no-migration-prescription) No key of any authorable schema is added, removed, renamed or re-shaped and no stored row is rewritten: what changes is the runtime hook dispatch shape the engine gives a cascaded child delete, so there is nothing for `objectstack migrate meta` to convert. -->
12+
13+
**BREAKING** for a delete-side hook that runs on a cascaded child and reads `ctx.dispatch.mode`, `ctx.input.options`, or the rows of the child's siblings.
14+
15+
Deleting a record now deletes the children each `cascade` relation reaches as ONE predicate delete per chunk of 500, `DELETE … WHERE id IN (…)`, through the predicate-delete arm a `multi: true` delete already takes. Before this, every child was its own by-id delete. Measured on the SQL-performance bench (one opportunity with 10 line items, the stock plugins loaded): 155 statements before, 58 after, on SQLite and on PostgreSQL alike (one of the 58 is the read of each chunk's ids through the caller's read door).
16+
17+
What a hook on a cascaded child sees:
18+
19+
- FROM `ctx.dispatch.mode: 'record'` and `ctx.input.options` `{ where: { id } }` TO `ctx.dispatch.mode: 'per-row'`, with `ctx.dispatch.index` its position in the chunk and `ctx.input.options` carrying `where: { id: { $in: [...] } }` and `multi: true`. `ctx.input.id` and `ctx.previous` still name the child's own row, and `ctx.referentialCascadeDelete` is still `true` on every per-row context, in both phases, grandchildren included.
20+
- FROM `ctx.result` in a cascaded child's `afterDelete` being the driver's by-id answer TO `ctx.result` absent, as on every per-row delete context. Read `ctx.previous` for the deleted row.
21+
- FROM `ctx.dispatch.scope` one scratch object per cascaded child TO one object shared by every child of the chunk, in both phases (the scratch of one caller write, which the chunk now is).
22+
- FROM one context object for a cascaded child's `beforeDelete` and `afterDelete` TO a fresh context per row per phase, so a value a `beforeDelete` handler leaves on `ctx` no longer reaches that child's `afterDelete`. Keep cross-phase state in `ctx.dispatch.scope`, keyed by `ctx.input.id`.
23+
- The one behaviour that flips: the chunk runs every child's `beforeDelete`, then the one set delete, then every child's `afterDelete`. Before, each child ran before → delete → after in turn. So a `beforeDelete` hook that counts a child's remaining siblings now sees them ALL present, where it used to see one fewer at each step. Judge the whole batch instead: on `ctx.input.options.multi === true` read the target set from `ctx.input.options.where` (the shipped last-administrator guard does exactly this, and reaches the same verdict as before), or use `ctx.referentialCascadeDelete === true` to tell the cascade from a hand delete.
24+
- A chunk the caller's scope narrows falls back to today's by-id deletes for that chunk, so the caller still meets the same refusal and the whole cascade rolls back: a child the caller may not delete, which a predicate delete would skip, and a child the caller may not read, which the by-id delete refuses through its re-read of the row (the cascade asks the caller's read door for each chunk's ids before batching it). Such a chunk keeps today's shape, `'record'` with no `multi`, so one cascade can show both shapes. A driver with no `deleteMany`, a floored external driver, and a cascade into the organization object (deleted by id or not at all) keep the by-id path too, and so does a child the walk finds that the cascade's collected set never held (a row a hook of the same cascade wrote after the set was collected): it is deleted as the root of its own cascade, with its own recycle-bin entry, as before.
25+
26+
Unchanged: one `data.record.deleted` realtime event per child (never the bulk `data.records.deleted`); a refusal from any child's hook, or a permission refusal, rolls the whole cascade back; the recycle bin keeps one entry per root; the bulk per-row hook ceiling is never reached (a chunk is 500, the ceiling 10,000). On a runtime that cannot roll back, a refusal raised after a chunk's set delete (a failed roll-up recompute) now finds the whole chunk deleted, where the per-child walk had deleted only the children before the refusal.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@object-ui/console': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
fix(console): on a cloud-managed environment, Setup's File storage page and the AI provider part of the AI page say the platform manages them
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
A direct route (a bookmark or a typed URL) to Setup → File storage on a cloud-managed environment used to draw the generic load error, because the server refuses that namespace there. The console now reads that refusal by its declared shape (`409 RESOURCE_CONFLICT` with `error.details.managedBy: 'platform'`) and draws "Managed by the platform" with no form and no retry. A `409` without `managedBy: 'platform'` keeps the error card.
12+
13+
The AI page is served without its provider, model and credential keys on a cloud-managed environment. When the served auth config says the environment is cloud-managed (`features.cloudManaged`) and the served page carries no `provider` key, the page draws one line saying the platform manages the AI provider; the conversation-title and observability settings stay editable. A save or an action the server refuses as platform-managed (a page loaded earlier) toasts the same managed text instead of the server's sentence.
14+
15+
Self-hosted environments are unchanged. Three new keys under `console.settingsView` in every `@object-ui/i18n` pack: `platformManagedTitle`, `platformManagedBody`, `aiProviderManaged`.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/cli': patch
3+
---
4+
5+
fix(cli): an app's `onEnable` and its job, hook and action handlers run from one evaluation of its config module
6+
7+
Clause-②: no
8+
Metadata-protocol: none (boot composition; no authorable key changes; the dev confirms against the diff)
9+
10+
A boot that serves the compiled artifact took the handlers from the artifact's runtime module (`dist/objectstack-runtime.*.mjs`). That module is a bundle of the same config source, so it is a second evaluation of it. `onEnable` came from the config module the boot had loaded. State that `onEnable` sets at module scope, such as a data engine a job reads, was therefore missing when the handler ran. Under `os dev` on a host config, a job that read it failed on every run with "no data engine", while `os start` served the same project.
11+
12+
`os start` and `os serve` on a config without its own plugin instances (a non-host config) had the same split, because they boot from the compiled artifact too and add the config's `onEnable` the same way.
13+
14+
Every handler the runtime module supplies now runs from the config module this boot loaded, the same module as `onEnable`. This covers `os dev` on any config and `os start` / `os serve` on a non-host config. A boot from an artifact alone, with no config, is unchanged: it has no `onEnable` to run. Handlers are matched by the ref the build gave them. Metadata still comes from the artifact. If the artifact names a handler that the config no longer has (for example `os dev --no-compile` over an older build), that handler still runs from the runtime module. The boot warns once and names it.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@object-ui/plugin-grid': patch
3+
---
4+
5+
fix(plugin-grid): a list asks for its rows' Edit / Delete verdicts when the row actions are first used, not on first paint
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Every list view with rows sent two `POST /api/v1/security/explain` requests right after its data arrived, one for `update` and one for `delete`, to decide whether each row's menu offers Edit and Delete. Each costs the server tens of milliseconds and dozens of queries, and on a hosted page they were the last layer of the page load. The answer only matters to items a row shows inside its menus, so the grid now asks when a row's actions are first reached for: a pointer or the focus on the actions cell, the row's "⋮" opening, or the row context menu opening. That first use asks once for the whole page, one batch per operation. Opening another row's menu asks nothing new. Once asked, the list keeps the verdicts current as before, on a new page or after a data change.
11+
12+
Until the answer lands, every row keeps the object-level verdict, as it did before the answer arrived. A menu opened in that window shows Edit and Delete inert, so neither can be clicked into a write the answer is about to refuse. An item the answer refuses then goes. A failed or missing answer keeps the object-level verdict.
13+
14+
The exported `RowActionMenu` takes two new optional props: `onActionsDemand`, called when the row's actions are reached for, and `crudVerdictPending`, which shows the built-in Edit or Delete inert. A menu that passes neither behaves as before.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@object-ui/core': patch
3+
'@object-ui/plugin-grid': patch
4+
---
5+
6+
fix(core, plugin-grid): an action's failure toast and a per-record bulk run's failed row show the handler's userMessage
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
A handler that refuses with a `userMessage` (the text it wrote for the user, already in the request's locale) now has those words shown where a single action reports its failure. The failure toast of `ActionRunner` (`@object-ui/core`) shows the action's authored `errorMessage` when it declares one, else the refusal's `userMessage`, else the error's own message; before, it went straight from `errorMessage` to the platform's error text. An action that sets `errorMessage` keeps its text.
12+
13+
The per-record bulk run (`bulkActions: ['NAME']`, `@object-ui/plugin-grid`) lists each failed record with its refusal's `userMessage` when the handler threw one, else the error's message, as the aggregate run already does for its one outcome. The error CSV keeps each failure's whole message. A blank `userMessage` is no marking and changes nothing.
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+
---
4+
5+
fix(console): a packaged app's lookup targets outside its package, and an app entry's `requiresObject`, are asked by name only once the host serves them
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The console asked two kinds of object definition by name even when the host does not register the object, and each answered `404` on every open of the route.
11+
12+
- **A packaged app's lookup targets outside its package.** An object's route and a page in an app with a package asked each lookup target the package list does not hold by name (`sys_approval_request` on a Free environment). Those targets are now asked first in the one `GET /api/v1/meta/object?names=` read an app with no package already uses, which leaves an absent object out, and only the ones it serves are then read by name. A target the package list holds is read as before, with no extra request.
13+
- **An entry's `requiresObject`.** The objects an app's navigation and area entries require were asked by name, by the route's scope, the sidebar's capability gate, the served view items and the `nav:menu` block. They are now asked in the same `?names=` presence read, in one request shared by those readers; the route reads by name only the ones it answers served. The sidebar and the `nav:menu` block still hide an entry whose object the answer leaves out, and show one it serves or has not answered yet. In a packaged app the package's own objects are answered by its list and are not asked again.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@object-ui/console': patch
3+
'@object-ui/app-shell': patch
4+
'@object-ui/i18n': patch
5+
---
6+
7+
feat(console): the first-run checklist takes a host profile; a managed environment adds "Put your first app in" and "Add your first record"
8+
9+
Clause-②: no
10+
Metadata-protocol: none
11+
12+
The administrator's first-run checklist on Home now draws its rows from a profile, selected by the flag the server already serves (`features.cloudManaged` of `GET /api/v1/auth/config`). No new field is served, and the checklist code has no branch on the host.
13+
14+
- **Self-hosted (the flag off or absent):** the checklist is exactly what it was.
15+
- **Managed (`features.cloudManaged: true`):** two rows are added after the platform's rows.
16+
- **Put your first app in** is done once the launcher lists an app that is not one of the platform's built-ins (`com.objectstack.*`, such as Setup and Studio). It reads the console's existing `/me/apps` answer and sends no request of its own.
17+
- **Add your first record** is done once a person created a record on an object one of those apps lists. It sends one `sys_activity` read (`type` `created`, an actor set, at most one row). The activity feed keeps 14 days, so this row is optional on the managed profile: it never keeps the checklist open and is not counted in its progress.
18+
- The Email delivery row is shown only once mail reads as delivering. The hosted platform mail channel cannot yet report itself as configured, so the row would otherwise say "not set up" on an environment whose mail is delivered.
19+
20+
`@object-ui/app-shell` exports `isPlatformBuiltinApp`, the test that the AI chat's package switcher already used, so the checklist and the switcher apply the same test. New translation keys `console.firstRunChecklist.firstApp.*` and `console.firstRunChecklist.firstRecord.*` are in every language pack.

0 commit comments

Comments
 (0)