Skip to content

Commit 7b25d55

Browse files
Merge branch 'main' into claude/project-thread-34376i
2 parents 58e603f + 3693644 commit 7b25d55

138 files changed

Lines changed: 8014 additions & 503 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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/types': patch
3+
'@objectstack/rest': patch
4+
---
5+
6+
fix(types, rest): a package-scoped refusal's `details.candidates` is answered only when every element is a holder
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
`packageScopedRefusalCandidates` (`@objectstack/types`), the one recogniser every door reads for a package-scoped refusal's `details.candidates`, answered the refusal's list as `readonly unknown[]` without looking at its elements, and the rest door cast that to core's `PackageScopedHolder[]`. The recogniser now checks each element against the four holder kinds (`package` with a string `packageId`, `environment`, `platform`, `residual` with a string `ownerId`) and answers the list typed as those holders, so the rest door assigns it without a cast. Every holder core's `PackageScopedNameRefusedError` carries passes, so every answer a framework producer can cause is unchanged.
12+
13+
One corner moves, for a refusal no framework producer throws: a `409 RESOURCE_CONFLICT` of the refusal's shape whose `refusal.candidates` holds an element that is not a holder. FROM `details.candidates` echoing the list as thrown TO no `details.candidates` member, the answer the recogniser already gave a `candidates` that is not an array. It moves on every door that reads the recogniser alike (the `/data` doors, a batch row's error, the `/meta` reads, the resolver's doors), so they keep agreeing. Status, `code` and the sentence are unchanged.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
'@objectstack/lint': minor
3+
---
4+
5+
fix(lint): the flow and hook publish doors accept an unguarded ordering comparison over `created_at` / `updated_at`, the two system columns the platform stamps on every stored row, as `os build` does
6+
7+
Clause-②: yes (widening) — the flow and hook publish doors (Studio, `/api/v1/meta`, the MCP and AI authoring doors) now accept a condition they refused and `os build` accepted: `created_at` or `updated_at` (as the registry injects them, on an object whose storage the platform provisions) read off the current row (bare in a flow, or `record.`) as an operand of `<`, `<=`, `>` or `>=` with no `!= null` guard, in a record-triggered flow or in a hook whose every event is `afterInsert`, `beforeUpdate`, `afterUpdate`, `beforeDelete` or `afterDelete`. Nothing that published before is refused, and no other verdict moves: arithmetic over either column, a `previous.` read, a `beforeInsert` or read-event hook, and the other six injected columns keep their verdicts. `os build`, `os validate`, `os lint` and the MCP `validate_expression` tool are unchanged. No exported type or signature changes.
8+
Metadata-protocol: added
9+
Skills-docs: none owed — no skill teaches that `created_at` or `updated_at` needs a null guard in a flow or hook condition, or that the door refuses one; the door now gives the verdict `os build` already gives on those two columns under an ordering comparison.
10+
11+
**Before:** every runtime publish door hands the authoring rules the objects as the registry serves them, and a served object carries the columns the registry injects as declared fields with `required: false` and no default. The null-guard gate read every one of them as nullable, so the flow and hook publish doors refused `record.created_at > timestamp('2025-01-01T00:00:00Z')` or `record.updated_at > record.created_at` in a record-triggered flow's start condition, edge condition or `decision` branch, or in a hook `condition`, with `422 INVALID_METADATA` (`expression-invalid`), while `os build` and `validate_expression` accepted the same condition.
12+
13+
**Now:** at a runtime publish door the null-guard gate does not report `created_at` or `updated_at` when the column is the platform's own injected definition on an object whose storage the platform provisions, the operand is the current row's column (a record-triggered flow's bare trigger-record name, or `record.created_at` / `record.updated_at`), and the operator is an ordering comparison (`<`, `<=`, `>`, `>=`). The warrant is the stamp: the platform writes both columns on every stored row in its own `beforeInsert` hook (`sys_stamp_audit_insert`, priority 10), so a read of the current row after it is never `null`. A record-triggered flow reads the stored row after it; so does a hook on `afterInsert`, `beforeUpdate`, `afterUpdate`, `beforeDelete` or `afterDelete`. A hook keeps every verdict unless each of its `events` is one of those five.
14+
15+
**Unchanged:**
16+
17+
- A `previous.created_at` / `previous.updated_at` read is judged as before: an insert binds `previous` itself to `null`, so `record.updated_at > previous.updated_at` in an `afterInsert` hook or a create-leg flow is refused, and the message names the full guard (`previous != null && previous.updated_at != null`).
18+
- A hook whose `events` include `beforeInsert` (it can run before the stamp, at any `priority`) or a read event (`beforeFind`, `afterFind`: no record) is judged as before.
19+
- Arithmetic over either column is refused at every door, as before: `record.created_at + 1 > 0` and `record.updated_at - record.created_at > duration('1h')` at a hook, at an action, and in a flow's `record.` spelling (where the null-guard is the door's refusal), and the bare `created_at + 1 > 0` in a flow (where the type verdict is).
20+
- A `created_at` the author declares, and the one on an ADR-0015 `external` object, are judged as before.
21+
- The door still judges six injected columns nullable: `owner_id`, `created_by`, `updated_by`, `owning_business_unit_id` and `queue`, which a stored row can hold `null` in, and `organization_id`, which org scoping stamps on insert.
22+
- On those six, and on a `beforeInsert` or read-event hook's ordering over `created_at` / `updated_at`, the door and `os build` still differ (the build judges no injected column) until #33435 settles their verdict.
23+
- The `object_extension` door, which reads the objects as authored, is unchanged.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
fix(metadata-protocol)!: a seed load for one organization finds a person among that organization's members, by keyset, and judges a person named by an id-shaped value by the same membership rule
6+
7+
Clause-②: no (narrowing) — narrowed: on a load for one organization (the per-organization replay, a reseed, an install into an organization), a person reference (`owner_id`, a `sys_user` lookup) whose value is UUID- or ObjectId-shaped is resolved only when it names a member of that organization, where it was written verbatim, so an id of a person outside the organization linked the row to them. A member's id still resolves to itself, and a load with no organization, a dry run and every other reference target keep an id-shaped value verbatim, as before. Unchanged: the lookup by name or email resolves the same member it did.
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) no key of any schema is added, removed, renamed or re-shaped and no stored row changes shape: what moves is which person an id-shaped seed reference resolves to on a load for one organization, so there is nothing for a migration to rewrite and no tombstone -->
11+
12+
**BREAKING** for a seed that names a person by an id-shaped value (UUID or ObjectId) on a load for one organization, where that person is not a member of the organization. The row is still seeded; the reference stays empty and the load's error says the person is not a member of that organization, exactly as it does for the same person named by name or email. The fix: add the person to the organization, or name a member of it. The seed documentation already teaches a natural key (`name`, `email`) rather than an id, which differs between environments.
13+
14+
What changes:
15+
16+
- **The membership lookup is bounded by the organization.** It reads the load organization's `sys_member` rows in `user_id` order, a page at a time by keyset (`user_id` greater than the last one seen), and asks ONE `sys_user` read per page, constrained to that page's people and the natural key. It no longer reads every same-named person in the deployment, 50 at a time by offset, which cost two reads per 50 organizations per reference value on a hosted deployment where every organization holds the same seeded names, and which could skip the member under a concurrent delete and say "not a member" falsely. An organization smaller than one page (500 members) answers a resolved reference with one membership read and one person read. Whether someone outside the organization answers to the key is one bounded read (`limit: 1`), asked only on a miss, to word the error.
17+
- **An id-shaped person value is judged by membership** on a load for one organization, as an id of any other shape already was.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/plugin-auth': patch
3+
---
4+
5+
fix(auth)!: under direct sign-in's local sign-in path `off`, the last identity provider is the last way in; the door's landings on the sign-in page keep its `?redirect=`
6+
7+
Clause-②: yes (narrowing) — narrowed: with direct sign-in on and its local sign-in path `off` (`directSignIn.localSignIn: 'off'`, or `OS_AUTH_DIRECT_SIGN_IN_LOCAL_PATH=off`), `POST /api/v1/auth/sso/delete-provider` on the last identity provider answers `409 DELETE_RESTRICTED` and deletes nothing while email and password is switched on, where it deleted the row; email and password, and phone sign-in, no longer count as a way in there, because the sign-in page does not offer them. Widened: module exports (not on the package entry) `pageOffersLocalSignIn`, `pageOffersEmailPassword` and `carriedRedirect`, an optional `localSignIn` on `SignInMethodConfigView.features`, and an `asThePageOffers` option on `otherSignInMethods`. The refusal under `off` answers with a new message, the copy key `enterpriseSsoLocalOff`, in all 11 locales.
8+
Metadata-protocol: none
9+
Skills-docs: none — no skill under `skills/**` teaches direct sign-in, the provider delete or the boot report; `content/docs/permissions/sso.mdx` gains the rule in this change.
10+
11+
<!-- adr-0087: not-required (no-migration-prescription) No schema key, accepted value or metadata type is added, removed, renamed or re-shaped. The moved answer is a runtime refusal at one auth door under a deployment switch, so there is nothing stored for a migration to rewrite and no tombstone. -->
12+
13+
**BREAKING** for a deployment running direct sign-in with the local sign-in path `off`: Setup's **Delete SSO Provider** on the last identity provider is refused `409 DELETE_RESTRICTED` (nothing deleted) unless another way in the sign-in page offers remains (another identity provider row, a social or OIDC provider with a client ID and secret, or a host sign-in handoff), even with email and password switched on, and even with phone sign-in switched on. Before, the delete went through and the sign-in page then showed "No sign-in method is available". A boot in that state now reports at error under `no_sign_in_method_at_boot`.
14+
15+
Unchanged: the local sign-in path `hidden` (the default) and direct sign-in off, where email and password and phone sign-in count as before; the server's own password sign-in, which `off` never changed.
16+
17+
What to do: nothing, unless you delete the last identity provider under `off`. Register another identity provider first, or set `OS_AUTH_DIRECT_SIGN_IN_LOCAL_PATH=hidden` (with email and password sign-in on) and restart.
18+
19+
Also fixed: the direct sign-in door hands the identity provider a sign-in page error address that keeps the page's `?redirect=`, and its own landing on the sign-in page (no provider to start, a refused or rate-limited start) keeps it too. A `?redirect=` that is not a same-origin path is dropped, by the return path's own rule.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): an owner, assignee or 负责人 in a request is the injected `owner_id`, never a second same-label field
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
objectstack-data teaches that a request's owner, assignee, 负责人 or 处理人 is the platform's injected `owner_id`, not a second person field beside it. A handler the request names apart from the owner is a `user` field that grants no access, with a label no other visible field carries, the injected `owner_id` (Owner, 负责人), `created_by`, `updated_by`, `created_at` and `updated_at` included. To pay for the text inside the file's token ceiling, SKILL.md drops a ruling date, four ADR asides, two zod pointers that `references/_index.md` already carries, an internal constant name, a sentence restating its heading and a link the Quick Reference list already gives. The Quick-Start Template's support case no longer declares an `assigned_to` user field, and a new eval asks for a ticket app with a 负责人.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
fix(app-shell): a record page offers the reactions column write only where `sys_comment` still declares the column
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A caller refused `sys_comment_reaction` (a permission set with no read on it, or an external user) was offered the reaction control on a record page's discussion, and every click answered `400 INVALID_FIELD`: the page fell back to writing the retired `sys_comment.reactions` column with `PATCH /api/v1/data/sys_comment/ID`, which the server refuses because the column left `sys_comment` in the release that added `sys_comment_reaction`.
11+
12+
The page took that fallback whenever it could not read `sys_comment_reaction`, and a refusal reads the same as an object the deployment does not have: the metadata door answers both as absent. It now tells them apart by `sys_comment`'s own definition, which the caller can read. Where `sys_comment` still declares `reactions` (a framework that predates `sys_comment_reaction`), the column path is used exactly as before. Anywhere else the caller is refused the reaction object: the page offers no reaction control, reads no reactions and sends no reaction request.
13+
14+
- A caller who holds read on `sys_comment_reaction` is unchanged: reactions are that object's records.
15+
- `useObjectPresence` also returns the object's served `definition` when the object is present, so a reader can choose by what the object declares without a second registry read.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
'@objectstack/cloud-connection': patch
3+
'@objectstack/runtime': patch
4+
'@objectstack/objectql': patch
5+
---
6+
7+
fix(cloud-connection, runtime, objectql)!: an install-local uninstall withdraws the package's action handlers and body hooks from the running engine, so a call that names no package is served by the one remaining holder at once instead of after a restart
8+
9+
Clause-②: yes (narrowing) — `ObjectQL#removeActionsByPackage` now hands a key it empties in the slot a call that names no package reads back to the entry another owner still holds under it in its own slot. On `ObjectQL#removePackage`, on the binder's re-bind that drops a package body of a multi-package artifact, and on the authored-action resync's teardown (`removeActionsByPackage('metadata-service')`), the action doors (`POST /api/v1/actions/OBJECT/NAME/ID`, MCP `run_action`) now reach that handed-back entry. Before, they reached the next entry their handler-key rotation held (`OBJECT`, then `global`, then `*`, per handler-key candidate), and answered "not found" only when none was held. The owner gates of the reached entry move with it, so a call that was served can now be refused `403 PERMISSION_DENIED`, `409 ACTION_DISABLED` or `503`. The install-local uninstall the card reports is widening only: a bare call that answered `409 RESOURCE_CONFLICT`, naming the uninstalled package as one of two owners, now answers with the one remaining holder's handler. `@objectstack/runtime` gains the export `unbindAppArtifactHandlers` and the type `AppArtifactHandlerUnbinding`.
10+
Metadata-protocol: none
11+
<!-- adr-0087: not-required (no-migration-prescription) No schema key, accepted value or metadata type is added, removed, renamed or re-shaped, and no stored row changes: what moves is which in-memory handler entry a call that names no package reaches after a live removal, which is the entry a restart already reaches, so there is nothing for `objectstack migrate meta` to rewrite and no tombstone. -->
12+
13+
**BREAKING** for a call that names no package, on a key that `removePackage`, a re-bind that drops a body, or the authored-action resync empties while another owner (host code, a plugin, a package or the environment) still holds a handler under it. The emptied key now resolves to that remaining holder's entry, so the call runs that handler, and that entry's owners' gates (403 / 409 `ACTION_DISABLED` / 503) can answer where the door's rotation used to fall through to a later entry and serve it. This is what a restart of the same process already answers. No data migration or heal is needed: nothing persisted changes. The install-local uninstall the card reports is unaffected, because the uninstalled package's handler stayed bound there and the key never emptied.
14+
15+
**The defect.** `DELETE /api/v1/marketplace/install-local/:manifestId` withdrew the package from the registry and left every handler its install had bound on the engine under `app:<manifestId>`: script-action handlers, body hooks and bundle functions. With two packages each holding an action of one name on one object, a call that names no package kept being refused as ambiguous until the runtime restarted, and the uninstalled package's body hooks kept firing.
16+
17+
**The fix.**
18+
19+
- `@objectstack/runtime`: `unbindAppArtifactHandlers(ql, appId, { logger, source })` is the inverse of `bindAppArtifactHandlers`. It removes the actions, hooks and functions of the package's owner and of every owner the package's last bind on that engine recorded (a multi-package artifact's bodies), releases those owners' bare-name function claims, and forgets the bind record, so a later install binds as a first bind. Another package's handlers, host code and the environment's authored-action handlers are untouched. Jobs keep leaving through the `runtime.package-jobs` uninstall cleanup.
20+
- `@objectstack/cloud-connection`: the uninstall door calls it right after the registry withdrawal, and not when the registry refuses the withdrawal (the package stays loaded then). A runtime that has no such export is warned with the remedy, as the install door already warns for a runtime with no binder.
21+
- `@objectstack/objectql`: `removeActionsByPackage` hands a key back to the owner that still holds a handler for it. Each owner keeps its handler in its own package slot, but the slot a call that names no package runs held only the last registration. Removing that registration emptied the key, so the engine's bare `executeAction` answered "not found" while another owner still held a handler. The key now takes back the entry another coordinate's slot holds: the last coordinate holding the key in the order the slots were created, which is not always the last registration of this key. That choice matters where the bare-call rule runs one owner while others hold the key: host code or a plugin beside one package on an object-bound key, and two shared owners with no package (host code beside a plugin, or two plugins). When the earlier-created slot registered this key last, the hand-back runs the other holder's handler where a restart runs the last registration. While two or more packages still hold the key, the bare call is refused naming them as before.
22+
23+
**Not changed.** `PATCH /api/v1/packages/:id/disable` leaves a disabled package's handlers in place, and the bare-call rule already counts no disabled package as an owner. `DELETE /api/v1/packages/:id` (the protocol's `deletePackage`) does not call this unbind, so it is unchanged.

0 commit comments

Comments
 (0)