Skip to content

Commit d6f1f40

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-k6o0gu
2 parents e855b14 + 5d1382a commit d6f1f40

209 files changed

Lines changed: 6837 additions & 473 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: 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): 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.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
'@objectstack/rest': patch
3+
'@objectstack/runtime': patch
4+
'@objectstack/client': patch
5+
'@object-ui/data-objectstack': patch
6+
---
7+
8+
fix(rest)!: `GET /api/v1/meta/_drafts` scopes by `?package=`, like every other metadata read, and refuses a query parameter it does not read
9+
10+
Clause-②: yes (narrowing) — `GET /api/v1/meta/_drafts` (on the REST server and the runtime dispatcher) declares its closed query-parameter set, `package` and `type`, and refuses any other name, the retired `packageId` among them, with `400 VALIDATION_ERROR`, where it ignored it and answered the drafts of every package with `200`. The widening half: `@objectstack/rest` exports two new names, the door's query decision that both transports ask: `META_DRAFTS_QUERY_PARAMS` and `metaDraftsQueryRefusal`.
11+
Metadata-protocol: none
12+
13+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped: the protocol's ListDraftsRequest keeps its packageId field, and the SDK options keep their names. What moves is the drafts route's query-string spelling, and nothing at rest records it, so there is nothing for a migration to rewrite. -->
14+
15+
**The package filter.** `GET /api/v1/meta/_drafts?package=ID` lists only that package's pending drafts. It reads the value the way `GET /meta/:type` and `GET /meta/diagnostics` read it: `?package=all` lists every package, and a package that is neither installed nor bound to a pending draft is refused with `400 INVALID_REQUEST`. Before, the door read only `?packageId=`, so `?package=ID` was dropped and every package's drafts came back with `200`.
16+
17+
**BREAKING** accept-set narrowing at the drafts list (`@objectstack/rest`, `@objectstack/runtime`): a query parameter the door does not read is refused instead of ignored, and `?packageId=` is retired.
18+
19+
- **Before.** `GET /meta/_drafts?packageId=ID` narrowed to one package. `?package=ID`, `?typ=view` or any other name was ignored, and the drafts of every package (or every type) came back with `200`.
20+
- **Now.** Only `package` and `type` are read. Any other name, `packageId` included, is refused with `400` and the nested `{ "error": { "code": "VALIDATION_ERROR", "message" } }` body, whose message names the parameter and lists the supported ones; nothing is read. A bracketed `?package[]=` or `?type[]=` keeps its own located refusal.
21+
- **Who moves.** `@objectstack/client`'s `meta.listDrafts({ packageId })` and `@object-ui/data-objectstack`'s `MetadataClient.listDrafts({ packageId })` keep their option name and now send `?package=`, as does the Console. A script that sends `?packageId=` gets the 400.
22+
23+
**The remedy.** FROM `GET /api/v1/meta/_drafts?packageId=ID` TO `GET /api/v1/meta/_drafts?package=ID`. Upgrade `@objectstack/client` and `@object-ui/data-objectstack` together with the server.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/cloud-connection': patch
3+
---
4+
5+
fix(cloud-connection): an installed app whose register the engine refuses at boot is listed as not loaded, with the refusal's code and sentence
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
An earlier build could ledger a cloud-fetched install whose register the engine refuses (a default page that is not a record page, an object another package owns, two packages of one artifact defining one object, and the like). At every boot the rehydrate meets the same refusal, logs `rehydrate failed`, loads nothing of the package and keeps its ledger entry. `GET /api/v1/marketplace/install-local` listed such an entry as installed, with `withSampleData` and no `notLoaded` marker, so Installed Apps showed an app that the runtime does not hold.
11+
12+
The rehydrate now records a register refusal (a throw declaring a 4xx status, the rule the install door uses to refuse it) where it records the protocol-range refusal. The listing then marks the entry `notLoaded: { code, message }` in place of `withSampleData`: `code` is the refusal's ADR-0112 code and `message` is the engine's sentence, the same one the boot logs. The `notLoaded` marker is now a closed union of two arms. The protocol arm `{ code: 'OS_PROTOCOL_INCOMPATIBLE', requiredRange }` is unchanged. A healthy entry is listed as before. DELETE and a compatible reinstall still act on the marked entry. A register fault that declares no 4xx is not marked, because the next boot can load it. A failure after a successful register is not marked either, because the package is loaded. The console's Installed Apps already shows a non-protocol code as "not loaded".
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
fix(metadata-protocol): a tenant's edit follows its item across the packages of one App
6+
7+
Clause-②: no — no accept set changes; the lookup scope widens only within one suite (triage 6724363147)
8+
Metadata-protocol: none
9+
10+
When a later version of an App moves an item from one of its packages to another (an ADR-0130 D4 suite split such as a flat App becoming an App plus modules, or the rollback of one), the item's reads no longer drop the tenant's edit of it. Before, the edit was still stored and every read served the vendor's item: the reads looked for the edit under the package that ships the item now, and the edit names the package that shipped it at the time of the edit.
11+
12+
- **What follows.** The App pair's (`<app>.custom`) declared override whose `overrides.package` names a former owner of the item, and a row bound to the former owner itself (a Regime O save stored before ADR-0146 D11 closed saves naming the read-only base). Each is served at the package that ships the item now, by name (with and without `?package=`), in the list and as the layered read's `effective`.
13+
- **Same App, read from the install record.** Two installed packages are of one App when `appOf` answers the same App for both over the registry's installed manifests. When the former owner is no longer installed (a rollback), the record is the row's binding to the App's pair, which the save door admits only for a package of that App. Never an id or name prefix.
14+
- **What never follows.** A row bound to, or declaring, a package of another App; a row of another App's pair; a row whose former owner still ships the item (it stays that package's edit); an `object` (it takes no tenant overlay, `ITEM_LOCKED`); and, between two former owners' rows, neither.
15+
- **Nothing is written.** The row keeps its binding and body, so a rollback needs no reverse step; the next save of the item writes the current owner's address, as every save does.

0 commit comments

Comments
 (0)