You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d1e3182
Browse filesBrowse the repository at this point in the historyBrowse files
docs(automation): the notify click-through default says a before-create run links to its record only when the caller wrote the id
8
+
9
+
Clause-②: no
10
+
Metadata-protocol: none
11
+
12
+
A `notify` node that writes none of `sourceObject`, `sourceId` and `actionUrl` links to the run's trigger record when the run has one. Four texts enumerated that run as "a record change other than a delete", which includes a before-create run (`record-before-create`, or the insert leg of `record-before-write`). On that run the record is the write's input, and the driver issues the id at the write, after the hook, so the input carries an id only when the caller wrote one; with no id the notification links nowhere. The runtime is unchanged. The texts now say "a record change other than a delete or a before-create", and that a before-create run links only when the caller wrote the id:
13
+
14
+
- the `NotifyConfigSchema` docblock and the `sourceObject` / `sourceId` descriptions in `@objectstack/spec`, and the reference page generated from them;
15
+
- the `notify` node's docblock and config descriptions in `@objectstack/service-automation`, which is the wording source;
16
+
- the Flows guide and the automation skill's `notify` example.
17
+
18
+
The same texts said that a `sourceId` evaluating to `null` "leaves the key unset". It is a written key: the node then writes a half pair, which is dropped rather than defaulted to the trigger record. The node's failure text, the guide and the schema say so.
19
+
20
+
A test pins that a notify on a `beforeInsert` run whose record carries no id writes no `source_object` / `source_id`, and that one whose caller wrote the id links to it. No key, shape, default or refinement changes.
feat(spec): a field declares the key or keys it was renamed from — `renamedFrom` on `FieldSchema`
8
+
9
+
Clause-②: yes (widening)
10
+
Metadata-protocol: added
11
+
Skills-docs: follow-up #30885 — `skills/**` does not teach the key yet: it is declared ahead of the upgrade step that carries the data (rename execution, #30885), and that step owns the skills line; this diff documents it in `content/docs/data-modeling/fields.mdx` and the generated references
12
+
13
+
A package author can now say that a field was renamed, so that an upgrade knows a rename from a drop-and-add. On the new field, write the old key: `account_name: Field.text({ label: 'Account Name', renamedFrom: ['company'] })`. A field renamed twice lists both earlier keys. This is the manifest half of the rename mapping ruled on epic objectstack-ai/cloud#3652 (Q3 「默认拒绝,需显式映射(推荐)」, and on where the mapping lives, 「写进清单 renamedFrom」), and it supersedes item 5 of objectstack#24443's ruling A ("No rename spelling is added to the spec").
14
+
15
+
-**`@objectstack/spec`: `FieldSchema.renamedFrom: string[]`, optional.** Each entry is an earlier key of this same field, in the field-key grammar (lowercase snake_case). The parse refuses, in one located issue naming the object, the field and the old key: an entry that is not a field key (judged by `FieldSchema`), and, in `ObjectSchema`'s refinement beside the stage-field check, an entry that is the field's own key, an entry repeated within one list, an entry that another field of the same object still declares (the old name is still in use), and an old key that two fields of the same object both claim. Type compatibility between the old column and the new field is not judged at parse: it depends on the installed version, so the upgrade plan judges it. An object that does not write the key parses exactly as before; nothing materializes.
16
+
-**Declared ahead of its readers.** Nothing in this release reads the key at upgrade or anywhere else. The upgrade plan (#30884) and the rename execution (#30885) read it; until the execution ships, no upgrade carries a column on this declaration. The liveness ledger records the row as `planned`, naming #30885 as the reader that flips it to `live`.
17
+
-**Publish-time consequence.**`FieldSchema` is strict, so an artifact that carries `renamedFrom` is refused, as an unrecognized key, by every runtime older than this release. A package that adds the key needs an installing runtime at this release or later; a package that does not write it is unaffected.
18
+
-**`@objectstack/driver-sql` and `@objectstack/metadata-core`: the key is classified in the two maps pinned exhaustive over `FieldSchema`.** The SQL driver's builtin-column classification files it as `storage` (on `id`, `created_at` or `updated_at` the platform's own column takes no data from an old one, so the builtin-column diagnostic reports it as discarded there). The field-level security scrub keeps it: the parse refuses any entry that names a live field, so no entry can name a field a caller is denied.
Copy file name to clipboardExpand all lines: content/docs/data-modeling/fields.mdx
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -458,6 +458,12 @@ These properties are available on all field types:
458
458
459
459
Database indexes are declared at the object level in the object's `indexes[]` array — there is no per-field `index` flag. See [Indexing](/docs/data-modeling/indexing).
460
460
461
+
### Package upgrades
462
+
463
+
| Property | Type | Default | Description |
464
+
| :--- | :--- | :--- | :--- |
465
+
| `renamedFrom` | `string[]` | — | Earlier keys of this field (snake_case), e.g. `renamedFrom: ['company']` on a field now keyed `account_name`: on a package upgrade from a version that has the old key and not this one, the platform carries the old column's data to this field instead of adding an empty column. Each entry once; never the field's own key, a key another field of the object still declares, or an old key another field also claims — each refused at parse. Read only at package upgrade, and declared ahead of the upgrade step that carries the data: until that step ships, no upgrade carries a column on this declaration |
|**severity**|`Enum<'info' \| 'warning' \| 'critical'>`| optional | Severity forwarded to the messaging service |
106
-
|**sourceObject**|`string`| optional | Object name of the record the notification links to (writes sys_notification.source_object) — a literal, read as written: a single-brace `{token}` is not resolved here and is refused, as is a CEL value envelope; write the value. Only takes effect together with sourceId — a half-specified click-through target is dropped at execute time, not defaulted, so the inbox never renders a dead link. When sourceObject, sourceId and actionUrl are all left out, a run started by a record (a record change other than a delete, a time-relative sweep, an action on a record) links to that record, and a run with no trigger record links nowhere; an explicit pair or an actionUrl is kept as written. |
107
-
|**sourceId**|`string \| { dialect: 'cel'; source: string; ast?: any; meta?: object }`| optional | Record id the notification links to (writes sys_notification.source_id) — a string, or a CEL value envelope `{ dialect: 'cel', source }` evaluated per run to one (`record.id`); a `{…}` template token is refused. Only takes effect together with sourceObject — a half-specified click-through target is dropped at execute time, not defaulted, so the inbox never renders a dead link. When sourceObject, sourceId and actionUrl are all left out, a run started by a record (a record change other than a delete, a time-relative sweep, an action on a record) links to that record, and a run with no trigger record links nowhere; an explicit pair or an actionUrl is kept as written. |
106
+
|**sourceObject**|`string`| optional | Object name of the record the notification links to (writes sys_notification.source_object) — a literal, read as written: a single-brace `{token}` is not resolved here and is refused, as is a CEL value envelope; write the value. Only takes effect together with sourceId — a half-specified click-through target is dropped at execute time, not defaulted, so the inbox never renders a dead link. When sourceObject, sourceId and actionUrl are all left out, a run started by a record (a record change other than a delete or a before-create, a time-relative sweep, an action on a record) links to that record, and a run with no trigger record links nowhere — a before-create run's record has no id until the driver issues one at the write, so it links only when the caller wrote the id; an explicit pair or an actionUrl is kept as written. |
107
+
|**sourceId**|`string \| { dialect: 'cel'; source: string; ast?: any; meta?: object }`| optional | Record id the notification links to (writes sys_notification.source_id) — a string, or a CEL value envelope `{ dialect: 'cel', source }` evaluated per run to one (`record.id`); a `{…}` template token is refused. Only takes effect together with sourceObject — a half-specified click-through target is dropped at execute time, not defaulted, so the inbox never renders a dead link. When sourceObject, sourceId and actionUrl are all left out, a run started by a record (a record change other than a delete or a before-create, a time-relative sweep, an action on a record) links to that record, and a run with no trigger record links nowhere — a before-create run's record has no id until the driver issues one at the write, so it links only when the caller wrote the id; an explicit pair or an actionUrl is kept as written. |
108
108
|**actorId**|`string`| optional | User id that caused the event (writes sys_notification.actor_id) — a literal, read as written: a single-brace `{token}` is not resolved here and is refused, as is a CEL value envelope; write the value |
109
109
|**actionUrl**|`string`| optional | Explicit click-through URL, rendered per run with `{{ }}` holes like `title` (`/crm_case/{{ record.id }}`); a single-brace `{token}` is refused. Overrides the link synthesized from sourceObject/sourceId, and written alone keeps the notification from linking to the record that started the run. |
110
110
|**payload**|`Record<string, any>`| optional | Extra values merged into the notification payload — literals, read as written: a single-brace `{token}` in any string of one is not resolved here and is refused, as is a CEL value envelope written as a value; write the value |
Copy file name to clipboardExpand all lines: content/docs/references/data/field.mdx
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,6 +125,7 @@ const result = CurrencyConfigSchema.parse(data);
125
125
|**placeholder**|`string`| optional | Placeholder text rendered inside the empty input (the HTML placeholder attribute); disappears once a value is entered. Distinct from `inlineHelpText` (always-visible help rendered beside/under the input) and `description` (tooltip/developer documentation). |
126
126
|**autonumberFormat**|`string`| optional (default: `"{0000}"`) | Auto-number format: literal text + `{0000}` counter, `{YYYY}`/`{MM}`/`{DD}`/`{YYYYMMDD}` date tokens (business tz), and `{field_name}` interpolation. Counter resets per rendered prefix (e.g. AD`{YYYYMMDD}``{0000}` resets daily). Omitted on an `autonumber` field ⇒ the contract default `{0000}`, which every driver and the engine fallback read, so one field numbers alike on every backend. |
127
127
|**externalId**|`boolean`| optional (default: `false`) | Not read: no upsert, import or seed matches on this flag. A seed dataset names its match field in its own `externalId`; an import names it in the mapping's `upsertKey`. |
128
+
|**renamedFrom**|`string[]`| optional | Earlier keys of THIS field, written in the field-key grammar (lowercase snake_case), e.g. `renamedFrom: ['company']` on a field now keyed `account_name`. On a package upgrade from a version that has one of these keys and not this one, the platform carries that column's data to this field instead of adding an empty column. A field renamed twice lists both earlier keys. Each entry once; never this field's own key; never a key another field of the same object still declares (that name is still in use); never an old key another field of the same object also claims. Read only at package upgrade: no record read, write or query reads it, and the type of the old column is judged by the upgrade plan, not here. Declared ahead of the upgrade step that carries the data: until that step ships, no upgrade carries a column on this declaration. |
Copy file name to clipboardExpand all lines: content/docs/references/data/object.mdx
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -294,6 +294,7 @@ const result = ApiMethod.parse(data);
294
294
|**placeholder**|`string`| optional | Placeholder text rendered inside the empty input (the HTML placeholder attribute); disappears once a value is entered. Distinct from `inlineHelpText` (always-visible help rendered beside/under the input) and `description` (tooltip/developer documentation). |
295
295
|**autonumberFormat**|`string`| optional (default: `"{0000}"`) | Auto-number format: literal text + `{0000}` counter, `{YYYY}`/`{MM}`/`{DD}`/`{YYYYMMDD}` date tokens (business tz), and `{field_name}` interpolation. Counter resets per rendered prefix (e.g. AD`{YYYYMMDD}``{0000}` resets daily). Omitted on an `autonumber` field ⇒ the contract default `{0000}`, which every driver and the engine fallback read, so one field numbers alike on every backend. |
296
296
|**externalId**|`boolean`| optional (default: `false`) | Not read: no upsert, import or seed matches on this flag. A seed dataset names its match field in its own `externalId`; an import names it in the mapping's `upsertKey`. |
297
+
|**renamedFrom**|`string[]`| optional | Earlier keys of THIS field, written in the field-key grammar (lowercase snake_case), e.g. `renamedFrom: ['company']` on a field now keyed `account_name`. On a package upgrade from a version that has one of these keys and not this one, the platform carries that column's data to this field instead of adding an empty column. A field renamed twice lists both earlier keys. Each entry once; never this field's own key; never a key another field of the same object still declares (that name is still in use); never an old key another field of the same object also claims. Read only at package upgrade: no record read, write or query reads it, and the type of the old column is judged by the upgrade plan, not here. Declared ahead of the upgrade step that carries the data: until that step ships, no upgrade carries a column on this declaration. |
|**_lockReason**|`string`| optional | Human-readable reason shown when a write is refused by _lock. |
299
300
|**_lockSource**|`Enum<'artifact' \| 'package' \| 'env-forced'>`| optional | Layer that set _lock (artifact \| package \| env-forced). |
@@ -666,6 +667,7 @@ const result = ApiMethod.parse(data);
666
667
|**placeholder**|`string`| optional | Placeholder text rendered inside the empty input (the HTML placeholder attribute); disappears once a value is entered. Distinct from `inlineHelpText` (always-visible help rendered beside/under the input) and `description` (tooltip/developer documentation). |
667
668
|**autonumberFormat**|`string`| optional (default: `"{0000}"`) | Auto-number format: literal text + `{0000}` counter, `{YYYY}`/`{MM}`/`{DD}`/`{YYYYMMDD}` date tokens (business tz), and `{field_name}` interpolation. Counter resets per rendered prefix (e.g. AD`{YYYYMMDD}``{0000}` resets daily). Omitted on an `autonumber` field ⇒ the contract default `{0000}`, which every driver and the engine fallback read, so one field numbers alike on every backend. |
668
669
|**externalId**|`boolean`| optional (default: `false`) | Not read: no upsert, import or seed matches on this flag. A seed dataset names its match field in its own `externalId`; an import names it in the mapping's `upsertKey`. |
670
+
|**renamedFrom**|`string[]`| optional | Earlier keys of THIS field, written in the field-key grammar (lowercase snake_case), e.g. `renamedFrom: ['company']` on a field now keyed `account_name`. On a package upgrade from a version that has one of these keys and not this one, the platform carries that column's data to this field instead of adding an empty column. A field renamed twice lists both earlier keys. Each entry once; never this field's own key; never a key another field of the same object still declares (that name is still in use); never an old key another field of the same object also claims. Read only at package upgrade: no record read, write or query reads it, and the type of the old column is judged by the upgrade plan, not here. Declared ahead of the upgrade step that carries the data: until that step ships, no upgrade carries a column on this declaration. |
0 commit comments