Skip to content

Commit a280b7b

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-ubqwdg
2 parents 9f28020 + 22ce3d1 commit a280b7b

186 files changed

Lines changed: 9212 additions & 962 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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/plugin-list': patch
3+
---
4+
5+
refactor(plugin-list): `ListView` reads its view blocks through `ListViewSchema` instead of a `(schema as any)` cast
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The kanban, calendar, gallery, timeline, gantt, tree and chart blocks and `bulkActionDefs` are declared members of `ListViewSchema`, so `ListView` now reads them as typed members. The host-composed `rowActionDefs`, which the spec refuses on the list surface, is read through one narrow cast typed as the `object-grid` node declares it. Nothing a list view renders or fetches changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
feat(spec): the error-code ledger registers `ERR_EXCHANGE_RATE_MISSING` and `ERR_HOME_CURRENCY_UNSET`, and `@objectstack/spec/data` exports `CURRENCY_FRACTION_DIGITS` (ADR-0144 D5, Open items 3 and 9)
6+
7+
Clause-②: yes (widening: two new error codes under `@objectstack/objectql` in `ERROR_CODE_LEDGER`; the `CURRENCY_FRACTION_DIGITS` table, already in the package, is now exported from `@objectstack/spec/data`. No Zod schema shape and no table value changes)
8+
Metadata-protocol: none
9+
10+
⛔ Not released alone: these are part of the R2 core (ADR-0144 D9) and ship with R1 in 18.3.0, together with the write-time home-currency projection that answers them, the `sys_exchange_rate` table (#27185) and the `localization.currency` lock (#27198).
11+
12+
- `ERR_EXCHANGE_RATE_MISSING` (400): a write that must convert an amount into the home currency found no exchange rate in force on the record's document date.
13+
- `ERR_HOME_CURRENCY_UNSET` (400): the same write found no home currency, because the organization's `localization.currency` setting is not set.
14+
- `CURRENCY_FRACTION_DIGITS` (CLDR fraction digits per code, which differ from ISO 4217's minor units for some codes such as IQD, HUF, COP, IDR and PKR) is the table the engine rounds a home amount with, exported so a consumer rounds with the same table instead of a copy.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@objectstack/objectql': patch
3+
---
4+
5+
feat(objectql): a record-mode amount that declares `currencyConfig.homeAmount` stores its value converted into the home currency, with the rate used, on every write (ADR-0144 D5)
6+
7+
Clause-②: yes (widening: `ObjectQL.setHomeLocalizationResolver(resolver)` is new public engine surface; the write refusals below reach only an object that declares `currencyConfig.homeAmount`, a key that ships in this same release, so no released accept set narrows)
8+
Metadata-protocol: none
9+
10+
⛔ Not released alone: this is the engine half of the R2 core (ADR-0144 D9). It ships with R1 in 18.3.0, together with the `currencyConfig.homeAmount` key (#27191), the `sys_exchange_rate` table (#27185) and the `localization.currency` lock (#27198).
11+
12+
When a record is inserted, and when an update changes its amount, its currency code or its document date, the engine writes the two fields `homeAmount` names:
13+
14+
- **The rate** is the organization's `sys_exchange_rate` row for the record's currency with the latest `effective_date` on or before the document date (`homeAmount.rateDate`). A `datetime` document date is dated in the organization's `localization.timezone` (UTC when unset): an invoice written at 01:00 in Shanghai takes that Shanghai day's rate. A `date` is its own day. The row's rate is stored in `homeAmount.rateField` as it is, unrounded.
15+
- **The home amount** is the amount divided by the rate (a rate states how many units of the foreign currency one unit of the home currency buys), computed in exact decimal arithmetic and rounded once, half away from zero, to the home currency's CLDR fraction digits (0 for JPY, 2 for USD and CNY, 3 for KWD; for a few codes, such as IQD, HUF, COP, IDR and PKR, CLDR's count differs from ISO 4217's minor units, and CLDR's applies). USD 10,000 at 0.1389 into CNY stores 71994.24.
16+
- **Same currency as home:** rate `1`, no rate read. **Blank amount:** blank home amount and rate.
17+
- **The home currency** is the `localization.currency` setting, read for the row's organization through the `settings` service, in one grouped read with `localization.timezone`. `ObjectQLPlugin` wires it; an engine booted without the plugin answers both through `setHomeLocalizationResolver`.
18+
- **The engine's alone.** A value a caller sends for either field is dropped (or refused under `strictReadonlyWrites`) as before; a `defaultValue`, a system write or a historical (`preserveAudit`) import of either field is computed over.
19+
- **Refusals, before anything is written:** `ERR_EXCHANGE_RATE_MISSING` / 400 when no rate row is in force on the document date (the message names the currency and the date; never a rate of 1, a later rate or an empty home amount); `ERR_HOME_CURRENCY_UNSET` / 400 when the organization has no `localization.currency` (never an assumed home currency); `VALIDATION_FAILED` `required` on the date field when a foreign-currency amount has no document date. A multi-row insert (`insertMany`, the import) refuses only the offending row; an update by filter is refused when its one patch would convert the matched rows to different home amounts.
20+
- **Every door, one path.** REST create and update, the import (batched and per row, dry run included) and `validate()` reach the same insert and update seam, so they convert and refuse alike.
21+
- **No migration.** Nothing changes for an amount that does not declare `homeAmount`.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
'@objectstack/rest': patch
3+
'@objectstack/plugin-hono-server': patch
4+
'@objectstack/cloud-connection': patch
5+
'@objectstack/types': patch
6+
---
7+
8+
feat(rest,plugin-hono-server,cloud-connection): metadata lists, the uncached item reads, `runtime/config` and `auth/me/localization` answer an `ETag` and `304`; every timed response carries `db`, `meta` and `total`
9+
10+
Clause-②: no
11+
Metadata-protocol: none
12+
13+
The Console's first reads on every load sent no validator, so each one was a full download every time. Measured against HotCRM on `main`, none of these sent an `ETag`, a `Cache-Control` or a `304`: `GET /runtime/config`, `GET /auth/me/localization`, the type list (`GET /meta`, `GET /meta/types`), every `GET /meta/:type` list, and the item reads the shared item cache never serves (`GET /meta/app/:name`, `/meta/dashboard/:name`, `/meta/doc/:name`, `/meta/book/:name`, and drafts, `?package=` and member-scoped reads). Each of them now answers:
14+
15+
- **`ETag`**: a weak validator (`W/"…"`) that hashes the body actually served, after every per-caller step (read gates, the app filter, the field mask, the translation, the host's environment). Two callers whose permissions change what they see get different validators, and one caller's validator never answers `304` for another caller's body.
16+
- **`Cache-Control: private, no-cache`**: the browser keeps the body and revalidates it on every use, so a publish, a permission change or a language switch shows on the next read. No shared cache stores it. A schema served under an undetermined field visibility keeps `private, no-store` and gets no validator.
17+
- **`304 Not Modified`**, with no body, when `If-None-Match` names the current validator.
18+
19+
`metadata.enableCache: false` still switches the `/meta` validators off, as its description says ("Enable HTTP cache headers").
20+
21+
`Server-Timing` (still opt-in: `OS_SERVER_TIMING=true`, or an admin's `X-OS-Debug-Timing: 1`):
22+
23+
- Every timed response carries `db` and `meta` beside `total`. A request that ran no SQL or read no metadata says so with a zero member (`db;dur=0;desc="0 queries"`), so "nothing spent there" no longer reads like "not measured".
24+
- The `/meta` routes count each metadata read into `meta` (`meta;dur=…;desc="N reads"`).
25+
- `GET /runtime/config` now opens the timing gate for an admin who sends `X-OS-Debug-Timing`. It resolves the caller only when that header is sent; the payload never depends on who asked.
26+
27+
`@objectstack/types` exports the rule the three packages share: `representationEtag(body)`, `ifNoneMatchHits(header, etag)` and `REVALIDATE_PRIVATE_CACHE_CONTROL`.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/core': minor
4+
'@objectstack/runtime': minor
5+
'@objectstack/plugin-audit': minor
6+
---
7+
8+
feat(spec,runtime,plugin-audit): an action run through MCP leaves an audit row naming its surface
9+
10+
Clause-②: yes (widening)
11+
Metadata-protocol: added
12+
13+
The audit trail could not tell an action an agent ran over MCP from one a person clicked. Neither action door wrote a row for the invocation itself: the script branch printed a `[action-audit]` log line, the api, flow and declarative-update branches printed nothing, and the `sys_audit_log` rows for the action's own data writes do not say which door started it.
14+
15+
- **`ExecutionContext.surface`** (`@objectstack/spec`): `'rest' | 'mcp'`, optional. The door an action invocation came through. Set only by the two action doors, from the door's own identity, on the envelope of the invocation they record; never client-supplied, never read by authorization. `@objectstack/core` declares it a non-entry field (identity resolution does not produce it).
16+
- **One `action_invocation` row per invocation** (`@objectstack/plugin-audit`): the `audit` service slot gains `recordActionInvocation`, and `sys_audit_log.action` gains the value `action_invocation`. The row carries the caller (`user_id`, `actor`, `tenant_id`), the action's object and subject record, and in `metadata` the `surface`, `action_name`, `branch` (`script` / `api` / `flow` / `update`), `outcome`, the status and error code of a refusal, the `run_id` of a `resume_run`, and `performed_by` / `on_behalf_of` when an agent performed the call. No new column.
17+
- **Both doors write it on every branch** (`@objectstack/runtime`): REST `POST /actions/:object/:action` (`surface: 'rest'`) and the `/mcp` bridge's `run_action` / `resume_run` (`surface: 'mcp'`), for every call that cleared the door's admission gates, whether the branch then answered or refused. A call refused by an admission gate (not found, `ai.exposed`, the `requiredPermissions` gate, the activation switch, the param contract, the confirmation gate) ran nothing and writes no row. The `api` branch's row is written by the door after the forward answers, so it names the true door although the target re-authenticates the caller.
18+
19+
Nothing about which actions a door may run changes. The existing `[action-audit]` log line stays. To read the rows: filter `sys_audit_log` on `action = 'action_invocation'` and read `metadata.surface`.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@object-ui/core': patch
3+
---
4+
5+
`SPEC_ACTION_KEYS` lists `submitText`, the key `@objectstack/spec` adds to `ActionSchema` for the param dialog's submit button label. An action that carries it is not counted as having an unknown key, and the inventory pin stays green.
6+
7+
Clause-②: no
8+
Metadata-protocol: none
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
'@objectstack/spec': minor
3+
---
4+
5+
feat(spec): an action's param dialog can name its own submit verb — `submitText`
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: added
9+
10+
`ActionSchema` gains one optional key, `submitText`: the label of the submit button in the dialog an action opens to collect its `params`. The button says "Confirm" today for every such action. With the key, a send-email action can say "Send" and a log-call action "Log Call". An action that does not declare it parses exactly as before.
11+
12+
```ts
13+
defineAction({
14+
name: 'log_call',
15+
label: 'Log Call',
16+
objectName: 'crm_contact',
17+
target: 'logCall',
18+
submitText: 'Log Call',
19+
params: [{ name: 'subject', label: 'Subject', type: 'text', required: true }],
20+
});
21+
```
22+
23+
- **An `I18nLabel`.** A plain string or an inline locale map (`{ en, 'zh-CN' }`). A blank string is refused at parse: `''` or whitespace only. Omit the key to keep "Confirm". `submitLabel` and `confirmLabel` (the same button's spelling on a view's `bulkActionDefs`) are refused with a rename to `submitText`, on the action and in a translation bundle.
24+
- **Actions with `params` only.** The param dialog opens only for a non-empty `params`, so `submitText` on any other registered action is refused at parse, naming the key. It is not `confirmText`, the message of the confirm dialog a param-less action opens.
25+
- **Translated like `description`.** The slot is `objects.OBJECT._actions.ACTION.submitText` (`globalActions.ACTION.submitText` for an action with no `objectName`). `translateAction` overlays it for an action that declares `params`, and never gives a button to an action without them.
26+
- **The name.** `submitText` is the protocol's existing word for a submit button's copy: the `object-form` component's `submitText`, beside its `cancelText`.
27+
28+
Nothing draws the key yet. The console's param dialog reads it in a follow-up change. Until then the liveness ledger marks it `planned` with `authorWarn`, so `os validate` warns an author who declares it that the button still says "Confirm".
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@objectstack/lint': patch
3+
---
4+
5+
`validateTranslationReferences` judges an action translation's new `submitText` key (`@objectstack/spec`'s param dialog submit label). Under an action that declares no `params`, at `objects.OBJECT._actions.ACTION.submitText` or `globalActions.ACTION.submitText`, it reports `translation-target-unknown` at `error`: such an action opens no param dialog, so nothing reads the label. Under an action that declares `params` the key is accepted.
6+
7+
Clause-②: no
8+
Metadata-protocol: none
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the automation guide says a `connector_action` input is judged against the action's `inputSchema` before dispatch
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
This text shipped in PR #28170 (#28041 / #28162), which missed its `@objectstack/skills` changeset; this entry carries it.
11+
12+
- **`objectstack-automation/SKILL.md`**: once evaluated, a `connector_action`'s `connectorConfig.input` is judged against the action's `inputSchema` (`required`, `type`, `properties`, `items`) before dispatch, and a breach fails the step `VALIDATION_ERROR` (`fault`-routable) with nothing sent. `registerFlow` and `os validate` refuse a `{…}` template token at `connectorConfig.input.<key>`.
13+
- **`objectstack-automation/references/integration-recipes.md`**: a record value reaches the payload through a CEL envelope (`{ dialect: 'cel', source: 'record.<field>' }`), and the recipes say that envelope is judged against the `inputSchema`.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/runtime': patch
3+
'@objectstack/objectql': patch
4+
'@objectstack/trigger-record-change': patch
5+
---
6+
7+
feat(runtime): an admin can disable a `type: 'module'` package of an installed app, and a disabled package's navigation contributions and record-change flows stop (#28117)
8+
9+
Clause-②: yes (widening) — `PATCH /api/v1/packages/:id/disable` now accepts a module of an installed app, which it refused `422 WRITABLE_PACKAGE_REQUIRED` before. Nothing is narrowed.
10+
Metadata-protocol: none
11+
12+
A suite ships one artifact: its `type: 'app'` package and several `type: 'module'` packages. A customer who does not use a module can now switch it off in their environment, and "disabled" keeps its one meaning: hidden, refused on the data plane, data kept.
13+
14+
- **The disable door** (`@objectstack/runtime`). An admin with `manage_metadata` may disable a package whose `manifest.type` is `'module'` and whose `manifest.dependencies` directly name an installed package of `manifest.type` `'app'`, unless its own `manifest.scope` is `system` or `cloud`. This holds for a suite booted from code and for one installed from the marketplace: both leave the same row. Every other read-only package answers the disable door `422 WRITABLE_PACKAGE_REQUIRED` as before: the app itself, a plugin, a platform package, a module that declares no app or whose app is not installed. The exemption is for disable only. The module stays read-only for authoring, so edit, publish, revert, delete and overwrite still refuse it, and its served row still says `writable: false`.
15+
- **Navigation** (`@objectstack/objectql`). `SchemaRegistry.applyNavContributions` drops the contributions of a disabled package, so `getApp`, `getAllApps` and the protocol's `app` reads (`GET /api/v1/meta/app`, `GET /api/v1/meta/app/:name`) no longer list a disabled module's menu entries. They come back on enable. A disabled package's contribution into a missing group is not relocated and raises no `nav_contribution_group_missing` diagnostic.
16+
- **Record-change flows** (`@objectstack/trigger-record-change`). A flow bound to an object whose owning package is disabled is not run for a write made in-process (an app hook's `ctx.api.object(...)`, another flow, a service), which the engine still accepts. The record is written; the flow runs again once the package is enabled. Writes through the data plane were already refused.
17+
- **Already in place**, and now pinned on the module path: the data plane's `404 OBJECT_PACKAGE_DISABLED` for the module's objects, and the per-environment state file that replays a disable at boot.
18+
19+
An app hook that reads a disabled module's object through `ctx.api.object(name)` is served the kept records: the in-process read is not refused, and this release does not change that. The marketplace handbook says so under "Disabling a module".

0 commit comments

Comments
 (0)