Skip to content

Commit 25e5034

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/area-A1-34257
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw
2 parents 518f1d6 + 6aeb665 commit 25e5034

449 files changed

Lines changed: 24450 additions & 24662 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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@objectstack/driver-turso': patch
3+
---
4+
5+
fix(driver-turso): Turso's remote face relaxes a NOT NULL column in place, so a package upgrade that makes a field optional reaches hosted databases
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
On Turso's remote face (`libsql://`, every hosted tenant database), a `relax_not_null` drift entry is now applied. Until now it was skipped with "it needs the SQLite table rebuild, which the Turso REMOTE transport does not run". A package upgrade that declares `storage: { notNull: false }` on a column therefore left the column NOT NULL on a hosted database, and every save that left the field empty failed.
11+
12+
The maintainer ruled how (decision record 6915086281 on #33724): the column is relaxed in place with libSQL's own column statement, `ALTER TABLE t ALTER COLUMN c TO c <definition>`, and no table rebuild runs.
13+
14+
- **Only the NOT NULL clause changes.** The definition sent is the column's own, cut from the table's stored `CREATE TABLE` with only its `[CONSTRAINT name] NOT NULL [ON CONFLICT …]` clause removed. The type, the DEFAULT, and any CHECK, COLLATE, UNIQUE or REFERENCES clause stay byte for byte. No row is copied or revalidated.
15+
- **Applied only on a read-back.** The statement is sent in one `write` batch with a check that the table's stored SQL now reads exactly as planned. If it reads any other way, the batch rolls back. The entry is reported `applied` only when the column then reads back nullable, with the type, the DEFAULT and the primary-key position it had before.
16+
- **A refusal is reported, and nothing falls back.** A statement the database refuses, a stored definition the plan cannot read, or a read-back that differs is reported `skipped`, and the reason is logged. Measured on libSQL (SQLite 3.45.1): libSQL ends the old definition at the first comma after the column's name, so a column whose definition holds a comma (in a DEFAULT, a CHECK, a type width such as `NUMERIC(10, 2)`, or a comment) is refused that way, and a real `sqld` 0.24.33 refuses it the same way. It keeps its NOT NULL, the table is left byte-identical, and the logged reason says the definition holds a comma. The maintainer accepted this limit (decision record 6922037129 on #33724): no table rebuild is added for such a column. Columns this face creates are `TEXT`, `INTEGER` or `REAL` with no DEFAULT and no width, so they are never in it.
17+
18+
The same three acts reach the relax as before: a managed install or upgrade of a package that declares `storage: { notNull: false }` on the column, the publish of an environment-authored object, and `os migrate apply`. A boot still never alters a column (ADR-0113 D5). On the remote face, `TursoDriver.applyMigrationEntries` now applies a `relax_not_null` entry, and `TursoDriver.driftApplyLimit('relax_not_null')` answers `null` where it answered the table-rebuild sentence. So `os migrate plan` and the apply's listing show a relax on a remote database with no transport limit, and count one fewer change they cannot apply.
19+
20+
A tightened NOT NULL, a dropped DEFAULT, and the type and width entries keep their answer on this face: skipped, because they need the table rebuild. The statement does not revalidate existing rows, so it is never used to tighten. A local SQLite file keeps the existing table rebuild for every column entry.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/lint': patch
3+
---
4+
5+
docs(lint)!: `os explain approval-approvers-may-resolve-empty` names SCIM as a route that populates `sys_user.manager_id`
6+
7+
Clause-②: yes (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) This package changes explanation text only: no key of any authorable schema and no stored row changes, so there is nothing for `objectstack migrate meta` to rewrite. The narrowing it describes is plugin-auth's SCIM answer, declared in that package's note. -->
11+
12+
**BREAKING** in the behaviour this text now describes, not in the lint package: a SCIM user write whose named manager would make the user their own manager, close a cycle, run past the depth cap or cross an organization boundary was served before and is now refused with SCIM `400 invalidValue` (plugin-auth's note has the details). The lint rule and its findings are unchanged.
13+
14+
The `manager` arm's remedy said the platform declares the SCIM `manager` attribute without projecting it onto the column. plugin-auth now projects it, so the remedy says that the Enterprise User `manager` attribute, whose value is the manager's SCIM resource id, is written onto the column for an active user a SCIM directory holds, from the connection that provisioned that user's profile, on a create, replace or patch that names the attribute, through the admin operation's refusals. A write that does not name it leaves the column as it is, and an id naming no existing user the connection provisioned is served with the column unchanged. Any other directory sync is still named as something your own deployment supplies.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
'@objectstack/plugin-auth': patch
3+
---
4+
5+
feat(plugin-auth)!: a SCIM directory sets, changes and clears a user's manager through the Enterprise User `manager` attribute
6+
7+
Clause-②: yes (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) No key of any authorable schema is added, removed, renamed or re-shaped and no stored row changes shape: what moves is the answer a SCIM user write gets when the manager it names would be refused by the admin endpoint. There is nothing for `objectstack migrate meta` to rewrite; the identity provider's manager mapping is corrected in the directory. -->
11+
12+
**BREAKING** for a SCIM identity provider that sends a manager the admin endpoint would refuse. A SCIM create, replace or patch that names the Enterprise User `manager` attribute, for an active user the directory holds, whose manager resolves to a User the same connection provisioned, and where that link would make the user their own manager, close a cycle, run past the 20-link depth cap, or cross an organization boundary, used to answer `201` / `200` and leave `manager_id` untouched. It now answers SCIM `400` with `scimType: invalidValue` and the admin endpoint's reason, and nothing of the request is written. Those four are the only requests served before and refused now. Remedy: correct the manager in the directory.
13+
14+
**On upgrade.** An identity provider that syncs by replace and maps no manager clears, on its next sync, a `manager_id` set earlier for a user the directory holds, because a replace without the attribute is a clear. Map the manager attribute in the identity provider before upgrading if those values should stay.
15+
16+
**The gap.** `POST /api/v1/auth/admin/set-user-manager` refuses a person a SCIM directory holds and says to change the manager in the directory, but nothing carried the directory's answer to `sys_user.manager_id`: `@better-auth/scim` stored and echoed `urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:manager` and wrote nothing of it onto the user. So a SCIM-held user's manager could not change from either side, and approvals routed to the manager could not follow a reorganisation.
17+
18+
**The rule.** A SCIM user write that names the attribute now projects `manager.value` onto `sys_user.manager_id`, inside the SCIM transaction. `manager.value` is the manager's SCIM resource `id` (RFC 7643 §4.3), looked up among the Users the same connection provisioned; a `$ref` alone is read by its final `/Users/{id}` segment. The link goes through the admin endpoint's own refusals, above.
19+
20+
- **Silence is not a clear.** A create or PATCH that does not name the attribute leaves `manager_id` as it is. An explicit PATCH `remove`, or a replace without the attribute, clears it.
21+
- **One owner per identity.** The projection writes only on an identity whose manager the directory owns, which is exactly the set the admin endpoint refuses (one shared predicate). On any other identity, for example one holding a local password, the admin endpoint owns the column and the projection writes nothing.
22+
- **A reference that names no User is served.** An unknown id, an `externalId` or email, another connection's id, a `$ref` with no readable `/Users/{id}` segment, or a User of this connection whose platform user no longer exists does not fail the write: the user is saved, `manager_id` stays as it was, and the event is recorded with one operator warning and one `scim_manager_unresolved` audit row (when `@objectstack/plugin-audit` is installed), both once per connection per window, carrying the count held back. The row names the connection, the user and the reference, cut to 256 characters, and nothing else from the request; a request that is refused writes none.
23+
- **An unchanged manager is not judged again**, so a write is never refused over a chain other links have since reshaped, and a report whose manager was deleted keeps working.
24+
25+
**Where it does not project, and why.**
26+
27+
- Outside an authenticated SCIM request: the vendor also runs this step while it decommissions a connection or replays a provisioning domain. Neither is a write the directory made, and a decommission must never be refused over an org-chart reference.
28+
- When the user's profile source belongs to another connection: that connection authors the user's name and email, so its manager is the one that counts, not this request's.
29+
- For an inactive user: a deprovision is never refused over the org chart. A manager named while the user is inactive is not applied on re-activation alone; it lands on the next replace, or on a patch that changes it. (`@better-auth/scim` calls the host only when a PATCH changes what it stores, so a patch that re-sends the same value, or removes an attribute the directory never sent, writes nothing; a replace always reaches the projection.)
30+
31+
The `idp_provisioned` stamp (ADR-0135 D4) is unchanged.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@objectstack/plugin-audit': patch
3+
---
4+
5+
feat(plugin-audit)!: `sys_audit_log` records a SCIM user write whose Enterprise `manager` reference names no user, as one bounded `scim_manager_unresolved` row
6+
7+
Clause-②: yes (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) This package adds one ledger action and its writer: no key of any authorable schema is added, removed, renamed or re-shaped and no stored row changes shape, so there is nothing for `objectstack migrate meta` to rewrite. The narrowing the PR declares is plugin-auth's SCIM answer, described in that package's note. -->
11+
12+
**BREAKING** in the SCIM behaviour this row belongs to, not in this package: plugin-auth now refuses with SCIM `400 invalidValue` a manager link the admin endpoint would refuse (self, cycle, depth cap, cross-organization); plugin-auth's note has the details. Nothing this package already wrote or read changes.
13+
14+
**The new row.** `sys_audit_log.action` gains `scim_manager_unresolved` (label "SCIM Manager Unresolved"), written by the SCIM writer on the `audit` slot (`recordScimManagerUnresolved`, beside `recordScimRefusal`, through the same insert). plugin-auth hands it one event when a SCIM user write it served named an Enterprise User `manager` whose reference resolves to no user that connection provisioned: the write is saved, `manager_id` is left as it was, and the event is recorded with one operator warning and this row.
15+
16+
- **Bounded rate.** The row and the warning share one admission: one per SCIM connection per 10-minute window. The next row carries the number held back in between as `metadata.suppressed`. The admission happens inside the SCIM transaction, before the answer is known: a request refused after its reference was admitted still logs the warning and spends the window, so the next served unresolvable reference in that window is counted only in `suppressed`.
17+
- **Bounded content.** `actor` is the connection's service principal (`svc:scim:CONNECTION_ID`), `object_name` / `record_id` the `sys_user` the write was about, `tenant_id` the connection's organization, and `metadata` holds `scim_connection_id`, `reference_kind` (`id` or `unreadable`) and `manager_reference`, the reference as the directory sent it, cut to 256 characters (`manager_reference_truncated: true` when it was longer). Nothing else from the request or the user is recorded.
18+
- **Only served writes.** A refused request writes no such row (its `scim_refused` row is unchanged), and the row is written after the response, outside the SCIM transaction.
19+
20+
Find them in the Audit Log under the "SCIM Manager Unresolved" action, or on the user's own audit history.

‎.changeset/33949-registry-split.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/objectql': patch
3+
---
4+
5+
refactor(objectql): `registry.ts` is split into section modules by codemod; a move only, with the public exports unchanged
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`packages/objectql/src/registry.ts` (12,577 lines) is split by codemod (the first pass of the `engine.ts` codemod; the script is kept in PR #34285's branch history and is not committed), as ruled on #33949 (item 1, split 1 of 8). `SchemaRegistry` keeps every member's signature and docblock, and each moved method forwards in one call to a facet module (`registry-SECTION.ts`). The top-level declarations ahead of the class move whole into `registry-top-level.ts`, and `registry.ts` re-exports every one it exported by name. The codemod's proof, recorded in PR #34285, shows that every moved body and declaration is byte-identical to the base, and that `registry.ts` still exports the same names, each a value or a type as before. No behaviour changes, and nothing an importer of `@objectstack/objectql` reads changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@object-ui/console': patch
3+
---
4+
5+
fix(console): a user with no personal language gets their browser's language when the app ships it, and the app's default language otherwise
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Since 18.5.0 the Console stated the app's declared default (discovery `locale.default`) as the `Accept-Language` of its language reads whenever the device held no explicit choice. Discovery always serves a default, so the browser's language was never asked: a zh-CN browser on an app with `i18n: { defaultLocale: 'en', supportedLocales: ['en', 'zh-CN'] }` booted an English Console, where 18.3.0 booted Chinese.
11+
12+
For a signed-in user with no `sys_user.locale`, the Console's language is now the browser's language when the app lists it in discovery `locale.supported`, else the app's declared default, else `en` (maintainer ruling, letter B). The browser's language is its top tag (`navigator.language`), and "the app lists it" is answered by the platform's one locale ladder (`resolveLocaleAmong`), the same matcher the server's `Accept-Language` rung uses: `ja` matches `ja-JP`, `zh-TW` matches `zh-Hant`, `en-US` matches `en`, `es-MX` matches `es-ES`. The Console states the app's own spelling of that entry. A browser language the app does not ship still gets the app's default, as in 18.5.0. A stored `sys_user.locale` or a language picked on the device still wins over both. No server or protocol change.

0 commit comments

Comments
 (0)