Skip to content

Commit 986de61

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/issue-35047-formula-percent-return
2 parents 7822b6b + 97f3420 commit 986de61

551 files changed

Lines changed: 25407 additions & 4191 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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/cli': patch
3+
---
4+
5+
fix(cli): a config that fails to load is no longer reported as "Compile failed"
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
When the `os compile` child that `os dev`, `os start`, `os serve --dev` and `os environments bind --build` run exits non-zero, the closing line said `Compile failed — fix errors above …`. The parent sees only the child's exit status, so the same line followed a refusal raised while `objectstack.config.ts` loads (for example a licence or key-management refusal), and an operator went looking for a code error.
11+
12+
The line now says what is true of every way the child fails, a syntax error, a refusal thrown at load or a refusal that prints and exits: `objectstack.config did not load or compile — the reason is printed above; fix it before …`, with each command's own tail (`starting dev server`, `starting the server` with the `--artifact` hint, `starting the dev server.`, `binding`). The `os dev` watch recompile's failure line reads `✗ objectstack.config did not load or compile (Nms)` in place of `✗ compile failed (Nms)`, with the compile output after it as before. Nothing classifies the failure: exit statuses, error codes and the text the child prints are unchanged.
13+
14+
A script that matched `Compile failed` in this output should match `did not load or compile`.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
fix(metadata-protocol): the `object-storage-sync-refused` advisory reads true on every door that raises it
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The warning a refused storage sync puts on the answer is raised by the save, publish, rollback and revert doors, but its text spoke of "this save" and told every caller to "publish the object again". It now names no door ("the columns this change added"), and its hint names the remedies that work from each of them: restarting the server, or the next live write of the object, both of which run the storage sync again. The rule id, severity and the quoted driver reason are unchanged.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/metadata-protocol': patch
4+
'@objectstack/plugin-security': patch
5+
'@objectstack/cli': patch
6+
---
7+
8+
fix: four refusals say what the author can act on — the clone control by its console label, an empty or short unknown key, and an unknown CLI command
9+
10+
Clause-②: no
11+
Metadata-protocol: none
12+
13+
Nothing new is accepted or refused; only the words change.
14+
15+
- **Packaged permission sets.** The `ITEM_LOCKED` save refusal and the `NOT_OVERRIDABLE` lock refusals sent the admin to a "Clone" action. Studio's Access pillar and Setup label that control "New similar" ("新建类似" in a Chinese session), so the diagnostic and both end-user messages, in every language they ship, now name it that way.
16+
- **Unknown keys.** A refusal naming an empty key printed it as empty backticks; it now says "an empty key (`""`)" and offers no rename. On a key of five characters or fewer, a "Did you mean" rename is offered only when the declared key is one edit away, counting a swap of two adjacent letters as one: `lable` → `label` is still offered, while a removed `aria` is no longer answered with `areas`.
17+
- **CLI.** `os <topic> <unknown>` and `os <unknown>` still exit 2 without running anything, and now name the command as typed (`command environments frobnicate not found`) and end with the help that lists the real ones (`See more help with \`os environments --help\``).
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
'@objectstack/objectql': patch
3+
'@objectstack/plugin-security': patch
4+
---
5+
6+
fix(i18n)!: a refusal names fields, options and objects in the declared `sourceLocale` as authored
7+
8+
Clause-②: yes (narrowing) — `ValidationMessageContext.labelTranslation` is a new optional member (a widening), and `ValidationMessageContext.translate` no longer translates the labels a refusal names (a narrowing): a direct caller of `validateRecord`, `validateInsertValues` or `evaluateValidationRules` that passes `messages: { locale, objectName, translate }` now gets the declared labels until it also passes `labelTranslation`.
9+
Metadata-protocol: none
10+
Skills-docs: follow-up owed — skills/objectstack-i18n/SKILL.md, evals
11+
12+
<!-- adr-0087: not-required (runtime-interface-only packages/objectql/src/validation/record-validator.ts#ValidationMessageContext) the narrowed behaviour belongs to an input member of a runtime TypeScript interface, the messages option of the published validators; no packages/spec schema, registered node type, stored row or ADR-0087 conversion surface names it, and no key, value or default a metadata author can write changes, so there is nothing for objectstack migrate meta to rewrite -->
13+
14+
**BREAKING** for a TypeScript caller of `validateRecord`, `validateInsertValues` or `evaluateValidationRules` (`@objectstack/objectql`) that passes its own `messages`. Engine writes are not affected: the engine builds `labelTranslation` itself from the i18n service.
15+
16+
The labels a write refusal names are now resolved the way `GET /meta` serves them: `translateObject` over the deployment's translations, with the request's locale, the declared fallback chain and the authored language (`i18n.sourceLocale`, else `defaultLocale`). They are no longer looked up through `II18nService.t()`. Before this, an app authored in English that defaults its users to Chinese (`sourceLocale: 'en'`, `defaultLocale: 'zh-CN'`) answered an `en` request with the Chinese row in its validation, duplicate-record, delete-restricted and restore refusals, and in the security layer's master-detail and field-write `userMessage`. `/meta` answered the same request with the English label.
17+
18+
This covers a field label, a choice option label (field entry, then the shared picklist's), an object label, the master object named by the master-detail write gate and the fields named by the field-write gate. Message templates and authored rule messages still go through `t()`.
19+
20+
What follows from it:
21+
22+
- In the declared `sourceLocale`, a refusal names labels exactly as declared. In every other locale it follows the same chain `/meta` does.
23+
- The labels come from `getLocales()` and `getTranslations()`. An i18n double that implements only `t()` no longer translates labels and leaves the declared ones in place, as `/meta` already did.
24+
- On the in-memory i18n fallback (`@objectstack/core`), which reports no `getFallbackLocale()`, a request in a locale with no bundle now gets the declared label, as `/meta` does. Before, it got the default locale's row.
25+
- A platform-injected system field (`owner_id`, `created_at`, …) that keeps its English default label is named by the built-in translation of that label, as `/meta` names it.
26+
- The security layer's labels now negotiate the request locale the way `/meta` does, so a `zh-TW` request reads the `zh-CN` rows, in step with its `zh-CN` sentence.
27+
28+
## What a direct validator caller sees
29+
30+
| `messages` passed to `validateRecord` / `validateInsertValues` / `evaluateValidationRules` | was | now |
31+
|:---|:---|:---|
32+
| `{ locale, objectName, translate }` | field, option and object labels translated through `translate` | declared labels in every locale; `translate` renders message templates only |
33+
| `{ locale, objectName, translate, labelTranslation }` | not a member of the type | labels translated through `labelTranslation`, the way `GET /meta` serves them |
34+
35+
What to do on upgrade: add `labelTranslation: () => ({ bundle, options })` to the `messages` you pass, where `bundle` is a `TranslationBundle` keyed by locale and `options` is a `ResolveOptions` (both from `@objectstack/spec/system`). The pair is typed `ValidationLabelTranslation`, now exported as a type from `@objectstack/objectql` and `@objectstack/objectql/core`. Nothing else changes: the call compiles as before, and no verdict, code or status moves.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@object-ui/plugin-grid': patch
3+
'@object-ui/i18n': patch
4+
'@objectstack/spec': patch
5+
'@object-ui/types': patch
6+
---
7+
8+
feat(plugin-grid): an aggregate bulk action that resolves with a `BulkActionResult` is reported per row: the rows it moved, the rows it refused with its own reasons, and the rows it did not confirm
9+
10+
Clause-②: yes
11+
Metadata-protocol: none
12+
13+
The grid's bulk executor now reads the resolve value of an `execution: 'aggregate'` bulk handler. When it is a `BulkActionResult` (`{ succeeded: string[], failed: { id, message }[] }`, `BulkActionResultSchema` in `@objectstack/spec/ui`), the result panel shows how many selected rows were moved, lists each refused row under its record with the handler's `message` (and in the error CSV), and lists every selected row the result names in neither list as "not confirmed", never as succeeded. Ids are read against the dispatched `params._selectedIds`: an id outside the selection is dropped, a duplicate counts once, an id in both lists counts as failed, and when one id is in `failed` twice the first entry's message wins. A rejection is unchanged: it stays one outcome for the whole selection.
14+
15+
A handler that partly succeeds no longer has to reject to avoid being reported as full success: resolve with the per-row answer instead. The `[PLANNED — not enforced]` marker is removed from `BulkActionResultSchema`'s description and its reference page, and the "all-or-nothing" wording is removed from the `bulkActionDefs` description (`@objectstack/spec`) and the `BulkActionDef.execution` TSDoc (`@object-ui/types`).
16+
17+
**Declared behaviour change.** An existing aggregate handler whose own return value carries a top-level `succeeded` or `failed` member in another form (for example counts, `{ succeeded: 2, failed: 1 }`, or only one of the two lists) was reported as full success and is now reported as "unreadable": the panel says the action finished but its result could not be read, prints no per-row count, and the grid re-reads its rows when the dialog closes. To keep the success report, return a value with neither member (a summary under another name), or return both lists in the `BulkActionResult` shape. A handler that returns nothing, or a value with neither member, keeps today's report.
18+
19+
The widening is additive: three new keys in every locale pack `@object-ui/i18n` publishes (`grid.bulk.resultNotConfirmed`, `grid.bulk.notConfirmedRecords`, `grid.bulk.aggregateUnreadable`). No metadata key, value or default changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/objectql': patch
3+
---
4+
5+
fix(objectql): a roll-up `count`/`sum` that arrives with a restart now says at boot that its stored rows hold NULL, and names `os migrate summary-nulls`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A roll-up `summary` field added by an install in a running process is computed on the rows already stored. One that arrives with a restart (a code-defined app's new version that boots with the field, a marketplace install loaded at the next boot, a ledger entry rehydrated at boot) is not: the boot treats every roll-up it serves as already computed, so those rows kept reading NULL until one of their child rows was written, with nothing in the log.
11+
12+
At `kernel:bootstrapped` the ObjectQL plugin now reads the first 100 rows of each object that owns a `count` or `sum` roll-up (one read per such object, `id` and the roll-up columns only) and, when a sampled row holds NULL there, logs one warning naming each roll-up, how many sampled rows hold NULL, and the commands that fill them: `os migrate summary-nulls --object <object>` (dry run), then the same with `--apply`. A `min`/`max`/`avg` roll-up is not named: NULL there is its reading of "no child rows". The boot writes nothing and never fails over this check.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/plugin-auth': patch
3+
---
4+
5+
fix(plugin-auth): removing a pending person writes an admin audit row, and the host-failure texts say the removal is refused
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`POST /api/v1/auth/admin/remove-sso-user` now writes one `sys_audit_log` row for a removal that committed, through the same writer the add doors use: `action: 'delete'` on the removed `sys_user`, naming the administrator, with `metadata` `{ event: 'user.admin_removed_pending', hostNotified }` (`hostNotified` is whether the environment-user host took the cancellation of the invitation; `false` with no host wired). A refused removal (a host that cannot be reached, a host's refusal, a person who is not pending, a failed delete) writes no row. With plugin-audit uninstalled no row is written, as for the other admin user doors.
11+
12+
The removal door already refused with `503 SERVICE_UNAVAILABLE` when the environment-user host could not be reached, but the `warn` line logged in that case still said "The removal goes ahead.", and the `EnvironmentUserHost` and `environmentUserHost` option docs said a host failure is only reported on a removal. All three now say the removal is refused. Behaviour of the door is unchanged.
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): the hooks skill teaches when a `before*` hook's `ctx.api` writes roll back with a refused save
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
objectstack-data's `references/data-hooks.md`, "Before vs After Hooks" table: the `before*` Transaction cell no longer says only "Within transaction". It now says the hook runs in one transaction with the outer write, so a refusal anywhere in that write (a validation, a later hook, a driver constraint) rolls back the hook's `ctx.api` writes too, with no per-hook opt-out. It names the four exits: a caller's open transaction decides; a hooked object off the default datasource, or a default driver with no transactions (Turso's remote transport), opens none, so those writes stay stored after a refusal; a hook registered in code with `registerHook` opens none. It also says MongoDB needs a replica set, which was read in the driver's code and not measured. Best Practices gains one DON'T: a `before*` hook does not write business records to another datasource through `ctx.api`. Its transaction refuses that write with `CrossDatasourceTransactionWriteError`, and only an append-only ledger (`lifecycle.class` `audit` / `telemetry` / `event`) is written outside it. `evals/hooks-security-seeds-datasources.json` gains two cases, one for each rule. Four restatements in data-hooks.md were removed to pay for the new text.
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): the api and i18n skills teach `RuntimeBuildIssue.userMessage`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
objectstack-api's SKILL.md, in the error-envelope section, names the post-publish probe report a batch publish answers (`probes`, `BuildProbeReportSchema`) and its finding element (`RuntimeBuildIssueSchema`): `message` / `fix` are English for the agent that built the app, the optional `userMessage` is the sentence for the person who published, and a client shows a person `userMessage`, never `message`, with its own generic sentence when the field is absent; the publish door reads the request's locale from `Accept-Language` alone. objectstack-i18n's SKILL.md lists the `probes` issue among the server-composed user text, which its platform locale ladder covers. The api skill points at the schema and ADR-0038 for the rest. One new eval case in the api skill grades a client that renders a build finding to a person.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/driver-mongodb': patch
3+
---
4+
5+
fix(driver-mongodb): refuse a non-UTC date-bucket timezone on a direct `aggregate()` call instead of answering UTC buckets
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no export changes shape. What moves is one runtime answer of MongoDBDriver.aggregate() to a direct caller: a non-UTC timezone with a date bucket is refused instead of answered with UTC buckets. No stored row, registry key or authored value changes, so there is nothing for a migration to rewrite and no tombstone. -->
11+
12+
**BREAKING** for a direct `MongoDBDriver.aggregate()` call that carries a non-UTC `timezone` with a `dateGranularity` group-by item: it used to answer UTC buckets and now answers `NOT_IMPLEMENTED` / 501. It ships `patch` because it is a non-protocol breaking change (AGENTS.md Post-Task Checklist step 3): no metadata author writes a driver query, so `Metadata-protocol` is `none`, and the engine path never sends this driver a zone.
13+
14+
`MongoDBDriver.aggregate()` now refuses a query that carries a non-UTC `timezone` (`DriverAggregateQuery.timezone`) together with a `dateGranularity` group-by item, answering `NOT_IMPLEMENTED` / 501 before anything is sent to the server. It used to ignore the zone and return UTC calendar buckets with no word. This driver does not declare `supports.zonedDateBucketing`, so `engine.aggregate` never sends it a zone and buckets such a query in memory; only a caller that goes around the engine is affected. No `timezone`, or `UTC`, buckets in UTC as before, and a `timezone` on a query with no date bucket is still ignored.
15+
16+
Fix for a direct caller: route the query through `engine.aggregate`, or drop the `timezone` and accept UTC buckets.

0 commit comments

Comments
 (0)