Skip to content

Commit 26b9e90

Browse files
Merge branch 'main' into claude/project-thread-d7w1a6
2 parents 78d7c1c + 6be71ab commit 26b9e90

220 files changed

Lines changed: 14306 additions & 2038 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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@objectstack/objectql': patch
3+
---
4+
5+
refactor(objectql): the `ObjectQL#delete` body moves into the delete-and-aggregate facet
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
- The body of `delete` moves out of `engine.ts` into `engine-delete-and-aggregate.ts`, beside `aggregate`. The method stays on the class as a one-call stub with its signature and its docblock. Where the body handed the engine itself on (`ql: this` in the hook context), it reads the same engine through the host's `facade` entry, and its one static read (the reference probe batch size) goes through the forwarder the other facets already use.
11+
- No behaviour changes and nothing to do on upgrade: the same statements run in the same order. The built declaration files are unchanged; the source maps move.
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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
Clause-②: no
6+
Metadata-protocol: none
7+
8+
`objectstack-api` now teaches the recycle bin's doors as they shipped: a by-id
9+
delete answers `recycleBinEntryId`; `POST /api/v1/data/{object}/recycle-bin/:entryId/restore`
10+
restores one entry (`allowRestoreOwnDeleted` for the caller's own deletes,
11+
`manageRecycleBin` for anyone else's); `GET` lists, `DELETE …/:entryId` purges
12+
and `DELETE …/recycle-bin` empties (all `manageRecycleBin`); a refused restore
13+
answers `409` with one of the four `RESTORE_*` codes. `restore` / `purge` are
14+
taught as derived from `delete` instead of "never derive". The api skill's
15+
"undelete invoices" eval grades the new teaching.
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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/cli': patch
3+
---
4+
5+
feat(cli): `os validate --target <environment URL>` fetches the target environment's restriction profile
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`os validate --target` now also takes an environment's `http://` or `https://` URL. The command fetches `GET /api/v1/discovery/restriction-profile` at that URL's origin (the route a hosted environment publishes its profile at), reads the `{ success, data }` body and parses `data` with `RestrictionProfileSchema`, the same parse the file form uses, so a fetched profile judges the stack exactly as the same profile saved to a file.
11+
12+
Every failure is refused and names the URL fetched: an environment that cannot be reached or does not answer within 15 seconds, any non-2xx answer (a `404 RESOURCE_NOT_FOUND` means no environment is served at that host), a body that is not JSON or not the `{ success: true, data }` envelope, and a profile the schema rejects. None of them is ever judged as "no restriction". A URL with any other scheme is refused before anything is fetched. The file form is unchanged.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/service-analytics': patch
3+
'@objectstack/spec': patch
4+
---
5+
6+
feat(service-analytics): `list_datasets` and `query_dataset` — the dataset AI tools, one definition and one executor (ADR-0149 D2–D4)
7+
8+
Clause-②: yes (widening) — new exports `createDatasetTools`, `getDatasetToolDefinitions`, `DATASET_TOOL_DEFAULT_MAX_ROWS`, `matchDatasetTerms` and their types, and three new `AnalyticsService` methods (`datasetTools`, `hasPluginWiredAdmission`, `admitDatasetCatalogEntry`) plus `reportDatasetCatalogDefect`.
9+
Metadata-protocol: none
10+
11+
An AI can now answer a business question from a governed dataset instead of guessing a field on an object.
12+
13+
- **Two tools, defined once.** `getDatasetToolDefinitions()` returns the two `AIToolDefinition`s — names, the descriptions that teach the model the selection rule, and the JSON Schemas projected from `@objectstack/spec`'s tool schemas. `AnalyticsService.datasetTools({ loadDatasets, maxQueryLimit?, diagnoseDelegation? })` (or `createDatasetTools`) binds the executor; the MCP bridges and the product AI's registry both call it.
14+
- **`list_datasets`** lists the saved datasets the caller may query, with each member's label, business description and synonyms at the caller's locale. It asks the same gates a query of the dataset asks: a dataset whose object the caller may not read, or that is not API-exposed, is absent; a member over a field the caller may not read is left out and `membersWithheld: true` says so; a member over an `internal` field is left out for every caller and reported once to the server log. With `terms`, each dataset's `matches` names which word equals which member's name, label (any locale) or synonym, after the dataset schema's own normalization.
15+
- **`query_dataset`** runs a `DatasetSelection` against one saved dataset through `queryDataset` with the caller's context — no gate added, none skipped. A missing dataset and one the caller may not query both answer `NOT_FOUND`. Rows are capped (50 by default) with `truncated`; the answer carries no SQL and adds a `provenance` block (dataset, measures with their descriptions, dimensions, the caller's `runtimeFilter`) composed from what ran — the model's input cannot set it.
16+
- **Plugin-wired only.** Both tools refuse with `SERVICE_UNAVAILABLE` / 503 on an `AnalyticsService` built without the admission hooks `AnalyticsServicePlugin` wires, where the exposure gate would warn and pass and the read admission would return silently.
17+
- **Member descriptions reach the Cube.** `compileDataset` writes a dataset member's `description` onto the Cube member, so `GET /api/v1/analytics/meta` publishes it for a registered dataset cube.
18+
- The spec liveness ledger moves the four dataset member rows (`synonyms` and `description` on dimensions and measures) from `planned` to `live`.
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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/service-settings': patch
3+
'@objectstack/service-cluster': patch
4+
---
5+
6+
feat(cluster): a settings change on one replica reaches every replica
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
Multi-replica deployments on the `redis` cluster driver only. The single-node default (no declared replicas, or any driver but `redis`) emits exactly what it emitted before.
12+
13+
`settings:changed` is an in-process subscriber set, and its subscribers rebuild the auth posture, password / session / MFA policy, organization access policy, mail, SMS, storage and the AI provider. Under round-robin only the replica that took the write rebuilt; every peer kept the old configuration, security posture included, until it restarted.
14+
15+
- **A fifth cluster lane (`@objectstack/service-cluster`).** `MetadataClusterBridgePlugin` attaches the settings service to the cluster bus on the `settings.changed` channel, only where the deployment declares several replicas (`OS_CLUSTER_REPLICAS` greater than 1, or `OS_EXPECT_MULTI_NODE=true`) over the `redis` driver (`declaresMultiReplicaOnRedis`). The split-brain guard is unchanged.
16+
- **The message is an address, never a value (`@objectstack/service-settings`).** A write publishes the namespace, key, scope, action and time of the change. A peer emits its own local `settings:changed`, so each subscriber re-reads the shared store. A received change is never published again, and the writer's own message is dropped by its node id. New exports: `SETTINGS_CHANGE_CLUSTER_CHANNEL` and the `ClusterSettingsChangePayload` type; new methods `SettingsService.attachSettingsChangePubSub()`, `detachSettingsChangePubSub()` and `resyncSettingsChangePubSub()`.
17+
- **Joins `cluster.resync`.** When the cluster driver's connection returns after an outage, every registered namespace is announced locally once (`key: '*'`), so a change whose message was lost during the outage still takes effect without a restart.

0 commit comments

Comments
 (0)