Skip to content

Commit 8598c1d

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-wlvkf3
2 parents 2a1630d + f02f4f6 commit 8598c1d

182 files changed

Lines changed: 1733 additions & 124 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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/core': patch
3+
'@objectstack/spec': patch
4+
'@objectstack/cloud-connection': patch
5+
---
6+
7+
fix(core): a composed artifact whose packages depend on each other in a cycle is refused as `422 CYCLIC_ARTIFACT_PACKAGES` naming the cycle, and install-local answers every artifact-resolver refusal instead of a 500
8+
9+
Clause-②: yes (widening)
10+
Metadata-protocol: none
11+
12+
- `@objectstack/core`: `resolveArtifactPackageEntries` / `resolveArtifactPackageOrder` refuse packages that depend on each other in a cycle with the ADR-0112 envelope their other refusals carry: `code: 'CYCLIC_ARTIFACT_PACKAGES'`, `status: 422`, and `details.cycle` listing the package ids along the cycle (each depends on the next, the first repeated last). Before, the cycle was a bare `Error` with no `code` or `status`. A caller that matched on the old message still finds `Circular dependency detected` in it. `resolvePluginOrder` now throws its cycle as `PluginOrderCycleError`, a new exported `Error` subclass that carries `cycle`. Its message is unchanged and it carries no `code`, so a kernel boot that hits a plugin cycle reads exactly as before.
13+
- `@objectstack/spec`: `CYCLIC_ARTIFACT_PACKAGES` is registered in `ERROR_CODE_LEDGER` under `@objectstack/core`, so `ErrorCode` accepts it.
14+
- `@objectstack/cloud-connection`: `POST /api/v1/marketplace/install-local` answered `500 INTERNAL_ERROR` with no reason for a composed artifact the resolver refuses: a `packages` that is not a list, a malformed entry, a duplicate package id, or a dependency cycle. On a real runtime, the step that judges the package's jobs and hooks reads the packages first and let the refusal escape. That step now answers the refusal itself, with its own status, code and `details`, and nothing is written. Every other step that reads the packages already did.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/plugin-sharing': patch
4+
'@objectstack/plugin-hono-server': patch
5+
'@objectstack/client': patch
6+
'@object-ui/permissions': patch
7+
'@object-ui/plugin-list': patch
8+
---
9+
10+
feat: the list toolbar offers the "In a queue" toggle only on objects that actually use queues
11+
12+
Clause-②: yes (widening)
13+
Metadata-protocol: added
14+
15+
Until now the toggle appeared on every list of an object with a user owner as soon as the organization had a single queue, although on most of those objects no record ever sits in a queue, so it could only return an empty list. It now appears only on an object where a queue can hold something:
16+
17+
- a record of the object sits in a queue now (no owner, a queue set), or
18+
- an active assignment rule routes the object's new records into a queue: one of the organization's own rules, or a rule an installed package declares that is not switched off.
19+
20+
Nothing is authored for this. The server works it out from the rules and the records.
21+
22+
`GET /auth/me/permissions` carries the answer as a new field beside `hasAnyQueue`: `objectsUsingQueues`, a list of object names, declared in `MePermissionsAuthenticatedResponseSchema`. It names only objects the caller may read, and never a queue name or a count. It is empty when the organization has no queue, when no ownership-queue service is registered, and on the closed body. The ownership-queue service contract gains the optional method `objectsUsingQueues(organizationId)`, implemented by `@objectstack/plugin-sharing`. The method checks each owned object for one sitting record (`limit 1`) and reads the routing rules once. The route asks only when `hasAnyQueue` is true, so an organization with no queue pays nothing extra.
23+
24+
**Migration.** `objectsUsingQueues` is required on the strict `MePermissionsAuthenticatedResponseSchema`. Code that builds a `MePermissionsAuthenticatedResponse` (a test fixture, a stub server) adds `objectsUsingQueues: []` beside `hasAnyQueue`. Code that parses a body from a server older than this release with the schema gets a parse failure for the missing key: parse with `.partial({ objectsUsingQueues: true })` or default it to `[]` until the server is upgraded. The console does not parse; it reads the field and treats its absence as "no object".
25+
26+
The console reads the field from the payload it already loads once per session. A record that starts sitting in a queue on an object not listed yet shows the toggle from the next time the permissions are read. An answer without the field is treated as "no", the same way an unknown `hasAnyQueue` is.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/lint': patch
3+
---
4+
5+
fix(lint): the line-items and association inline-edit advisories read every inline-edit mode, not only `inlineEdit: true`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`inlineEdit` on a relationship field accepts `true`, `'grid'` and `'form'`, and the platform edits the child inline in all three. Two `os lint` advisories read only `true`:
11+
12+
- `relationship/line-items-inline-edit` told a `*_line` / `*_item` child whose `master_detail` already declares `inlineEdit: 'grid'` or `'form'` to "consider inlineEdit: true", offering a fix that would replace the mode the author chose. It is now silent for any of the three values and suggests inline editing only when `inlineEdit` is absent or `false`.
13+
- `relationship/association-inline-edit` warned an association child (comments, audit, activity) only for `inlineEdit: true`. It now warns for `'grid'` and `'form'` too, which clutter the parent's entry form the same way.
14+
15+
Rule ids, severities and messages are unchanged. Nothing is refused; both rules stay advisories.

