Skip to content

Commit 8ad4e19

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-pgp7w2
2 parents 1a4bf46 + 0ab4a09 commit 8ad4e19

44 files changed

Lines changed: 3628 additions & 1303 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
refactor(metadata-protocol): the metadata item reads and the layered read move out of `protocol.ts` through the protocol host
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
No behaviour change. The bodies of `getMetaItem`, `getMetaItemForExecution`, `readMetaItem`, `packagelessLayeredReadRefusal` and `getMetaItemLayered` now live in `protocol-meta-item-reads.ts` and `protocol-meta-layered-reads.ts`, reached through the per-instance host (`protocol-host.ts`). Each method keeps its docblock and signature on `ObjectStackProtocolImplementation`, and each moved body differs from the method body only by `this.` reading `host.`. The published `index.d.ts` (ESM and CJS) is byte-identical to the one `main` builds before this change. Nothing to migrate.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@object-ui/mobile': patch
3+
'@object-ui/app-shell': patch
4+
---
5+
6+
feat(mobile, app-shell): inside the ObjectStack mobile shell, the header's organization button opens the shell's native connection switcher, and the Console answers the shell's `connectionRemoved` event
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
The mobile shell's bridge (`window.ObjectStackNative`) gained `showConnectionSwitcher()` and the `objectstack-native:connectionRemoved` window event. The Console now uses both:
12+
13+
- **Organization button.** When the shell announces `has('showConnectionSwitcher')`, `WorkspaceSwitcher`'s button calls `showConnectionSwitcher()`, which opens the shell's own sheet of saved organizations and company servers. The web organization menu does not open. In the shell the button renders whenever there is an active organization, at one membership too, since the sheet lists the shell's connections across company servers; `CurrentOrganizationIndicator` then renders nothing, so the organization is drawn once. In a plain browser, or in a shell that does not announce the capability, both render as before.
14+
- **Removed connection.** `useNativeHostRouting` listens for `objectstack-native:connectionRemoved` while the bridge is present and calls `event.waitUntil()` with the promise its new optional `onConnectionRemoved` returns. Omitted, the promise is already resolved, so the shell is released at once. No Console path registers a device push token yet, so there is nothing to unregister today. The option is where that unregister step goes once registration exists.
15+
16+
`@object-ui/mobile` adds `showConnectionSwitcher` to `NativeHostMethod` and, as an optional method (an older shell does not carry it), to `ObjectStackNative`, and exports `nativeShowConnectionSwitcher()`, `nativeHostCan(host, method)` (the wrappers' own feature-detect), `NATIVE_CONNECTION_REMOVED_EVENT` and the `NativeConnectionRemovedEvent` type. `@object-ui/app-shell` now depends on `@object-ui/mobile`.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/objectql': patch
3+
'@objectstack/spec': patch
4+
---
5+
6+
feat(objectql): a `referenceNameVisible` lookup or user field names the record it points at on `$expand` when the reader may not read that record
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
`FieldSchema.referenceNameVisible` was declared ahead of its runtime. It is now served on the expanded read:
12+
13+
- **What a refused reader gets.** On `$expand` of a `lookup` or `user` field that declares `referenceNameVisible: true`, a target the reader is refused (the target object's read gate, its required permissions or its row scope) answers `{ id, name, readRefused: true }` in place of the bare id it answered before. `id` is the id the record holds; `name` is the target's display name as ADR-0079 resolves it (`nameField`, then `displayNameField`, then the derived title, with the floor `Record #` and the id). `readRefused: true` tells a renderer to show the name as text with no link. A `multiple: true` field is answered per element.
14+
- **Nothing else of the target.** The name is read by the engine from exactly the target's id and its name field. The `$expand` request's projection, nested expand, filter and order are never applied to that read, and the field's `displayField` does not change the column it reads.
15+
- **Field-level rules on the name field still hold.** When the reader's field-level security keeps the name field from it, the field declares a `maskingRule`, or the name is a formula reading through another reference, the name served is the `Record #` floor with the id.
16+
- **Unchanged.** A target the reader can read is expanded exactly as before. An id no record has, a record of another organization, and every field without the key keep the bare id. An unexpanded read still answers the stored id for every reader. The same key covers `sys_user` names through a `user` field or a lookup to `sys_user`.
17+
18+
The key's `.describe()` drops its planned marker and the liveness ledger records it as live.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the `resolveSearchFieldResolution` docblock says a declared search column whose type can never hold a string is admitted to the set but contributes no clause
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The declared-branch text on `resolveSearchFieldResolution` (`@objectstack/spec`, shipped in its `.d.ts`) still said a `json` column declared in `searchableFields` is "a scan that CAN match". The `$search` expansion in `@objectstack/objectql` gives such a column no clause: its declared type can never hold a string, which is the text-operator door's `door-refusal` verdict (`textOperatorDoorVerdict`). The docblock now says so:
11+
12+
- a declared `json` column (or any numeric, boolean, date or time, or structured-JSON column) is still admitted to the set, but contributes no clause;
13+
- a set made only of such columns answers no rows, never an error;
14+
- a declared single-valued `lookup` column still matches by substring over the stored foreign key;
15+
- only an entry that names no column at all is dropped, as before.
16+
17+
Comment-only: no behaviour, schema or accepted value moves.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/runtime': patch
3+
---
4+
5+
Clause-②: no (message text only)
6+
Metadata-protocol: none
7+
8+
fix(runtime): the read-only package refusals name the paired `.custom` route, not the closed package-less save (#29568)
9+
10+
- **Before.** Every `422 WRITABLE_PACKAGE_REQUIRED` from the `/packages` doors (delete, disable, publish, revert, adopt-orphans, the manifest edit, an install with `overwrite`) and the `422 DUPLICATE_SOURCE_NOT_A_BASE` from the duplicate door ended with "customise what this package provides beside it, as environment-level state (ADR-0131 D6): save an item under its own name". That save, made with no `?package`, onto an item the package ships, is refused `403 NOT_OVERRIDABLE` since ADR-0146 D11, so the refusal sent the caller into a second refusal.
11+
- **Now.** The sentence names the ADR-0146 route: `POST /api/v1/packages/<id>/ensure-customization`, then save the item into `<id>.custom` (`?package=<id>.custom`), declaring `overrides: { package: '<id>', basedOn }` to replace an item the package ships. It also says that a type that takes no override, or a locked item, is refused naming its route or the lock, and that a package that cannot have a pair (no namespace, for example) is refused at the ensure door with the reason.
12+
- **Unchanged.** The status, the `code`, the `details`, which doors refuse and in what order. Only the message text changed. A client that reads `code` sees no difference.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@object-ui/app-shell": patch
3+
---
4+
5+
Clause-②: no
6+
Metadata-protocol: none
7+
8+
Studio now reads an open system-scope (kernel) package as the server judges it: read-only, with the read-only chip
9+
and Customize into its paired customization package, as for a code-booted package. It used to open such a package
10+
editable, because the switcher's list leaves kernel packages out and the surface took that absence for "no verdict",
11+
so every edit was refused on save. The switcher still does not offer kernel packages.

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

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,29 @@ The package is registered as code and stays the authority. Its install is
106106
recorded on the runtime host, so it is registered again at every boot, and a
107107
later version is installed over it.
108108

109-
**Nothing it ships is edited in place.** What a customer changes lives beside
110-
the package, as environment-level state:
111-
112-
- a `view`, `dashboard`, `report`, `translation` or `email_template` is
113-
overlaid by saving one under the same name, and removing the overlay brings
114-
the package's own back;
115-
- a flow is switched off, or cloned under a new name and changed there;
116-
- a save onto any other item the package ships is refused, and the refusal
117-
names the route its type has.
109+
**Nothing it ships is edited in place.** What a customer changes is an item of
110+
the package's paired `<package id>.custom` package
111+
([how](/docs/concepts/metadata-lifecycle#customizing-an-installed-package-the-paired-custom-override-adr-0146)).
112+
`POST /api/v1/packages/<package id>/ensure-customization` creates the pair, or
113+
answers it when it already exists, and a save naming it
114+
(`?package=<package id>.custom`) lands there:
115+
116+
- an item the package ships, of a type that takes an override (a `view`,
117+
`dashboard`, `flow` and the other types ADR-0146 lists), is replaced by
118+
saving one of the same name into the pair that declares
119+
`overrides: { package: '<package id>', basedOn }`, and removing it from the
120+
pair brings the package's own back;
121+
- a new item is saved into the pair under its own name;
122+
- a flow can also be switched off;
123+
- a type that takes no override (an `action` for now, a permission set, a
124+
position, a capability, or a code-only type such as a hook) is refused, and
125+
the refusal names the route its type has, such as a new item under a new
126+
name.
127+
128+
A save naming no package onto an item the package ships is refused with
129+
`403 NOT_OVERRIDABLE`, naming the pair. A package the ensure door cannot pair,
130+
for example one whose manifest declares no `namespace`, is refused there with
131+
the reason.
118132

119133
**The vendor's protection locks hold.** A package locks an item in either
120134
[ADR-0010](https://github.com/objectstack-ai/objectstack/blob/main/docs/adr/0010-metadata-protection-model.md)

‎content/docs/references/data/field.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const result = CurrencyConfigSchema.parse(data);
7878
| **reference** | `string` | optional | Target object name (snake_case) for lookup/master_detail fields. Required for relationship types. Used by $expand to resolve foreign key IDs into full objects. Never a stored-metadata table (`sys_metadata`, `sys_metadata_history`): their rows are served only through the metadata API, so the engine never hydrates a reference into one, and `os validate`, `os build` and the object save door refuse it. On a `tree` field it is optional and, if given, must be the declaring object's own name — the object schema refuses any other target, and writes the own name when it is left out. |
7979
| **referenceVia** | `string` | optional | Declares this text field as the id half of a polymorphic pointer pair (ADR-0052 §5 ActivityPointer): the value is a record id of the object named by the SIBLING FIELD this key names — e.g. `record_id` with `referenceVia: 'object_name'`. The sibling must be a declared field on the same object holding an object machine name. Text fields only; mutually exclusive with `reference` (a static and a per-record target contradict). Enforced today at seed load: the value resolves as a natural key against the object the sibling column names, and an unresolvable pointer is refused loudly instead of stored verbatim. Adds no referential integrity or $expand behavior. |
8080
| **referenceDeletedWhen** | `{ field: string; value: string }` | optional | Marks the record a `referenceVia` pointer names as PLATFORM-DELETED on rows where a sibling `select` field holds one declared option — e.g. `record_id` with `{ field: 'cancel_reason', value: 'record_deleted' }`. A renderer then draws a tombstone from that option's own label, reads nothing and links nothing. Valid only beside `referenceVia`; `field` must be a single-value `select` on the same object declaring inline `options`, and `value` one of its option values — any other shape is refused at parse. |
81-
| **referenceNameVisible** | `boolean` | optional | [PLANNED — not yet served] Declared name exposure (`lookup` and `user` fields only). TRUE declares that a principal who can read the record carrying this field may see the referenced record's display name (the target object's `nameField` value) and id even when that principal cannot read the referenced record. Nothing else of the target: `$expand` on this field returns the same name and id only, the field's `displayField` does not widen it, and the name renders as text with no link to the target. Absent or false keeps the restricted-reference posture for a target the reader cannot read. Declared on the referencing field only; there is no target-object switch. Refused on any other type. Declared ahead of its producer (ADR-0049): no runtime serves the name yet, so setting it changes no read today. |
81+
| **referenceNameVisible** | `boolean` | optional | Declared name exposure (`lookup` and `user` fields only). TRUE declares that a principal who can read the record carrying this field may see the referenced record's display name (the target object's `nameField` value) and id even when that principal cannot read the referenced record. Served on `$expand`: a target the reader is refused (the object's read gate or its row scope) answers `{ id, name, readRefused: true }`, per element on a multi-value field; an unexpanded read answers the stored id, as for every reader. Nothing else of the target: `$expand` on this field returns the same name and id only, the field's `displayField` does not widen it, and the name renders as text with no link to the target. A field-level rule on the name field still holds: when the reader may not read that field, it is masked, or it is a formula reading through another reference, the name is the `Record #` floor with the id. A principal who can read the target is served exactly what it is served without the key. Absent or false keeps the restricted-reference posture for a target the reader cannot read. Declared on the referencing field only; there is no target-object switch. Refused on any other type. |
8282
| **mailAssociation** | `boolean` | optional | Inbound mail association (`email` fields only): TRUE marks this field as identifying a correspondent. When a mailbox service ingests a message, it associates the message with every record of this object whose value in this field equals one of the message's participant addresses (From, Sender, Reply-To, To and Cc, plus those of a forwarded message it carries; ASCII case-insensitive; the receiving mailbox's own addresses excluded; only within the mailbox's organization). A message no record matches waits in the mailbox's unassociated pool. Refused on any other type. Takes effect only where a mailbox service is composed. |
8383
| **deleteBehavior** | `Enum<'set_null' \| 'cascade' \| 'restrict'>` | optional (default: `"set_null"`) | What happens if referenced record is deleted |
8484
| **inlineEdit** | `boolean \| Enum<'grid' \| 'form'>` | optional | Edit these child records inline within the parent's form (atomic master-detail). true = auto-pick grid/form by child shape; 'grid' = editable line-item grid; 'form' = list + per-row full form. |

0 commit comments

Comments
 (0)