@segmentstream/ontology 0.99.0 → 0.99.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,1255 @@
1
+ # Changelog
2
+
3
+ ## 0.99.2
4
+
5
+ Replication reads a workspace's manifest from its database once per process instead of on every
6
+ pass, page and bound query. Target reads select the manifest's hash and take the manifest from
7
+ memory for a generation and hash already read; an epoch's target and routes, which never change
8
+ after insert, are read once per epoch while its state is read every time. A large ontology's
9
+ replication bookkeeping no longer sends the whole manifest out of the database several times a
10
+ minute. Behavior is unchanged.
11
+
12
+ ## 0.99.1
13
+
14
+ `check`'s `*:*` warning names only what the role does not already grant by name: the entities an
15
+ entity wildcard leaves out without their `<entity>:*`, administering users without `user:*`, and
16
+ workflows, which no entity grant reaches, without `workflow:*:*`. A builder role that already
17
+ holds `app_feedback:read`, `app_feedback:respond` or `app_feedback_file:read` unscoped no longer
18
+ gets them a second time in the deployed manifest.
19
+
20
+ Each package carries its changelog, `CHANGELOG.md`: the notes of every release up to the installed
21
+ one, newest first. An npm package has it beside its `package.json`, such as
22
+ `node_modules/@segmentstream/ontology/CHANGELOG.md`; a Python sdist has it at its root and a
23
+ wheel in `.dist-info/extra_metadata/CHANGELOG.md`. `segmentstream changelog` prints the same notes
24
+ for the releases between a project's pins and the CLI's starter, paragraphs starting with
25
+ `Action required:` first.
26
+
27
+ ## 0.99.0
28
+
29
+ One word for one thing: the agent's settings, code, logs and docs say chat, session or chat archive,
30
+ never conversation. See the terms in `docs/agent.md`.
31
+
32
+ Configuration, which deploys unchanged and warns to rename:
33
+
34
+ - `review` replaces `conversations` in `agent/segmentstream.json`, one level flatter:
35
+ `"review": { "byRole": { "lead": { "mode": "whenUnsure", "minConfidence": 0.9 } }, "default": { "mode": "never" } }`.
36
+ The criteria stay in `agent/review/<role>.md`. `conversations` is still read as before.
37
+ - Group routing policy `"chat"` replaces `"conversation"`, and `engagement.engagementMinutes`
38
+ replaces `engagement.conversationMinutes`. The earlier names read as the new ones, in the top
39
+ level, every chat and the shadow policy, and in router payloads stored with them.
40
+
41
+ Code: the archive client is `chatArchive()`, its types `ChatArchive`, `ChatEvent` and `ChatPage`,
42
+ and the routing exports `chatKey` and `groupChatAddressing` replace `conversationKey` and
43
+ `groupConversationAddressing`. The agent appends and searches the archive under `agent/chats/`,
44
+ which Cloud serves.
45
+
46
+ Compatibility: the agent sends the chat to the ontology service in `X-SegmentStream-Agent-Chat`
47
+ and, for services built before, `X-SegmentStream-Agent-Conversation`; the ontology service reads
48
+ either. Sessions, Telegram principals and file parts stored before keep working. The attachments
49
+ REST route reads a `conversation` filter and answers it beside `chat`, for CLIs built before; the
50
+ attachments table keeps its column name.
51
+
52
+ ## 0.98.1
53
+
54
+ A toolset tool whose provider sends no structured content now answers with the provider's text
55
+ alone, instead of a `{ content }` stand-in that repeated it. Clients and workspace code that read
56
+ structured content first no longer see the provider's answer wrapped twice.
57
+
58
+ ## 0.98.0
59
+
60
+ Reply review. `conversations` in `agent/segmentstream.json` says, per role of the person the agent
61
+ replies to (`byRole`, first match in the order written, then `default`), who sends its replies on
62
+ Telegram and WhatsApp: `{ "review": { "mode": "never" } }`, the agent, as before;
63
+ `{ "mode": "always" }`, a member reviews every reply; or
64
+ `{ "mode": "whenUnsure", "minConfidence": 0.9 }`, the decision model (`models.decision`) judges
65
+ each reply in the conversation the person saw, with the criteria in `agent/review/<role>.md` or
66
+ `agent/review/default.md`, and the agent sends the replies it gives at least `minConfidence`. A
67
+ model failure holds the reply. A reviewed conversation gets no interim messages.
68
+
69
+ A held reply becomes a record of the new built-in ontology entity `agent_review`, created through
70
+ the runtime route `POST /api/ontology/agent/reviews`. `agent_review.approve({ review, text? })`
71
+ sends the draft or the member's edit to the person's conversation as the agent, without sender
72
+ attribution and at most once, through the ontology's `chat.<provider>.connection`;
73
+ `agent_review.reject({ review })` discards it. Reading, approving and rejecting need
74
+ `agent_review:read`, `agent_review:approve` and `agent_review:reject`: no wildcard covers them,
75
+ including a pipeline's `*:*`, and agent tasks cannot approve. Every ontology gets the entity and
76
+ its table on its next deploy; a workspace entity named `agent_review`, or `user` inverses named
77
+ `agentReviews` or `decidedAgentReviews`, must be renamed. Chat providers render a post with an
78
+ empty attribution without a footer, and Telegram posts can name a forum topic.
79
+
80
+ The app SDK's permission matcher now treats `agent_review`, `app_feedback`, `app_feedback_file`
81
+ and `user_identity` as the ontology service does: an entity wildcard covers none of them.
82
+
83
+ ## 0.97.0
84
+
85
+ `toolset(name, { connection, api, lock, description })` serves a connection's MCP API tools from
86
+ the ontology's MCP server, for agents and members' own MCP clients. Each tool in the lock becomes
87
+ `<toolset>_<tool>`, granted by `<toolset>:<tool>` (or `<toolset>:*`); a read tool needs no
88
+ confirmation, every other tool is confirmed. The workspace's fixed values are removed from the
89
+ tool's input and added to every call. List toolsets in `defineOntology({ toolsets })` and their
90
+ connections in `connections`; write the lock with `segmentstream connection mcp lock <key>`.
91
+ A toolset has no records. Toolset tools are not served by the REST API or to workflows, and an
92
+ OAuth client consented to `ontology:read` does not see them. Manifests without toolsets are
93
+ unchanged.
94
+
95
+ ## 0.96.0
96
+
97
+ `defineOntology({ signUp, onSignUp })` lets strangers sign up through email, Telegram and WhatsApp
98
+ with roles the workspace names. `signUp: { channels: ["whatsapp", "email"], roles: [lead],
99
+ byChannel: { telegram: [client] } }` opens each listed channel: a first private message to the
100
+ agent on Telegram or WhatsApp, opening the Telegram Mini App, or signing in to the app by email
101
+ code creates a user holding exactly the listed roles, granted like any other and revocable one
102
+ person at a time. These users never hold `member`, which stays the baseline of invited people, so
103
+ staff grants can stay on `member`. `roles: []` admits a person with nothing beyond what is granted
104
+ or shared with them. `onSignUp` names an idempotent, input-free action run as each new user with
105
+ the roles their channel granted, for every channel including email; it cannot grant roles.
106
+
107
+ Turn limits count every user sign-up created, whatever roles they are given later. `check`
108
+ refuses in sign-up roles an undeclared role, `member`, an entity wildcard and a generated write
109
+ that is not scoped to the person's own records, warns on shared reads, and needs a `chat.<channel>`
110
+ adapter for Telegram and WhatsApp. The manifest carries `sign_in.sign_up` and
111
+ `sign_in.on_sign_up` only when declared; older readers keep every channel closed.
112
+
113
+ `signIn.channels.telegram: "open"`, `signIn.policy: "open"` and `signIn.onNewUser` keep their
114
+ behaviour: their users hold `member`. A channel opened both ways is refused.
115
+
116
+ ## 0.95.0
117
+
118
+ External agent runtimes can act for members, and administrators can attach members' chat accounts.
119
+
120
+ - **API keys with delegation.** `createServiceUser(ontology, { name, roles: [], keyLabel, delegation: true })`
121
+ (or `segmentstream ontology api-key create NAME --delegation`) creates a key that holds no role
122
+ and acts only for the member each request names in `X-SegmentStream-Act-As`, through the live
123
+ chat account of the provider named in `X-SegmentStream-Identity-Provider`, which is required.
124
+ The request runs with that member's current roles and history names the member. Such a key
125
+ reaches the routes that accept the runtime's act-as header, the account lookup
126
+ `GET /api/ontology/agent/identities/{provider}/{external_id}` and the agent's attachment and
127
+ file routes; it never runs a workflow's task. Its `_segmentstream` source must name the
128
+ member's own account as `sender`. Ordinary API keys keep ignoring both headers.
129
+ `resolveApiKeyCredential` returns a key's principal and whether it delegates, and
130
+ `ApiKeySummary` has `delegation`.
131
+ - **Attaching chat accounts.** The built-in `user_identity` entity gains two platform actions:
132
+ `user_identity.attach({ user, provider, subject, username?, display? })` attaches a Telegram,
133
+ WhatsApp or Slack account to an active member with the new origin `attach`, and
134
+ `user_identity.revoke({ id })` revokes any chat account. They need `user_identity:attach` and
135
+ `user_identity:revoke`, which no wildcard covers, grant no role, and record the administrator in
136
+ history. Attaching is idempotent for the member's own account and a conflict for another
137
+ member's live account or a second account of the provider.
138
+ - **Shared locations.** The Telegram runtime source accepts an optional `location`
139
+ (`latitude`, `longitude`, `horizontal_accuracy`, `live_period`), which actions read in
140
+ `context.runtime.source` when the runtime that received the message reports it.
141
+ - **Migration.** Deploying adds the `attach` value to the `user_identity_origin` type and the
142
+ `delegation` column to `_api_keys`, both additive. Platform reads of `_api_keys` tolerate a
143
+ database an earlier SDK migrated.
144
+
145
+ ## 0.94.1
146
+
147
+ The ontology service now logs `ontology.request.failed` with the full cause, under the request id
148
+ the client receives, for every failure it answers with a 5xx, including the mapped ones such as
149
+ `workflow_recovery_unavailable`, `ontology_updating` and `warehouse_read_unavailable`. Before, only
150
+ unexpected failures were logged, so a mapped 503 left nothing but its status in the logs. Responses
151
+ are unchanged, and client errors (4xx) are still not logged.
152
+
153
+ ## 0.94.0
154
+
155
+ The agent's temporary attachments accept `slack` as a source, so files members send the agent in
156
+ Slack are stored as Telegram's are. The next `segmentstream-ontology migrate` (every deploy runs it)
157
+ widens the attachment table's source check; no data changes.
158
+
159
+ ## 0.93.0
160
+
161
+ Members can ask the agent to post into a Telegram chat from a Slack or WhatsApp conversation, not only from Telegram.
162
+
163
+ **Agent**
164
+ - Every channel now stamps its principal with the conversation a message came from: provider, chat, thread, whether it is the member's own direct conversation, and there the member's id on the provider.
165
+ - The posting card checks, pins and executes from that conversation.
166
+ - In Slack and WhatsApp, eve's approval card shows the exact message, destination and attribution, as the Telegram card does. A card the channel cannot show whole is refused.
167
+ - Edit stays Telegram-only.
168
+
169
+ **Ontology**
170
+ - `RuntimeSource` is now a union: the Telegram source, unchanged, or `{ provider: "slack" | "whatsapp", chat_id, thread_id, kind, peer?, message_id?, sender? }`. Action code that reads Telegram-only fields such as `attachments` or `callback_query_id` must narrow on `provider === "telegram"` first.
171
+ - Delivery refuses a source on a channel other than the member's verified pairing.
172
+ - Delivery also refuses a post into the conversation it came from, including a private destination naming the same person.
173
+ - Which chats can receive a post is set separately per provider (`chat.telegram`, `chat.slack`, `chat.whatsapp`).
174
+
175
+ Upgrade both SDKs together. An older ontology refuses a Slack or WhatsApp source before sending anything. Posting from Telegram is unchanged with any combination of versions.
176
+
177
+ Members can ask the agent to post into a Slack channel or into a member's Slack direct message, from Telegram, Slack or WhatsApp. The post keeps the same exact preview, requester-only approval, ten-minute expiry, attribution and idempotency as a Telegram post.
178
+
179
+ **Ontology**
180
+
181
+ - Declare `chat.slack: { connection }` beside `chat.telegram` to make Slack chats destinations. The connection must be listed in `connections` and must not be Telegram's. Without it nothing changes: Slack chats are neither listed nor posted to.
182
+ - Slack destinations are:
183
+ - the channels in the `agent_chat` registry with provider `slack`;
184
+ - `slack:private:<member id>` for each member paired on Slack.
185
+ - `chat_list` lists Slack destinations only when Slack is declared. Telegram's chats are listed as before.
186
+ - `chat_history` still reads Telegram chats only. A Slack conversation is archived under its session rather than under the channel a destination names, so its history is not offered.
187
+ - A Slack post is one `chat.postMessage` call through the declared connection:
188
+ - `markdown_text` is the member's exact Markdown, then the separator and the attribution, both escaped, with the attribution in italics.
189
+ - `reply_to` is the `ts` of a thread's message.
190
+ - Slack's own refusal consumes the key. A timeout, a 5xx, or an answer that cannot be parsed or verified is `uncertain` and is never resent.
191
+ - The receipt carries the message's `ts` and no URL.
192
+ - `@segmentstream/ontology/slack` exports `renderSlack`, `escapeSlackMarkdown` and `SLACK_MESSAGE_LIMIT`.
193
+ - Telegram delivery, digests and operation ids are unchanged.
194
+
195
+ **Agent**
196
+
197
+ - The posting card describes Slack destinations with the ontology's own renderer.
198
+ - The Telegram card shows a Slack post's exact Markdown and attribution as literal text.
199
+ - The Slack channel reports these channels to the chat registry, titled by `conversations.info`:
200
+ - a channel where a paired member writes;
201
+ - a channel it joins, leaves or sees renamed.
202
+ - Direct and group direct messages are never reported.
203
+ - Channels are reported only once the Slack connection is authorized for `channels:read` and `groups:read`. These are opt-in: list them in the `SlackConnection`'s `scopes` beside the defaults and authorize it again. A Slack app SegmentStream creates with them also subscribes to `member_joined_channel`, `member_left_channel`, `channel_rename` and `group_rename`. Without them, Slack direct messages to paired members are still destinations, and connections on the default scopes keep working without reauthorization.
204
+ - An agent before this release refuses a Slack destination when it describes the post, so nothing is sent. Upgrade both SDKs together.
205
+
206
+ Members can ask the agent to post into another paired member's WhatsApp chat with the workspace's number, from Telegram, Slack or WhatsApp. The post keeps the same exact preview, requester-only approval, ten-minute expiry, attribution and idempotency as any other post.
207
+
208
+ Meta delivers free-form text only inside the 24-hour customer-service window, which opens when the member last wrote to the number. A post outside it fails with Meta's code, 131047, and is not resent. `sent` means Meta accepted the message: a failure Meta reports only later, in the number's delivery statuses, does not change the receipt.
209
+
210
+ **Ontology**
211
+
212
+ - Declare `chat.whatsapp: { connection }` beside `chat.telegram` and `chat.slack` to make members' WhatsApp chats destinations. The connection must be listed in `connections` and must not be another provider's. Without it nothing changes.
213
+ - A destination is `whatsapp:private:<member id>` for each member with a live WhatsApp pairing; its external id is their WhatsApp id. WhatsApp has no group destinations.
214
+ - A WhatsApp post is one text message from the connected number, `POST /phone/messages` through the declared connection:
215
+ - the body is the member's text as written, then the separator and the attribution in italics; WhatsApp's formatting markers (`*`, `_`, `~`, `` ` ``) in the separator and the attribution are replaced by look-alikes WhatsApp never formats;
216
+ - link previews are off;
217
+ - the body is at most 4096 characters and is refused, never cut, when longer;
218
+ - a post cannot reply to a message: `reply_to` is refused.
219
+ - Meta's refusal with an error code consumes the key, and its code is kept in the operator diagnostic. A timeout, a 5xx, or an answer that cannot be parsed or names no message is `uncertain` and is never resent.
220
+ - The receipt's `message_id` is Meta's `wamid…`; it has no URL.
221
+ - `@segmentstream/ontology/whatsapp` exports `renderWhatsApp`, `literalWhatsAppText` and `WHATSAPP_MESSAGE_LIMIT`.
222
+ - Telegram and Slack delivery are unchanged.
223
+
224
+ **Agent**
225
+
226
+ - The posting card describes WhatsApp destinations with the ontology's own renderer, and shows no card for a reply to one.
227
+ - The Telegram card shows a WhatsApp post's text and attribution as literal text.
228
+ - A post from a member's WhatsApp chat into that same chat is refused.
229
+ - An agent before this release refuses a WhatsApp destination when it describes the post, so nothing is sent. Upgrade both SDKs together.
230
+
231
+ ## 0.92.1
232
+
233
+ Update the ontology's coordinated Workflow 5 packages to the 5.5 release and require patched Zod validation. Workspace apps must update their `workflow` dependency to match the ontology SDK's peer requirement.
234
+
235
+ Require patched postal-mime and fast-xml-parser releases in the agent SDK to prevent excessive CPU use when parsing crafted email headers or XML.
236
+
237
+ Require patched filelock in the pipeline SDK, and patched oauthlib and pyasn1 in its BigQuery extra. Rebuild installed environments and images to replace older dependencies.
238
+
239
+ ## 0.92.0
240
+
241
+ The ontology and app SDKs are published under the `@segmentstream` scope, beside
242
+ `@segmentstream/agent` and `@segmentstream/web-tracker`: `@segmentstream-cloud/ontology` is now
243
+ `@segmentstream/ontology`, and `@segmentstream-cloud/app` is now `@segmentstream/app`. Versions
244
+ continue from the earlier names. Exports, subpaths, APIs and the `segmentstream-ontology` and
245
+ `segmentstream-page-catalog` commands are unchanged. The earlier names get no further releases.
246
+
247
+ To upgrade a workspace:
248
+
249
+ 1. In `ontology/`, run `npm uninstall @segmentstream-cloud/ontology` and
250
+ `npm install --save-exact @segmentstream/ontology@latest`.
251
+ 2. In `app/`, run `npm uninstall @segmentstream-cloud/app` and
252
+ `npm install --save-exact @segmentstream/app@latest`.
253
+ 3. Replace `@segmentstream-cloud/ontology` with `@segmentstream/ontology`, and
254
+ `@segmentstream-cloud/app` with `@segmentstream/app`, in every import, `export … from`,
255
+ dynamic `import()`, `require`, CSS `@import`, Nitro and Next.js configuration, and
256
+ documentation under `ontology/`, `app/` and `agent/`, subpaths included
257
+ (`@segmentstream/ontology/workflows`, `@segmentstream/app/ui/styles.css`,
258
+ `@segmentstream/app/navigation/next`).
259
+ 4. Run `npm --prefix ontology run check`, build the app, then `segmentstream sync` and
260
+ `segmentstream deploy`.
261
+
262
+ Cloud keeps deploying and previewing workspaces that depend on the earlier names until
263
+ 2027-02-09; after that it refuses them and names the package to move to.
264
+
265
+ ## 0.91.0
266
+
267
+ `groups` validation accepts `smart.thresholds.reply` (0.5 to 1) and `smart.thresholds.defer`
268
+ (0 to 1, at most `reply`) for the conversation group policy, at the top level, per chat and in a
269
+ shadow policy. Setting either at the top level under another policy is refused with "reply and
270
+ defer apply only to engagement.policy conversation".
271
+
272
+ ## 0.90.0
273
+
274
+ Actions can describe their own confirmation card with `action({ confirm })`: a read-only function
275
+ of the input, the principal and the chat's `locale` that returns the card's title, icon, facts to
276
+ check, collapsed details and page link in the workspace's words, or refuses the input with
277
+ `ActionRejected` before anyone is asked. Its MCP tool lists `preview: true` in its card facts, and
278
+ the MCP method `segmentstream/confirmation/preview` answers with that card, running and writing
279
+ nothing; a tool without `confirm` is refused there, and a principal whose permission for the action
280
+ is scoped gets no card from it.
281
+
282
+ The agent asks such an action for its card before showing one: the card needs no `_confirmation`
283
+ from the model, a refusal reaches the member as the action's reason instead of a card, and a
284
+ description that fails, cannot be shown or lacks the input's file falls back to the action's fields. Telegram cards are
285
+ formatted (bold title or question, linked facts, collapsed details), with a green confirm button
286
+ and the action's page as a button. Their status line keeps the card and adds a marker unless the
287
+ workspace's word has one, in a group who decided, and the time in each reader's time zone; a failure the
288
+ action refused shows its reason instead of a diagnostic reference. The agent's instructions no
289
+ longer announce an action before its card or repeat its outcome after it.
290
+
291
+ ## 0.89.0
292
+
293
+ Withdraw the workflow deploy guard that 0.86.0 introduced. A deployment applies its ontology
294
+ whether or not workflows are running, as before 0.86.0: it is no longer refused with
295
+ `deployment_legacy_workflow_quiescence_required` or `deployment_blocked_by_active_workflows`, and
296
+ a workspace whose production SDK predates 0.86.0 can upgrade and change its ontology in one deploy.
297
+
298
+ The runtime no longer compares the applied catalog with its own on workflow starts, workflow steps
299
+ and actions that trigger workflows, so a run in flight keeps executing the code that started it
300
+ against the new catalog. File operations answer the retryable `ontology_updating` again while the
301
+ catalog differs. Change what running workflows use in steps: add and deploy first, remove in a
302
+ later deploy.
303
+
304
+ Manifests no longer carry `executionCompatibility` or the `workflow-execution-compatibility-v1`,
305
+ `workflow-admission-v1` and `workflow-execution-extension-v1` capabilities, and
306
+ `executionCompatible`, `executionContractOf`, `EXECUTION_COMPATIBILITY_CAPABILITY`,
307
+ `EXECUTION_CONTRACT_VERSION` and `ExecutionContract` are no longer exported.
308
+
309
+ A workspace deployed on 0.86.0 to 0.88.0 still interrupts its own in-flight runs when a later
310
+ deployment changes the ontology beyond labels and descriptions. Upgrade it while no workflow is
311
+ running.
312
+
313
+ ## 0.88.0
314
+
315
+ A deployment whose ontology only adds to the workflow execution contract no longer waits for
316
+ workflow runs to drain. Runtimes now declare `workflow-execution-extension-v1`. They keep serving,
317
+ with their pinned runs, against an applied catalog that `executionExtends` their own: every earlier
318
+ part unchanged, plus entities related only to new entities, optional non-unique properties, optional
319
+ keys from earlier entities to new ones, non-unique indexes, actions, metrics, roles, wider grants,
320
+ connections or workflows started only by cron or webhooks. Such a migration applies without closing
321
+ workflow admission. Every other change is still a cutover, and so is the upgrade that brings the
322
+ capability, which is part of the execution contract. Browser compatibility and the legacy catalog
323
+ bridge ignore it.
324
+
325
+ ## 0.87.2
326
+
327
+ A workspace bridged from a legacy workflow runtime can apply execution-contract changes again.
328
+ The bridge installs the admission journal and records the legacy catalog in it, so
329
+ `closeWorkflowAdmissions` accepts that catalog with `legacyIngressVerified: true`, and
330
+ `applyMigration` accepts its drained fence. Without the journal entry or the verification, the
331
+ legacy catalog is still refused. Earlier, every such change was refused for good with
332
+ `deployment_legacy_workflow_quiescence_required`.
333
+
334
+ ## 0.87.1
335
+
336
+ No behavior change: comments now mark the code kept only for compatibility with earlier names and earlier releases. Upgrade notes will name each removal before it ships.
337
+
338
+ ## 0.87.0
339
+
340
+ Every ontology now includes the built-in entity `user_identity` (`UserIdentity`, "Sign-in
341
+ identity"): each external account a member signs in or talks with, namely their email sign-in
342
+ (`neon-auth`), SegmentStream sign-ins (`oidc`, with the issuer), SegmentStream app tokens and
343
+ channel accounts such as Telegram. It is the source every sign-in, pairing, channel admission,
344
+ Mini App session and `ActionIdentity` now reads. Only the platform writes it, with history; an
345
+ action that writes it fails. Reading it needs a role that names it, such as
346
+ `user_identity:read`: neither `*:read` nor `*:*` covers it, except that the workspace's own
347
+ pipeline workloads read it. The user gains the inverse
348
+ relationship `identities`, so a workspace entity named `user_identity`, or another relationship
349
+ whose inverse on `user` is `identities`, must be renamed.
350
+
351
+ Deploying runs an idempotent copy of members' `identity_provider`/`identity_subject`,
352
+ `_user_identities` and `_agent_identities` (same ids) into it, on every migration including a
353
+ no-op one, so a workspace that ran an earlier SDK in between is in step again. First-contact
354
+ notices move to the hidden `_identity_notices`. The legacy stores are still written in the same
355
+ transactions, so deploying an earlier SDK again keeps working: its migration keeps the
356
+ `user_identity` table and detaches it. Service principals keep their identity in the user's
357
+ columns. See docs/workspace-user-identities.md.
358
+
359
+ ## 0.86.0
360
+
361
+ Recover stored workflow failures through provider failure events without loading workflow inputs or outputs, page attempt history accurately, and preserve partial diagnostics when provider or encryption reads fail. Distinguish deployment switching and interruption from permission denial, retain safe deployment provenance, and keep older stored failure envelopes readable.
362
+
363
+ Keep pinned workflow execution compatible across presentation-only ontology deployments using a verified execution contract, distinct from the manifest provenance hash. Incompatible or legacy workflow catalog changes now require a verified cutover before migration; a provider run-list snapshot does not establish quiescence. Catalog incompatibility is reported as a permanent deployment interruption instead of a permission denial or an indefinitely retryable update.
364
+
365
+ ## 0.85.0
366
+
367
+ `chat_history` and `chat_search` now read the group chats a member is in, the way the chat's
368
+ attachments already are: a member in a chat's `members` reads its history without
369
+ `agent_chat:read`, which still reads every group. A member reads their own private chat as
370
+ before, and a posting service still reads no conversation. The archive search receives the
371
+ member's group chats with the request; it needs the matching Cloud release, which ships first.
372
+
373
+ ## 0.84.2
374
+
375
+ The documentation of `signIn.codeLink` and `codeFromLink` now leaves the choice to the app:
376
+ `useSignIn()` still never submits a linked code itself, and an app may call `submitCode()` once
377
+ when `codeFromLink` turns true so the email's button signs in with one click, accepting that a mail
378
+ scanner which runs the page's scripts can spend the code first. The starter declares `codeLink: true`
379
+ and its form submits the linked code at once.
380
+
381
+ ## 0.84.1
382
+
383
+ The ontology MCP server's `files_upload_list` tool now lists an object input schema that accepts
384
+ exactly `{}`. It advertised `{ "not": { "type": "null" } }`, which MCP's tool schema rejects, so
385
+ clients that validate `tools/list`, such as Claude's connectors, refused the whole listing and
386
+ showed none of the workspace's tools whenever file storage was enabled. Calls are unchanged: the
387
+ tool still takes no arguments and refuses unknown ones.
388
+
389
+ ## 0.84.0
390
+
391
+ Sign-in code emails can carry a sign-in link. Declare `signIn: { policy, codeLink: true }` in the
392
+ ontology; it is off when omitted, and the manifest writes `sign_in.code_link` only when declared.
393
+ The platform's code email then also has a button to the app's production `/sign-in` page with the
394
+ address and code in the URL fragment, which browsers never send to a server.
395
+
396
+ `useSignIn()` reads that fragment, removes it from the address bar, and opens on the `code` step with
397
+ `email` and `code` filled in and the new `codeFromLink` flag true. It never submits on load, since
398
+ mail scanners open links: the page asks the person to confirm with `submitCode()`. Apps word that
399
+ confirmation themselves; the starter's form shows "Sign in as …", and `<SignIn />` shows its usual
400
+ code step with the code filled in. `signInCodeFromLink(hash)` parses the fragment for apps that
401
+ read it themselves. Upgrade the app before declaring `codeLink`; an older page
402
+ ignores the fragment and shows the email step.
403
+
404
+ ## 0.83.0
405
+
406
+ `check` now warns, with the diagnostic code `earlier-name`, where workspace code still uses a name
407
+ the SDK has renamed, and names the replacement. Today that is `measures`, the earlier name of
408
+ `metrics`: `entity(name, { measures })` warns at `<entity>.metrics` and
409
+ `defineOntology({ measures })` at `metrics`, with "measures is the deprecated earlier name of
410
+ metrics; rename it to metrics." The earlier name keeps working as before; declaring both names is
411
+ still an `invalid-metric` error, without the warning.
412
+
413
+ ## 0.82.0
414
+
415
+ An authored action may declare the entities its handler writes: `action({ writes: [self, Note] })`,
416
+ with a thunk such as `() => Note` for a circular import, an entity name, or `[]` for an action that
417
+ writes nothing. The runtime refuses any other write as an `UndeclaredWrite` defect and rolls the
418
+ action back; `onDelete` cascades are not writes of the action. The manifest lists the entities on
419
+ the action as `writes`, within version 13, and its route and MCP tool descriptions say
420
+ `Writes lead, note.`. `check` refuses targets that are not stored entities of the ontology, or that
421
+ repeat. Without `writes`, nothing changes.
422
+
423
+ `<entity>_find` publishes a compact MCP input. Paging, includes and sorting come first, then a
424
+ closed `where`: each field names its type or options, and each relationship names its target's
425
+ fields instead of repeating their filters. The operators are described once, in the tool
426
+ description. The server still decodes every call with the closed query schema, so an unknown field
427
+ or operator is refused as before; REST, the app SDK and the query language are unchanged. On a
428
+ 13-entity ontology the catalog shrinks from 310 KB to 162 KB and `bill_find` from 17 KB to 5 KB,
429
+ and Eve's tool search shows the whole signature instead of cutting it before `limit` and `include`.
430
+
431
+ A confirmable action's MCP tool lists its confirmation card's facts in
432
+ `annotations["segmentstream/confirmation"]`: the action, entity and description, and each shown
433
+ field's label, option labels and, for a record id, the property that titles the record. Eve's
434
+ approval policy receives a tool's annotations, not its input schema, so the agent can present the
435
+ card without reading the ontology's metadata again. `resources/read` answers `ontology://tools/{name}` with one
436
+ tool exactly as `tools/list` lists it to the caller, and `resources/templates/list` lists that
437
+ template. `initialize` advertises `capabilities.experimental["segmentstream/runtime-source"]`; the
438
+ `me` tool keeps its `_meta` marker for older agents.
439
+
440
+ `defineOntology({ discovery: { model: "typesafe-ai/jev-1.14.0" } })` opts in to ranking
441
+ `discover`'s entities by meaning. It is off by default. When on, each entity search asks that
442
+ decision model on AI Gateway one yes-or-no question per entity the caller may use, with
443
+ `AI_GATEWAY_API_KEY` or the deployment's Vercel OIDC token. The answer lists the likely entities,
444
+ most likely first, each with its `relevance` and the caller's `tools` and `metrics` for it, under
445
+ `ranking: "meaning"`. A model failure, timeout or missing credential falls back to word matching
446
+ with `ranking: "words"` and is logged as `ontology.discover.ranking_failed`. Action and metric
447
+ searches and continuation pages match words. The `discover` tool's description tells agents what
448
+ to pass when ranking by meaning. `check` reports `invalid-discovery` for a malformed option.
449
+
450
+ MCP no longer lists `describe` or the `ontology://describe` resource; the tools now carry what
451
+ only `describe` held. Each `<entity>_find` description lists, under "Fields:", what each described
452
+ field and value means, and its metrics now include their conditions and balance rules.
453
+ The `aggregate` tool, now `query_metrics`, lists the metrics of the model the caller may
454
+ compute, with what each reads.
455
+ `discover` is listed only by an ontology that ranks entities by meaning with
456
+ `defineOntology({ discovery: { model } })`; word search alone repeated the client's own tool
457
+ search. `initialize` points agents to these descriptions. MCP clients and prompts that call
458
+ `describe` should read the tools' descriptions instead; the REST `GET /api/ontology/describe`
459
+ catalog is unchanged.
460
+
461
+ MCP: metric tools, named as dbt names its MCP tools. `list_metrics` lists every metric the caller
462
+ may compute, entity metrics and model metrics, with what each means; `get_dimensions` says what
463
+ given metrics can be grouped and filtered by, a stored entity's `id` included; `get_dimension_values`
464
+ gives the values a dimension takes, a choice field's from its options and any other's from its
465
+ data, with the warnings of the metric query they come from, such as a filter that did not reach
466
+ every metric's entity; and `query_metrics` computes them. `query_metrics` replaces the `aggregate`
467
+ tool: its arguments are the body of `POST /api/ontology/query_metrics`, `metrics` and an order's
468
+ `metric` included. Rename `aggregate` to `query_metrics` in prompts and agent instructions. `check`
469
+ refuses an entity tool that would take a metric tool's name, such as entity `list`'s action
470
+ `metrics`.
471
+
472
+ The ontology names analytics as dbt does: measures are now metrics, and aggregates are metric
473
+ queries. Declare metrics with `entity(…, { metrics })` and `defineOntology({ metrics })`, and run a
474
+ fresh metric query in an action with `Order.queryMetrics({ metrics, groupBy?, where })`. The types
475
+ are `Metric`, `Metrics`, `MetricExpression`, `ModelMetrics`, `MetricQueryValue`,
476
+ `FreshMetricQueryOptions`, `FreshMetricQueryRow`, `MetricQueryGroupKey` and the like, and the
477
+ constant `METRIC_CONDITION_OPERATORS`. `m` is unchanged. `check` diagnostics say metric, with the
478
+ codes `invalid-metric`, `unknown-metric`, `circular-metric` and `single-entity-model-metric`.
479
+
480
+ The manifest moves to version 14: entities and the model list `metrics`, and an expression reads
481
+ another metric with `{ op: "metric", name }`. The ontology service answers metric queries at
482
+ `POST /api/ontology/query_metrics` and `POST /api/ontology/<entity>/query_metrics`, which take
483
+ `metrics` and `orderBy[].metric`, and forwards them to SegmentStream's `…/metrics/query` routes;
484
+ `query_metrics` is reserved as an entity and model metric name. Discovery answers kind `metric`,
485
+ refs `metric:<name>` and the field `metrics`. Operator log events are now named
486
+ `ontology.metric_query.*` instead of `ontology.aggregate.*`; error codes such as
487
+ `invalid_aggregate_query`, `aggregate_unavailable`, `aggregate_upstream_unavailable` and
488
+ `scoped_aggregate_unavailable` are unchanged.
489
+
490
+ The earlier names keep working as deprecated aliases, so existing workspace code and older app SDKs
491
+ need no change to upgrade. `entity`, `defineOntology` and fresh metric queries accept `measures`,
492
+ and `check` reports `invalid-metric` when both names are declared; entity handles keep `aggregate`
493
+ beside `queryMetrics`. The earlier type names (`Measure`, `Measures`, `ModelMeasures`,
494
+ `MEASURE_CONDITION_OPERATORS`, `AggregateValue`, `FreshAggregateOptions`, …) remain. The service
495
+ still answers `POST /api/ontology/aggregate` and `POST /api/ontology/<entity>/aggregate`, documented
496
+ as deprecated, and `aggregate` stays reserved; both routes accept `measures` and
497
+ `orderBy[].measure` and refuse a request that names one field both ways. Every manifest decoder
498
+ reads manifests written before version 14, with their `measures` and `op: "measure"` nodes, as the
499
+ current model, while a stored document keeps the names its hash was computed over;
500
+ `withCurrentManifestNames` renames a raw document for readers that serve it.
501
+
502
+ An agent learns what it can ask `query_metrics` from the entity it already found. Each
503
+ `<entity>_find` description names the entity's metrics with their units, the entities that can
504
+ group them and their routes, and says when User relationships cannot split them. The
505
+ `query_metrics` description replaces the `aggregate` tool's fixed examples about `sales`, `stock`
506
+ and `product`, which named entities most workspaces do not have, with placeholder shapes and points
507
+ to the find descriptions, which list what each metric's entity reaches for the caller.
508
+
509
+ Keep a warehouse-backed entity's `measures` property as a deprecated alias of `metrics`,
510
+ with the same value and exact declared names. Existing typed app queries keep compiling
511
+ when the ontology SDK is upgraded before the app SDK. New code should use `metrics`.
512
+
513
+ Keep `FreshAggregateOptions` compatible with its original `measures` field. API catalogs
514
+ retain deprecated `measures` aliases, including the earlier spelling of expression references.
515
+
516
+ An action whose transaction PostgreSQL rolled back cleanly for a deadlock (`40P01`) or a
517
+ serialization failure (`40001`) now answers `409` `conflict` with `retryable: true` and
518
+ `retry_after`, over HTTP and MCP, instead of `500` `internal_error`: nothing was written, so the
519
+ caller may send the same request again. Opt-in `retryOnDeadlock` retries are unchanged and come
520
+ first. Operators keep the original cause chain under `ontology.action.transaction_conflict`. An
521
+ action that calls a connection in `prepare`, which a resend would call again, and a conflict whose
522
+ rollback or connection release also failed remain internal errors.
523
+
524
+ An entity may declare `writes: "actions"`: only its authored actions write its records. It
525
+ gets no generated `create`, `update`, `delete`, `upsert_by_<property>`, `link` or `unlink`, its
526
+ permissions are `read` and its actions, and agents and apps no longer see a generated write that
527
+ skips the entity's rules. A `rel.many` with either end in that mode has no generated `link` or
528
+ `unlink`; deleting a record on the other side still removes that record's own links. Calling a removed generated write, including a workflow step's handle write, answers
529
+ that the entity writes only through its actions and names them. The manifest carries
530
+ `writes: "actions"` on such an entity, within version 13; readers that derive generated actions
531
+ from `permissions` need no change.
532
+
533
+ The default stays `writes: "generated"`, so no existing entity changes. Switching one removes its
534
+ generated writes: `check` refuses roles that still grant them (`unknown-permission`), and code
535
+ that called them must call an action. `check` now warns with `generated-update-empty` when every
536
+ property of an entity in the default mode is `managed` and it has no relationship, so its
537
+ generated `update` could change nothing.
538
+
539
+ The app SDK's typed client leaves out `actions.create`, `actions.update` and `actions.delete` for
540
+ an entity that declares `writes: "actions"`.
541
+
542
+ ## 0.81.1
543
+
544
+ Preserve original file names, including non-Latin scripts and repeated spaces, in
545
+ download grants and multipart upload metadata using a UTF-8 `filename*` parameter
546
+ alongside the safe ASCII `filename` fallback.
547
+
548
+ ## 0.81.0
549
+
550
+ Discover the caller's open file uploads through REST, MCP and the app storage client,
551
+ including IDs, filenames, target actions, expiry and occupied upload slots. Ready
552
+ sessions explicitly report that a saving action is still required. The app SDK
553
+ exposes structured limit errors, returns the upload session with a completed transfer,
554
+ and can report its ID before a transfer fails. Retry and cancellation semantics are
555
+ unchanged. Upgrade and redeploy the workspace ontology to enable session discovery;
556
+ no database migration is required.
557
+
558
+ ## 0.80.2
559
+
560
+ Keep MCP tool discovery compatible with clients whose JSON Schema validators do not support
561
+ Unicode property regex escapes. Advertised tool inputs omit those pattern constraints while
562
+ the original action schemas continue to enforce them on every call.
563
+
564
+ ## 0.80.1
565
+
566
+ A deployment's browser sign-in revision check now keeps only an active answer. A refusal or a
567
+ failed check is asked again on the next request, so a deployment that becomes the serving one
568
+ during a promotion admits sign-in at once instead of up to a minute later.
569
+
570
+ When the app's sign-in configuration is not the serving one, a page load now receives a
571
+ text-free page that reloads itself after five seconds, instead of a raw JSON error. The reload
572
+ reaches the deployment that serves, or retries a switch-over still in progress. Data requests
573
+ and route handlers still receive the `browser_auth_configuration_unavailable` JSON error.
574
+
575
+ ## 0.80.0
576
+
577
+ Aggregates apply read scopes. An aggregate that reads an entity the caller reads through a scoped
578
+ permission no longer answers `403 scoped_aggregate_unavailable` for that reason alone: the service
579
+ sends the scope to SegmentStream, with bare `me` resolved to the caller's user id, and SegmentStream
580
+ counts, sums and groups only the rows the scope admits wherever it reads the entity, including as a
581
+ dimension's target, where a hidden related record groups as none. Field conditions, the system
582
+ fields (`created_by`, `created_at`, …) and to-one relationships apply. The answer names those entities
583
+ in `execution.rowScopes`, and the service passes on only an answer that confirms every scope it
584
+ sent, so a platform that predates row scopes never answers a scoped caller.
585
+
586
+ A scope that follows a path from `me`, a to-many or value-matched relationship, the built-in
587
+ user's fields or a column excluded from replication is still refused with `403
588
+ scoped_aggregate_unavailable`, now with a `reason` code (`me_path`, `unplannable`, `too_large`
589
+ or `unconfirmed`). A scope the service's own reads would compile to nothing, such as `me` on a
590
+ field that is not a key or an operand of the wrong type, counts no rows. Counts follow the warehouse
591
+ replica, so a record that just left a scope can be counted until replication catches up. No
592
+ migration; redeploy to apply.
593
+
594
+ ## 0.79.4
595
+
596
+ Resume paused replication with a fresh private capture incarnation instead of reusing a disabled candidate. Recover every selected scope for direct SDK resume, including after a schema change, while ordinary migrations retain scoped recovery. Refresh paused targets from the current ontology catalog while preserving explicit export exclusions and rename/default projections.
597
+
598
+ ## 0.79.3
599
+
600
+ Allow explicitly declared browser sign-in in workspace previews. Federation keeps its
601
+ deployment-bound verification and live revision checks; previews without a browser
602
+ sign-in declaration continue to reject federation, and agent OAuth remains unavailable.
603
+
604
+ ## 0.79.2
605
+
606
+ Keep unpublished replication scopes unavailable to direct SQL aggregates even when the warehouse prunes unused projected columns.
607
+
608
+ ## 0.79.1
609
+
610
+ Preserve STRING/JSON types in all-null shadow lineage projections, and type unavailable or denied placeholders using the current property incarnation after a name is reused. This prevents BigQuery union type errors while a predecessor epoch still serves.
611
+
612
+ ## 0.79.0
613
+
614
+ Declare workspace browser sign-in methods in ontology code. New workspace starters use
615
+ SegmentStream accounts; existing workspaces keep their current authentication until they
616
+ explicitly adopt the additional method. Shared authentication preserves ontology user IDs,
617
+ roles, and admission policy and grants no Cloud access.
618
+
619
+ Add verified invitation enrollment, explicit account linking in both directions, isolated
620
+ deployment and local sessions, parent-session revocation checks, and headless app sign-in
621
+ and recovery hooks. Keep workspace email templates, reply routing, and requested landing
622
+ pages; SegmentStream-only email links use central sign-in, which may require authentication.
623
+ Automatic browser sign-in preserves embedded channel authentication and the workspace's
624
+ configured Telegram launch failure page.
625
+
626
+ Existing email and dual-method workspaces retain their Neon email flow. This release permits
627
+ adding sign-in methods but blocks removing any method from an already serving app. Method
628
+ removal requires a later cutover release.
629
+
630
+ ## 0.78.0
631
+
632
+ An upload no longer holds an open-upload slot after its action is done with it. When an action
633
+ succeeds without storing a ticket it was given, for example because it found the same file already
634
+ kept, the ticket is released in the action's transaction and storage maintenance removes its bytes.
635
+ A rejected action still leaves the ticket ready for a retry, a retry of the committed action replays
636
+ its saved outcome, and a promoted chat attachment keeps its file.
637
+
638
+ MCP clients gain `files_upload_cancel`, which cancels one of the caller's own open uploads. The
639
+ `pending_uploads` limit error now lists the caller's open uploads (`uploads`: `id`, `filename`,
640
+ `expires_at`) so a client can store or cancel them instead of waiting for them to expire.
641
+
642
+ ## 0.77.3
643
+
644
+ Shadow replication views type a placeholder for a JSON property as JSON, matching the
645
+ `JSON_QUERY` value its other branches select, so BigQuery accepts views of entities with JSON
646
+ properties.
647
+
648
+ ## 0.77.2
649
+
650
+ Shadow replication views type the placeholder that stands in for a column a branch cannot serve
651
+ like the column itself, instead of as a bare NULL. BigQuery read the bare NULL as INT64 and
652
+ refused every shadow view whose first column was text, so replication passes failed while
653
+ publishing views.
654
+
655
+ ## 0.77.1
656
+
657
+ Shadow replication epochs store each route's target once against the epoch target instead of
658
+ copying the full manifest into every route. A workspace with many replicated entities and a
659
+ large manifest no longer writes epoch rows larger than a PostgreSQL client can read back, which
660
+ had failed migrations, preview dry runs and replication passes. Epochs written in the earlier
661
+ full form are still read unchanged.
662
+
663
+ ## 0.77.0
664
+
665
+ The manifest is version 12, which changes no field: it marks an SDK whose actions arm recovery runs for their triggers. Publication writes the five-minute sweep cron only for older manifests, so a workspace that redeploys without upgrading keeps its recovery, and the cron disappears with the upgrade.
666
+
667
+ ## 0.76.1
668
+
669
+ A create intent is matched in either letter case. An action that staged a file for the record it
670
+ creates was refused with "This upload cannot be attached to this record." when the caller passed
671
+ its create intent in upper case, as macOS `uuidgen` prints it. Action options, `Files.stage` and
672
+ upload sessions now lower-case create intents (and upload record IDs) where they enter.
673
+
674
+ ## 0.76.0
675
+
676
+ Buffered connection calls (`get`, `post`, `request`) no longer stop at 2 MiB responses. The
677
+ ontology service now asks SegmentStream for a streamed response and collects it, up to 64 MiB
678
+ (`MAXIMUM_CONNECTION_RESPONSE_BYTES`). A larger response fails with `invalid_response` and is not
679
+ retried; read it with `connection.stream`. Previously a response over 2 MiB failed as a
680
+ retryable `unavailable` ("Connections are temporarily unavailable"). Request bodies remain capped
681
+ at 2 MiB. No code changes are needed; redeploy with the new SDK.
682
+
683
+ ## 0.75.0
684
+
685
+ Action triggers no longer need a cron job. An action whose triggers may fire arms a durable Workflow SDK run before its transaction: the run sleeps, then starts the pending starts the request left, and ends once nothing created before its horizon waits. Publication writes no `/api/ontology/workflows/sweep` cron entry any more, so an idle workspace's database is never woken for recovery; the sweep route stays for operators with the cron secret. `ontologyWorkflows()` compiles the platform's recovery workflow beside the workspace's and registers it at startup; an action with matching triggers is refused with `workflow_recovery_unavailable` (503, retryable) when the run cannot be armed.
686
+
687
+ ## 0.74.3
688
+
689
+ Prepare a preview or development branch in seconds however much replication history production holds. `preparePreviewDatabase` empties the copied runtime tables with one `TRUNCATE` instead of row-by-row deletes, which exceeded the 30-second statement timeout on a workspace with gigabytes of replication bookkeeping. It still refuses, and changes nothing, when a workspace table references one of those tables, now even when no row does.
690
+
691
+ ## 0.74.2
692
+
693
+ Keep `nitro dev` running when a save reloads it twice in a row. The ontology's workflow bundles now rebuild one at a time, and a failed rebuild is logged once while the server keeps the previous bundle, instead of exiting with "The Workflow SDK's generated flow route no longer contains workflowEntrypoint(workflowCode, { once".
694
+
695
+ ## 0.74.1
696
+
697
+ Read the persisted baseline cursor explicitly when resuming pre-shadow source scans. Preserve
698
+ legacy writer and page admission tests across the capability 6 migration, including dual capture
699
+ and reconstruction of isolated old-schema fixtures without weakening deployed schema floors.
700
+
701
+ ## 0.74.0
702
+
703
+ The ontology service runs as a local preview for `segmentstream dev`. With
704
+ `SEGMENTSTREAM_PREVIEW_HOST=local` it keeps the preview profile and admits only workflow runs
705
+ that the Workflow SDK's local world recorded for its session, and it refuses to start when a
706
+ Vercel deployment ID is present. Manifests declare `workspace-app-local-previews-v1`;
707
+ `segmentstream dev` requires it, so upgrade the ontology SDK to use the command. Hosted previews
708
+ and production are unchanged.
709
+
710
+ ## 0.73.0
711
+
712
+ Install source capability 6 for independent serving and candidate capture, immutable epochs,
713
+ resumable warehouse loads and fenced publication. Schema-aware wire bindings preserve renames,
714
+ explicit nulls, defaults and property identity across name reuse. Restored or newly included data
715
+ repairs affected scopes automatically while existing analytical coverage remains available.
716
+ Normal SDK deployment upgrades the source; existing writer protocols and explicit opt-outs remain
717
+ supported. Destructive physical drops require source-schema compatibility.
718
+
719
+ Track logical property identities across renames and name reuse; bind aggregate coverage to the
720
+ actual selected warehouse epoch after resource admission. Keep first initialization unpublished
721
+ across deployments, reconcile empty exclusion requests, and journal fenced source-identity
722
+ replacement with recoverable attempts and old-source rejection.
723
+
724
+ Apply current identity/export restrictions to installed serving views before copy claims, pending
725
+ loads or retry delays. Retain immutable warehouse epoch ownership so source replacement can prove
726
+ the prior source even when a successful selector switch was not reflected in the product mirror;
727
+ fence exact selector and receipt incarnations and revalidate proof at completion.
728
+
729
+ Support active replication schema evolution without a manual pause: property renames adapt retained-event views with revision-fenced lineage, and restored or newly included data uses resumable scoped scans. Preserve opt-outs, pending/replayable events and compatible writers; install a permanent schema floor protecting the new lineage metadata during owner migration. Publisher acceptance remains distinct from BigQuery visibility.
730
+
731
+ ## 0.72.0
732
+
733
+ A workspace email declared in `defineOntology({ emails })` can name where replies go with
734
+ `replyTo`, one plain address such as `legal@example.com`. Without it, replies go to the member
735
+ whose action sent the email, as before. The email is still sent from the platform's address under
736
+ the workspace's name. The manifest carries it as `reply_to`; `check` reports `invalid-email` for
737
+ anything but a single address.
738
+
739
+ ## 0.71.0
740
+
741
+ Actions can email a member a link that signs them in and opens a page of the app:
742
+ `User.sendSignInLink(user, { template?, returnTo?, values? })` in a handler. `template` names one
743
+ of the workspace's own emails, declared with the new top-level
744
+ `defineOntology({ emails: { name: { subject, eyebrow?, heading, card?, note?, paragraphs?, action, footer? } } })`:
745
+ plain-text fields with `{{value}}` placeholders for the values the action passes, and
746
+ `{{member.name}}`, `{{member.firstName}}` and `{{workspace.name}}`. The platform lays them out,
747
+ escapes them, adds the plain-text part and sends the email from the workspace's name, with replies
748
+ to the member whose action sent it. Without `template`, the member receives the platform's own
749
+ invitation or sign-in email. The email is sent once the action commits, in production; a send
750
+ that fails never fails the action. The migration adds the `_sign_in_emails` table, and the
751
+ manifest carries the declared `emails` within version 11. Workflow steps refuse
752
+ `sendSignInLink`; they run an action that sends it. Check reports `invalid-email` for a malformed
753
+ email.
754
+
755
+ ## 0.70.0
756
+
757
+ Add the canonical version-1 UI page catalog contract and optional read-only `navigation` MCP discovery. Discovery uses deployed metadata and existing definition visibility without reading records, with trusted application URLs, bounded search and pagination, and revision checks. The Nitro integration embeds an immutable deployment catalog; existing services retain their tool surface until page discovery is enabled.
758
+
759
+ ## 0.69.0
760
+
761
+ Add opt-in `action({ retryOnDeadlock: true })` for handlers safe to replay after rollback.
762
+ The default SQL runtime retries only confirmed PostgreSQL deadlocks, at most twice,
763
+ after successful rollback and connection release, within the original admission and
764
+ handler budgets. Each attempt rebuilds mutable runtime, edit and trigger state while
765
+ retaining action identity. Preparation, workflow dispatch and after-commit hooks are
766
+ never replayed. Retries remain disabled by default; uncertain commits, timeouts,
767
+ cancellation, permission failures and cleanup failures are not retried. The optional
768
+ action manifest field remains compatible with older manifests and tolerant readers.
769
+
770
+ Prevent schema deployments from deadlocking with ontology writes and replication lifecycle work.
771
+ Migrations acquire replication relation, lifecycle and catalog locks in a compatible order while
772
+ preserving legacy writer fences and concurrent independent writes. Rolling upgrades also drain
773
+ older replication workers that acquire lifecycle admission before reading replication state.
774
+ Baseline requests recheck the protocol under the lifecycle fence if an upgrade commits before admission.
775
+
776
+ ## 0.68.3
777
+
778
+ Use Pub/Sub acceptance of the fixed initialization prefix for replication readiness. Remove
779
+ per-event BigQuery verification and verification-driven re-publication; native subscription
780
+ delivery and retries remain. Status no longer reports a verified counter, and aggregates omit
781
+ the destination freshness watermark. Historical schema columns and writer fences are retained.
782
+
783
+ ## 0.68.2
784
+
785
+ Declare an explicit object input schema for MCP actions with no arguments so clients can load
786
+ tool catalogs containing those actions instead of rejecting the entire discovery response.
787
+
788
+ ## 0.68.1
789
+
790
+ Report remaining blob and attachment cleanup work from bounded maintenance passes so the platform can schedule prompt follow-ups and wait six hours after draining cleanup.
791
+
792
+ ## 0.68.0
793
+
794
+ App previews support normal ontology workflows through manual starts, action/change triggers and authenticated inbound webhooks. Scheduled cron triggers stay disabled. Run reads, steps, callbacks and hook resumes require the exact child deployment and recheck preview expiry; copied production state cannot resume. Managed connections, pipelines, replication and agents including chat delivery stay unavailable, while trusted workspace code can cause external network side effects. The platform must expose VERCEL_DEPLOYMENT_ID, provision a fresh child SEGMENTSTREAM_WEBHOOK_SECRET, admit verification-only child proof for declared signing secrets, and deliver authenticated recovery POST sweeps. The App SDK reports workflows as available in preview deployment observations.
795
+
796
+ ## 0.67.0
797
+
798
+ Workflow steps can post through the existing chat delivery action when their role explicitly grants agent_chat:post_message. Delivery retains service attribution, destination checks, durable idempotency and uncertain-send recovery. The companion preview_message action returns the verified destination and attributed text without sending or reserving a key. Agent tasks still cannot post to chat.
799
+
800
+ ## 0.66.3
801
+
802
+ Allow previews with provisioned storage to start before the ontology declares a blob property.
803
+ Preserve complete redacted runtime startup errors in operator diagnostics while keeping HTTP
804
+ failures sanitized and correlated by request ID.
805
+
806
+ ## 0.66.2
807
+
808
+ Document the opt-in hourly production admission window for existing operator
809
+ release processes. Manual source storage and indexing continue; production create
810
+ and retry are refused outside the configured window before an attempt or desired
811
+ commit write, with a typed next-opening response. Preview lifecycle and default
812
+ per-push deployment remain unchanged.
813
+
814
+ ## 0.66.1
815
+
816
+ Document replication lifecycle availability separately from delivery freshness.
817
+ The Cloud worker keeps published streams active during later delivery lag, so
818
+ ordinary writes do not restart copy workflows or indefinitely hold release gates.
819
+ Initial baselines, replay, generation changes and freshness watermarks retain
820
+ their existing verification requirements.
821
+
822
+ ## 0.66.0
823
+
824
+ Support explicitly targeted app previews with typed deployment and capability observations,
825
+ deadline admission, child Neon authentication and isolated ontology/file operations. Preview
826
+ runtimes refuse pipeline execution, connections, agents, workflows, Cloud OIDC and copied or
827
+ legacy credentials. Production remains the default.
828
+
829
+ The ontology SDK exports `preparePreviewDatabase({ sql })` for verified, unexposed child
830
+ databases. Provisioners must separately invalidate/configure child Neon Auth and supply fresh
831
+ child credentials. Preview storage bindings must include the exact `deploymentId` and verified
832
+ `productionBranchId`; a copied production binding is refused. Copied retained files are served
833
+ through the verified child storage endpoint, and transfer grants cannot outlive the preview.
834
+
835
+ ## 0.65.2
836
+
837
+ Document the source-controlled manual deployment trigger available in Cloud. Workspaces can
838
+ accumulate main updates for explicit releases while retaining source indexing, deployment
839
+ authorization, canonical idempotency and retries. The default remains per-push deployment;
840
+ the setting introduces no scheduler, SDK API change or ontology migration.
841
+
842
+ ## 0.65.1
843
+
844
+ The package's root entry no longer reaches `agentTask`'s steps: its limits and result types moved to
845
+ a module without workflow or step functions, so a bundler that compiles steps, such as another
846
+ Workflow SDK major, no longer compiles them from the root entry. `agentTask` and its exports from
847
+ `@segmentstream-cloud/ontology/workflows` are unchanged.
848
+
849
+ ## 0.65.0
850
+
851
+ Workflows can hand the workspace's agent a task: `agentTask({ prompt, timeoutMs? })` from
852
+ `@segmentstream-cloud/ontology/workflows`, called in a `"use workflow"` body, gives the agent the
853
+ prompt and waits durably for its answer, `completed`, `needs_input`, `failed` (`agent_unavailable`,
854
+ `busy` or `agent_failed`) or `timed_out`. The agent acts as the workflow's own user. The
855
+ migration adds the `_agent_tasks` table. The agent authenticates a task with its runtime token and
856
+ the task's secret in `X-SegmentStream-Agent-Task`, accepted on `/mcp` and the new
857
+ `GET /api/ontology/agent/tasks/current` and `POST /api/ontology/agent/tasks/current/result` only.
858
+ Tasks run in production with an agent release that takes them; until then, and outside
859
+ production, `agentTask` resolves with `agent_unavailable`. `installWorkflowRuntime()` now sets
860
+ `WORKFLOW_QUEUE_NAMESPACE` to `ontology` in the service's process, so that hooks resumed there
861
+ continue on the ontology's queue.
862
+
863
+ ## 0.64.0
864
+
865
+ Expose permitted operations directly to every MCP client. Large external catalogs use standard
866
+ `tools/list` cursor pagination instead of `ontology_search_tools`, `ontology_describe_tool`, and
867
+ `ontology_call_tool`; those helper tools and the `mcp.toolListing` setting are removed. Refresh
868
+ external connectors' tool catalogs after deployment and call operations by their listed names.
869
+ Input schemas, descriptions, confirmation metadata, and live permission checks are preserved.
870
+ Eve runtime clients retain a single page for compatibility with Eve's current listTools client.
871
+
872
+ ## 0.63.0
873
+
874
+ Declaring a removed entity again with its `id`, or a removed property or relationship again
875
+ under its name, now restores the storage its removal kept: records, values, links and history
876
+ come back, with their constraints, indexes and foreign keys. Before, such a deploy failed in SQL
877
+ (`type "…" already exists`). The catalog records kept storage in a new `_ontology.retained`
878
+ column, added the first time a migration keeps something; earlier SDKs ignore it.
879
+
880
+ A different `id` under a kept entity's name, a kept field declared with another type, or a
881
+ rename into a kept name is refused (`name-collision`, `type-change`). Storage an earlier SDK
882
+ kept without a record is refused by name instead of failing in SQL. A restored foreign key
883
+ validates kept rows, and enabled replication refuses restoring rows or values capture never saw.
884
+ Removing a file property now also drops its file-revision foreign key, like other kept storage.
885
+
886
+ `planMigration` takes `retained` (from the new `readRetainedStorage`) and `existingStorage`
887
+ (from the new `readStorageNames`); `migrate` and `segmentstream-ontology migrate` read both.
888
+ A plan made without `retained` neither restores nor records kept storage, as before.
889
+
890
+ ## 0.62.0
891
+
892
+ Action handlers and `prepare` can compute an entity's declared measures fresh with
893
+ `Entity.aggregate({ measures, groupBy?, where })`, in the action's transaction and with the
894
+ warehouse aggregate's meaning, so a decision over a set of records an index finds, such as one
895
+ invoice's lines, no longer takes a caller's `asOf` total and a freshness check. The `where` is
896
+ `find`'s and must look records up through an index; every matching record is aggregated.
897
+ Balance measures and workflow steps are not supported. Code that implements `OntologyReads`
898
+ itself adds the `aggregate` method.
899
+
900
+ ## 0.61.1
901
+
902
+ Allow removing unused select options without enabling destructive storage drops. The enum conversion validates existing records in the migration transaction and rolls back schema and catalog changes while any record still holds a removed option. Entity, property and relationship storage stays retained by default.
903
+
904
+ ## 0.61.0
905
+
906
+ Allow workspaces to preauthorize minimal technical failure reports during requested work with feedback.automaticFailureReports. Keep confirmation for other feedback and preserve existing role scopes and defaults.
907
+
908
+ ## 0.60.1
909
+
910
+ Extract selected replication fields before ranking retained record versions, allowing warehouse
911
+ queries to prune unused JSON subfields while preserving revision ordering, tombstones and fills.
912
+
913
+ ## 0.60.0
914
+
915
+ Actions may opt into enforced read-only provider connections while retaining transactional local writes. Their MCP annotations no longer request external-effect confirmation solely for those connections; local destructive and irreversible effects retain confirmation.
916
+
917
+ MCP file-writing actions expose idempotency options when preparation stages a file, including actions with no client upload input.
918
+
919
+ Telegram failure notices use workspace-authored text without appending internal diagnostic identifiers. Full failures and their correlation identifiers remain in operator diagnostics.
920
+
921
+ ## 0.59.0
922
+
923
+ Read warehouse-backed records through the ordinary find/get tools and HTTP routes,
924
+ with opaque source-key identities, bounded pagination and permission-checked
925
+ value-matched relationship traversal. The typed app client exposes these reads.
926
+ Observations remain in the warehouse; no ontology tables or actions are added.
927
+
928
+ ## 0.58.1
929
+
930
+ Replace the ontology gateway with Eve's native MCP connection for every paired member, without
931
+ a mode setting. Remove the four ontology gateway tools and their bespoke search and metadata cache.
932
+ Eve owns discovery and direct calls; the existing member-bound
933
+ approval policy preserves permissions and exact chat-post previews. Approvals now pause the turn.
934
+
935
+ Upgrade the workspace ontology and agent together. Remove workspace-authored instructions for
936
+ the retired gateway. Migrate script-generated JSON payloads to the narrow `ontology_call_file`
937
+ tool: it snapshots the file before native approval and dispatches the original contents once.
938
+ Remove `confirmations.mode`; legacy `deferred` configs are accepted and ignored. Existing
939
+ deferred cards retain their callbacks, durable execution fences and expiry sweep, but no new
940
+ ontology call creates a deferred card.
941
+
942
+ Runtime MCP listings omit optional output schemas unless `mcp.toolListing: "full"` is selected.
943
+ Input schemas, annotations, metadata and all permitted operation names remain available.
944
+
945
+ ## 0.58.0
946
+
947
+ Allow list and query requests to select base record fields without fetching unused large properties. Selected pages always include ids and carry a projection marker; typed clients distinguish them from complete records. Pagination, related-record permissions and action reads retain their existing behavior.
948
+
949
+ ## 0.57.0
950
+
951
+ - Enable text feedback by default on upgrade and deploy. Human members receive a reserved,
952
+ unassignable reporter role with own-item scopes; OAuth consent narrowing remains authoritative.
953
+ Files default on only when another entity has a blob; explicit `feedback: true` retains files.
954
+ Configure `feedback: { builders: [...] }`, `files` or `feedback: false` in workspace code.
955
+ Missing responders produce a warning, including in the starter. Manifest 11 records the resolved
956
+ settings. Historical deployments keep their existing grants.
957
+ - Pipeline workload `*:*` no longer grants feedback or widens named feedback scopes. Explicit
958
+ grants retain their meaning; review services that relied on the former wildcard exception.
959
+ - The agent attaches a member's screenshots and files to feedback only when
960
+ `app_feedback_file_attach` is available.
961
+
962
+ ## 0.56.3
963
+
964
+ Reduce startup work for large ontologies by sharing identical relationship-filter
965
+ schema definitions within each manifest and wire spelling. Canonical identifiers
966
+ avoid character-by-character normalization, and role lookup uses the same exact
967
+ permission fast path as principal checks. Query validation and permission rules
968
+ are unchanged; no records or authorization decisions are cached.
969
+
970
+ ## 0.56.2
971
+
972
+ Return workflow steps newest first in pages of at most 100, with a continuation cursor for older steps. Preserve visible step and run errors independently of the bounded attempt history. Upgrade and redeploy the workspace to enable step history pagination in Cloud and the CLI.
973
+
974
+ ## 0.56.1
975
+
976
+ Check permissions faster on large catalogs. `isAllowed` now looks for a grant equal to the
977
+ required permission before scanning every grant, so checking many explicit permissions no longer
978
+ reparses each preceding grant every time. Decisions are unchanged: an exact grant is still
979
+ validated by the same matcher, so an identical malformed name or wildcard workflow name does not
980
+ become a grant, and normalized names, wildcards, workload exceptions and scoped reads behave as
981
+ before. No decision is cached; changed grants apply at the next check.
982
+
983
+ ## 0.56.0
984
+
985
+ - `connection.stream({ method, path, ... })` reads large provider responses incrementally within
986
+ an Effect scope. Existing buffered methods and the 2 MiB request limit keep their behavior.
987
+ - `Files.stage` streams a source into the existing blob upload lifecycle, returning a ticket for
988
+ the action's handler to attach. Declare targets with `files: [uploads.target(entity, property)]`.
989
+ `Files.open` reads retained file revisions under current permissions and record scopes. Both
990
+ capabilities are available in preparation and workflow steps; stable identities let retries
991
+ reuse staging and replay committed actions without reopening the source.
992
+
993
+ ## 0.55.1
994
+
995
+ - The migration refusal while replication still copies existing records no longer suggests pausing
996
+ and rebuilding replication, which starts another copy. It asks to apply the schema change after
997
+ the copy finishes; the platform's deployments already wait for it.
998
+
999
+ ## 0.55.0
1000
+
1001
+ - Meta webhook triggers check `X-Hub-Signature-256` against the raw body with
1002
+ `signature: { scheme: "meta", secret }`. Opt into the GET registration handshake with
1003
+ `verification: { scheme: "meta", verifyToken }`, naming a separate workspace secret.
1004
+ The backend compares the token and the route returns the plain-text challenge without
1005
+ starting a workflow. Signing secrets and stored verification tokens stay in the backend.
1006
+ Meta deliveries accept batches up to 3 MiB; other webhook limits and behavior are unchanged.
1007
+
1008
+ ## 0.54.2
1009
+
1010
+ - Adding a field with a default to an entity that replicates to the warehouse no longer refuses the
1011
+ migration with "pause replication, apply the migration, then explicitly rebuild replication".
1012
+ The migration records the value PostgreSQL gave existing rows, and the warehouse views read it
1013
+ for events captured before the field existed. Replication keeps its stream and needs no pause or
1014
+ rebuild. Renames and fields or entities that were excluded and are now included are still refused.
1015
+
1016
+ ## 0.54.0
1017
+
1018
+ - Webhook triggers: `webhook(name, { description, signature, headers })` starts a workflow for
1019
+ each delivery a provider pushes to `/api/webhooks/<name>` on the workspace's domain. The
1020
+ workflow's `input` is `webhookDelivery`: the body as UTF-8 text, its content type, the raw query
1021
+ string, the headers the trigger lists and when it arrived. A webhook without `signature` has a
1022
+ URL that ends in a token derived from the workspace's webhook secret; one with
1023
+ `signature: { scheme: "stripe", secret }` is checked against that workspace secret through
1024
+ SegmentStream, which never hands the secret to the service. The route answers `200` once the run
1025
+ has started and refuses forged, oversized or non-UTF-8 deliveries before any run exists.
1026
+ `ontologyRoutes()` adds `/api/webhooks/**`; `check` adds the `workflow_webhook_*` codes.
1027
+ - Runs record their trigger's kind: `startedBy.triggerKind` is `cron`, `action` or `webhook`.
1028
+
1029
+ ## 0.48.0
1030
+
1031
+ - `defineOntology({ feedback: true })` lets the app's members send its builders feedback through
1032
+ their agents. It adds the built-in `AppFeedback` (`app_feedback`), with the actions `submit`,
1033
+ `respond` and `acknowledge`, and `AppFeedbackFile` (`app_feedback_file`), whose `attach` adds
1034
+ any number of files to an item. The reporter is always the caller. No generated action writes
1035
+ them and no entity wildcard covers them, so members read their own items through a scoped
1036
+ `app_feedback:read`. For a caller who may submit, the MCP server's instructions say when to
1037
+ offer feedback and how to report the builders' response, and `app_feedback_submit` stays
1038
+ listed beside compact discovery. An entity of the ontology's own may not take either name.
1039
+
1040
+ ## 0.47.0
1041
+
1042
+ - The built-in `AgentChat` no longer declares `routing`, `participants` and `scope`; their stored
1043
+ values are retained. Group settings come only from the agent's `segmentstream.json`.
1044
+
1045
+ ## 0.46.0
1046
+
1047
+ - File operations answer failures a client can retry as retryable 503s instead of a bare 500 or 403. A storage provider failure answers `storage_unavailable` and is still logged with its
1048
+ cause as `ontology.storage.failed`. A request made while a deployment migrates the database
1049
+ catalog answers `ontology_updating`; `PermissionDenied` marks that refusal with `updating`.
1050
+ Both carry `retryable: true` and `retry-after`, over REST and MCP. A retry of an upload that a
1051
+ failed attempt still holds answers 409 `conflict` with `retryable: true` and `retry_after`, the
1052
+ seconds until its claim goes stale; `Conflict` carries them as `retryAfter`. The `files_upload`
1053
+ tool tells clients to send their own `idempotency_key` and to repeat a retryable call with it.
1054
+
1055
+ ## 0.45.0
1056
+
1057
+ - MCP clients can store files. `files_upload` begins an upload session for an action that takes
1058
+ a file, such as an authored `upload` action, and returns the session, a short-lived PUT grant
1059
+ for the bytes and the `options` the action needs; `property` may be left out when the action
1060
+ takes one upload of the entity. `files_upload_complete` checks the stored bytes and returns the
1061
+ ticket for the action's file field. The client sends the bytes over HTTP and runs the action
1062
+ tool with the ticket and `_options`. Both tools appear when file storage is deployed and use
1063
+ the REST upload sessions' checks, limits and action permissions.
1064
+
1065
+ ## 0.42.0
1066
+
1067
+ - File upload and agent attachment refusals name the limit that refused them. `ActionRejected`
1068
+ carries an optional `limit`: `storage_quota` with `usedBytes`, `requestedBytes` and
1069
+ `quotaBytes`; `pending_uploads` with `pending` and `max`; or `member_attachments` with `live`
1070
+ and `max`. The 422 `action_rejected` body and MCP tool errors return it as `limit`, in snake
1071
+ case (`used_bytes`, `requested_bytes`, `quota_bytes`), and the message names the specific
1072
+ limit instead of combining two. Workspace apps and agents can explain the refusal in their own
1073
+ words. The quota itself comes from the platform's storage binding.
1074
+
1075
+ ## 0.41.3
1076
+
1077
+ - Add a covering `(at, principal_id)` index to stored entities' history for rolling activity
1078
+ counts. Existing databases gain missing indexes concurrently on their next ontology migration,
1079
+ including when the manifest is unchanged; failed index builds are retried.
1080
+
1081
+ ## 0.41.2
1082
+
1083
+ - `validate_only` checks scoped permissions on generated actions. When the caller's permission
1084
+ for `create`, `update`, `delete`, `upsert_by_<property>`, `link` or `unlink` is scoped, the
1085
+ write runs in a transaction that is rolled back: a record outside the scope before the change
1086
+ is an issue at the input key holding its id, and one the change would leave outside the scope
1087
+ an issue at the input's root, instead of `ok`. An authored action's writes are still checked
1088
+ only when it runs. Unscoped callers validate as before.
1089
+
1090
+ ## 0.41.1
1091
+
1092
+ - `check` no longer reports `scope-unused` when `member` grants a scoped permission unscoped.
1093
+ Every member holds `member`, so the scope narrows nothing for members, but API keys hold only
1094
+ the roles they were given and the scope still applies to them. That overlap is now the note
1095
+ `scope-member-overlap`, with the new diagnostic severity `info`, and suggests no change.
1096
+ `scope-unused` stays a warning for a scope the same role grants unscoped, by name or wildcard.
1097
+ The `check` command counts notes after errors and warnings when there are any.
1098
+
1099
+ ## 0.41.0
1100
+
1101
+ - Record `startedBy` in the Workflow SDK's plaintext run attributes for action triggers, cron
1102
+ triggers, member starts and platform starts. Action triggers include the starting `actionId`
1103
+ and, when evaluated per edited record, `recordId`.
1104
+ - Return `startedBy` on run lists and detail reads without resolving inputs or outputs. Older
1105
+ runs without attributes omit the field.
1106
+
1107
+ ## 0.40.0
1108
+
1109
+ - Add scoped permissions: `role()` and `defineOntology({ member })` accept
1110
+ `{ permission, where }` beside permission strings. `where` is a `find` filter in which `me`
1111
+ stands for the caller and `me.<relationship>…` for the ids a path of at most three
1112
+ relationships from the built-in `User` reaches.
1113
+ - A scoped read filters lists, records, history, includes and relationship filters; a row outside
1114
+ it answers 404. A scoped write checks the record before the change (404) and after it (403
1115
+ `forbidden` with `entity` and `permission`). Roles union, and a permission any held role grants
1116
+ unscoped covers every record. Ontologies without scoped permissions behave as before.
1117
+ - An aggregate touching an entity the caller reads scoped answers 403
1118
+ `scoped_aggregate_unavailable` with `entity` until aggregates apply scopes.
1119
+ - Manifest version 10 writes `roles[].scopes` only for roles that scope a permission, with `me` as
1120
+ `{ "$me": [] }` and a path as `{ "$me": ["staff_member", "division"] }`; `roles[].permissions`
1121
+ still lists every permission. `describe` lists each role's scoped permissions, and
1122
+ `GET /api/ontology/me` and the MCP `me` tool add `scopes` when the caller holds some.
1123
+ - `check` adds the errors `invalid-scope` and `invalid-scope-path` and the warnings
1124
+ `scope-reads-all`, silenced with `readsAll: true`, `scope-unused`, for a scope the same role or
1125
+ `member` grants unscoped, and `workflow_role_scoped`. A `user`
1126
+ permission other than `user:read` cannot be scoped, since member writes are not checked against
1127
+ a scope.
1128
+
1129
+ ## 0.39.0
1130
+
1131
+ - Add action triggers, the second workflow trigger kind:
1132
+ `after(name, target, { description, when?, input? })` from
1133
+ `@segmentstream-cloud/ontology/workflows` and the root entry. `target` is an action handle
1134
+ (`Lead.actions.changeStatus`), whose event types `input` and `result` from the action, or an
1135
+ entity handle (`Lead`), for any of its actions with `unknown` input and result. `when` and
1136
+ `input` are synchronous functions of the `ActionEvent` (`action`, `actionId`, `at`,
1137
+ `principal`, `input`, `result`, `edits`) and the `TriggerRecord` (`record`, `before`, `after`,
1138
+ typed as the entity's records and `undefined` on a create or a delete). `input` omitted means
1139
+ `{}`.
1140
+ - Add `changed(field, { from?, to? })`, a `when` predicate typed from the entity's properties: true
1141
+ when the field differs before and after the action and matches the bounds given.
1142
+ - Authored action handles carry `entity` and `name` as declared (`ActionHandle`), so triggers can
1143
+ name them; they stay callable.
1144
+ - The manifest writes action triggers as `{ kind: "action", name, description, entity, action? }`
1145
+ in wire names, `action` absent for the entity form; the version stays 9. `ActionTriggerManifest`
1146
+ and `isActionTrigger` are exported.
1147
+ - `check` reports `invalid-trigger` (the target is not a handle, names an entity the ontology does
1148
+ not declare or a warehouse-backed one, or `when`/`input` is not a function),
1149
+ `trigger_action_unknown`, `trigger_function_async`, `workflow_input_invalid` when `input` is
1150
+ omitted and the workflow's input rejects `{}`, and `workflow_trigger_limit_exceeded` above
1151
+ `MAX_ACTION_TRIGGERS` (20) action triggers per ontology, besides the name, duplicate and
1152
+ description checks cron triggers have.
1153
+ - `WorkflowRunContext.startedBy` for a trigger may carry `actionId` and `recordId`.
1154
+ - The runtime evaluates action triggers in the action's transaction, after the handler: for each
1155
+ trigger on the action or its entity, except the triggers of the workflow whose user runs the
1156
+ action, it selects the record the input names (one input field references the entity and the
1157
+ action edited that record; the row's `record_id` is null) or else each edited record of the
1158
+ entity (`record_id` set), runs `when`, encodes `input` with the workflow's input and inserts a
1159
+ row into `_workflow_starts`. Generated actions fire the entity form too. A throwing or
1160
+ non-boolean `when` is a defect and rolls the action back; an input the workflow rejects fails the
1161
+ action with `TriggerInputInvalid`, answered `422 trigger_input_invalid` with `trigger` and
1162
+ `issues`.
1163
+ - After the commit the same request starts each row through the Workflow SDK with
1164
+ `startedBy: { kind: "trigger", trigger, actionId, recordId? }` and records `run_id` and
1165
+ `started_at`; a failure increments `attempts`, is logged `ontology.workflow.trigger_start_failed`
1166
+ with the request id, and leaves the row pending. The action's response is unchanged.
1167
+ `OntologyServiceRuntime.connect` receives the service's `workflowStarter`; a custom runtime
1168
+ passes it to `backendLayer(ontology, blobStorage, workflowStarter)`, else rows wait for the
1169
+ sweep.
1170
+ - Add the sweep, `GET` (Vercel's cron) and `POST /api/ontology/workflows/sweep` with the cron
1171
+ secret: up to 100 rows pending for more than 30 s, oldest first, `FOR UPDATE SKIP LOCKED`,
1172
+ answered `{ started, failed, abandoned }`. Rows at 10 attempts are logged
1173
+ `ontology.workflow.trigger_start_abandoned` and retried only with `?retryAbandoned=true`;
1174
+ started rows older than 30 days are deleted.
1175
+ - Add `GET /api/ontology/workflows/:workflow/starts?pending=true|false&limit&after` for
1176
+ `workflow:<name>:read` and the platform: `{ items: [{ trigger, actionId, recordId, createdAt,
1177
+ runId, startedAt, attempts }], nextCursor }`, newest first.
1178
+ - `GET /api/ontology/workflows` lists action triggers as `{ kind, name, description, entity,
1179
+ action }`, `action` null for the entity form.
1180
+ - Migration creates `_workflow_starts` when the manifest declares an action trigger. A primary key
1181
+ cannot hold the null `record_id`, so uniqueness per trigger, action and record is the unique
1182
+ index `_workflow_starts_key` on `(trigger, action_id, COALESCE(record_id, nil uuid))`, beside the
1183
+ partial index `_workflow_starts_pending` and `_workflow_starts_workflow` for the listing.
1184
+
1185
+ ## 0.38.0
1186
+
1187
+ - Member management from actions. The built-in `User` gains `roles`, a managed read-only
1188
+ `p.list(p.text())` read beside the record from its role assignments and filterable with `has`
1189
+ and `has_any`. Generate `user.invite`, `user.grant_roles`, `user.revoke_roles`,
1190
+ `user.deactivate` and `user.reactivate`, each requiring the permission named after it, and give
1191
+ the `User` handle the same writes (`grantRoles`, `revokeRoles`, `invite`, `setActive`) for
1192
+ authored action handlers; `User.actions(…)` lists them in `defineOntology`.
1193
+ - Every member write, from an action, the console or the CLI, records `user_history` rows under
1194
+ the action's name: `user.invite` as a `create`, the others as `update`s of `roles` or `active`.
1195
+ - Wildcard permissions (`*:*`, `*:<verb>`) cover only `user:read` and `user:update`; member
1196
+ administration verbs must be granted explicitly, and the pipeline worker's workload wildcard
1197
+ and workflow users no longer cover them. `check` warns on wildcard grants and reports a roster
1198
+ whose roles hold no member permission.
1199
+ - Manifest properties may carry `type: "list"` with `items`; readers that do not know it must
1200
+ ignore it. Deploy the ontology service with this SDK before workspaces publish with it.
1201
+
1202
+ ## 0.37.1
1203
+
1204
+ - A run id the Workflow SDK does not know answers 404 on
1205
+ `GET /api/ontology/workflows/runs/:runId`, as a world's bare 404 already did, instead of 500.
1206
+
1207
+ ## 0.37.0
1208
+
1209
+ - Add ontology workflows, durable processes written with the Vercel Workflow SDK and run by the
1210
+ ontology service: `workflow(name, { description, role, input, run, triggers, connections })`
1211
+ and `cron(name, expression, { description, input })` from
1212
+ `@segmentstream-cloud/ontology/workflows`, listed in `defineOntology({ workflows })`, checked
1213
+ with the `workflow_*` and `invalid-workflow` diagnostics. Cron triggers take Vercel's five-field
1214
+ UTC syntax.
1215
+ - Write manifest version 9 with the top-level `workflows`: wire names, the input as JSON Schema,
1216
+ the connections' keys and the triggers by `kind`, each cron trigger's input in wire form.
1217
+ Absent reads as none; readers drop trigger kinds they do not know.
1218
+ - Add `run(effect)` for `"use step"` functions: the entity handles, `Lead.actions.<name>(input)`
1219
+ (new: authored actions on a handle are callable as Effects that run them through
1220
+ `OntologyActions`) and the workflow's connections, bound to the run's workflow user with the
1221
+ routes' permission checks and history.
1222
+ - Add `installWorkflowRuntime()` from `@segmentstream-cloud/ontology/server`, the one entry that
1223
+ imports the Workflow SDK: it sets the SDK's base path to `/api/ontology` until the flow handler
1224
+ sets it and registers the SDK for the routes under
1225
+ `/api/ontology/workflows`: the cron trigger route verified with `CRON_SECRET`, `start` for
1226
+ holders of `workflow:<name>:start`, and run reads for holders of `workflow:<name>:read` and
1227
+ the platform's `platform:<workspace id>` workload subject, which no other route admits.
1228
+ `workflows` is a reserved entity name.
1229
+ - `@segmentstream-cloud/ontology/workflows` re-exports `p`, and neither it nor entity and action
1230
+ declarations import a Node built-in at load time (the manifest hash loads `node:crypto` when it
1231
+ runs), so the Workflow SDK can bundle a workflow file's top-level imports.
1232
+ - Property constructors refuse options they do not take, such as `p.integer({ minimum })`: in
1233
+ TypeScript, and through `check` with `invalid-property` for code evaluated without type checks.
1234
+ - Add `ontologyWorkflows()`, a Nitro module from `@segmentstream-cloud/ontology/nitro` that
1235
+ replaces `workflow/nitro`: it compiles the workflows and their steps and serves the flow callback
1236
+ in the ontology service at `/api/ontology/.well-known/workflow/v1/flow`, on the queue namespace
1237
+ `ontology` (`__ontology_wkf_workflow_*`), with a Vercel queue function for it. No webhook route.
1238
+ Requires Workflow SDK 5: `workflow` 5.2.2 is a peer dependency.
1239
+ - Add keyless workflow users (`workflows:<workspace id>:<workflow name>`, provider
1240
+ `segmentstream-ontology-workflow`) holding exactly the declared role: `resolveWorkflowUser`,
1241
+ and `applyMigration({ workspaceId })` reconciles them in the migration transaction
1242
+ (`reconcileWorkflowUsers`); `segmentstream-ontology migrate` reads `SEGMENTSTREAM_WORKSPACE_ID`
1243
+ for it and also applies no-op plans. A run creates a missing user but never changes roles.
1244
+ Actions of workflow users re-check their roles in the action's transaction.
1245
+
1246
+ ## 0.31.2
1247
+
1248
+ - Add Server-Timing headers and safe structured request duration logs, including
1249
+ MCP calls, without waiting for streaming responses to finish.
1250
+
1251
+ ## 0.31.0
1252
+
1253
+ - Add public-client SegmentStream OIDC sign-in, proof-based multi-identity linking,
1254
+ workspace-owned sessions and bounded Cloud revocation checks.
1255
+ - Add forward-compatible identity and session tables to ontology migrations.