‎content/docs/automation/queues-and-assignment-rules.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ The moment someone claims it, the queue path stops applying: the other members l
119119

120120
In the Console, a list of an object that carries the `queue` column has an **In a queue** toggle in its toolbar when your organization has at least one queue and the view's own filter does not require `owner_id` to hold a value (a top-level `equals`, `in` or `is_not_empty` condition on it, such as a "my records" view; one inside an OR group does not count), since a parked record has no owner. It narrows the list to parked records (`owner_id` empty and `queue` set); which of them you see is still the server's read filter, so a member sees what sits in their own queues.
121121

122+
The toggle appears only where it can find something: on an object where a record of your organization sits in a queue now, or where an active assignment rule (the organization's own or a package's) routes new records into a queue. Nothing is declared for this; the server works it out and the Console reads it once per session from `GET /api/v1/auth/me/permissions` (`objectsUsingQueues`, which names only objects you may read). So the toggle on an object whose first record was just parked by hand appears from the next time the Console loads your permissions, for example after signing in again or reloading the page.
123+
122124
## How a claim is spelled
123125

124126
A **claim** is an ordinary update of `owner_id` to your own user id, by record id:

‎content/docs/references/api/auth.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ const result = AuthProvider.parse(data);
9797
| **systemPermissions** | `string[]` | optional | The effective system capabilities (ADR-0066). Absent only on the degraded body, where it means unknown; an empty array means none. |
9898
| **tabPermissions** | `Record<string, Enum<'visible' \| 'hidden' \| 'default_on' \| 'default_off'>>` | optional | The effective app tab visibilities, keyed by app name. Absent only on the degraded body. |
9999
| **hasAnyQueue** | `boolean` | ✅ | Whether the caller's organization has at least one ownership queue: a declared queue the activation ledger has not switched off, or a `sys_queue` row of the organization. Resolved server-side through the ownership-queue service, so a member who may not read `sys_queue` still gets the answer; no names and no counts are disclosed. False when no ownership-queue service is registered, and on the closed body. |
100+
| **objectsUsingQueues** | `string[]` | ✅ | The objects, by name, on which a queue filter can find something in the caller's organization: a record of the object sits in an ownership queue now (no owner, a queue set), or an active assignment rule of the organization or of an installed package routes the object's new records into a queue. Resolved server-side through the ownership-queue service and listed only for objects the caller may read, except on the degraded body, where no object permissions resolved and the list is not narrowed; no queue names and no counts are disclosed. Empty when `hasAnyQueue` is false, for a person outside every organization, for a caller with no active organization on a deployment that walls organizations apart (`isolated` or `group`; under `single` that caller is answered environment-wide), when the ownership-queue service is not registered or cannot answer, and on the closed body. Read once per session, so a record that starts sitting in a queue later shows here from the next read on. |
100101

