Skip to content

Commit 47eb219

Browse files
committed
Merge origin/main into claude/project-thread-1at98g
docs/adr/README.md resolved by regenerating it with pnpm adr:index. Claude-Session: https://claude.ai/code/session_01ADHkmSoGBrHrzTArx233j6 Co-authored-by: Claude <noreply@anthropic.com>
2 parents fcd6553 + a2d0f73 commit 47eb219

408 files changed

Lines changed: 21735 additions & 2373 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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@object-ui/i18n': patch
3+
'@object-ui/fields': patch
4+
'@object-ui/plugin-form': patch
5+
'@object-ui/plugin-detail': patch
6+
---
7+
8+
feat(ui): a home-currency amount shows the rate and document date it was converted at
9+
10+
Clause-②: yes (widening)
11+
Metadata-protocol: none
12+
13+
A `record`-mode amount that declares `currencyConfig.homeAmount` (ADR-0144 D5) has its home field filled by the server when the record is saved. That home field now draws as a read-only amount in the organization's home currency, with the line "Converted at RATE on DATE" taken from the record's own rate and document-date fields, or "In the home currency (rate 1)" when the amount was already in the home currency. This holds on the record page and on authored form sections (the record dialog, the drawer and an inline `ObjectForm`), where it used to be a disabled number box with no currency symbol. A form laid out automatically still leaves readonly fields out, the home field included.
14+
15+
`@object-ui/i18n` adds `homeAmountSourceOf`, `withHomeAmountSource`, `readHomeAmountSource`, `HOME_AMOUNT_SOURCE_KEY` and the `HomeAmountSource` type, plus two locale keys in every pack: `fields.currencyHome.convertedAt` and `fields.currencyHome.homeCurrency`. `@object-ui/fields` exports `HomeAmountHint`.
16+
17+
The Studio field editor gains the three `homeAmount` pickers under `record` mode (home amount field, document date, rate field), listing only the fields the spec accepts for each. Re-picking an amount's currency code field no longer deletes its `homeAmount`.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/metadata': patch
3+
---
4+
5+
feat(metadata): a read-only count of the history snapshots the drained-key scrub would rewrite
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`@objectstack/metadata/migrations` gains `scrubHistoryDrainedKeys(driver, { mode: 'count' })`, the count mode of a one-time scrub of `sys_metadata_history` snapshots written before history started withholding what a connector save drains (undeclared `auth` keys).
11+
12+
- **One predicate.** A stored snapshot is counted exactly when `historySnapshotBody` — the helper both history writers already store through — would store a different body for it today. Nothing in the count names a key or a type, so the count and the write-time withholding cannot disagree, and a snapshot written since that withholding landed is never counted.
13+
- **Read-only.** It takes a driver's `find` and nothing else, pages the table by primary key, and reports the number of affected rows, the number of distinct items they belong to, and the affected rows' ids as opaque handles. A body that is not JSON, or one the snapshot helper cannot reduce, is listed beside the count, never folded into it. The result never carries a key name, a value or a body.
14+
- **Count only.** Any other mode is refused before anything is read. The rewrite of stored history runs only after the maintainer confirms the count; run the count on a copy of the database and hand its numbers over privately.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/objectql': patch
4+
'@objectstack/metadata-protocol': patch
5+
'@objectstack/rest': patch
6+
'@objectstack/client': patch
7+
---
8+
9+
feat(rest): the recycle bin has REST doors: list an object's entries, restore one, purge one, and empty the object's bin; a delete answer names the entry to undo
10+
11+
Clause-②: yes (widening)
12+
Metadata-protocol: semantic
13+
Skills-docs: follow-up #30847
14+
15+
The recycle bin (ADR-0148) is now reachable over HTTP, one object at a time, under the data surface:
16+
17+
- **`GET /api/v1/data/:object/recycle-bin`** lists the object's entries, newest first (`limit` 1 to 200, default 50; `offset`). It is the recycle-bin manager's: a caller without `manageRecycleBin` on the object is refused `403`. Each entry's rows carry only the fields the caller may see on their object; a field the caller sees masked is left out.
18+
- **`POST /api/v1/data/:object/recycle-bin/:entryId/restore`** writes one entry back. A member restores the entries they deleted (`allowRestoreOwnDeleted`); another member's entry needs `manageRecycleBin`. The four `409` refusals carry the entry, row and parent they name, so a client can restore a parent entry first.
19+
- **`DELETE /api/v1/data/:object/recycle-bin/:entryId`** purges one entry, and **`DELETE /api/v1/data/:object/recycle-bin`** empties the object's bin. Both need `manageRecycleBin`.
20+
21+
An entry addressed under an object it does not belong to answers `404`. Each door refuses an unknown or repeated query parameter `400`. An object whose API exposure withholds `delete` withholds the four doors too (`405`): the API derivation now derives `restore` and `purge` from `delete`.
22+
23+
`DELETE /api/v1/data/:object/:id` answers `recycleBinEntryId` (optional on `DeleteDataResponseSchema`) when the delete wrote a recycle-bin entry, so a client can offer an undo. The engine's by-id `delete` tells an `onRecycleBinEntry` callback (`RecycleBinDeleteObservability`, exported by `@objectstack/objectql` beside `EngineDeleteOptions`, as update's `WriteObservabilityOptions` are) the entry it wrote, once the driver reports the row removed.
24+
25+
The engine gains `ObjectQL.listRecycleBin(object, { context, limit, offset })`, refused unless the caller manages the object's bin (fail closed when no permission resolver answers), and `restore` / `purge` take an optional `object` that an entry must belong to. `@objectstack/client` gains `client.recycleBin.list / restore / purge / empty`, and `DeleteDataResult` gains `recycleBinEntryId`.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
'@objectstack/objectql': patch
3+
'@objectstack/cli': patch
4+
'@objectstack/spec': patch
5+
'@objectstack/metadata-protocol': patch
6+
---
7+
8+
feat(objectql): the package upgrade plan lists, as advice, each `.custom` override that hides a change of the upgrade, and each override already stale
9+
10+
Clause-②: yes (widening)
11+
Metadata-protocol: none
12+
13+
Who sees it: whoever previews a base package upgrade before it runs — `os package install … --dry-run` (the install-local door's `dryRun: true`) and a hosted upgrade preview that reads the `manifest` service's `planUpgrade`.
14+
15+
The plan's environment reading gains an advisory class, `environment.overrides` (ADR-0146 D2, as amended): for every base package the upgrade replaces, each item of its paired `<base>.custom` package that the reads serve over a base item (the protocol's served-override list) is read against the installed and the incoming version of the base.
16+
17+
- `hidesChange`: the base's item differs between the two versions (`change: 'changed'`), the new version no longer ships it (`'removed'`), or now ships it (`'added'`). The override keeps being served, so it hides that change.
18+
- `stale`: the override's `basedOn` is not the installed base version.
19+
20+
Each finding names the type, the name, the bundle member where the type has one, `basedOn`, the installed and the incoming base version, and the next step in Studio: open the item, compare, re-base it, or restore the package original. Advice only: nothing is refused on it, no confirmation token covers it, and nothing is merged or rebased; the upgrade installs exactly as before. `null` means the overrides could not be read (no protocol service, or the read failed), never "none". `os package install --dry-run` prints both lists after the schema plan.
21+
22+
The `overrides.basedOn` description (`@objectstack/spec`, and the generated reference pages) and the published declarations of `@objectstack/metadata-protocol` (`judgeOverrideWrite`'s JSDoc) no longer say no upgrade diff reads it: it never gates, and the upgrade plan reads it as advice.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/plugin-auth': patch
3+
'@objectstack/platform-objects': patch
4+
---
5+
6+
feat(plugin-auth): an SSO sign-in grants the ordinary permission set its IdP group is mapped to
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
An enterprise SSO provider (OIDC or SAML, through `@better-auth/sso`) can now drive what its users may do from the groups the identity provider sends at sign-in, through the same `sys_idp_group_mapping` mappings a SCIM connection uses. There is no second mapping model.
12+
13+
- **Where the groups come from.** Set the provider's own claim mapping to fill `groups`: `mapping.extraFields: { groups: 'groups' }` for an OIDC claim named `groups`, or the attribute name an IdP uses for SAML (for example Entra ID's groups claim URI). The value may be one string or a list of strings. A provider whose mapping fills no `groups` behaves as before.
14+
- **Saving a mapping.** `POST /api/v1/auth/admin/scim/set-group-mapping` now also takes `providerId` in place of `connectionId` (exactly one of the two; both is `400 VALIDATION_FAILED` on `providerId`). The grant's organization is the provider's own `organization_id`; a provider that names none, or an unknown provider, is refused `400 VALIDATION_FAILED` on `providerId`. With SSO off the save is refused `503`. The same platform-admin gate and the same organization-boundary judgement apply: administrator sets and every set outside the organization boundary are refused, and without a security service the save is refused `503`. The row is stored with `source_kind: 'sso'` (a new option on `sys_idp_group_mapping.source_kind`) and `source_id` = the provider id.
15+
- **At each sign-in.** Every sign-in through the provider matches each group value against the provider's mappings (by `groupExternalId` when the mapping names one, which suits Entra ID's group object ids, else by exact `groupDisplayName`) and makes the user's grants follow them: a mapped group grants its set in the provider's organization, and a group the user has left loses the set at their next sign-in. A sign-in with no groups removes the grants that provider made earlier. The boundary is asked again before every grant, so a set that becomes an administrator set after its mapping was saved grants nothing, and with no security service nothing is granted. Only grants the provider made (their `reason` names the provider) are ever removed: a grant made by hand, or by SCIM, is never touched. Every write goes through the engine, so the break-glass last-administrator guard still refuses what it refuses elsewhere. If applying the mappings fails, the sign-in still succeeds and the failure is logged at `error`.
16+
- **Deleting a mapping.** `POST /api/v1/auth/admin/scim/delete-group-mapping` removes an SSO mapping and, at once, the grants its provider made of that set in that organization, unless another of the provider's mappings still names that set (then each user's next sign-in decides).
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): more of objectstack-data's self-contained examples are type-checked by `check:skill-examples`, and the `Field.*` factory example imports from the subpath that exports it
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Fourteen more fenced TypeScript blocks in `skills/objectstack-data` carry the opt-in check marker, so 25 of its 95 are now compiled against the spec: 8 of 10 in `rules/indexing.md` (index lists typed as `ObjectIndex[]` from `@objectstack/spec/data`), 4 more in `references/data-hooks.md` (the full `defineHook` definition and three pattern hooks, which gain their `defineHook` import), and one each in `rules/lifecycle.md` and `rules/field-types.md`. One example was wrong: `rules/field-types.md` imported `Field` from `@objectstack/spec`, which does not export it (the spec root has no namespace exports); it now imports from `@objectstack/spec/data`, and the prose no longer names the root. The ✅ script example in `rules/validation.md` gains the `name` every validation rule requires. The rest stay unmarked: fragments, shapes, ❌ examples, and the blocks whose file had no token headroom left to pay for a wrapper. No rule's teaching changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/service-datasource': patch
3+
'@object-ui/app-shell': patch
4+
'@object-ui/i18n': patch
5+
---
6+
7+
feat(service-datasource): the Studio connection form offers Oracle and SQL Server, federation only
8+
9+
Clause-②: yes (widening)
10+
Metadata-protocol: none
11+
12+
`GET /api/v1/datasources/drivers` now lists `oracle` (Oracle Database) and `mssql` (SQL Server). Each entry's connection fields are projected from the driver's config contract in `@objectstack/spec`, like every other entry, and its words are served in every language on the platform locale table.
13+
14+
Both drivers serve federation only (ADR-0015 §4.6), so their entries carry a new key, `federationOnly: true`, read from the spec's `FEDERATION_ONLY_DRIVER_IDS`. The key is absent on every other entry; a client that does not read it sees two more entries and nothing else changed.
15+
16+
The New datasource dialog reads that key from the catalog: for Oracle and SQL Server its Schema mode select offers External and Validate only, never Managed (the spec refuses a managed datasource naming either), and one sentence under it says why. A Managed choice made on another driver moves to External when one of them is chosen. As with PostgreSQL and MySQL, the database client (`oracledb`, `tedious`) is an optional install next to the server. A SQL Server datasource whose `tedious` is missing is now refused with the install of `tedious` as its remedy, like the other clients; it used to be told to rebuild the workspace.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/driver-sql': patch
3+
---
4+
5+
fix(driver-sql): an Oracle `RAW(16)` uuid column (a `SYS_GUID()` key, or a lookup over one) is now filtered and written by the uuid text it reads back as
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
The driver already read a `RAW(16)` column as a lowercase hyphenated uuid, but it bound that same text back as a string, which Oracle refuses against `RAW`. So a lookup keyed by a `SYS_GUID()` column displayed correctly and could not be filtered, written, updated or deleted by its value.
11+
12+
The driver now reads, once per federated object, which of its remote columns are `RAW(16)` (`ALL_TAB_COLUMNS`), and binds a comparand, a written value or a by-id key for those columns as `HEXTORAW(?)` over the uuid's 32 hex digits. The column type decides, never the value: a `VARCHAR2` column holding uuids is bound as text, as before. Uuid text is accepted dashed (the read form) or as the 32 digits undashed, in either case. Anything else is refused before the statement is sent: a filter comparand with `INVALID_FILTER` / 400, a written value with `VALIDATION_ERROR` / 400. A failed catalog read changes nothing: values are bound as before and the next read asks again. Other dialects are unchanged.
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/driver-sql': patch
4+
'@objectstack/service-analytics': patch
5+
---
6+
7+
fix(service-analytics): a dashboard's text filter on a SQL Server object matches the rows the list view matches; the text-match construct table moves to `@objectstack/core`
8+
9+
Clause-②: yes (widening)
10+
Metadata-protocol: none
11+
12+
- **`@objectstack/service-analytics`:** the native-SQL `where`, the read scope and the ObjectQL echo now compile `$contains` / `$notContains` / `$startsWith` / `$endsWith` / `$icontains` on SQL Server the way `@objectstack/driver-sql` does: the four case-exact operators compare under a binary collation, `$icontains` folds the 26 ASCII letters and nothing else, and a `[` in the comparand is matched literally. Before, a SQL Server object's text filter compiled to a plain `LIKE` under the database's case-insensitive default collation, so `$contains: 'acme'` also matched `ACME Corp`, `$icontains` also folded accented letters, and `$contains: '[1]'` matched any value holding a `1`. `AnalyticsServiceConfig.sqlDialect` now accepts `'mssql'` beside `'sqlite'`, `'postgres'` and `'mysql'`, and the plugin's bridge hands a SQL Server driver's dialect on instead of reading it as "no answer". Every other per-dialect behaviour of the package (duration measures, the multi-value empty test, JSON membership, the window clause, NULL placement, the aggregand policies) treats `'mssql'` exactly as it treated the unknown dialect before. Oracle is unchanged: it already matched the driver's rows.
13+
- **`@objectstack/core`:** exports `dialectTextMatchSql` (with `TextMatchDialect`, `TextMatchShape`, `TextMatchEmitters`, `TextMatchRequest`), the per-dialect text-match constructs `driver-sql` and the analytics compilers now both emit through, plus `textMatchLikePattern`, `ASCII_UPPER_LETTERS` / `ASCII_LOWER_LETTERS`, `mssqlCaseExactSql`, `mssqlAsciiLowerSql` and `mysqlAsciiLowerBinarySql`. The column and each value are emitted through caller-supplied emitters, so each face keeps its own placeholders. The unknown dialect answers `null`; each face keeps its own fallback there.
14+
- **`@objectstack/driver-sql`:** no behaviour change. Its `$contains` family and `$icontains` emit through the shared table; the SQL and bindings are identical to before.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/driver-sql': patch
3+
---
4+
5+
fix(driver-sql): on SQL Server, the text operators match a `uniqueidentifier` column as the lower-case text a read answers
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A federated SQL Server table's `uniqueidentifier` columns read back lower-case, but `$contains`, `$startsWith`, `$endsWith`, `$notContains`, `$icontains`, `$like` and `$ilike` compared SQL Server's own upper-case text of the GUID, so a lower-case fragment copied from a read matched nothing. The driver now reads which columns are `uniqueidentifier` from the remote catalog (`INFORMATION_SCHEMA.COLUMNS`) once per object, the first time a read uses a text operator on it, and matches such a column as `LOWER(CONVERT(nvarchar(36), col))`.
11+
12+
The case-exact operators follow the read form: `$startsWith: '3f2504e0'` now matches, and `$startsWith: '3F2504E0'`, which matched SQL Server's upper-case rendering before, now does not; use `$icontains` / `$ilike` to match either case. Equality and `$in` are unchanged (SQL Server compares GUIDs by value). `nvarchar` columns, and every other dialect, compile exactly as before.

0 commit comments

Comments
 (0)