Skip to content

Commit 571c0eb

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-t0oa5x
2 parents 03269aa + 8ca9dd7 commit 571c0eb

119 files changed

Lines changed: 5804 additions & 518 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+
'@objectstack/spec': minor
3+
---
4+
5+
feat(spec): the customizations read's `contributions` declares a `nav` kind, with an entry shape per kind
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: added
9+
10+
`GET /packages/:id/customizations` names the package behind each item another installed package contributes to a base (ADR-0029 D7 as amended by ADR-0146 D3). `GetPackageCustomizationsResponseSchema.contributions` now declares a third kind: the navigation items another package's `navigationContributions` add to an app the base owns.
11+
12+
- **The entry shape is per kind.** A `field` or `flow` entry is `{ kind, object, name, packageId }` and accepts exactly what it accepted before. A `nav` entry is `{ kind: 'nav', app, group?, name, packageId }`: the base-owned app, the group the contribution targets when it targets one, the nav item's id, and the contributing package. Each shape is strict, so a `nav` entry carrying `object`, or a `field` entry carrying `app`, is refused.
13+
- **Order.** The `field` and `flow` entries come first, in the order they had before. The `nav` entries follow, by app, group (an entry with no group first), name and package. `counts.contributions` still counts items.
14+
- **Not served yet.** The runtime lists no `nav` entry yet. The kind is declared ahead of its producer, and its describe opens `[PLANNED — not yet served]`. No nav item gains a key: the served app's `navigation` stays as declared.
15+
16+
TypeScript code that reads `object` from a `contributions` entry now narrows on `kind` first (`entry.kind !== 'nav'`), because a `nav` entry has no `object`.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/service-automation': patch
4+
'@objectstack/runtime': patch
5+
---
6+
7+
feat(automation): an `oauth2` connector instance with `clientSource: 'installer'` connects with the OAuth client its administrator entered, and uses it for every exchange and refresh
8+
9+
Clause-②: yes (narrowing)
10+
Metadata-protocol: none
11+
Ruling-ref: 6566728470
12+
13+
<!-- adr-0087: not-required (no-migration-prescription) No metadata key, schema, accepted value, stored row, export or error code is removed or renamed: the begin leg of the connector connection door now refuses, with the existing 400 VALIDATION_ERROR, a request body it used to drop unread, so nothing stored changes and there is nothing for objectstack migrate meta to rewrite, and the two contract types only gain OPTIONAL members no existing caller has to send. -->
14+
15+
**BREAKING** for three call shapes only, each of which used to be answered as if its extra input were absent and now answers `400 VALIDATION_ERROR` with nothing connected, read or revoked: a `POST /api/v1/automation/connectors/NAME/connection` whose JSON body carries a key other than `clientId` and `clientSecret`; the same begin carrying a client for an instance that does not declare `clientSource: 'installer'`; and an in-process `getConnectorConnection` or `revokeConnectorConnection` call whose request carries `client`. What to do: nothing, unless a caller sends a body to that begin leg. Send none (or `{}`) for an instance that declares its client or leaves it to MCP dynamic registration, and send only `clientId` and `clientSecret` for one that takes the installer's.
16+
17+
An `authorization_code` instance that declares `clientSource: 'installer'` names no client in its definition. Its administrator registers a client with the vendor against this deployment's redirect URI and hands it to the connect door:
18+
19+
```http
20+
POST /api/v1/automation/connectors/esign/connection
21+
{ "clientId": "CLIENT_ID", "clientSecret": "CLIENT_SECRET" }
22+
```
23+
24+
- **What it does.** The authorization request, the code exchange and every refresh of that connection go out as the administrator's client. Each organization's connection keeps its own client, and a reconnect replaces it. On `provider: 'mcp'` over http the MCP authorization flow still discovers the endpoints, and registers nothing.
25+
- **Where the client is kept.** In the connection record's encrypted client column, the one that keeps a dynamically registered client. The id alone is also kept in plain text, so the connection's read shows `client: { source: 'installer', clientId, hasSecret }`. The secret is never answered back, logged or written to metadata.
26+
- **What it refuses (400 `VALIDATION_ERROR`).** A connect of such an instance with no client: the message names the instance and the vendor registration step, with the redirect URI to register. A client offered to an instance that declares its own client or leaves it to dynamic registration, which used to be ignored. A body key other than `clientId` and `clientSecret` on the begin leg, which used to be ignored too. A client on the read or revoke leg. No refusal repeats a value the caller sent.
27+
- **Contracts.** `ConnectorConnectionRequest` gains an optional `client`, and `ConnectorConnectionState` an optional `client`.
28+
- **Unchanged.** An instance that declares its `clientId`, or leaves its client to MCP dynamic registration, connects, exchanges and refreshes exactly as before, and a begin with no body is still a begin with no client.
29+
30+
The `clientSource` key no longer carries `[PLANNED — not enforced]`, and the liveness ledger's `connector/auth` row no longer calls it planned.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
'@objectstack/metadata-protocol': minor
3+
'@objectstack/metadata-core': minor
4+
'@objectstack/service-automation': patch
5+
---
6+
7+
**BREAKING** fix(metadata)!: a flow whose loop is not closed by a `type: 'back'` edge is refused at publish, and its draft read says so, instead of publishing and then never registering
8+
9+
Clause-②: no (narrowing)
10+
Metadata-protocol: narrowed
11+
Skills-docs: none — `skills/objectstack-automation/references/state-machines-and-approvals.md` teaches that the resubmit edge MUST be typed `'back'` and that `registerFlow` rejects an unmarked cycle; both stay true, and the publish door now refuses the same flow earlier, in the same words.
12+
13+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped. The publish doors now refuse a flow body the automation engine already refused to register, with the engine's own sentence, so a published body that could never run has nothing a migration could rewrite it to: the author's fix is the one the refusal names. -->
14+
15+
**BREAKING** accept-set narrowing at the runtime authoring gate (`@objectstack/metadata-protocol`), which the metadata draft read and every publish door run (`PUT /api/v1/meta/:type/:name` live, `POST …/publish`, `POST /api/v1/packages/:id/publish-drafts`).
16+
17+
- **Before.** A flow whose top-level graph had a cycle with no edge typed `back` (ADR-0044) saved as a draft, its draft read answered `_diagnostics: { valid: true }`, and it published (`outcome: 'published'`). The automation engine then refused to register it ("Flow contains a cycle: push → check → revise → push. …"), so the flow never ran, and only the by-name read's `registration` and a boot-log warning said why.
18+
- **Now.** The draft still saves (drafts are never gated). Its read answers `valid: false` with an error coded `flow-undeclared-cycle` on the cycle-closing edge (`edges.N`), and every publish door refuses it `422 INVALID_METADATA` with that finding; a package publish refuses the batch (`outcome: 'refused'`). The message is the engine's registration refusal, word for word.
19+
- **One judge.** The cycle walk moved from `@objectstack/service-automation` to `@objectstack/metadata-core` as `findUndeclaredFlowCycle` (with `undeclaredFlowCycleMessage`). The engine's registration and the publish gate both call it, so they refuse exactly the same graphs; the engine's behaviour and message are unchanged. `@objectstack/metadata-core/testing` exports `FLOW_CYCLE_CORPUS`, the case table both faces are tested against.
20+
- **Unchanged.** A cycle with any of its edges typed `back` publishes and registers, as before. Cycles inside a `loop` / `parallel` / `try_catch` region are judged where they were. `os validate` and `os build` do not run this check yet.
21+
22+
**The remedy.** None for a flow that registers today: it publishes exactly as before. A flow this now refuses was already refused by the engine at registration and never ran; the refusal names the closing edge, and ADR-0044's `type: 'back'` on that edge is how an intended loop is declared. A stored flow published before this change is re-registered exactly as before (still refused by the engine).
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@objectstack/plugin-security': patch
3+
'@objectstack/core': patch
4+
---
5+
6+
fix(plugin-security): a permission set holding View All / Modify All on an object reads and edits every field of it, so an app's field mask no longer hides fields from platform admins
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
An app permission set could not withhold a platform object's fields from its own members without withholding them from platform admins too. Field permissions merge most-permissively, but only sets that declare a field entry voted. `admin_full_access` grants every object through its `'*'` super-user bits and declares no field entries, so it cast no vote, and an app set's `readable: false` hid the field from any admin who also held the app set. Lists dropped the columns, sorting or filtering on them was refused 403, and Setup screens rendered them empty.
12+
13+
Now, per ADR-0066 D2 ⑧ as amended (ruling of record 6573563853), a set that holds the super-user bypass on an object votes on every field of that object in the field merge:
14+
15+
- **`viewAllRecords` votes `readable: true`.** It never grants an edit.
16+
- **`modifyAllRecords` votes `readable: true` and `editable: true`.**
17+
- **Who counts as holding it is the row-level answer.** It is the same rule `PermissionEvaluator.superuserBypassSets` applies: the set's own entry for the object if it has one, otherwise its `'*'` wildcard. The field merge and the row bypass now read it through one function, `holdsSuperuserBypass` (`@objectstack/core`).
18+
- **Every reader agrees.** That covers list projection, record read, the sort and filter gate, the field-level write gate, `GET /auth/me/permissions` (`fields`) and `POST /security/explain`.
19+
- **Union without deny is otherwise unchanged.** A caller who holds the app set and no super-user set on the object is still masked. A field's `requiredPermissions` capability gate still applies to everyone.
20+
21+
**What to check after upgrading.** A permission set that holds `viewAllRecords` or `modifyAllRecords` on an object and also declares `readable: false` (or `editable: false`) on that object's fields no longer hides those fields from its own holders. To keep a field from someone, grant them the object without View All / Modify All and withhold the field there.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/driver-sql': patch
4+
'@objectstack/metadata-core': patch
5+
---
6+
7+
feat(spec): a lookup can declare that its target's name is visible to every reader of the record (`referenceNameVisible`)
8+
9+
Clause-②: yes (widening)
10+
Metadata-protocol: added
11+
12+
`FieldSchema` declares one optional boolean, `referenceNameVisible`, on `lookup` and `user` fields. `true` declares that a principal who can read the record carrying the field may see the referenced record's display name (the target object's `nameField` value) and its id, even when that principal cannot read the referenced record. Nothing else of the target is exposed: `$expand` on the 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. The same key covers `sys_user` targets. It is declared on the referencing field only, so each application decides whose names its own pages reveal; there is no target-object switch.
13+
14+
Absent or `false` keeps the current posture: a lookup whose target the reader cannot read shows no name. The key is refused at parse on any other field type, `master_detail` included, and an authored `false` off-type is refused too.
15+
16+
This is the contract half. No runtime serves the name yet, so the describe carries the `[PLANNED — not yet served]` marker and setting the key changes no read today. The server read and `$expand` branch and the console's text-only rendering follow in later changes. Nothing to do for existing metadata.
17+
18+
`@objectstack/driver-sql` and `@objectstack/metadata-core` classify the new key in their closed `FieldSchema` key tables (a presentation key that names no field), so the built-in column collision warning and the field-level-security projection keep covering every key.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/lint': patch
3+
'@objectstack/metadata-protocol': patch
4+
---
5+
6+
Clause-②: no
7+
Metadata-protocol: none
8+
9+
A form view whose section names a field its object does not have, or a field group the object does not declare, now hears about it when it is saved and published, not only on a later read.
10+
11+
- `validateFormLayout` runs at the runtime publish gate for `view` writes (`runtimeTypes: ['view']`). An active save and a publish of such a view answer `form-field-unknown` / `form-section-group-unknown` in the response's `advisories`, with the lint's own message and hint. They are warnings: the write lands, nothing is refused. A draft save still runs no authoring rule; its read carries the warnings.
12+
- The rule now also reads a stored form item's `config` (`{ name, object, viewKind: 'form', config }`, the shape Studio saves), so a Studio-authored form is judged on save, on publish and by `os validate` / `os build` / `os lint` alike, at `config.sections…` paths. A list item's `config` is not walked.
13+
- The `/meta` view read now carries `form-section-group-unknown` in `_diagnostics.warnings` beside `form-field-unknown`, with the same message the lint prints. `valid` stays the schema's answer.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/lint': patch
3+
---
4+
5+
feat(lint): `connector-credential-literal` — `os validate`, `os build`, `os lint` and the connector save door warn on a credential-shaped literal in a connector's header or env map
6+
7+
Clause-②: yes (widening)
8+
Three new exports on the `@objectstack/lint` entry and a new advisory on the connector save door; nothing is refused or narrowed.
9+
Metadata-protocol: none
10+
11+
A declarative connector entry's four maps — `providerConfig.headers`, `providerConfig.defaultHeaders`, `providerConfig.transport.headers` and `providerConfig.transport.env` — are withheld whole on the metadata read path, but a literal credential in one of them is still stored in metadata. The same `credential-literal` predicate the `flow-credential-literal` advisory asks now judges those four maps and names each credential-shaped entry by its position (never its value), with the `auth.credentialRef` route:
12+
13+
- a header entry: move it to the connector's `auth: { type: 'bearer' | 'api-key' | 'basic', credentialRef }`, which the `rest` provider and an `mcp` http transport send themselves;
14+
- a stdio `transport.env` entry: a stdio MCP server takes no `auth`, so the warning says `auth.credentialRef` reaches the server only over an http transport.
15+
16+
Always a `warning`; nothing is refused and every save lands. The rule runs on all three CLI commands and on the runtime publish gate for `connector` (`PUT /meta/connector/:name`), where it rides the save response's `advisories`. `os explain connector-credential-literal` carries the reasoning.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/plugin-form': patch
3+
---
4+
5+
fix(plugin-form): an edit `ObjectForm` in its default layout whose record does not exist shows the record not-found state instead of an empty editable form
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`DataSource.findOne` answers `null` for a record that does not exist (the ObjectStack adapter maps the server's 404 to it). The default `object-form` layout seeded its form from that answer, so editing a deleted or unknown record opened a blank form with an enabled Update button, and the 404 surfaced only after submit. It now draws the record not-found state ("Record not found", the same copy the record page and the modal, drawer, tabbed and wizard forms show) with no fields and no submit, both on the first read and when a background re-read finds the record deleted. Create, and an edit of a record that exists, are unchanged.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
fix(metadata-protocol): the by-id OCC comparison hands a row absent from the caller's read to the write door
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`updateData` and `deleteData` compare a caller's version token (`If-Match`, or `expectedVersion`) before the write is authorized. On a mismatch they re-read the row as the caller. When that read returns no row, the comparison is now dropped and the request goes on to the write, whose door answers it: the answer the request gets without a token, and the answer a token on an id naming no row gets. This restores the governing text for the write doors (ruling of record 5985885287).
11+
12+
- **Unchanged:** a row the caller reads still answers `409 CONCURRENT_UPDATE` with that row as `currentRecord`, including a row the caller reads but may not write. A caller read that throws — a refusal or a fault — propagates as raised, as before. A matching token, or none, reads nothing more than before.
13+
- **The write door's answers for a row absent from the caller's read:** a caller who may not update or delete the object gets that refusal (`403`); a caller who may write the object gets `404 RECORD_NOT_FOUND`, as for an id naming no row.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
fix(app-shell): inside a package's second app, the sidebar and the `nav:menu` block link into that app
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`/apps/SEGMENT` opens a package's first app when SEGMENT is the package id, and a package can ship more than one app. The sidebar built every entry link, and the route its area election reads, on the package id, so inside a package's second app a click on any entry opened the first app. The `nav:menu` page block built its links the same way. Both now build on the app's one address among the metadata app list (`appAddressSegment`, the address the app page resolves its own links with): the package id when it reaches the app, else the app's name. A package's first or only app keeps its package-id links unchanged.

0 commit comments

Comments
 (0)