Skip to content

Commit 767220d

Browse files
committed
Merge origin/main (the option-patch fold change) into the redeclared-field branch
# Conflicts: # packages/objectql/src/registry.ts
2 parents 288fd65 + 7e60dc2 commit 767220d

82 files changed

Lines changed: 3701 additions & 433 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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): objectstack-data rules/lifecycle.md teaches the save notice
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
- **Before.** A hook can tell the person who made a create or update what the save set in motion (`ctx.notice(message)`, answered as the create/update `notice`), and a flow a record create/update trigger starts can set the same message with a `save_notice` node, but no published skill taught it, so an AI author writing a save hook from `objectstack-data` kept reaching for a `record:alert` banner.
11+
- **Now.** `objectstack-data/rules/lifecycle.md` gains *Save Notice — what the save set in motion*: the `ctx.notice` spelling for inline `handler` and sandboxed `body` alike (no capability), info severity and the distinction from validation `warnings` and from a `record:alert` banner, one message per write with the last call winning, the dispatches that carry it, the non-string refusal, and the flow face (`save_notice`, refused outside a create/update record trigger and after an `approval` / `wait`).
12+
- The file stays under its token ceiling: the new text is paid for by deleting the Decision Tree (which restated the class table and the syntax examples), the telemetry-growth anecdote and a Safety Semantics restatement. No ceiling moves; no schema, key or behaviour changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@object-ui/types': patch
3+
'@object-ui/react': patch
4+
'@object-ui/plugin-detail': patch
5+
'@object-ui/app-shell': patch
6+
---
7+
8+
feat(console): a record open is one request — the discussion, the activity, the attachments and the related rows' names come with the page payload (#28470)
9+
10+
Clause-②: yes (widening)
11+
Metadata-protocol: none
12+
13+
After the record page payload answered, a record open still sent the comment thread, the activity feed, the attachment list, the mention list and one `?top=1` name read per object the related rows point at. They are gone from the open:
14+
15+
- The page asks the payload for the discussion and the activity when a block that draws the feed is on screen at open (the 动态 panel of a laid-out page, or a feed block on the tab the page opens on), and for the attachments when the page draws them. The feed, the Attachments panel and the Attachments tab badge draw those parts; a refused part draws the refusal the panel draws today. There is no fallback read: a part the payload carries is never read again on the open.
16+
- Each related list asks the lookups of its rows to resolve, as its own read expands them, so the rows carry their names. The related list's name fallback no longer resolves the parent record's own id, which no column draws.
17+
- The mention list (`sys_user`, 50 rows) is read on the comment composer's first focus, not when the record opens. A reply or an edit whose text holds an `@` before then reads it when written, so its mentions still resolve.
18+
19+
- `@object-ui/types`: `RecordPagePayload` gains `discussion`, `activity` and `attachments`.
20+
- `@object-ui/react`: `DiscussionContextValue.onMentionSuggestionsWanted`.
21+
- `@object-ui/plugin-detail`: `RichTextCommentInput`, `RecordActivityTimeline` and `RecordChatterPanel` take `onMentionSuggestionsWanted`, called on the editor's focus; `record:activity` and `record:chatter` pass the context's hook.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/rest': minor
4+
---
5+
6+
feat(rest): the record page payload carries the record's discussion, activity and attachments, and the related rows' names (#28470)
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: added
10+
11+
`POST /api/v1/data/{object}/{id}/page` answers the reads a record page still made on its own after the payload arrived. Each new part is the read it replaces, asked as the same caller behind that object's own exposure gate, and each is refused on its own:
12+
13+
- **`related[].expand`** (request): the lookups of a related list's rows to resolve, as that list read's own `$expand`. The rows carry the referenced records the caller may read in place of their ids, so no name lookup follows the payload.
14+
- **`discussion: true`** (request) → **`discussion`** (response): `{ comments, reactions }` — the record's comment thread (`sys_comment` where `thread_id` is `{object}:{id}`, oldest first, no page size) and those comments' `sys_comment_reaction` rows (oldest first). The reactions carry their own refusal, which leaves the comments answered.
15+
- **`activity: { top }`** (request, 1–200) → **`activity`** (response): `{ total, records }` — the record's newest `sys_activity` rows with their count, `actor_id` expanded.
16+
- **`attachments: { top }`** (request, 0–100) → **`attachments`** (response): `{ total, records }` — the record's newest `sys_attachment` rows with their count.
17+
18+
A stream part is its rows or its refusal (`RecordPageStreamRefusalSchema`), never both and never neither. The body stays strict, the query-parameter set stays empty, and a record the caller cannot read still refuses the whole request. New exports in `@objectstack/spec/api`: `RecordPageActivityRequestSchema`, `RecordPageAttachmentsRequestSchema`, `RecordPageStreamRowsSchema`, `RecordPageStreamRefusalSchema`, `RecordPageDiscussionSchema`, `RecordPageDiscussionReactionsSchema`, `RECORD_PAGE_MAX_ACTIVITY_ROWS`, `RECORD_PAGE_MAX_ATTACHMENT_ROWS`, and their types.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): objectstack-data teaches an object extension's `fieldPatches` — relabel a vendor field without redeclaring it in `fields`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
- **Before.** `ObjectExtensionSchema.fieldPatches` is applied by the registry merge and refused at install and by `os validate` when it names nothing, but the published `objectstack-data` skill's *Object Extension Model* taught only `fields` / `priority`, so an agent that wanted a vendor field to read "Sector" instead of "Industry" redeclared the field in `fields` and took it over.
11+
- **Now.** The section carries one paragraph on `fieldPatches`: display keys only (`BASE_FIELD_DISPLAY_WHITELIST` — `label`, `description`, `inlineHelpText`, `placeholder`, and an option's `label` keyed by its stored `value`), type / values / rules stay the owner's, a tenant's edit wins, the higher `priority` wins between extensions, a patch naming a missing field or option is refused at install and by `os validate`, a `picklist`-bound field's options are not patchable — with the `crm_account.industry` example.
12+
- The file stays under its token ceiling: the new text is paid for by deleting restatement in the same file (the search section's second refusal paragraph, folded into its first; the index blockquote and the validation type list, each already carried by `rules/indexing.md` / `rules/validation.md`). No ceiling moves, no frontmatter, schema, key or behaviour changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): objectstack-platform says an email-template override names a locale its base ships; a new locale carries no `overrides`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
- **Before.** The ADR-0146 customization paragraph taught that a same-named item in the paired `.custom` package with `overrides` replaces the base's item, and listed `email_template` among the honoured types, but said nothing about the locale. An email template is one item per `(name, locale)`, and the override write gate refuses a declared override of a locale the base does not ship (`declared_package_ships_no_such_item`), so an author following the skill could declare `overrides` on a locale the base never shipped and be refused.
11+
- **Now.** One sentence in that paragraph: an email template is one item per (name, locale), an override names a locale the base ships, and a locale the base does not ship is added without `overrides`. The file stays at its token ceiling: the sentence is paid for by naming the not-yet-honoured types as the rest of `OVERRIDABLE_METADATA_TYPES` instead of enumerating them, and by dropping four filler intro clauses. No rule is removed, no frontmatter, schema or behaviour changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
'@objectstack/rest': patch
4+
'@objectstack/runtime': patch
5+
'@objectstack/mcp': patch
6+
---
7+
8+
fix(metadata-protocol,rest,runtime,mcp): the remaining write doors answer a write that landed under a failing roll-up with their own success (#28782)
9+
10+
Clause-②: no
11+
Metadata-protocol: none
12+
Skills-docs: none — no file under `skills/**` teaches what a write door answers when a parent roll-up cannot be recomputed after the write.
13+
14+
When a child write is stored but a parent's roll-up summary cannot be recomputed after it (`ERR_SUMMARY_RECOMPUTE`, "the triggering records WERE written"), #28781 made the REST and dispatcher single-record doors answer the write's own success. The other write doors now do the same, each with the success answer it already publishes — no new code, member, status or header:
15+
16+
- **Public form submit** (`POST /forms/:slug/submit`): `201 { id, fields? }` instead of `500`.
17+
- **`createMany`** and **clone**: `201` with their usual body instead of `500`. `createManyData` and `cloneData` attach the answer to the refusal the way `createData` does, so a caller that does not read it still gets the refusal.
18+
- **Per-object `batch`, `updateMany`, `deleteMany`** (non-atomic): a stored row is a `success` row built from the refusal's `written`, and the loop goes on to the next row. Before, the row came back `success: false` with the refusal and every later row was not attempted, so a client retrying the failed rows duplicated the stored one. An **atomic** batch is unchanged: the refusal is raised inside its transaction, the batch rolls back, and nothing landed.
19+
- **`callData`'s ObjectQL fallback** (a host with no `protocol` service): its create, update and delete arms attach their answer to the refusal, so the dispatcher's `/data` door answers it.
20+
- **MCP `create_record`**: answers the create on both bridges. The runtime bridge relays the protocol's attached answer, and the stdio bridge builds its own.
21+
22+
The stale summary column is logged at `error` once per field per process, with the fix, as on the single-record doors. A refusal before the write (validation, permission, constraint) answers exactly as before. The import runner and seed loader are untouched.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/service-analytics': patch
3+
---
4+
5+
fix(service-analytics): a dataset selection asking one column twice is refused with a repair the selection can make, not the engine's "own 'alias'"
6+
7+
Clause-②: no — the accept set of `queryDataset` is unchanged on every face: each selection served on `main` is served, each refused is refused with status 400. Only the refusal's prescription moves, and the ObjectQL strategy now refuses these keys itself, right before `engine.aggregate`. Nothing is widened: no export, public member, answer member, error code or status is added.
8+
Metadata-protocol: none
9+
10+
A `queryDataset` selection that asks one column for two values under one name (the column raw beside its own bucket, such as `dimensions: ['closed_at']` with `timeDimensions: [{ dimension: 'OBJECT.closed_at', granularity: 'month' }]`, or two buckets of it) is refused `INVALID_QUERY` / 400 on the native strategy, the ObjectQL strategy and the draft preview, with the same `param`, `path`, `object` and `fields` as before. The message used to be the engine's, which tells the caller to "give one of the group entries its own 'alias'"; a dataset selection has no alias. It now names the selection's members over the column and a repair:
11+
12+
- raw beside its bucket: "The selection asks for 'closed_at' both raw and bucketed (`dimensions` 'closed_at'; `timeDimensions` 'OBJECT.closed_at' by month). Drop the raw dimension from `dimensions`, or drop the granularity from the `timeDimensions` entry."
13+
- two buckets: "The selection asks for 'closed_at' at two granularities (`timeDimensions` 'closed_at' by month, 'closed_at' by year). Ask one granularity of it in `timeDimensions`."
14+
15+
The three faces answer one refusal, `dataset-group-column-door.ts` (formerly the draft preview's copy of the engine's): the ObjectQL strategy calls it on the keys it built on its direct and cross-object paths, and the preview on the keys the direct path would build. The engine's own refusal in `@objectstack/objectql` is unchanged, and a direct `engine.aggregate` caller, who can alias, still gets its prescription.
16+
17+
One selection carrying two faults answers the other one now. Example: `dimensions: ['region']` beside `timeDimensions: [{ dimension: 'zone', granularity: 'month' }]`, where `zone` is declared over the text column `region`. The engine judges a bucket over a text column (`INVALID_FIELD`) before a column named twice, and both live faces answered that. They now answer the column refusal, as the draft preview already did. It is still a 400 refusal, and fixing it meets the other one.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/objectql': minor
3+
---
4+
5+
fix(objectql)!: the registry fold judges an option patch against the options the object's owner declares, as the install door and `os validate` do (#28809)
6+
7+
Clause-②: yes (narrowing) — the object fold every read serves no longer applies a `fieldPatches` option patch whose option the owner's field does not declare: one an extension's `fields` redeclaration adds (applied on `main` when the redeclaring extension folded first), or one a tenant overlay base adds (applied on `main`). Nothing is widened, and no door's accept set moves.
8+
Metadata-protocol: narrowed
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no export is added or removed: the install door and `os validate` already refuse this patch, so a package that installs today never carries it. No package or example in this repository declares `fieldPatches`, so there is nothing for a migration to rewrite. -->
11+
12+
**BREAKING** narrowing in the object fold every read serves (`@objectstack/objectql`).
13+
14+
- **Before.** An extension can take an owner field over through `fields` and add an option the owner does not declare, and a tenant overlay base can add one too. A `fieldPatches` option patch of such an added option was judged by the fold against the field as merged so far, so it applied whenever the added option was already there: a tenant overlay base's option, or a redeclaring extension that folded first (a lower `priority`, or the same extension). The install door and `os validate` judge the owner's own declaration and refused the same patch.
15+
- **Now.** The fold asks the one judge (`fieldPatchTargetMisses`, `@objectstack/metadata-core`) of the owner's fields as the owner declares them, and applies only what it admits. A patch of an option the owner does not declare is not applied and is named once in the log, whatever the priorities, as any other unmatched patch is. Which fields a patch reaches is unchanged: the owner's own.
16+
- **Residual, unchanged rule.** When an earlier layer leaves out an option the owner declares (an extension's `fields` redeclaration, or a tenant overlay base), a patch of that option is admitted at all three readers, and the fold has no such option to relabel, so nothing of it applies. The fold asks the same judge once more of the merged fields, which only names: the patch is named once, as on `main`. Nothing is dropped or refused by that second asking.
17+
- **Who sees it.** A package whose extension patches an option the owner does not declare, which only an extension's `fields` redeclaration or a tenant overlay base adds. Both doors already refused such a package. Measured in this repository: none (`fieldPatches` appears in no package or example outside the implementing code and tests).
18+
19+
**The remedy.** Set that option's label where the option is declared: in the `fields` entry of the extension that redeclares the field, or in the tenant's own customization of the field.
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 layered read on a base's address answers an email template locale added in the base's `.custom` pair with the pair's layer (#28830)
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
`GET /meta/email_template/<name>/layers?package=<base>&member=<locale>` (and the same read naming no package) answered `404` for a locale the base does not ship and its `.custom` pair adds, while the by-name read, the base's lists and `sendTemplate` serve that locale since #28802. It now answers the pair's row as the `overlay` and `effective` layers (`code: null`, the base ships no such locale), from the one read the by-name read uses. Another package's added locale stays `404` there and answers under the read naming that package; the base's own locales, the pair's declared overrides and every type whose identity is its name alone are unchanged.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
fix(app-shell): the condition builder offers `user.isPlatformAdmin` instead of `user.isAdmin` and `user.role`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The no-code condition builder's subject list offered `user.isAdmin` and `user.role`. Neither builds an admin gate. `user.isAdmin` is not a member of the identity the browser evaluates against, so a row on it faults: a field or action `visible` gate then shows the item to everyone, and a navigation gate hides it from everyone. `user.role` is better-auth's legacy scalar, which ObjectStack never writes and which reads `user` for a signed-in platform admin too.
11+
12+
The list now offers `user.isPlatformAdmin`, the platform-admin flag the identity carries on every branch (`false` when signed out), and no longer offers `user.role`. The raw editor's example placeholder teaches `user.isPlatformAdmin` as well. A stored condition on either old subject still opens in row mode with its subject intact and is never rewritten. A new test evaluates every offered `user.*` subject against the real expression scope, so the list cannot drift from it again.

0 commit comments

Comments
 (0)