Skip to content

Commit 0f74af4

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/area-A5-33712
2 parents c09b8aa + 4bd3f24 commit 0f74af4

111 files changed

Lines changed: 5123 additions & 427 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+
'@objectstack/objectql': patch
3+
'@objectstack/service-analytics': minor
4+
---
5+
6+
feat(objectql): a nested-relation condition on a read verb is an in-database subquery per relationship, up to three relationships, where that is provably the same read as the id read; analytics serves the dataset's own `filter` the same way
7+
8+
Clause-②: yes (widening) — `{ account: { status: { $ne: 'cancelled' } } }` on `find`, `findOne`, `count` and `aggregate` (and so every analytics face that hands the engine the nested form) is served whatever the number of matching related records on a driver that compiles the subquery (the SQL drivers; the in-memory driver evaluates it in process), where more than 1,000 answered `INVALID_FILTER` / 400. The related read is planned through its whole pipeline as the caller and its final `where` becomes the subquery's scope; related-object read restrictions the planned read observes are carried into the subquery, or the hop falls back to the id read (the related object read as the caller, then `$in`, under the 1,000 cap). A relation key inside the condition may now carry a condition of its own, down to ADR-0071's three relationships (`{ contact: { account: { region: { name: 'NA' } } } }`), where a second level answered `INVALID_FILTER` / 400; each hop is that object's own read, and a fourth relationship is refused by name. On the analytics engine-aggregate path a dotted `where` leaf through up to three relationships (`order.customer.tier`), and a cross-object leaf in a compiled dataset's own definition-level `filter`, reach the engine as that nested condition, where both answered `INVALID_FIELD` / 400. Still the id read, under the 1,000 cap: a related object on another datasource, a federated related object, a driver that compiles no subquery (MongoDB, OData), a related object an object-scoped middleware or an `afterFind` hook shapes, a related object read under different driver options than the outer object (decided before planning where the registry answers it: the two objects' tenancy class under a walled posture), a related read that a middleware answers itself, a multi-valued relation and the `update` / `delete` verbs. A hop that falls back after planning dispatches the related read twice: its middleware chain and `beforeFind` hooks run for the planned read and again for the id read. A per-measure `filter` carrying a cross-object leaf stays refused. The SQL echo of a dataset `filter` carrying a served cross-object leaf refuses `INVALID_FILTER` / 400 where it refused `INVALID_FIELD` / 400; neither printed a statement.
9+
Metadata-protocol: added — a compiled dataset's definition-level `filter` (`@objectstack/service-analytics`) now accepts a cross-object leaf on the engine-aggregate path, where it answered `INVALID_FIELD` / 400: a new accepted value for a dataset author.
10+
Skills-docs: `content/docs/protocol/objectql/query-syntax.mdx` and `content/docs/kernel/contracts/data-engine.mdx` describe the subquery, the three-relationship limit, where the id read and its cap still apply and which drivers compile the subquery. `skills/objectstack-query` still says "up to 1000 related ids" and one level for every relation; that is now stricter than the engine for a single-valued relation on a read verb (a follow-up skills-only change, governed).
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
'@objectstack/lint': minor
3+
'@objectstack/spec': minor
4+
---
5+
6+
fix(lint): the runtime `object_extension` publish door refuses an extension that adds a field under a label the object it extends already shows, or under the label of another field of the same extension (`field-label-duplicate`)
7+
8+
Clause-②: no (narrowing) — the `object_extension` publish door (Studio's add-field on a `.custom` pair, `PUT /api/v1/meta/object_extension/TARGET`, the MCP and AI authoring doors) now refuses an extension whose fields create a `field-label-duplicate` clash on the object it extends. No exported type or signature changes. Measured first-party: the two extension entries (`examples/app-showcase` on `showcase_account`, three fields; `packages/plugins/plugin-auth` on `sys_sso_provider`, one `secret` field) add no clash, as written or in any locale, so nothing first-party is newly refused. HotCRM: not measured.
9+
Metadata-protocol: narrowed
10+
Skills-docs: none owed — this PR edits `content/docs/deployment/validating-metadata.mdx` (the object extension door paragraph names the rule); `os explain field-label-duplicate` names the door; `skills/objectstack-data` teaches `defineObjectExtension({ extend, fields })` and reusing `owner_id` instead of a second owner field without saying the runtime door is exempt, so the door now gives the verdict the build already gives.
11+
12+
<!-- adr-0087: registered object-extension-door-field-label-duplicate-refused -->
13+
14+
**BREAKING** accept-set narrowing of the runtime `object_extension` publish door (`lintDuplicateFieldLabels` joins its `runtimeTypes`).
15+
16+
`os build`, `os validate` and `os lint` refuse an object whose visible fields share one label, extension fields of the same stack folded in, and the publish door refused it on an `object` write. An `object_extension` write ran no such judgment, so an extension could add a field under a label its target already shows (a `user` field labelled 负责人 beside the injected `owner_id`, which a `zh-CN` reader is served as 负责人), or two fields of its own under one label, and publish with a 200: two columns of one name in every grid, card and form of the object.
17+
18+
- On an `object_extension` write the rule judges the target as it will be served after the write: the door's live target without the package's own stored extension (which the write replaces), the written entry folded in among the target's other packages' extensions by priority, as `os build` folds every package's entry. A field two packages add at the priority that decides it is left out, as at the build. The injected columns are read as the platform's, so the finding names `owner_id` as the platform's column.
19+
- A refusal is the gate's `422 INVALID_METADATA` with issue rule `field-label-duplicate`, located on the extended object (`objects.TARGET.fields`), naming the object, every field of the group, the shared label and, when only some locales clash, those locales: the message the build gives for the same entry.
20+
- The write is charged only with a clash its entry creates: a clash the target already carries is not the extension's to answer for, nor is what is left of one after the entry took a field out of it (a new label, `hidden: true`, or a tie at the deciding priority); an entry that joins one changes the group and is refused.
21+
- Unchanged: the object save door, `os build`, `os validate`, `os lint`, a draft save (never gated), and a stored extension, which is served and is judged only when it is published again.
22+
23+
Migration: before publishing an extension again, give each field it adds a label the extended object does not already show and no other field of the same extension carries, set `hidden: true` on it, or drop it and use the field the object already has (the platform's `owner_id` for an owner). The door compares labels as written and as the platform translates its own columns; it reads no translation bundle, so a bundle edit neither raises nor clears a refusal there (`os build` and `os validate` judge the bundle). Upgrade-guide entry `object-extension-door-field-label-duplicate-refused`.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/scenarios': patch
3+
---
4+
5+
feat(scenarios): a roll-up the build leaves readable over child data the card withholds is a failed Build check
6+
7+
Clause-②: yes (widening) — through `./runner`: the new exports `rollupSourceCharges`, `readRollupSourceFinding`, `RollupSourceCharge` and `RollupSourceReading` (`orchestrate.ts`) and `rollupSourceFindings` and `rollupSourceChecks` (`scorecard.ts`); the new optional field `BuildHalf.rollupSourceUnreadable` (`orchestrate.ts`); a new runtime dependency on `@objectstack/lint`. An answer that moves: the Build score of a matching build (`buildTally`'s `total`, the record's `build` / `iterate-build` verdict) and `buildPassed`, so such a build is no longer installed as the verified build of template and ask modes
8+
Metadata-protocol: none
9+
10+
`os build` reports `security-rollup-source-unreadable` as an advisory warning when a permission set can read a parent's roll-up summary but not the child object, the aggregated child field, or a child field the roll-up's filter tests; the build still succeeds. The scenario runner passed such a build with the warning standing, so a card that withholds that child from a persona scored full on Build while the built app still showed that persona an aggregate of the data the card hides.
11+
12+
The Build half now runs the rule itself (`validateRollupSourceVisibility` from `@objectstack/lint`) on the built artifact — never on the bounded tail of `os build`'s output it keeps — in every build that produces one: scratch, its iterate, and template mode's iterate on what the app serves. A finding is charged when its permission set is a card persona's own and that persona's `hidden` withholds the roll-up's child object, or the child field the finding names. Each charge is one failed Build check (in total, never in passed; `rollup-source-unreadable:PERSONA:PARENT.FIELD` in the run record's evidence, with the rule's own report on `BuildHalf.rollupSourceUnreadable`) and one Build finding naming the persona, the roll-up and the withheld child. A finding on a set no persona holds, on a child the card lets the persona read, or the rule's `info` row-scope arm is not charged. Ask mode authors nothing and is never charged. A build with no such finding scores, renders and records exactly as before.
13+
14+
The remedy is the rule's own: mask the parent summary on the persona's set (`fields["PARENT.SUMMARY"]: { readable: false }`).
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
'@objectstack/plugin-sharing': patch
3+
---
4+
5+
fix(plugin-sharing)!: the write gate judges by id exactly the writes the engine runs by id
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) a runtime authorization answer moves: no metadata key, accepted value or stored row changes, so `os migrate meta` has nothing to rewrite -->
11+
12+
The sharing write gate now takes its by-id or bulk branch from the engine's own dispatch decision for the write's options. A write the engine runs by id is judged by id, as before. Every other write is one the engine runs as a predicate, an `$in` or `$eq` on `id` included, and it meets the bulk write scope: it writes the rows the caller may update or delete, leaves the others as they were, and answers no error.
13+
14+
A member's multi-row delete or update of rows it owns, on a `private` or `public_read` object with an `owner_id`, now lands where it answered 403 FORBIDDEN.
15+
16+
A call the engine refuses at dispatch (for example a scalar `where.id` beside another key without `multi: true`, or a payload `id` beside a `where` predicate) now gets the engine's own refusal, the answer a system caller gets, instead of this gate's 403 first. It is refused either way and nothing is written.
17+
18+
**BREAKING** for a caller of a multi-row (`multi: true`) update or delete in one of two shapes, both of which the engine runs as a predicate and the gate now judges as one:
19+
20+
- a `where` that carries a scalar `id` beside another key;
21+
- an `id` that is falsy (`''` or `0`).
22+
23+
Such a write meets the bulk write scope instead of the by-id judgment:
24+
25+
- a row the caller may not write is left as it was, and the write answers no error where it answered 403 FORBIDDEN;
26+
- a row the caller may write only because an application row-level policy widens the sharing scope for it (the by-id judgment's deferral to such a policy) is no longer written by these two shapes, as for every other predicate write.
27+
28+
To write such a row, address it by id alone (`where: { id }`, or the payload `id`): that write is judged by id, as before.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
fix(metadata-protocol): an exact by-name read (`?package=X`) of a `doc`, a `view` or another type the exact qualifier does not judge no longer answers another package's item from the metadata service
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`GET /api/v1/meta/doc/NAME?package=X` (both transports, and every reader of the protocol's by-name read) answered the other package's doc when two packages ship the name and the other one registered last. The metadata service keeps such a type by name alone, so it holds the item of the package registered last, and the read asked it before the registry. Now that copy is not served at X's address when it is stamped with another installed package (one that is neither X nor X's customization pair). The registry's read naming X answers X's own item instead (ADR-0150 D3: an exact address answers that holder).
11+
12+
The same holds for every type the exact qualifier of ADR-0150 D5 does not judge: `doc`, `view`, `translation`, `field`, `seed`, `datasource`, `external_catalog` and `object_extension`. `position` and `capability` keep one package holder. `object` is not changed: one package owns an object name, and the registry reads it by name. The covered types were already right, because the exact qualifier replaces another package's copy after the layers.
13+
14+
Unchanged: a package that is the only holder, a service copy bound to no package, a copy stamped X, and the read that names no package.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/plugin-webhooks': minor
4+
---
5+
6+
fix(spec,plugin-webhooks)!: a webhook can no longer be saved with method `GET`, and a stored GET webhook is parked with a visible reason instead of failing silently
7+
8+
Clause-②: no (narrowing)
9+
Metadata-protocol: narrowed
10+
Skills-docs: none — `git grep` of `skills/` finds no webhook `method` value taught anywhere, so no page names `GET` as a webhook method.
11+
12+
<!-- adr-0087: registered webhook-method-get-retired -->
13+
14+
**BREAKING** for a webhook authored with `method: 'GET'`. Every webhook delivery sends the event envelope as its request body, and a GET request carries none, so no GET webhook ever delivered an event: the outbox sent the body, the HTTP client refused a GET with a body, and the delivery retried until dead. `GET` is removed from both authoring surfaces.
15+
16+
What moves (each line FROM → TO):
17+
18+
- `WebhookSchema.method` (`@objectstack/spec/automation`, a declared webhook in `defineStack({ webhooks })`): FROM `GET` / `POST` / `PUT` / `PATCH` / `DELETE` TO `POST` / `PUT` / `PATCH` / `DELETE` (default `POST`, unchanged). `method: 'GET'` fails parse with a prescription naming the four methods; any other unknown method keeps zod's own message. A declared GET webhook already in a registry is skipped with the existing "declared webhook failed validation — not dispatched" warning.
19+
- the `sys_webhook` `method` select (`@objectstack/plugin-webhooks`, Setup and the data API): FROM five options TO four; an insert or an update with `method: 'get'` FROM stored TO refused 400 `VALIDATION_FAILED`. The `options.get` translation leaves every locale bundle.
20+
- a `sys_webhook` row already stored with `get`: FROM retried until dead on every event (and, from the outbox's bodyless-GET refusal on, a lost-event log line and no delivery row) TO parked — each event it matches is written to `sys_http_delivery` as a `dead` row with 0 attempts, no signature and a reason that names the method and the fix, said once at `error`; nothing is sent and the row cannot be redelivered.
21+
22+
The fix: set the webhook's `method` to the one the endpoint accepts a body on — `POST` (the default), `PUT`, `PATCH` or `DELETE`. The parked row re-arms at the next periodic cache refresh. A receiver that only answers GET cannot take a webhook.
23+
24+
No conversion is made, at load, at save or by a migration (ADR-0087 D3, entry `webhook-method-get-retired`): there is no lossless one, because converting GET to another method would start sending a different request to an endpoint its administrator configured for GET. A stored row's method is left exactly as stored.
25+
26+
Unchanged: a `POST` / `PUT` / `PATCH` / `DELETE` webhook delivers byte-identically; `HEAD` was never a webhook method on either surface.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/service-settings': patch
3+
'@objectstack/cloud-connection': patch
4+
'@object-ui/app-shell': patch
5+
---
6+
7+
fix(console): the console asks the deployment notice, install-local and a page's lookup targets only of a host that serves them
8+
9+
Clause-②: yes (widening)
10+
Metadata-protocol: none
11+
12+
A hosted environment's console asked three routes its host does not serve, and each answered an error in the network log on every load.
13+
14+
- **The deployment notice.** `GET /api/v1/runtime/config` now serves `features.deploymentNotice`. It is true exactly when the deployment notice is composed on this host: `SettingsServicePlugin` registers the notice's door as the kernel service `settings.deployment-notice` when it mounts the settings routes with it, and `RuntimeConfigPlugin` reads that registration per request. A host that mounts the settings routes itself, with no door, answers `GET /api/settings/deployment/notice` with `503` and now reports `false`. The route table is the same on both hosts, so it cannot answer this. A host's `resolveFeatures` policy cannot override the key. The console's home and System Overview read the notice only when the key is true. A runtime that serves no key is older than this change and still serves the notice, so the console keeps reading it there; only an explicit `false` stops the read.
15+
- **Install-local on the marketplace catalog.** The catalog's side load reads `GET /api/v1/marketplace/install-local` only when `features.installLocal` is true, the gate the package page already reads. A host without it no longer answers a `404` on every load and Refresh, and the catalog list draws as before.
16+
- **A page's lookup targets.** In an app with no package, a page and an object's route asked each lookup target's definition by name, and a target the host does not register (`sys_business_unit` on the control plane's Members page) answered `404` on every open. The targets the route has not asked already are now asked first in one `GET /api/v1/meta/object?names=` read, which leaves an absent object out, and only the ones it serves are then read by name. A registered target still resolves as before. An app with a package reads its lookup targets as before.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/console': patch
4+
---
5+
6+
fix(app-shell): an object list page reads its object once per load
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
An object list page sent two reads of its object on every load: the list's own `GET data/OBJECT?top=50&…` and a `GET data/OBJECT?top=0` record-count probe, and the probe was sent again on every refresh. The probe's number fed a page-level count that nothing drew any more. The footer it once fed was retired with the split pane, and the one panel prop it still reached was never read. The record-count bar under the list and the view count in the title both take the `total` from the list's own answer, which carries the view's filters and search. The probe is gone, so a list page load sends one `data/OBJECT` read, and a refresh sends one. The numbers on the page do not change.

0 commit comments

Comments
 (0)