Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
0009fe1
wip(spec,core): a record field value marked as text, and the organiza…
claude Nov 16, 2026
99d7ff4
wip(automation,lint): write marked text in the organization's languag…
claude Nov 16, 2026
264b90a
wip(spec,automation): pin the record field text contract; export the …
claude Nov 16, 2026
57f3b26
test,docs(automation): pin the organization-language write end to end…
claude Nov 16, 2026
8654c31
chore(spec): regenerate the reference docs, api surface, origins, dec…
claude Nov 16, 2026
5f61572
test(automation): a record-change run of a system write declares runA…
claude Nov 16, 2026
485d1c7
Merge remote-tracking branch 'origin/main' into claude/issue-34062-fl…
claude Nov 16, 2026
c881dac
fix(lint): a record write's marked text is a text slot, its other val…
claude Nov 16, 2026
920f54c
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 16, 2026
b585364
docs(changeset): name the skills follow-up card for the record write'…
claude Nov 16, 2026
ce287ea
fix(automation): an unregistered Localization setting is not set, so …
claude Nov 16, 2026
f421259
docs(changeset): an unregistered Localization setting reads as unset;…
claude Nov 16, 2026
6d1794d
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 16, 2026
2c13aeb
fix(studio): a record write's fields cell judges a text envelope by t…
claude Nov 16, 2026
55b0d88
docs(changeset): the Studio inspector half of the record-field rule s…
claude Nov 16, 2026
2b13583
test(studio): the inspector pin pays its first lint load at collection
claude Nov 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .changeset/34062-flow-record-text-org-locale.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
'@objectstack/spec': minor
'@objectstack/core': minor
'@objectstack/service-automation': minor
'@objectstack/lint': minor
'@objectstack/runtime': patch
'@object-ui/app-shell': patch
---

feat(automation): a flow writes a field marked as text in the organization's language

Clause-②: yes (widening) — `create_record` / `update_record` `fields` values now also take the text envelope `{ dialect: 'template', source }` (`FlowRecordFieldValueSchema`), and the translation face gains `flows.<flow>.records.<node_id>.fields.<field>`; every value accepted before is accepted and written as before
Metadata-protocol: added
Skills-docs: follow-up #34434 — skills/objectstack-automation/SKILL.md (the record write's field values: the text envelope beside the CEL envelope and the literal), skills/objectstack-i18n/SKILL.md (the `flows.<flow>.records.<node_id>.fields.<field>` key and the organization-language rule)

A `create_record` / `update_record` field value can now be marked as text: `{ dialect: 'template', source: 'Auto-escalated: {{ record.priority }} priority' }`. The node writes that sentence in the organization's language, because everyone in the organization reads the record. It picks the translated template at `flows.<flow>.records.<node_id>.fields.<field>` first, then fills its `{{ }}` holes. The language is the Localization setting (`localization.locale`) when somebody set it, else the app's declared `i18n.defaultLocale`. It is never the language of the person who started the run, so a run started by a button writes the same text as a record-change run.

- A missing translation, or no language to pick, writes the authored text, and the run goes on.
- A bare string is still a literal and is written as spelled. Only the `fields` map of these two nodes takes the text envelope; every other value slot still refuses it. The source is judged as a text slot: a single-brace `{token}` is refused with its `{{ }}` spelling.
- A Localization setting that cannot be read fails the node and writes nothing, so another language is never stored over a choice that may exist. A `fault` edge routes the failure. A host that registers no `localization` setting has none set, so the app's declared default answers.
- The Studio flow inspector judges a record node's `fields` cells by the same rule (`FlowRecordFieldValueSchema`), so a text envelope there reads as valid and a malformed value still shows the spec's refusal. Fixes #34445.
- `os i18n extract` scaffolds the key, and the existing coverage check reports it missing against `supportedLocales`. `objectstack validate` refuses a key over an unknown node, over a node that is not a record write, or over a field the node does not mark as text.
- Text is picked when it is written. Records already written are not changed.

`@objectstack/core` exports `resolveOrganizationLocale` and `readOrganizationLocaleSetting`: one reader of the organization's language, for text the platform writes on the organization's behalf. `@objectstack/runtime`'s seed-locale resolver now reads its organization-setting rung through `readOrganizationLocaleSetting`; its answers are unchanged.
42 changes: 42 additions & 0 deletions content/docs/automation/flows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,48 @@ check.

