Skip to content

Commit 1e112d6

Browse files
Merge branch 'main' into claude/project-thread-g9ecx3
2 parents 50b105c + 3c0033f commit 1e112d6

126 files changed

Lines changed: 3957 additions & 294 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/plugin-audit': patch
3+
'@objectstack/rest': patch
4+
---
5+
6+
feat(plugin-audit, rest): a query of an opted-in saved dataset writes one `dataset_query` row in `sys_audit_log` (#31797)
7+
8+
Clause-②: yes (widening) — a new `sys_audit_log.action` value, `dataset_query`, with its writer; a new `AuditPlugin` option, `datasetQueryAudit` (`datasets`, `maxBatchSize`, `flushIntervalMs`); a new `recordDatasetQuery` member on the `audit` service slot; and new exports from `@objectstack/plugin-audit` (`createDatasetQueryAuditWriter`, `buildDatasetQueryAuditRow`, `DATASET_QUERY_AUDIT_ACTION` and their types). `createReadAuditBatcher` takes an optional event type parameter and an optional `overflowMessage`, both defaulting to what it did before. No door answers differently: with no dataset named, nothing is recorded or buffered.
9+
Metadata-protocol: none
10+
Skills-docs: none — no file under `skills/**` teaches the audit ledger's actions or `AuditPlugin`'s options; `content/docs/permissions/record-view-auditing.mdx` gains a "Dataset queries" section.
11+
12+
**What a deployment gets.** Name saved datasets in `new AuditPlugin({ datasetQueryAudit: { datasets: [...] } })` and each query of one through `POST /analytics/dataset/query`, or through each query of its batch door, writes one run-level row: the caller (`user_id`, `actor`, `tenant_id`), the dataset's base object in `object_name`, and in `metadata` the dataset name, the package holding it (`dataset_package`, `null` for the environment's own definition; a name in `datasets` covers every holder of that name), `preview: true` when a draft definition was read, the dimensions and measures selected, the filtered field names and operators (never the values), the row count and the outcome. A report or dashboard is composed in the browser, so the row names the dataset, not a report.
13+
14+
**The rules.** Off by default and opted in per saved dataset; an inline definition (the Studio preview) writes no row. A request the door refuses before the read writes no row; a query that fails after the read started writes one row with outcome `failed`, the HTTP status and the error's machine code, never the error's text. Rows are written in batches off the request path, stamped with the query's instant, and a lost batch is reported at `error` once per cause.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/core': patch
3+
---
4+
5+
fix(core): a release artifact entry wrapped correctly whose content is refused ends its refusal on that content refusal, not on advice about the wrapper or about glob patterns
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`resolveArtifactPackageEntries` (ADR-0130 D4) refuses a `packages[]` entry as `INVALID_ARTIFACT_PACKAGE_ENTRY` / `422` and quotes the entry's parse issues. It used to append the same two pieces of advice to every such refusal: wrap an inlined body as `{ manifest: { … } }`, and the body holds definitions, not the authoring manifest's glob patterns. So an entry wrapped correctly whose record page places no component, whose `manifest.id` is invalid or whose body carries an undeclared key pointed its author at the wrapper and at globs, away from the one thing to fix.
11+
12+
The advice now follows the issue it answers. The wrapper advice is given when the entry itself is not an object or carries keys beside `manifest` / `source` (an inlined body), or when its `manifest` is missing or not an object. The assembled-body advice is given when `manifest.objects` or `manifest.datasources` (or an element of either) holds a string. Any other refusal ends on the quoted issues and, when issues are withheld, their count. A quoted issue that already ends on a period is no longer followed by a second one. The error code, the status, the leading sentence and the quoted issues are unchanged, and so is what is refused.
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): a stored computed field reads only its own row; the skills name the cross-record and volatile-input warnings
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The three places the published skills tell an agent to move a `formula`'s `expression` onto a stored field now say what that field may read. `objectstack-data` → Relationships → Computed column owns the sentence: a stored computed field reads only its own row; a related record's value (`record.product.unit_price`) keeps what it held at the row's last write and draws the `stored-expression-cross-record-input` warning, so it stays a `formula` (read time, not totallable) or becomes a snapshot a flow on the related object writes, and a field left stored is repaired by `os migrate stored-expressions --object OBJECT --field FIELD --changed --apply`; the clock (`now()`, `today()`, `daysFromNow()`, `daysAgo()`), the acting user, `can()` and `hasCapability()` are fixed at the write and draw `stored-expression-volatile-input`; a `formula` keeps them current, and for the clock a scheduled flow does too. The `formula` row in `rules/field-types.md` and the total-over-a-computed-value bullet in `objectstack-ui` `rules/dashboards.md` point to it. The dashboards bullet also stops saying existing rows have no backfill: rows a publish did not fill are filled by `os migrate stored-expressions --apply`. Both rules are warnings, not refusals; no schema or runtime change.
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 `notify` selectors say when `org:members` reaches nobody, and show the computed `owner_of:` form
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`objectstack-automation` § `notify` said `org:members` reaches every member of the run's organization, else that of the record the notification is about, and was silent on a run with neither. There the resolver warns in the server log and returns nobody while the node still succeeds: under the `single` posture, a `schedule` flow that declares no start-node `organization` and has no record hits it (under `group` the notification write itself is refused and the node fails). The line now says so, matching `content/docs/automation/flows.mdx`, and says the warning for an unrecognised `org:` value is a server-log one too. The `owner_of:OBJECT:ID` line now shows the form a flow needs, an envelope that builds the string from a computed id (`source: "'owner_of:crm_case:' + record.case_id"`). Paid for in the same file, no ceiling moved: the `NotifyConfigSchema` `strictObject` clause that restated "an undeclared key is a named parse error", three ADR asides, and the pointer that sends side effects to an object hook, which the skill's own description and objectstack-data already carry. No schema or runtime change.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
'@objectstack/cli': patch
3+
'@objectstack/plugin-audit': patch
4+
---
5+
6+
feat(cli): `os migrate audit-side-copies` runs the at-rest side-copy rewrite on the live audit tables and the archive
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
**Run `os migrate audit-side-copies` once after upgrading from 18.4.0 or earlier, a dry run first:**
12+
13+
```bash
14+
os migrate audit-side-copies # dry run: counts per table and store, writes no row
15+
os migrate audit-side-copies --object sys_audit_log # only one copy table (repeatable)
16+
os migrate audit-side-copies --apply # remove the columns (prompts; --yes skips the prompt)
17+
os migrate audit-side-copies --apply --yes --json # CI / scripts
18+
```
19+
20+
The audit writer no longer copies a side-copy column (another record's field values, today an approval request's `payload_json`) into `sys_audit_log` (`new_value`, `old_value`) or `sys_activity` (both halves of `metadata`). Copies written before that still carry it. Until they are rewritten, the read-time redaction drops the column and the query guard treats a query naming it as reaching every object, so the command is cleanup, not a gate.
21+
22+
- **The command.** It drives `@objectstack/plugin-audit`'s `migrateSideCopies` (the live `sys_audit_log` and `sys_activity` rows) and `migrateArchivedSideCopies` (the archive datasource `sys_audit_log` archives to). It is a dry run by default and writes only with `--apply`. Its flags are `os migrate audit-key-material`'s (`--database-url`, `--apply`, `--yes`, `--force`, `--json`) plus `--object`, which takes `sys_audit_log` or `sys_activity` and narrows the run, hot and archive, to the tables it names. Any other name is refused with `OBJECT_NOT_FOUND`, exit 1, before anything is read. The report gives, per copy table, the copies read and the copies rewritten (or to rewrite), for the hot tables and for the archive each, and never prints a value. It is idempotent: a second `--apply` rewrites nothing. A failed read or write, a sealed row it had to refuse, or an archive it could not reach exits 1, as for its twins.
23+
- **The rewrite's name (`@objectstack/plugin-audit`).** A sealed row the rewrite amends (ADR-0154 D7) now records `rewritten_by: 'os migrate audit-side-copies'`, the command that rewrote it, as `audit-mail-bodies`, `audit-key-material` and `audit-metadata-bodies` record theirs. It recorded `side-copy-migration` before, a name no release shipped; a row amended under it on a pre-release build keeps it.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/console': patch
3+
---
4+
5+
perf(console): the first load no longer downloads the Setup pages, the package form and the view config panel
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Every Console route, a dashboard included, used to download the Packages page with its package form dialog, the permission-set editor, the Setup pages for packaged actions, connector credentials, connector connections, position holders, permission-set assignment and the recycle bin, and the list view's config panel with the Studio form widgets it draws, before the app asked for any data. These now load the first time they are drawn: a Setup page when its entry is opened, the view config panel as a list mounts. The Console's eager closure (`dist/eager-closure.json`) goes from 2,293,387 to 2,163,688 bytes gzipped (−129,699), measured on two builds of the same tree. What each route draws is unchanged; a Setup page shows a one-line loading notice while its code arrives.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/plugin-auth': patch
3+
---
4+
5+
fix(plugin-auth): `POST /api/v1/auth/admin/create-user` reports the membership the store holds for the new account
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`membershipCreated`, in the answer and in the `user.admin_created` audit row, now says the new account holds a membership after the call, whichever writer made the row during this creation. The account did not exist before the call, so any membership it holds was made by this creation.
11+
12+
- Single-org posture: the `user.create.after` membership reconciler (the default-organization join) binds the new user while the account is being created, so the endpoint's own reconcile finds the row and yields. That used to answer `membershipCreated: false` next to the `organizationId` while `sys_member` held the row; it now answers `true`. When the endpoint inserts the row itself it answers `true`, as before.
13+
- Multi-org (walled) posture: a row already in the administrator's current organization is still respected (no second add-member), and is now reported as `membershipCreated: true` for the same reason.
14+
- Unchanged: under `membershipPolicy: 'invite-only'` on the single-org posture the answer and audit row carry no `organizationId` and `membershipCreated: false`, and no `sys_member` row is written. A bind that fails, finds no target organization, or meets an AI service account still answers `false`.
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): `objectstack-data` evals 11, 12 and 14 carry their own `must_contain` literals in the reference answer
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
In `objects-fields-relationships.json`, three evals listed `must_contain` literals that their own `expected_output` described only in prose, so the reference answer failed its own grader: eval 11 (`type: 'select'`, `type: 'state_machine'`), eval 12 (`type: 'summary'`, `type: 'formula'`) and eval 14 (`label: '公司名称'`, `value: 'active'`). Every literal is the spelling the data skill teaches on `main`, so the reference answers now spell them; eval 14's options are written in the skill's `{ label, value }` shape. No assertion, schema or runtime change.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/service-automation': patch
3+
---
4+
5+
fix(service-automation): a durable `http` node with no `method` sends POST on the no-outbox fallback too, as it does through the outbox
6+
7+
Clause-②: no — no accepted input, export or served shape is added; the no-outbox fallback now sends the verb the node's descriptor and the outbox already send.
8+
Metadata-protocol: none
9+
10+
A flow `http` node with `durable: true` and no `method` was enqueued as a POST when the messaging HTTP outbox was wired, but sent as a GET when it was not (the awaited fallback, and the one background send on a record save's path). The GET carried no body and was counted as a read, so the run reported it changed nothing. The verb is now resolved once — the authored `method`, else POST for a durable node and GET for a request/response one — and both paths send it, with the same body and signature the outbox would deliver. To keep the old behaviour, author `method: 'GET'` on the node.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@object-ui/console': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
fix(console): a signed-in person whose account link is refused as already linked to another user, or as unable to link, is told why on the page they land on
7+
8+
Clause-②: yes (widening) — the `@object-ui/i18n` locale packs gain two keys, `auth.login.errors.linkAlreadyLinkedToOtherUser` and `auth.login.errors.linkUnableToLink`, in all eleven shipped locales; no key is renamed or removed.
9+
Metadata-protocol: none
10+
11+
Linking another sign-in to your account can be refused by the server for two more reasons besides a different email: the provider account is already linked to a different user here (`account_already_linked_to_different_user`), or it could not be linked at all (`unable_to_link_account`, chiefly when the sign-in service did not confirm the account's email as verified). Both send you back to the Console sign-in page, which, because you are still signed in, sent you straight on to the console with no word. Each now travels the same way as the email mismatch: the page you land on shows an error toast with its own sentence, in your language, until you close it. The sentence names no other user or email, and nothing from the URL is shown as it came. The refusals themselves are unchanged.

0 commit comments

Comments
 (0)