Skip to content

Commit d981cf7

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-samipm
2 parents e9cf4d6 + fdfcc7a commit d981cf7

106 files changed

Lines changed: 5012 additions & 398 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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
'@object-ui/types': patch
3+
'@object-ui/data-objectstack': patch
4+
'@object-ui/core': patch
5+
'@object-ui/i18n': patch
6+
'@object-ui/app-shell': patch
7+
'@object-ui/plugin-view': patch
8+
'@object-ui/plugin-detail': patch
9+
---
10+
11+
feat(ui): undo a business-record delete from its toast, through the recycle bin
12+
13+
Clause-②: yes (widening)
14+
Metadata-protocol: none
15+
16+
A delete of one business record (an object without the `sys_`, `cloud_` or `ai_` prefix) enters the recycle bin (ADR-0148). When the server answers with its `recycleBinEntryId` and the caller holds `allowRestoreOwnDeleted` on the object (read through `objectPermissionGrants`, so `manageRecycleBin` and `modifyAllRecords` grant it too), the "deleted" toast on the console list, the plugin list and the record page now carries an Undo action. Undo restores that entry under its original ids (`POST {data}/:object/recycle-bin/:entryId/restore`), never re-creates the record, refreshes the view and toasts "{label} "{name}" restored". On the record page, Undo also returns to the record.
17+
18+
A refused restore toasts one sentence per reason, in the session language: another record now holds the same unique value, the parent record was purged, the package was uninstalled, the parent is itself in the recycle bin, the entry is gone, no permission, or no recycle bin on this deployment. An unknown code keeps the server's message. Without the grant, without an entry id, or for a batch delete, the toast is unchanged.
19+
20+
The delete confirmation for a business record (one record and a selection, on the console list, the plugin list, the record page and the plugin detail view) is now the question alone ("Are you sure you want to delete this record?", "Delete N selected records?"). It no longer says "This cannot be undone." Platform objects keep today's copy.
21+
22+
`@object-ui/types`: `DataSource.delete` options gain `onRecycleBinEntry?`, and `DataSource` gains an optional `restoreRecycleBinEntry?`. `delete` still returns a boolean. `@object-ui/data-objectstack` implements both. `@object-ui/core` exports `recycleBinRestoreRefusalText`, `RECYCLE_BIN_RESTORE_REFUSAL_KEYS` and the `RecycleBinRefusalLabels` type, and `recordDelete` gains `successToast`, `undo` and `entersRecycleBin`. `@object-ui/i18n` adds `objectActions.deleteConfirmQuestion`, `restoredNamed`, `restoreSuccess` and `restoreFailed`, `detail.deleteConfirmQuestion`, the `console.objectView.bulkDeleteQuestion` family and the seven `recycleBin.refusal.*` sentences to every pack.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
'@object-ui/i18n': patch
3+
'@object-ui/app-shell': patch
4+
'@object-ui/console': patch
5+
---
6+
7+
fix(i18n): the Console language menu offers the platform locale table's languages, intersected with the app's locale list
8+
9+
Clause-②: no (narrowing)
10+
Metadata-protocol: none
11+
12+
<!-- adr-0087: not-required (no-migration-prescription) no metadata an author writes changes: `i18n.supportedLocales` accepts the same values, `GET /api/v1/i18n/locales` reports the same list and no stored shape is rewritten; what narrows is the Console menu's reading of that list, and a language outside the platform locale table has no replacement spelling to migrate to -->
13+
14+
**BREAKING** for an app whose locale list names a language outside the platform locale table (for example `th`): the Console language menu no longer offers it. No first-party app does — examples/app-crm, app-showcase, app-todo and HotCRM declare only table languages, through read-alias spellings that now show as their table entries.
15+
16+
The Console language menu now offers the platform locale table's languages,
17+
intersected with the app's locale list (ruling F). `offerableLanguages` reads
18+
each code the app lists through the table's read aliases and offers table tags
19+
only, de-duplicated, in the app's order:
20+
21+
- a stored spelling is its table entry with the table's own label: an app
22+
declaring `zh-CN`, `ja-JP` or `es-ES` shows 简体中文, 日本語 and Español instead
23+
of 中文(中国), 日本語 (日本) and Español de España, and a pick writes the
24+
table tag (`zh-Hans`) to `sys_user.locale`;
25+
- two spellings of one language (`zh-CN` beside `zh-Hans`) are one entry;
26+
- a code the table does not name (for example `th`) is no longer offered, and
27+
neither is an out-of-table key of `config.resources` in the offline fallback.
28+
A stored choice of such a code still boots, then reverts and is cleared once
29+
the app's list arrives.
30+
31+
The menu's checkmark and the profile page's language card compare a stored
32+
spelling through the same resolution, so an account storing `zh-CN` sees one
33+
简体中文 entry, ticked.
34+
35+
Migration: none for a metadata author — `i18n.supportedLocales` accepts the
36+
same values and `GET /api/v1/i18n/locales` reports the same list. An app that
37+
relied on the menu offering a language outside the platform locale table has
38+
no replacement; that language is not complete on the platform's own surfaces.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/cli': patch
3+
---
4+
5+
feat(cli): `os deploy` to a self-hosted runtime shows the upgrade plan before it installs: `--dry-run`, `--json`, and a confirmation on the terminal for an undeclared rename or a risky type change
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
Who sees it: a developer deploying to a self-hosted runtime (`os environments use-runtime`) with `os deploy`, or with the `d` key in `os dev`.
11+
12+
- **The plan comes first, and a plain upgrade is not interrupted.** `os deploy` already printed the runtime's upgrade plan (added and removed fields, type changes, renames declared with `renamedFrom`, suspected renames, seed datasets) before it installed. A plan with only additions and declared renames still installs with no question, so the `d` key stays one key press.
13+
- **An undeclared rename or a risky type change stops the deploy before anything is written**, as before, and now asks on a terminal: "Deploy anyway, accepting each finding as listed?". Yes sends the same install again with the finding-set token from the runtime's refusal. Anything else deploys nothing and exits 1. The `d` key gets the same question, because it runs `os deploy` on the same terminal. Off a terminal (CI, a pipe) nothing is asked: the refusal prints both ways forward, as before. Either declare the old key in the new field's `renamedFrom` and rebuild, or run `os deploy --confirm-upgrade <token>`. There is no `--rename` flag: a rename is declared in the package.
14+
- **`os deploy --dry-run`** builds, prints the plan and installs nothing. It also says whether the install would stop for a confirmation, using the framework's own verdict on the plan the runtime answered. The token that confirms comes only from the install's refusal.
15+
- **`os deploy --json`** prints one JSON document on stdout: `target`, `url`, `result` (`planned`, `installed`, `refused` or `failed`), `package`, `plan`, `environment`, `wouldStop`, `refusal` (the runtime's error, verbatim), `confirm` (the command that confirms the refused findings) and `error`. Progress goes to stderr. A refusal or a failure exits non-zero.
16+
- With ObjectOS Cloud as the target, `--dry-run` and `--json` are refused by name before anything is built or sent. This command does not read a cloud environment's plan yet.
17+
- `os package install --dry-run` and `os deploy` print the plan and the refusal with one shared printer, so the two cannot disagree.
18+
- For code that runs the install command in-process: `PackageInstall.outcome` (the `os package install` command class) gains a `refused` variant (`status`, `code`, `message`, `details`, and `schemaUpgrade` when the refusal is a schema upgrade stop), and it is set whenever the endpoint answers the install with a refusal (any non-zero error status; a timeout or a refused connection is not one).
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/mcp': patch
3+
'@objectstack/runtime': patch
4+
---
5+
6+
feat(mcp): serve `list_datasets` and `query_dataset` over MCP under `data:read`
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
An MCP client can now answer business questions through the governed dataset layer (ADR-0149 D2). `McpDataBridge` gains three optional members, `listDatasets`, `queryDataset` and `datasetToolDefinitions`, and `wireBridgeTools` registers the two tools only when a bridge carries all three and the caller's grant admits `data:read` (an API key or a session keeps them, as every read tool). Both bridges carry the members where the `analytics` service serves its dataset executor (`datasetTools`) and none of them otherwise, so a deployment without the analytics service lists exactly the tools it listed before.
12+
13+
The tools run the service-analytics executor as the caller, with no gate added or skipped: each tool's description is the executor's own definition, its input is the spec declaration (`ListDatasetsInputSchema` / `QueryDatasetInputSchema`), `query_dataset` is held to the same page cap as `query_records`, and a refusal answers in the coded envelope the other data tools use. The generated `SKILL.md` names both tools where they register and teaches the selection rule: an exact word match on a member's name, label or synonym is the only hit, one hit answers through `query_dataset`, several hits are a question for the user, and no hit falls back to the object tools with the answer marked as not a governed metric.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@objectstack/runtime': patch
3+
'@objectstack/spec': patch
4+
---
5+
6+
feat(runtime)!: the runtime package doors refuse to change packages when the deployment declares several replicas on the Redis cluster driver, instead of changing the one replica that served the request
7+
8+
Clause-②: yes (narrowing) — narrowed: `POST /api/v1/packages`, `PATCH /api/v1/packages/:id/enable`, `PATCH /api/v1/packages/:id/disable`, `POST /api/v1/packages/:id/duplicate`, `POST /api/v1/packages/:id/ensure-customization`, `PATCH /api/v1/packages/:id` and `DELETE /api/v1/packages/:id` now answer `409 MULTI_REPLICA_PACKAGE_CHANGE_REFUSED`, right after the caller is admitted (the `manage_metadata` gate and the walled-catalog refusal still answer first) and before the body is judged or anything is written, when the deployment declares several replicas (`OS_CLUSTER_REPLICAS` greater than 1, or `OS_EXPECT_MULTI_NODE=true`) and the composed cluster service runs the `redis` driver; `POST /api/v1/automation/:name/clone` and `POST /api/v1/security/permission-sets/:name/clone` answer the same `409` under the same condition only when their default landing would create the source's paired customization package on this replica. Nothing is written: no package, no package-state file, no metadata row. On a single node, on the in-process driver or with no cluster service composed, every door answers exactly as before. Widened: `ERROR_CODE_LEDGER` (`@objectstack/spec`) registers `MULTI_REPLICA_PACKAGE_CHANGE_REFUSED` under `@objectstack/runtime` too (one row per emitting package; the code itself is unchanged); nothing is removed or renamed.
9+
Metadata-protocol: none
10+
11+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped and no export is removed: a request that changed one replica's package registry or enable/disable state is now refused, with an already registered error code, only on a deployment that declares replicas on the Redis driver. There is nothing for a migration to rewrite and no tombstone. -->
12+
13+
**BREAKING** for a multi-replica deployment on the Redis cluster driver that installs, enables, disables, duplicates, edits or deletes packages at runtime (Studio's package pages, the Console, the SDK or the HTTP doors), or clones a packaged flow or permission set whose customization package does not exist yet.
14+
15+
- **Before.** The package registry is read from the database at boot only, so a package created, installed, edited or deleted at runtime was seen by the serving replica alone until every other replica restarted; the enable/disable choice was written to the serving replica's own package-state store (a file under its own `OS_HOME` when the host registers none), so restarted replicas could serve different packages for good.
16+
- **Now.** Those doors refuse with `MULTI_REPLICA_PACKAGE_CHANGE_REFUSED` (409), the code the marketplace install-local doors already answer under the same condition, and name the maintenance-window recipe: make the change on a single replica or through the CLI, then restart every replica. A clone whose customization package already exists on the replica, or which names a writable target, still lands, since it creates no package.
17+
- **Unchanged.** A single node, or replicas declared on any driver other than `redis`, change packages as before. The metadata write doors (publish, publish-drafts, discard-drafts, revert, rollback, commit revert, adopt-orphans) write the shared store and are not refused. The split-brain guard is untouched.
18+
- **Who sees it.** An administrator of a multi-replica deployment on the Redis cluster driver who changes packages at runtime, or who clones a packaged flow or permission set before its customization package exists.
19+
20+
The condition is `@objectstack/service-cluster`'s `declaresMultiReplicaOnRedis`, read per request from the composed `cluster` service's driver.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/plugin-sharing': patch
4+
---
5+
6+
feat(spec, plugin-sharing): the ownership-queue reads take an optional caller package, so a declared sharing rule's queue recipient resolves from the rule's package
7+
8+
Clause-②: yes (widening); narrowing per ADR-0150 D3 declared below
9+
Metadata-protocol: none
10+
11+
`IOwnershipQueueService.resolveQueue`, `expandMembers` and `isMember` (`@objectstack/spec/contracts`) take an optional `callerPackageId` (new type `OwnershipQueueCallerPackage`, `string | null`). With it, a queue name resolves from that package (ADR-0150 D3): the package's own declared queue, else the unique holder in its declared dependency closure plus `sys`, else a refusal naming every candidate. Without it, the read is environment-wide, exactly as before. An implementation written before the key still satisfies the contract.
12+
13+
`@objectstack/plugin-sharing` implements it and passes it where a package wrote the queue name: a declared sharing rule's queue recipient is now read from the rule's package. A queue name the rule's package reaches through one declared dependency is served even when an unrelated package also declares a queue of that name; before, that name was refused because two packages declared it. Every other answer is unchanged: no caller package, one holder, two holders in the package's reach (refused, naming both), a holder only outside the reach (refused), and an organization's own `sys_queue` row.
14+
15+
Narrowing, per ADR-0150 D3: take a declared rule whose package depends on a package D that is disabled, where an unrelated package U declares a queue of the same name. That rule used to grant to U's queue members. Its queue recipient is now refused. The refusal is logged once at `warn` and names U as outside the rule package's dependency closure. U's members gain no grant from it; grants the rule already holds are kept, as for any refused recipient. A disabled package holds no queue for this read, the same population the listing serves. To resolve it, enable D or declare a dependency on the package whose queue you mean. Measured first-party: 0 (no first-party package declares a queue).
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@object-ui/core': patch
3+
'@object-ui/plugin-form': patch
4+
'@object-ui/plugin-grid': patch
5+
'@object-ui/plugin-detail': patch
6+
---
7+
8+
fix(ui): a stored field carrying an `expression` is read-only on every write surface, as a formula is
9+
10+
Clause-②: yes (widening)
11+
Metadata-protocol: none
12+
13+
- **Before.** A non-`formula` field with an `expression` (for example a `currency` amount computed from quantity times unit price) is computed by the engine on every write, so a client-sent value never stands. The record form still drew it as an editable input, a list grid offered an editable cell, the record page offered inline edit, and the import wizard offered it as a column to write. The save then replaced what the user typed, with no message.
14+
- **Now.** Such a field is computed exactly as a `formula` is. The auto-layout create form leaves it out. The auto-layout edit form, and an authored form section on create or edit, draw its type's read face (the formatted value, no input), and the edit save does not send it. A list grid cell, the record page's details body, its highlight strip and its path stage offer no editor. The import wizard offers it only as a match key, as it does a `readonly` field, and the spreadsheet import bar does not offer it. The value itself is unchanged: the engine computed it before and still does.
15+
- **The widening.** `@object-ui/core` exports `isExpressionComputedField(def)`. It answers whether an object field carries a non-empty `expression`, either a bare CEL string or the `source` of the `{ dialect, source }` envelope, which is the spec's own reading. Every gate above asks it alongside its type list. Nothing is removed or renamed.

0 commit comments

Comments
 (0)