[#22110]: https://github.com/objectstack-ai/objectstack/issues/22110

### Text a record keeps — a field value marked as text

A `create_record` / `update_record` field value is a literal or a CEL value
envelope, and a literal string is written exactly as spelled. A field that
stores a **sentence people read** — an escalation reason, a status note — is
marked as text instead, with the text envelope `{ dialect: 'template', source }`.
Only the `fields` map of these two nodes takes it; every other value slot
refuses it.

```typescript
{
id: 'set_reason', type: 'update_record', label: 'Set reason',
config: {
objectName: 'crm_case',
filter: { id: { dialect: 'cel', source: 'record.id' } },
fields: {
escalation_reason: { dialect: 'template', source: 'Auto-escalated: {{ record.priority }} priority' },
status: 'escalated', // a literal: written as spelled, never translated
},
},
}
```

- `source` is a text slot like the ones above: `{{ }}` holes over the flow's
variables, and a single-brace `{…}` token is refused with its `{{ }}` spelling.
- The text is written in the **organization's** language, because everyone in
the organization reads the record: the Localization setting
(`localization.locale`) when somebody set it, else the app's declared
`i18n.defaultLocale`. It is never the language of the person who started the
run — a button-started run writes the same text a record-change run does.
- The translated template is picked first, then its holes are filled. Its key is
`flows.<flow>.records.<node_id>.fields.<field>`; `os i18n extract` scaffolds
it and `os lint` reports it missing against `supportedLocales`, like every
other `flows.*` key.
- A missing translation, or no language to pick, writes the authored text and
the run goes on. A Localization setting that cannot be **read** fails the
node and writes nothing: the organization's choice may exist, and writing
another language over it would look like success. A `fault` edge routes it.
- The text is picked once, when it is written. Records written before a
translation existed keep what they hold, and changing the Localization setting
does not rewrite them.

**Create Record:**

```typescript
Expand Down
15 changes: 11 additions & 4 deletions content/docs/references/automation/builtin-node-config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ Deliberately absent:
## TypeScript Usage

```typescript
import { AssignmentConfigSchema, AssignmentExpressionValueSchema, AssignmentValueSchema, CreateRecordConfigSchema, DeleteRecordConfigSchema, EndConfigSchema, FlowCollectionSlotSchema, FlowValueSlotSchema, GetRecordConfigSchema, MapConfigSchema, SaveNoticeConfigSchema, ScreenConfigSchema, ScreenFieldConfigSchema, UpdateRecordConfigSchema } from '@objectstack/spec/automation';
import type { AssignmentConfig, AssignmentExpressionValue, AssignmentValue, CreateRecordConfig, DeleteRecordConfig, EndConfig, FlowCollectionSlot, FlowValueSlot, GetRecordConfig, MapConfig, SaveNoticeConfig, ScreenConfig, ScreenFieldConfig, UpdateRecordConfig } from '@objectstack/spec/automation';
import { AssignmentConfigSchema, AssignmentExpressionValueSchema, AssignmentValueSchema, CreateRecordConfigSchema, DeleteRecordConfigSchema, EndConfigSchema, FlowCollectionSlotSchema, FlowRecordFieldValueSchema, FlowValueSlotSchema, GetRecordConfigSchema, MapConfigSchema, SaveNoticeConfigSchema, ScreenConfigSchema, ScreenFieldConfigSchema, UpdateRecordConfigSchema } from '@objectstack/spec/automation';
import type { AssignmentConfig, AssignmentExpressionValue, AssignmentValue, CreateRecordConfig, DeleteRecordConfig, EndConfig, FlowCollectionSlot, FlowRecordFieldValue, FlowValueSlot, GetRecordConfig, MapConfig, SaveNoticeConfig, ScreenConfig, ScreenFieldConfig, UpdateRecordConfig } from '@objectstack/spec/automation';

// Validate data
const result = AssignmentConfigSchema.parse(data);
Expand Down Expand Up @@ -154,7 +154,7 @@ Value the variable takes: a CEL value envelope `{ dialect: 'cel', source }` eval
| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **objectName** | `string` | ✅ | Object to insert into |
| **fields** | `Record<string, any>` | optional | Field values to write on the new record: each key is a field name, each value a CEL value envelope or a literal |
| **fields** | `Record<string, any>` | optional | Field values to write on the new record: each key is a field name, each value a CEL value envelope, a text envelope (a sentence written in the organization's language) or a literal |
| **outputVariable** | `string` | optional | Flow variable bound to the created record — a name without a leading `$` (the `$` names are the flow engine's own), read as `{{ name }}` |


Expand Down Expand Up @@ -215,6 +215,13 @@ CEL value envelope `{ dialect: 'cel', source }` — evaluated by the expression
---


---

## FlowRecordFieldValue

A field value: a CEL value envelope `{ dialect: 'cel', source }` evaluated to the value written, a text envelope `{ dialect: 'template', source }` — a sentence for people to read, written in the organization's language (its translation picked at `flows.<flow>.records.<node_id>.fields.<field>`, then its `{{ }}` holes filled; the authored text when none is held) — or a literal written as it is (a bare string is never translated; a `{…}` template token in it is refused)


---

## FlowValueSlot
Expand Down Expand Up @@ -340,7 +347,7 @@ A value: a CEL value envelope `{ dialect: 'cel', source }` evaluated by the expr
| :--- | :--- | :--- | :--- |
| **objectName** | `string` | ✅ | Object to update |
| **filter** | `Record<string, any>` | optional | Field/value pairs identifying the record(s) to update: each operand — a field's value, an operator's comparand (`{"$ne": null}`), a list comparand's element — is a CEL value envelope `{ dialect: 'cel', source }` evaluated before the query (one that evaluates to null refuses the node), a query placeholder such as `{current_user_id}` or `{today}` the query engine resolves, or a literal; a flow `{…}` template token is refused |
| **fields** | `Record<string, any>` | optional | Field values to write: each key is a field name, each value a CEL value envelope or a literal |
| **fields** | `Record<string, any>` | optional | Field values to write: each key is a field name, each value a CEL value envelope, a text envelope (a sentence written in the organization's language) or a literal |
| **multi** | `boolean` | optional | Declare bulk intent: update every row the filter matches (default false — a predicate update without it is refused by the engine) |


Expand Down
10 changes: 5 additions & 5 deletions content/docs/references/index.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Protocol reference — every schema by module
navTitle: Protocol Reference
description: Every schema published by @objectstack/spec — 1664 schemas across 14 protocol modules
description: Every schema published by @objectstack/spec — 1665 schemas across 14 protocol modules
---

{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs live in the module folders under content/docs/. */}
Expand All @@ -22,7 +22,7 @@ counts are sums of the rows they head. Regenerate with
| :--- | ---: | ---: | :--- |
| [AI Protocol](/docs/references/ai) | 14 | 81 | Agents, tools, skills, RAG and knowledge sources, model registry, conversations. |
| [API Protocol](/docs/references/api) | 36 | 494 | REST contracts, endpoints, routing, realtime, batch, discovery. |
| [Automation Protocol](/docs/references/automation) | 16 | 81 | Flows and their nodes, approvals, ETL pipelines, webhooks, state machines, execution records. |
| [Automation Protocol](/docs/references/automation) | 16 | 82 | Flows and their nodes, approvals, ETL pipelines, webhooks, state machines, execution records. |
| [Data Protocol](/docs/references/data) | 35 | 187 | Objects, fields, queries, filters, datasources and drivers — the ObjectQL layer. |
| [Identity Protocol](/docs/references/identity) | 5 | 27 | Users and accounts, organizations, positions, SCIM provisioning. |
| [Integration Protocol](/docs/references/integration) | 1 | 23 | The single connector protocol (ADR-0097) — catalog descriptors and provider-bound instances. |
Expand All @@ -34,7 +34,7 @@ counts are sums of the rows they head. Regenerate with
| [Studio Protocol](/docs/references/studio) | 3 | 35 | Studio designer metadata — the authoring surfaces for the protocols above. |
| [System Protocol](/docs/references/system) | 40 | 297 | The runtime environment — logging, jobs, cache, metrics, notifications, i18n and compliance. |
| [UI Protocol](/docs/references/ui) | 16 | 176 | Apps, pages, views, dashboards, reports, actions and themes — the ObjectUI layer. |
| **Total** | **218** | **1664** | 14 protocol modules |
| **Total** | **218** | **1665** | 14 protocol modules |

---

Expand Down Expand Up @@ -112,7 +112,7 @@ REST contracts, endpoints, routing, realtime, batch, discovery.

## Automation Protocol

**Source:** `packages/spec/src/automation/` · **Import:** `@objectstack/spec/automation` · **16 pages, 81 schemas**
**Source:** `packages/spec/src/automation/` · **Import:** `@objectstack/spec/automation` · **16 pages, 82 schemas**

Flows and their nodes, approvals, ETL pipelines, webhooks, state machines, execution records.

Expand All @@ -123,7 +123,7 @@ Flows and their nodes, approvals, ETL pipelines, webhooks, state machines, execu
| [`approval.zod.ts`](/docs/references/automation/approval) | `ApprovalDecision`, `ApprovalEscalation`, `ApprovalNodeApprover`, `ApprovalNodeConfig`, `ApproverType`, `DecisionOutputDef` |
| [`assignment-rule.zod.ts`](/docs/references/automation/assignment-rule) | `AssignmentRule`, `AssignmentRuleEntry`, `AssignmentStrategy`, `AssignmentTarget` |
| [`bpmn-interop.zod.ts`](/docs/references/automation/bpmn-interop) | `BpmnDiagnostic`, `BpmnElementMapping`, `BpmnExportOptions`, `BpmnImportOptions`, `BpmnInteropResult`, `BpmnUnmappedStrategy`, `BpmnVersion` |
| [`builtin-node-config.zod.ts`](/docs/references/automation/builtin-node-config) | `AssignmentConfig`, `AssignmentExpressionValue`, `AssignmentValue`, `CreateRecordConfig`, `DeleteRecordConfig`, `EndConfig`, `FlowCollectionSlot`, `FlowValueSlot`, `GetRecordConfig`, `MapConfig`, `SaveNoticeConfig`, `ScreenConfig`, `ScreenFieldConfig`, `UpdateRecordConfig` |
| [`builtin-node-config.zod.ts`](/docs/references/automation/builtin-node-config) | `AssignmentConfig`, `AssignmentExpressionValue`, `AssignmentValue`, `CreateRecordConfig`, `DeleteRecordConfig`, `EndConfig`, `FlowCollectionSlot`, `FlowRecordFieldValue`, `FlowValueSlot`, `GetRecordConfig`, `MapConfig`, `SaveNoticeConfig`, `ScreenConfig`, `ScreenFieldConfig`, `UpdateRecordConfig` |
| [`control-flow.zod.ts`](/docs/references/automation/control-flow) | `FlowRegion`, `LoopConfig`, `ParallelBranch`, `ParallelConfig`, `RetryPolicy`, `TryCatchConfig`, `TryCatchErrorValue` |
| [`execution.zod.ts`](/docs/references/automation/execution) | `Checkpoint`, `ConcurrencyPolicy`, `ExecutionError`, `ExecutionErrorSeverity`, `ExecutionLog`, `ExecutionStatus`, `ExecutionStepLog`, `ExecutionStepMetrics`, `ExecutionStepSkipReason`, `FlowRunGateSummary`, `FlowRunNodeSummary`, `FlowRunSummary` |
| [`flow.zod.ts`](/docs/references/automation/flow) | `Flow`, `FlowEdge`, `FlowNode`, `FlowNodeAction`, `FlowVariable`, `FlowVersionHistory` |
Expand Down
4 changes: 4 additions & 0 deletions content/docs/references/system/translation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ Translation data for a single object
| **refusals** | `Record<string, { message?: string }>` | optional | Refusal translations keyed by the node id (`FlowNode.id`) of an `end` node declaring `outcome: 'refused'` |
| **approvals** | `Record<string, { label?: string }>` | optional | Approval-step translations keyed by the node id (`FlowNode.id`) of an `approval` node |
| **notices** | `Record<string, { message?: string }>` | optional | Save-notice translations keyed by the node id (`FlowNode.id`) of a `save_notice` node |
| **records** | `Record<string, { fields?: Record<string, string> }>` | optional | Record-write text translations keyed by the node id (`FlowNode.id`) of a `create_record` / `update_record` node |

### Nested Shape: `PlatformTranslationData.hooks[string]`

Expand Down Expand Up @@ -470,6 +471,7 @@ Translation data for a single object
| **refusals** | `Record<string, { message?: string }>` | optional | Refusal translations keyed by the node id (`FlowNode.id`) of an `end` node declaring `outcome: 'refused'` |
| **approvals** | `Record<string, { label?: string }>` | optional | Approval-step translations keyed by the node id (`FlowNode.id`) of an `approval` node |
| **notices** | `Record<string, { message?: string }>` | optional | Save-notice translations keyed by the node id (`FlowNode.id`) of a `save_notice` node |
| **records** | `Record<string, { fields?: Record<string, string> }>` | optional | Record-write text translations keyed by the node id (`FlowNode.id`) of a `create_record` / `update_record` node |

### Nested Shape: `ServedTranslationData.hooks[string]`

Expand Down Expand Up @@ -711,6 +713,7 @@ Translation data for a single object
| **refusals** | `Record<string, { message?: string }>` | optional | Refusal translations keyed by the node id (`FlowNode.id`) of an `end` node declaring `outcome: 'refused'` |
| **approvals** | `Record<string, { label?: string }>` | optional | Approval-step translations keyed by the node id (`FlowNode.id`) of an `approval` node |
| **notices** | `Record<string, { message?: string }>` | optional | Save-notice translations keyed by the node id (`FlowNode.id`) of a `save_notice` node |
| **records** | `Record<string, { fields?: Record<string, string> }>` | optional | Record-write text translations keyed by the node id (`FlowNode.id`) of a `create_record` / `update_record` node |

### Nested Shape: `TranslationData.hooks[string]`

Expand Down Expand Up @@ -921,6 +924,7 @@ Translation data for a single object
| **refusals** | `Record<string, { message?: string }>` | optional | Refusal translations keyed by the node id (`FlowNode.id`) of an `end` node declaring `outcome: 'refused'` |
| **approvals** | `Record<string, { label?: string }>` | optional | Approval-step translations keyed by the node id (`FlowNode.id`) of an `approval` node |
| **notices** | `Record<string, { message?: string }>` | optional | Save-notice translations keyed by the node id (`FlowNode.id`) of a `save_notice` node |
| **records** | `Record<string, { fields?: Record<string, string> }>` | optional | Record-write text translations keyed by the node id (`FlowNode.id`) of a `create_record` / `update_record` node |

### Nested Shape: `TranslationItem.hooks[string]`

Expand Down
1 change: 1 addition & 0 deletions content/docs/ui/translations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export default defineStack({
| Page tab labels (`page:tabs` items) | `pages.<name>.components.<tabsId>.items.<value>.label` — keyed by the tabs component's `id` and the item's `value`; an item without a `value` has no key (localize it with an inline locale map), and `page:accordion` panels have none |
| A page `object-form`'s thank-you panel | `pages.<name>.components.<formId>.submitBehavior.title` / `.message` — keyed by the `object-form` component's `id` (a form without an `id` has no key), by the same rules as a form view's panel |
| Screen-flow wizards (flow label, screen headings and body text, screen field copy) | `flows.<flow>.label` / `flows.<flow>.screens.<node_id>.title` / `.description` / `.fields.<field>.label` / `.placeholder` / `.inlineHelpText` — a screen field's help text is `inlineHelpText`, the key the field itself declares, not `help`; see the boundary note below |
| Text a flow writes into a record (a `create_record` / `update_record` field value marked `{ dialect: 'template', source }`) | `flows.<flow>.records.<node_id>.fields.<field>` — picked in the organization's language (the Localization setting when set, else the app's `i18n.defaultLocale`), never the run starter's; see [Flows](/docs/automation/flows#text-a-record-keeps--a-field-value-marked-as-text) |
| Hook refusal messages | `hooks.<hook>.refusals.<CODE>.message` — one per entry of the hook's `refusals` catalogue — and `hooks.<hook>.refusals.<CODE>.reasons.<REASON>.message`, one per reason an entry declares. A hook (a `js` body or a TypeScript `handler`) refuses by code, optionally with a declared reason, and the server answers the refusal with this sentence in the caller's locale, else the declared one. A translation of an entry that declares `params` keeps its `{{ name }}` holes; the server fills them after picking the translation |
| Position label / description | `positions.<name>.label` / `description` — keyed by the position's `name`; overlaid on every served position, which is the list the console's position picker draws |
| Permission-set label / description | `permissions.<name>.label` / `description` — the group is spelled as the stack spells the collection (`permissions[]`), keyed by the set's `name` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ hand-patch a number here** — fix the code or the verdict and regenerate.

| Dir | Sites |
|---|---|
| `system/` | 403 |
| `system/` | 404 |
Loading
Loading