101102
### Nested Shape: `MePermissionsAuthenticatedResponse.objects[string]`
102103

@@ -160,6 +161,7 @@ This schema accepts one of the following structures:
160161
| **systemPermissions** | `string[]` | optional | The effective system capabilities (ADR-0066). Absent only on the degraded body, where it means unknown; an empty array means none. |
161162
| **tabPermissions** | `Record<string, Enum<'visible' \| 'hidden' \| 'default_on' \| 'default_off'>>` | optional | The effective app tab visibilities, keyed by app name. Absent only on the degraded body. |
162163
| **hasAnyQueue** | `boolean` | ✅ | Whether the caller's organization has at least one ownership queue: a declared queue the activation ledger has not switched off, or a `sys_queue` row of the organization. Resolved server-side through the ownership-queue service, so a member who may not read `sys_queue` still gets the answer; no names and no counts are disclosed. False when no ownership-queue service is registered, and on the closed body. |
164+
| **objectsUsingQueues** | `string[]` | ✅ | The objects, by name, on which a queue filter can find something in the caller's organization: a record of the object sits in an ownership queue now (no owner, a queue set), or an active assignment rule of the organization or of an installed package routes the object's new records into a queue. Resolved server-side through the ownership-queue service and listed only for objects the caller may read, except on the degraded body, where no object permissions resolved and the list is not narrowed; no queue names and no counts are disclosed. Empty when `hasAnyQueue` is false, for a person outside every organization, for a caller with no active organization on a deployment that walls organizations apart (`isolated` or `group`; under `single` that caller is answered environment-wide), when the ownership-queue service is not registered or cannot answer, and on the closed body. Read once per session, so a record that starts sitting in a queue later shows here from the next read on. |
163165

164166
### Nested Shape: `MePermissionsResponse[authenticated=true].objects[string]`
165167

‎content/docs/references/api/automation-api.mdx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ const result = AutomationApiErrorCode.parse(data);
417417

418418
| Property | Type | Required | Description |
419419
| :--- | :--- | :--- | :--- |
420-
| **code** | `Enum<'VALIDATION_ERROR' \| 'INVALID_FIELD' \| 'MISSING_REQUIRED_FIELD' \| 'INVALID_FORMAT' \| 'VALUE_TOO_LONG' \| 'VALUE_TOO_SHORT' \| 'VALUE_OUT_OF_RANGE' \| … +368 more>` | ✅ | The inner refusal's code in its WIRE spelling - the ADR-0112 member a record save of the same write answers in `error.code` (e.g. `UNIQUE_VIOLATION`); the closed set `ApiErrorSchema.code` parses against |
420+
| **code** | `Enum<'VALIDATION_ERROR' \| 'INVALID_FIELD' \| 'MISSING_REQUIRED_FIELD' \| 'INVALID_FORMAT' \| 'VALUE_TOO_LONG' \| 'VALUE_TOO_SHORT' \| 'VALUE_OUT_OF_RANGE' \| … +369 more>` | ✅ | The inner refusal's code in its WIRE spelling - the ADR-0112 member a record save of the same write answers in `error.code` (e.g. `UNIQUE_VIOLATION`); the closed set `ApiErrorSchema.code` parses against |
421421
| **message** | `string` | ✅ | The inner refusal's own diagnostic text, verbatim, without the node and operation prefixes the run's failure text adds |
422422

423423
### Allowed Values: `FlowInnerRefusal.code`
@@ -523,6 +523,7 @@ const result = AutomationApiErrorCode.parse(data);
523523
* `CREATE_FAILED`
524524
* `CREDENTIALS_NAME_DIFFERENT_ACCOUNTS`
525525
* `CUBE_NOT_FOUND`
526+
* `CYCLIC_ARTIFACT_PACKAGES`
526527
* `DATASET_INVALID`
527528
* `DATASOURCE_ADMIN_ERROR`
528529
* `DEFAULT_RECORD_PAGE_CONFLICT`

‎content/docs/references/api/contract.mdx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const result = ApiErrorSchema.parse(data);
2828

