Skip to content

Commit 64a5a2d

Browse files
committed
Merge origin/main (#37185) into claude/issue-36904-object-designer-fullscreen
Two conflicts, both a collection-time comment beside an import both sides kept (entryReadsOnce-11797, itemDraftLine-12725): main's comment taken. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYoFqGdRM9Qmg7M2o2B
2 parents 2bf127d + ad604c1 commit 64a5a2d

280 files changed

Lines changed: 6819 additions & 691 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: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/service-automation': minor
4+
'@objectstack/runtime': minor
5+
'@objectstack/objectql': patch
6+
---
7+
8+
feat(service-automation)!: a sync-in pull marks the rows the source deleted, and an incremental source states how it learns of a delete
9+
10+
Clause-②: no (narrowing)
11+
Metadata-protocol: narrowed
12+
Skills-docs: none (no skills/ page names `deletePolicy`, `deletedField` or `_sync_deleted_at`; the guide that teaches them is `content/docs/automation/jobs.mdx`, updated here)
13+
14+
<!-- adr-0087: registered incremental-source-delete-policy-stated -->
15+
16+
ADR-0153 D3, delete marking (#32062, slice 6).
17+
18+
- **A pull marks a row the source deleted, and never deletes it.** Under `deletePolicy: 'mark'`, the reading when the key is absent, a pull stamps the platform column `_sync_deleted_at` on a row of a `synced` object that the source deleted, and clears it when a later pull reads the row again. `deletePolicy: 'ignore'` leaves every row as it is. Two detections:
19+
- `deletedField`, on any pull that declares it: a read record whose value in that source field is truthy has its copy marked; every other read record's copy is cleared.
20+
- Absence, on a full pull whose read was complete: every row of the mapping (`_sync_source`) the run did not read is marked. A `datasourceSource` with `full: true` is complete when its windows read to their end and no source row in the job's organization has a NULL watermark; it marks only rows whose copied watermark is at or above `watermark.start`. A `connectorSource` without a `watermark` is complete only under `paging: { style: 'none' }` (one response is the whole set); with no `paging`, or a paging style the pull does not follow yet, it marks nothing by absence. A refused or interrupted pull marks nothing by absence; a row the import runner refused was read, so it is not marked. A record whose `upsertKey` value is blank names no row, so one such record makes the run mark nothing by absence (`unjudged, rows refused`). A row pulled before the provenance columns existed carries no `_sync_source`, so it is no mapping's row: if the source has since deleted it, no pull marks it.
21+
- Two mappings on one target: each marks and clears only the rows whose `_sync_source` is its own; a second mapping is not refused.
22+
- **`sys_sync_run` records it.** New columns: `marked_deleted_count`, `deletes` (`judged`, `by deletedField`, `ignored`, or `unjudged, …` with the reason: `null watermark`, `no paging declared`, `pages not followed`, `rows refused`) and `skipped_null_watermark` (a datasource source's rows with a NULL watermark, counted under the organization predicate; through a plugin driver's row cap a count above the cap is recorded as the cap plus one). The end-of-pull log line says what the run marked and cleared. `job_run_id`'s and `trigger`'s descriptions now say when each is empty.
23+
- **BREAKING: an incremental source states how it learns of a delete.** A `connectorSource` with a `watermark`, or a `datasourceSource` without `full: true`, never sees an absent row, so under `deletePolicy` absent or `'mark'` with no `deletedField` it is refused at parse (`MappingSchema`, so `defineStack` and `os validate`) and again when the pull runs (`400 VALIDATION_ERROR`, reason `delete_policy_unhonourable`). Fix: name the source's soft-delete field (`deletedField: 'is_deleted'`), or write `deletePolicy: 'ignore'`, which is what every pull did before this release. New export: `incrementalSourceDeleteRefusal` (`@objectstack/spec/data`), the rule both doors ask.
24+
- **BREAKING: a `synced` target that withholds the provenance columns** (`systemFields: false`) is refused under `deletePolicy` absent or `'mark'` (`400 mapping_target_refused`): no row of it can carry the mark. Fix: let the platform add its columns, or write `deletePolicy: 'ignore'`. This arm is judged only when the pull runs: `os validate` and `defineStack` do not catch it, so a stack that validates green can still fail every scheduled pull. Migration entry `incremental-source-delete-policy-stated` names both arms.
25+
- A datasource source's `deletedField` must name a field of the source object (`400 source_binding_invalid` otherwise). `deletedField` is read by truthiness: the text `'false'` or `'0'` marks the row, and on a connector source a field the records do not carry reads as falsy on every record and marks nothing.
26+
- A stored `deletePolicy` outside `'mark'` / `'ignore'` (which the parse refuses) is refused by the pull too (`delete_policy_unhonourable`) instead of being read as `'mark'`.
27+
- The liveness rows for `deletePolicy` and `deletedField` on both sources are `live`, and `os validate` no longer warns that nothing reads them. `paging` stays `planned`: the connector paging loop is a later change.
28+
- A connector pull whose target definition cannot be read now says whether the object is not registered or the metadata read failed.
29+
- A connector pull keeps the job run id and trigger only when the run record can hold them: a trigger other than `schedule` or `manual`, or a run id longer than 255 characters, is left out instead of failing the run record's open.
30+
- `JobHandlerContext` (`@objectstack/runtime`) declares `trigger` and `runId`: the handler run form spreads the job service's context into the handler's, so every `handler` job already receives `trigger`, and `runId` under the database job adapter. The jobs guide lists both.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/plugin-approvals': patch
3+
'@object-ui/plugin-detail': patch
4+
'@object-ui/app-shell': patch
5+
---
6+
7+
feat(plugin-approvals): a record's activity shows its approval steps, to the users who can read its approvals
8+
9+
Clause-②: no
10+
Metadata-protocol: none
11+
12+
A record under approval used to show no approval in its activity: nothing wrote an activity entry for an approval step, so the activity stream's one-line approval entry was reachable only from items a host supplied by hand.
13+
14+
- **One activity entry per approval step.** plugin-approvals now appends one `sys_activity` entry for each step it records in its decision log, about the record the request governs: submitted, approved (`Approved · Manager review`, the step's label after the dot), rejected (`Rejected · Manager review`), sent back for revision (`Sent back for revision · Manager review`), resubmitted, recalled, and cancelled (the record was deleted). Other actions (a reminder, a reassignment, a thread comment, …) write none, and an object that sets `enable.activities: false` gets none, as the CRUD mirror writes none for it. The entry carries no decision comment. It follows ADR-0052 §5, so no published vocabulary changes: `type` is the built-in `system`, the domain kind is `metadata.kind: 'approval'` (with the step's action, its label and the flow and step names beside it), and `source_object` / `source_id` name the request. A deployment without plugin-audit has no `sys_activity` and gets no entries.
15+
- **Each entry reads in the reader's language.** The stored `summary` is the English line from plugin-approvals' own catalog (`approvalActivity*` messages, shipped in all eleven of its locales). A read that carries a locale is served the line re-composed in that locale, and the step's label is read from the app's language pack (`flows.<flow>.approvals.<node_id>.label`) the way the approvals tab reads it, else the stored label: a zh-CN reader sees `已批准 · 经理审批`. A system read, or a read with no locale, gets the stored English line. A failed append never fails the approval step; it is logged once at `error`.
16+
- **Only the users who can read the record's approvals read those entries.** A read of `sys_activity` keeps an approval entry only when the approvals service would serve the caller its request: a participant (submitter, current or past approver), the override actor, or a reader of the record where the object opts into `enable.approvalsVisibleToReaders`. Every other entry is served as before, and plugin-audit's rule that the record must be readable still applies. The record page's activity count and its rows agree.
17+
- **The stream draws each entry as the approval line, and 「看审批」 opens the approvals.** The console reads an activity row with `type: 'system'`, `metadata.kind: 'approval'` and a `sys_approval_request` source as the `approval` feed kind (`APPROVAL_ACTIVITY_FEED_TYPE`, exported from `@object-ui/plugin-detail`), so `approval` now counts as produced. The record page supplies the new `RecordViewApprovalsContext`, and the approval line's 「看审批」 opens the record's 审批 tab, the same place the approval tag in the header opens; with no approvals the reader is served, the line has no link. The entry keeps `sys_activity`'s own lifecycle (reaped after 14 days); the 审批 tab keeps the full history.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/plugin-approvals': patch
4+
'@object-ui/app-shell': patch
5+
'@object-ui/i18n': patch
6+
'@object-ui/console': patch
7+
---
8+
9+
feat(approvals): a decided request's step line says where the record's approval went next: on to a later step, or ended
10+
11+
Clause-②: yes
12+
Metadata-protocol: none
13+
14+
The single approval request read (`GET /api/v1/approvals/requests/ID`) serves one more fact on a decided request's own route: `flow_route.outcome`, beside `ahead: 'decided'`. Before, a decided route stopped at the request's own step, so an approver reopening a request they had decided could not tell whether the record's approval went on to a later step or ended.
15+
16+
- `outcome.step` is the run's latest request when it is a later one than this request (a request of the same flow run opened after it, on any node, a later round of the same node included; a pending one wins over a decided one). It is absent when no later request was opened in that run; a request a child run opened is not among them.
17+
- `outcome.status` is that latest request's status, or this request's own when `step` is absent. `pending` with a `step` means the approval went on to that step and waits on its decision.
18+
- `outcome.ended` is `true` only when the record's approval is known to have stopped: the request's run is a root run (not a `subflow` body or a `map` item, whose end is not the approval's), the flow body the run ran holds no `subflow` or `map` node anywhere, regions included (a child run files its requests under its own run, so this run's requests cannot show what it decided, before or after this request), and the run reports it stopped for good, with the same terminal set the dead-run sweep uses. The body the run ran is known only when the body armed now is the flow's newest registration and was registered before the run started, so a flow edited, rolled back or re-registered after a run started is never judged by its current body for that run. `false` means not known to have stopped: the run goes on, is a child run, ran a body that can start a child run, ran a body that is not known, cannot be read, or was opened before this release (the approval node now records on each new request whether its run is a root run).
19+
20+
`outcome` is absent when nothing past the request is known: no later request was opened and the approval is not known to have ended, or several later requests are pending at once (parallel steps). A pending request's route never carries it. It is served to every reader of the request and says only where the same approval went: the later step's node id and label and that request's status, never the later request's id, approvers, comments or field values. The `ApprovalRequestRow.flow_route` contract type in `@objectstack/spec/contracts` gains the optional member, and `routeOutcome` in `@objectstack/plugin-approvals` is the rule.
21+
22+
The approval request page (`@object-ui/app-shell`) draws one line under the decided step: "Went on to STEP, waiting for a decision", "Went on to STEP: DECISION", "Went on to STEP, then ended: DECISION", or "The approval ended here". No line is drawn when no outcome is served. `@object-ui/i18n` carries the four new `approvalsInbox` rows in every built-in locale, and the console's request type (`@object-ui/console`) mirrors the new member.
23+
24+
Nothing to migrate: a caller that does not read `outcome` is unaffected.
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+
fix(console): the developer pages and the device sign-in approval send the stored sign-in token, so a session held by its token alone works there too
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The developer integrations page, the agent-connect section (discovery and creating an API key) and the device sign-in approval (claim, approve, deny) asked this server with the session cookie only, so a session held by its sign-in (bearer) token alone was refused there. They now send the stored token as well, as the other same-server console requests do. The session cookie is still sent, so a cookie session behaves exactly as before, and a refused request now reaches the console's session-ended check. Nothing changes in what the server accepts.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
fix(app-shell): the package list, Studio, AI chat and draft screens send the stored sign-in token, so a session held by its token alone keeps its packages, Studio and design entries
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
These screens asked this server for their data with the session cookie only, while the other same-server console requests also send the stored sign-in (bearer) token. A session held by its token alone (a second local runtime on the same host replaced the cookie, the browser blocked it as a third-party cookie, or the cookie jar was cleared) was refused there. The most visible case was the package list behind the sidebar, the app header, the command palette and the Studio entries: every package went missing, and the Studio and design entries with it, with no error shown.
11+
12+
They now send the token as well:
13+
14+
- packages: the package list and the package switcher, creating a package's customization package, duplicating a package, a package's customizations, and the package form;
15+
- Studio: the automation status, cloning a flow, cloning a permission set, the flow picker and connector inputs, a flow's run history and node palette, the page preview, the sharing-rule catalog and catalog activation, and the packaged action and flow ledgers in Setup;
16+
- drafts: the pending drafts, the unpublished-app bar, the draft changes panel and its flow checks, and the commit history with its revert;
17+
- AI: the conversation list and conversations, the build-debug report, AI usage, and suggested bindings;
18+
- the inbox bell, the approval feeds and a record's approvals, and changing a record's owner;
19+
- the shell: the no-access state, the deployment notice, the connect-agent widget, the context selectors (only for requests to this server's own origin), the design-mode language list, and the marketplace's install steps on this server.
20+
21+
The session cookie is still sent, so a cookie session behaves exactly as before, and a refused request now reaches the console's session-ended check. A few requests stay cookie-only for now, among them sign-in, the OAuth hand-off, public forms and calls to the cloud control plane; they are unchanged. Nothing changes in what the server accepts.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@objectstack/embedder-openai': patch
3+
'@objectstack/spec': patch
4+
---
5+
6+
feat(embedder-openai): an over-limit input is refused, not truncated — known-model input limits and one shared token estimate
7+
8+
Clause-②: yes
9+
Metadata-protocol: none
10+
11+
When a limit applies (a model in the known-model table, or `maxInputTokens`), `OpenAIEmbedder.embed()` now measures every input before it sends anything. When one input is over the model's per-input token limit, the call fails with an error naming the input's 0-based index, the model, the estimate and the limit; nothing is sent, so the provider never silently truncates the text and drops its tail from the index. An input at or under the limit is sent unchanged.
12+
13+
- The known-model table gains each model's provider-documented per-input limit: OpenAI `text-embedding-3-small` / `-3-large` / `ada-002` 8192, DashScope `text-embedding-v3` 8192 and `-v2` / `-v1` 2048, BigModel `embedding-3` 3072 and `embedding-2` 512, SiliconFlow `BAAI/bge-m3` 8192 and `BAAI/bge-large-zh-v1.5` / `-en-v1.5` 512.
14+
- New option `OpenAIEmbedderOptions.maxInputTokens` (a positive integer) overrides the table.
15+
- A model that is not in the table, with no `maxInputTokens`, has no limit and warns once per embedder instance. That warning is the same single warning an unknown model already gave for its batch size: one instance warns at most once, naming every option it is missing.
16+
17+
`@objectstack/spec/shared` exports `estimateTokens(text)`, its `TOKEN_ESTIMATE_MARGIN` (1.1) and `ASCII_RUN_CHARS_PER_TOKEN` (`{ letters: 4, digits: 3, mixed: 2 }`): the one conservative token estimate the embedder uses, for an app that sizes its own chunks to call too. CJK characters and full-width punctuation count 1.5 each, a run of ASCII letters only ceil(length / 4), of digits only ceil(length / 3), and of letters and digits mixed ceil(length / 2), any other punctuation mark or character 1, whitespace 0; the sum is multiplied by 1.1 and rounded up.
18+
19+
The estimate is conservative: on Chinese text it runs about 1.4 times the real token count. It is at or above OpenAI `cl100k` counts on Chinese, mixed Chinese/English and English-heavy text (long words, numbers, URLs, code); text made mostly of random hex or base64 (UUIDs, hashes) can estimate below its real count.
20+
21+
What to do: nothing for a known model. A call that used to send a text over the model's limit — which the provider truncated — now fails instead. Because the estimate errs high, a text whose real count is under the limit can now be refused too, although it was never truncated. For example, on a 512-token model such as `BAAI/bge-large-zh-v1.5`, whose tokenizer counts about one token per Chinese character, a Chinese text of about 311 to 510 characters fits the model but estimates over 512 (311 characters estimate 514), so it is now refused; 310 characters estimate 512 and are sent. In both cases split the text smaller, or set `maxInputTokens` yourself if you know the model's real count fits. For a model outside the table, set `maxInputTokens` to your provider's documented limit, which also silences the warning; an app that set only `maxBatchSize` for such a model now sees the warning again until it sets `maxInputTokens` too.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/console': patch
4+
'@objectstack/console': patch
5+
---
6+
7+
feat(console): an app's documentation pages draw in the app shell from 768 px up
8+
9+
Clause-②: no
10+
Metadata-protocol: none
11+
12+
From 768 px up every app page lost the top bar and keeps the app menu, search, notifications and account in the sidebar. An app's documentation pages (`/apps/APP/docs`, a book, a flat doc link, an article) were the one exception: they kept the top bar at every width and mounted no sidebar. They now draw like every other app page there: no top bar, the resident sidebar with its usual head (the app-name menu, collapse, search, notifications) and foot (the account), and the page header's button group (assistant and help) at the top right.
13+
14+
The documentation still has one navigation, its own: the sidebar's body carries the docs column (「← Back to APP」, every book of the app with the current one open, a title filter and 「All documentation」) in place of the app's menu. The reader no longer draws that column inside the page there. The app's other docs pages (its docs index, a book with no articles, a book or doc that is not found) carry the same column in the sidebar instead of a back link above the page.
15+
16+
Unchanged: every docs address resolves to the same page as before, and a phone keeps its app bar, no sidebar and the in-page column. The `/docs` portal is not changed by this release. Nothing to migrate.

0 commit comments

Comments
 (0)