Skip to content

Commit 77210bb

Browse files
committed
Merge branch 'main' of https://github.com/objectstack-ai/objectstack into claude/project-thread-19thpz
2 parents 2ac50c0 + e78d743 commit 77210bb

393 files changed

Lines changed: 15493 additions & 1813 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
feat(spec)!: one pending-confirmation service for every AI door — the in-app assistant's pending-action queue leaves `IAIService`
6+
7+
Clause-②: yes (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: registered ai-pending-action-queue-merged-into-confirmation-service -->
11+
12+
**BREAKING** contract change in `@objectstack/spec/contracts`, inside the 19 prerelease window and before 19.0.0. A confirmation rule had two seams: the in-app assistant's pending-action queue on `IAIService` (answering the model `pending_approval`) and the AI-door hand-off `IActionConfirmationService` (answering `pending_confirmation`, with only a `submit` member). They are now one: `IActionConfirmationService`, still registered under `ACTION_CONFIRMATION_SERVICE` (`'ai.actionConfirmation'`), carries the whole lifecycle, and every AI door hands its gated calls to it and answers `pending_confirmation`. No metadata changes: `ai.requiresConfirmation` and every other key an author writes mean what they meant.
13+
14+
| FROM | TO |
15+
|:--|:--|
16+
| `aiService.proposePendingAction({ objectName, actionName, toolName, toolInput, conversationId, messageId, proposedBy })`, answering `{ id }` | `confirmations.submit({ actionName, objectName, recordId, params: toolInput, door: 'assistant', toolName, conversationId, messageId }, context)`, answering `{ pendingId }` (`context` = the person the call runs as) |
17+
| `aiService.listPendingActions(filter, context?)` | `confirmations.list(filter, context)` (context required) |
18+
| (none) | `confirmations.get(pendingId, context)`, one item's row or `null` |
19+
| `aiService.approvePendingAction(id, actorId)` | `confirmations.approve(id, context)` (`context` = the deciding person; still answers `executed`, `held` or `failed`) |
20+
| `aiService.rejectPendingAction(id, actorId, reason?)` | `confirmations.reject(id, context, reason?)` |
21+
| `ProposePendingActionInput` | `ActionConfirmationHandOff`, which gains optional `toolName`, `conversationId` and `messageId` for an in-app item |
22+
| in-app tool answer `{ status: 'pending_approval', pendingActionId }` | `{ status: 'pending_confirmation', pendingId, message, actionName, objectName }` (`ActionConfirmationPending`) |
23+
24+
The one-line fix: register one `IActionConfirmationService` implementing `submit`, `list`, `get`, `approve` and `reject`, route the in-app assistant's gated tool calls through `submit` instead of `proposePendingAction`, and delete the four `IAIService` members from your implementation. A reader of stored conversations reads an old `pending_approval` answer with the same recogniser that reads `pending_confirmation`, taking `pendingActionId` as the `pendingId`; it never gets a second reader. Keep the ids of items you move from the old queue so those answers still name their item.
25+
26+
- **`@objectstack/spec`**: `IActionConfirmationService` gains `list`, `get`, `approve` and `reject` (all required) and states the three deciding points (only the person the call ran as decides; only on a signed-in session; the call runs as that person with every gate re-checked) for every item, whichever door handed it off. New types `ActionConfirmationListFilter` and `ActionConfirmationApproveOutcome`. `IAIService` loses `proposePendingAction`, `approvePendingAction`, `rejectPendingAction` and `listPendingActions`; `ProposePendingActionInput` is removed. `PendingActionStatus` (six states, `held` included) and `PendingActionRow` keep their shape and now describe the service's items; the service's docblock says how a hand-off from every door becomes a row (`tool_name` is the tool the call was made through, `run_action` or `resume_run` on an MCP item; `tool_input` is that call's input as JSON, record, namespace and run included; `object_name` is the empty string for an action on no object). The `/api/v1/ai/pending-actions` route schemas (`AiPendingAction*`) are unchanged. The D3 entry `ai-pending-action-queue-merged-into-confirmation-service` lists the hand work for `os migrate meta --from 18`.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@object-ui/plugin-chatbot': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
fix(plugin-chatbot): a pending AI action that lapsed reads "Expired" in the AI Approvals inbox and in the chat's approval card, not "Rejected"
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
Widened: `@object-ui/plugin-chatbot`'s exported `ToolDecisionState` gains the member `expired` (read from `useHitlInChat().decisions`, passed in through `ChatbotEnhancedProps.toolDecisions`); `@object-ui/i18n` gains `aiApprovals.statusExpired` and `aiApprovals.expiredDetail` in every locale pack.
12+
13+
A pending action nobody decided in time, or whose proposer lost access, is stored `status: 'rejected'`, `rejection_reason: 'lapsed'`, with no `decided_by`. The AI Approvals inbox badge, its phone card and its detail drawer now read such a row as "Expired", say why, and name no decider; a row a person rejected (a `decided_by` is recorded) still reads "Rejected". A decision on a lapsed item, answered `409` with `error.details.reason: 'pending_action_lapsed'`, now reads "Expired" in place of the conflict error: in the inbox the list is re-read, so the row turns "Expired"; in the chat the approval card (and the record-write card) settles on a new `ToolDecisionState` value, `expired`. Two new locale keys, `aiApprovals.statusExpired` and `aiApprovals.expiredDetail`, in all 11 packs.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/lint': minor
3+
'@objectstack/spec': patch
4+
---
5+
6+
fix(lint)!: a lookup filter's `$record` path to a structured field is refused where it is written
7+
8+
Clause-②: no (narrowing)
9+
Metadata-protocol: narrowed
10+
11+
A lookup field's `lookupFilters[].value.$record` reads one value from the record being edited and compares it under a scalar operator. A path whose first segment, or whose leaf behind one relationship hop, is a structured field — a member of `STRUCTURED_JSON_TYPES` in `@objectstack/spec/data`: `json`, `composite`, `repeater`, `record`, `location`, `address`, `vector` — holds a list or an object rather than one value. Read from code, the picker compares that list or object as one value under a scalar operator, so the filter does not do what it reads as, and `os lint` said nothing. Rule `object-field-ref-unknown` now refuses such a path, at the same two positions and with the same hint as a path to a multi-valued field: point `$record` at a single-valued field. A hop through a structured field was already refused as "not a relationship" and still is, once.
12+
13+
To fix a refused path, copy the value you mean onto a single-valued field and reference that field instead.
14+
15+
The ADR-0087 ledger gains the semantic entry `lookup-filter-record-path-structured-refused` in `@objectstack/spec`, beside the multi-valued one.
16+
17+
<!-- adr-0087: registered lookup-filter-record-path-structured-refused -->
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
fix(metadata-protocol): global search titles a hit by the name `referenceNameVisible` serves when the searcher is refused the record the title points at
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`searchAll` (the ⌘K palette and global search) titles a hit whose object's `nameField` is a reference field by the target record's title, read as the searcher; a searcher refused the target kept the bare id even when the field declares `referenceNameVisible: true`, while the record's `$expand` already served that reader the target's name. The search title now follows the declaration.
11+
12+
- Only for a pointer declaring `referenceNameVisible: true`, and only for the ids the searcher's own title read left untitled, after the same gates (the target's declared exposure serves `get`, its package is not disabled).
13+
- The name is the engine's own `$expand` answer for a refused reader (`{ id, name, readRefused: true }`), read as the searcher: no system-context read is added in the protocol. A name column field-level security keeps from the searcher, or one that declares a `maskingRule`, titles the hit with the `Record #<id>` floor, never the name.
14+
- The name is display only: it never joins the match set, and the hit's `record` still carries the stored id.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/service-analytics': patch
3+
---
4+
5+
fix(analytics): an empty or blank `where` key answers 400 INVALID_FIELD on all three analytics doors
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
An empty filter key (`{"": "z"}`) on `POST /api/v1/analytics/query`, as a dataset's `runtimeFilter` on `POST /api/v1/analytics/dataset/query`, or through the MCP `query_dataset` tool reached the database as `WHERE = ?` and answered `500 DATABASE_ERROR`. A blank or whitespace-only key (`" "`, a tab) answered `403 PERMISSION_DENIED` from the field-read gate. Both now answer `400 INVALID_FIELD` with `field` and `param: 'where'` on those three doors, as `/data` answers the same body, and nothing reaches the database. A key that is text but no column reference, such as `amount + 1` or `foo bar`, is unchanged: it still answers `403 PERMISSION_DENIED` from the #21156 member-shape gate. Nothing to migrate.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/rest': patch
4+
'@objectstack/runtime': patch
5+
'@objectstack/mcp': patch
6+
'@objectstack/metadata-protocol': patch
7+
'@objectstack/service-analytics': patch
8+
'@objectstack/service-storage': patch
9+
---
10+
11+
feat: an answer whose translations could not be read says so, as `translationWarning`
12+
13+
Clause-②: yes (widening) — `GetMetaItemsResponseSchema`, `GetMetaItemResponseSchema` and `QueryDatasetOutputSchema` gain the optional string `translationWarning`; the MCP `list_objects` and `describe_object` answers gain the same optional member, and `DiagnosedObjectListing` and the dataset tools' `DatasetToolSource` gain the optional `translationWarning` they carry it in; `DatasetToolsDeps` gains an optional `logger`
14+
Metadata-protocol: added
15+
16+
When the deployment's i18n service resolves but its translations cannot be read (its `getLocales` or `getTranslations` throws), the metadata and dataset answers are served in the authored language, untranslated. Until now only `list_datasets` told the caller why; every other answer looked exactly like one for a locale with no translation. These answers now carry `translationWarning`, one fixed sentence saying the translations could not be read, beside what they serve: `GET /meta/:type` and `GET /meta/:type/:name` on both HTTP hosts (the REST server and the runtime dispatcher), the MCP `list_objects` and `describe_object` tools on both transports, and `query_dataset`. It is present only on such a fault, so an answer whose translations were read is byte for byte what it was. `list_datasets` keeps the `partial` and `warning` it already serves for the same fault. Every warning sentence here, `list_datasets`' warning when the dataset catalogue itself cannot be read, and `query_dataset`'s 503 refusal when the dataset read fails, are now the platform's client-facing failure text: a fixed sentence, with the original error in the server log only. A list answered as a bare array (a protocol that answers without the `{ type, items }` envelope) has no member to carry it; the server log says the fault either way.
17+
18+
Three more places read the i18n service's whole catalog with no guard, so the same fault failed them with an unhandled error:
19+
20+
- An object save and the stored-metadata migration (its preview and its apply pass, from the REST route, the runtime dispatcher and `os migrate meta`) read the catalog to tell a translated label a Studio session sent back from one the author typed. Both are now refused as 503 `SERVICE_UNAVAILABLE`, a declared refusal whose fixed sentence reaches the HTTP caller ("The translations could not be read, … nothing was saved or migrated. Retry once the translations can be read."), and nothing is stored; the i18n error is logged on the server. Retrying once the translations read again saves the same body. Going on without the catalog would have stored translated labels as the authored ones, or counted an echoed stored row as canonical.
21+
- A dataset query's select-option labels and the upload page's object and field labels are now served as declared, with one `warn` line saying the translations could not be read.
22+
23+
Nothing to migrate.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/driver-sql': patch
3+
---
4+
5+
fix(driver-sql): a plain index MySQL refuses to key is logged and the sync goes on, so the object's remaining boot steps run
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
MySQL refuses a TEXT column in a key without a key length (`ER_BLOB_KEY_WITHOUT_LENGTH`) and a key part wider than 3072 bytes (`ER_TOO_LONG_KEY`). A UNIQUE index past that refusal is carried on a hash shadow; a plain (non-unique) index has no such route. Schema sync logged the refusal and then threw it, and no caller between it and the per-object boot loop caught the throw. So on every boot, for that object, every index declared after the refused one was never attempted, and the old-key index retirement, the drift reconcile and report, the canonical datetime/time/json/boolean backfills and the MySQL `TIMESTAMP`/`TIME` widenings were all skipped, while the boot counted a schema-sync failure.
11+
12+
The shape that reaches it is an upgrade: a column created as TEXT before its field declared a `maxLength` stays TEXT, so a release that adds the bound and a plain index over that column hits the refusal.
13+
14+
FROM: the refusal is logged at `error` and thrown, and the object's remaining steps are skipped. TO: the refusal is logged at `error` once, on the durability channel, with the same field-level remedy, and the sync goes on. The index is still not created and still not substituted (no prefix index, no shadow column); the drift report still lists it as missing. A UNIQUE index that the hash-shadow route could not carry still throws, as before. PostgreSQL and SQLite never refuse these keys and are unchanged.
15+
16+
To build the refused index, convert the column to `varchar(n)` by hand (the remedy the log line names) and let the next boot create it.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the open self-hosted restriction profile lists the whole node vocabulary and does not state which plugins the runtime runs
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`RestrictionProfileSchema.allowedFlowNodeTypes` said an environment that runs the approvals plugin lists `approval` / `approval_revise` and one that does not leaves them out. The open profile a self-hosted runtime serves (`GET /api/v1/discovery/restriction-profile`) is a constant: it lists the whole vocabulary, the approval pair included, on every kernel, whether or not the approvals plugin is installed. The reader rule and the schema docs now say so: a profile that states plugin composition lists the pair only when the environment runs the plugin; the open self-hosted profile states no plugin composition, so `os validate --target <self-hosted url>` does not check that an approval flow has an executor there. The field's description in the published JSON Schema and the reference page carries the same sentence. No key, accepted value or served answer changes. Nothing to migrate.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/skills': patch
4+
---
5+
6+
feat(spec)!: a form view no longer declares `modalSize`; no form view opens in a dialog, so nothing read the key there
7+
8+
Clause-②: yes (narrowing)
9+
10+
Metadata-protocol: narrowed
11+
12+
<!-- adr-0087: registered form-view-modal-size-removed, ui-form-view-modal-size-retired -->
13+
14+
**BREAKING** accept-set narrowing on the form view surface (`@objectstack/spec`), ADR-0049 enforce-or-remove.
15+
16+
The one reader of a form view's `modalSize` was the console's New / Edit record dialog, which copied it from the object's internal form view. Through 18.6.0 that dialog opened at the authored size. From 19.0.0 it loads no form view (the `internal-record-forms-not-loaded` entry): it lays a record out by the object's `fieldGroups` and chooses its own size. A form opened by name, or by a public link, gets a page of its own. So on 19 a form view saved with `modalSize: 'lg'` is accepted, served and drawn exactly as one without it.
17+
18+
- **FROM → TO.** `form: { …, modalSize }` (and `formViews.<key>`, a form view item's `config`, a `form` item) → `form: { … }`. Nothing on the form replaces it. The record dialog picks its size from the number of fields it draws, and the person filling it in can maximize it; a React page that opens a form in a modal writes the prop on the block, `ObjectForm` with `formType='modal'`.
19+
- **The one-line fix.** Delete `modalSize` from the form view. `os migrate meta --from 18` lists the edits for existing sources, and `--write` applies them. A stored `sys_metadata` row is converted when it is read (the `form-view-modal-size-removed` conversion), so a form view saved with the key keeps loading, and deleting it changes nothing a reader sees on 19.
20+
- **Coming from 18.x.** A New or Edit dialog whose form set `modalSize` opened at that size through 18.6.0. On 19 it opens at the size the dialog chooses from the number of fields it draws. No key restores the authored size.
21+
- **What the parse says.** "`view.form.modalSize` was removed in @objectstack/spec 19.0.0 (ADR-0049) — no form view opens in a dialog, so nothing reads it from a form view. …", at every form view door (a view's `form` and `formViews.*`, a form view item record, a flattened form overlay, a `form` item) and at `defineStack` as `STACK_SCHEMA_INVALID` / 422. TypeScript rejects the key at the authoring site.
22+
- **Unchanged.** The React `ObjectForm` block still takes `modalSize` for the modal it opens with `formType='modal'`: the react-tier contract now declares it on the block itself, with the same type. The `object-form` page block keeps it in its own props. A form view's `subforms` is not touched by this change.
23+
24+
The retirement kit: the `retiredKey()` tombstone on `FormViewSchema` (the `form` item takes it by reference); the D2 conversion `form-view-modal-size-removed` (protocol 19, retired from the load path, reaching `form`, `formViews.*`, form view items, flattened form overlays and `forms[]`); `RETIRED_KEYS_BY_MAJOR[19]` rows `ui/FormView:modalSize` and `ui/Form:modalSize`; the D3 entry `ui-form-view-modal-size-retired`; the liveness rows `view.json` `form.modalSize` and `form.json` `modalSize`, now `dead`.
25+
26+
Also corrected: the protocol-18 D3 entry `ui-form-view-type-layout-only` said the console's New and Edit dialogs were "sized by `modalSize`". They choose their own size, and the entry now says so.
27+
28+
`@objectstack/skills`: `skills/objectstack-ui/references/react-blocks.md` is regenerated. `<ObjectForm>`'s `modalSize` is listed as a binding prop from the block's overlay, no longer as a data prop from the form view schema.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/service-knowledge': patch
3+
---
4+
5+
docs(service-knowledge): the knowledge service treats a record id as text; a caller-supplied numeric id on driver-memory or driver-mongodb is not supported
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The service TSDoc of the complete-reindex purge and the protocol page (`content/docs/protocol/knowledge.mdx`) no longer describe the numeric-id case as a known limit of the purge. They now say what the service supports: it treats a record id as text, and a caller-supplied numeric record id on driver-memory or driver-mongodb, which keep the id as given and do not equate `'5'` with `5`, is not supported. On such a row the purge's re-read, which asks by the id text, finds nothing, so a document whose row was restored during a complete reindex is deleted until the row's next change or the next full reindex. Ids the platform mints are text on every driver, so nothing changes for them. No behaviour changes.

0 commit comments

Comments
 (0)