2929
| Property | Type | Required | Description |
3030
| :--- | :--- | :--- | :--- |
31-
| **code** | `Enum<'VALIDATION_ERROR' \| 'INVALID_FIELD' \| 'MISSING_REQUIRED_FIELD' \| 'INVALID_FORMAT' \| 'VALUE_TOO_LONG' \| 'VALUE_TOO_SHORT' \| 'VALUE_OUT_OF_RANGE' \| … +368 more>` | ✅ | Error code (e.g. VALIDATION_ERROR; StandardErrorCode ∪ the ledger the serving side registers — ERROR_CODE_LEDGER for framework packages) |
31+
| **code** | `Enum<'VALIDATION_ERROR' \| 'INVALID_FIELD' \| 'MISSING_REQUIRED_FIELD' \| 'INVALID_FORMAT' \| 'VALUE_TOO_LONG' \| 'VALUE_TOO_SHORT' \| 'VALUE_OUT_OF_RANGE' \| … +369 more>` | ✅ | Error code (e.g. VALIDATION_ERROR; StandardErrorCode ∪ the ledger the serving side registers — ERROR_CODE_LEDGER for framework packages) |
3232
| **declaredCode** | `string` | optional | The producer-declared code, verbatim, when it is not a member of the closed `code` vocabulary — the open, author-authored channel (app-specific spellings; ADR-0112) |
3333
| **message** | `string` | ✅ | Readable error message |
3434
| **userMessage** | `string` | optional | Producer-marked user-facing refusal text, verbatim, in the request's locale: platform-composed text falls back to the workspace default locale, then `en`; an app-authored refusal falls back to its declared wording. Present exactly when the producer opted in at throw time; consumers render it to end users as received and keep their generic substitution for anything unmarked. Status-agnostic; never replaces `message`. |
@@ -141,6 +141,7 @@ const result = ApiErrorSchema.parse(data);
141141
* `CREATE_FAILED`
142142
* `CREDENTIALS_NAME_DIFFERENT_ACCOUNTS`
143143
* `CUBE_NOT_FOUND`
144+
* `CYCLIC_ARTIFACT_PACKAGES`
144145
* `DATASET_INVALID`
145146
* `DATASOURCE_ADMIN_ERROR`
146147
* `DEFAULT_RECORD_PAGE_CONFLICT`

‎content/docs/references/api/error-code-ledger.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ const result = ErrorCode.parse(data);
308308
* `CREATE_FAILED`
309309
* `CREDENTIALS_NAME_DIFFERENT_ACCOUNTS`
310310
* `CUBE_NOT_FOUND`
311+
* `CYCLIC_ARTIFACT_PACKAGES`
311312
* `DATASET_INVALID`
312313
* `DATASOURCE_ADMIN_ERROR`
313314
* `DEFAULT_RECORD_PAGE_CONFLICT`

‎packages/client/src/auth-me-permissions.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ describe('[#28709] client.auth.mePermissions over the real /auth/me/permissions
110110
expect(answer.userId).toBe(USER);
111111
expect(answer.tenantId).toBe(ACTIVE_ORG);
112112
expect(answer.hasAnyQueue).toBe(true);
113+
// [#34602] Typed on the client too; this service names no object.
114+
expect(answer.objectsUsingQueues).toEqual([]);
113115
expect(answer.permissionSets).toContain('member_default');
114116
});
115117

‎packages/client/src/index.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5400,7 +5400,8 @@ export class ObjectStackClient {
54005400
* Discriminate on `authenticated`: an anonymous caller RESOLVES
54015401
* `{ authenticated: false }` (the route answers it at 200, so a client can
54025402
* tell "signed out" from a fault), unlike {@link me}, which rejects. The
5403-
* authenticated answer carries `hasAnyQueue` among the rest;
5403+
* authenticated answer carries `hasAnyQueue` and `objectsUsingQueues`
5404+
* among the rest;
54045405
* `systemPermissions` / `tabPermissions` are absent only on a server
54055406
* without SecurityPlugin, where absent means unknown and an empty array
54065407
* means none.

0 commit comments

Comments
 (0)