Skip to content

Commit 1862d8d

Browse files
fix(spec): the script.config.template tombstone points at the notify node's own template key (#25085)
Closes #24965 Clause-②: no (prose only: no shape, key, default or accepted value moves) ## What changed The `script.config.template` tombstone in `packages/spec/src/automation/schemaless-node-config.zod.ts` told authors that "stored templates live in the messaging service (`sys_notification_template`), not on the node". That text predates the `notify` node's own `template` key. This is the spec-lane half of execution card ② of ruling D on #24770 (decision `6290342354`, recorded by triage in `6293376907`). The services half is #24924. The prescription now reads: > Delete the key. For templated content use a `notify` node and name an email template (`email_template`) in its own `template` key, with `templateData` filling its placeholders: the email and in-app inbox channels render that template in each recipient's locale. Otherwise the node carries inline `title`/`message`. The messaging service's `sys_notification_template` rows are read only by the `email` and `sms` channels, `email` only when the node names no template. The `retiredKey()` call, the key's rejection and every other tombstone are unchanged. The generated reference `content/docs/references/automation/schemaless-node-config.mdx` was regenerated with `gen:docs` and carries the same text. No test pins the old wording (`git grep "stored templates live"` on the base finds only the source and the generated page). ## Claims verified against the runtime (origin/main `2b1382a5b3`) | Claim in the new text | Evidence | |:--|:--| | `notify` has its own `template` key naming an `email_template`, and `templateData` fills its placeholders | `packages/spec/src/automation/io-node-config.zod.ts:585` (`template`, described as an `email_template` item's `name`), `:593` (`templateData`); `email_template` is a metadata type at `packages/spec/src/kernel/metadata-plugin.zod.ts:162` | | The executor forwards the template reference, not inline content, when one is named | `packages/services/service-automation/src/builtin/notify-node.ts:465` reads `cfg.template`; `:614-616` puts `{ template, templateData }` in the payload, else `{ title, body }` | | The email channel renders the named template per recipient locale and does not read `sys_notification_template` then | `packages/services/service-messaging/src/email-channel.ts:330-333` takes `payload.template`, `:345` calls `email.sendTemplate`, and that branch returns before `:378`, the only `store.load(…, 'email', …)` | | The inbox channel renders the named template per recipient locale | `packages/services/service-messaging/src/inbox-channel.ts:163-166` takes `payload.template`, `:182` resolves the recipient locale, `:188` calls `email.renderTemplate` | | The inbox never reads `sys_notification_template` | `packages/services/service-messaging/src/messaging-service-plugin.ts:285` builds the inbox channel with no `store`; only the email (`:398`) and sms (`:417`) channels get `templateStore` | | `sms` reads `sys_notification_template` whether or not a template is named | `packages/services/service-messaging/src/sms-channel.ts:285` calls `store.load(topic, 'sms', …)` unconditionally; the file reads no `payload.template` | | Without a template, the node carries inline `title`/`message` | `notify-node.ts:508` (title required when no template), `io-node-config.zod.ts:559`/`:562` | The services side states the same reader set: `packages/services/service-messaging/src/objects/notification-template.object.ts:6-27` (`TEMPLATE_CHANNELS = ['email', 'sms']`). **One deviation from the dispatch wording.** The dispatch said a named template "is used on every channel". The runtime shows otherwise for `sms`: it has no template path and reads `sys_notification_template` (falling back to the topic) even when the node names an email template. So the text names email and inbox as the channels that render the named template. It says `sys_notification_template` is read by `email` only when no template is named, and it does not say the same of `sms`. ## Verification (head `2318cdd237`) - `pnpm --filter @objectstack/spec build`: `VERDICT command-exit 0`. - `pnpm --filter @objectstack/spec check:generated`: before `gen:docs`, `✗ 1 of 14 artifact(s) stale: content/docs/references/**`. After it: `✓ All 14 generated artifacts are up to date`. - `pnpm --filter @objectstack/spec test`: `Test Files 705 passed (705)`, `Tests 21424 passed | 1 todo`. - `pnpm --filter @objectstack/spec typecheck`: exit 0. - `pnpm --filter @objectstack/spec test:repo`: `Test Files 72 passed (72)`, `Tests 1237 passed (1237)`. - `node scripts/pm/dispatch-gates.mjs --commands` derived 105 commands: 104 exit 0 (six of them after building the `@objectstack/lint` closure, `@objectstack/client` and `@objectstack/client-react`, which they read as built output). `check:dual-build-cjs-loads` is NOT MEASURED: it exited 3 (PREREQUISITE NOT MET) because it reads every workspace package's `dist/`, which needs a whole-workspace build. CI runs it. `dispatch-gates --ran`: `105 derived famil(ies) accounted for — 104 run, 1 NOT-MEASURED`. ## Acceptance notes - Changeset `.changeset/24965-script-template-tombstone.md`: `@objectstack/spec` `patch`, because the tombstone text ships in the published runtime's rejection message. Not breaking, so it has no ADR-0087 marker. - No open PR touched `schemaless-node-config.zod.ts` when this was opened (all 14 open PRs' file lists were read). --- _Generated by [Claude Code](https://claude.ai/code/session_01D6F9axfoPzR7t8G1J7Ytzz)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 28c9a2c commit 1862d8d

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
fix(spec): the `script.config.template` tombstone points at the `notify` node's own `template` key
6+
7+
Clause-②: no (prose only: no shape, key, default or accepted value moves)
8+
9+
The rejection an author sees for the retired `script.config.template` key said that stored templates live in the messaging service (`sys_notification_template`). That text predates the `notify` node's own `template` key. It now prescribes that key: name an email template (`email_template`) in a `notify` node's `template`, with `templateData` filling its placeholders, and the email and in-app inbox channels render it in each recipient's locale; otherwise the node carries inline `title`/`message`. It mentions `sys_notification_template` only as the rows the `email` and `sms` channels read, `email` only when the node names no template. The key stays rejected exactly as before, and the generated reference page carries the same text.

‎content/docs/references/automation/schemaless-node-config.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ const result = DecisionConditionSchema.parse(data);
168168
| **inputs** | `Record<string, any>` | optional | Inputs passed to the function: each value a CEL value envelope `{ dialect: 'cel', source }` evaluated against the live flow variables, or a literal written as it is — a `{…}` template token is refused |
169169
| **outputVariable** | `string` | optional | Flow variable the function's return value is bound to — a name without a leading `$` (the `$` names are the flow engine's own), read as `{{ name }}` |
170170
| **actionType** | `never` | optional | [REMOVED] `script.config.actionType` was removed in @objectstack/spec 17 — none of its values did what it said. The two built-ins were logger-backed stubs that recorded the intent and delivered nothing under any configuration, and every other value was a second spelling of `config.function`. Replace it per branch: for `email` use a `notify` node (it delivers through the messaging service — the in-app inbox by default, real email once `@objectstack/plugin-email` is installed); for `slack` use a `connector_action` node with the Slack connector, or an `http` node posting to a webhook; for anything else, move the name into `config.function`. Run `os migrate meta --from 16` to list the mechanical edits for the shorthand case into `config.function`; `--write` applies the ones it can prove, and the stub and marker values are removed. |
171-
| **template** | `never` | optional | [REMOVED] `script.config.template` was removed in @objectstack/spec 17 — it fed only the logger-backed `email`/`slack` stubs, which never rendered or sent a message, so no template id was ever resolved. Delete the key. A `notify` node carries its own `title`/`message`, and stored templates live in the messaging service (`sys_notification_template`), not on the node. Run `os migrate meta --from 16` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
171+
| **template** | `never` | optional | [REMOVED] `script.config.template` was removed in @objectstack/spec 17 — it fed only the logger-backed `email`/`slack` stubs, which never rendered or sent a message, so no template id was ever resolved. Delete the key. For templated content use a `notify` node and name an email template (`email_template`) in its own `template` key, with `templateData` filling its placeholders: the email and in-app inbox channels render that template in each recipient's locale. Otherwise the node carries inline `title`/`message`. The messaging service's `sys_notification_template` rows are read only by the `email` and `sms` channels, `email` only when the node names no template. Run `os migrate meta --from 16` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
172172
| **recipients** | `never` | optional | [REMOVED] `script.config.recipients` was removed in @objectstack/spec 17 — the addresses were logged, never messaged: the `email`/`slack` branches it fed delivered nothing. Use a `notify` node, whose `recipients` (user ids, field refs or addresses) reach the messaging service for real. Run `os migrate meta --from 16` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
173173
| **variables** | `never` | optional | [REMOVED] `script.config.variables` was removed in @objectstack/spec 17 — it injected values into a template no side effect ever rendered. Delete the key. A `notify` node carries structured data in `payload`; a registered function takes it in `config.inputs`. Run `os migrate meta --from 16` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
174174
| **script** | `never` | optional | [REMOVED] `script.config.script` was removed in @objectstack/spec 17 — the built-in runtime has no server-side JS sandbox, so an inline body was recognized and never executed: the node warned and completed as a no-op. Move the logic into a registered function (`defineStack({ functions })`) and name it in `config.function`. Run `os migrate meta --from 16` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |

‎packages/spec/src/automation/schemaless-node-config.zod.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,12 @@ export const ScriptConfigSchema = lazySchema(() => strictObject({
353353
template: retiredKey(
354354
'`script.config.template` was removed in @objectstack/spec 17 — it fed only the '
355355
+ 'logger-backed `email`/`slack` stubs, which never rendered or sent a message, so no template '
356-
+ 'id was ever resolved. Delete the key. A `notify` node carries its own `title`/`message`, and '
357-
+ 'stored templates live in the messaging service (`sys_notification_template`), not on the '
358-
+ 'node. '
356+
+ 'id was ever resolved. Delete the key. For templated content use a `notify` node and name an '
357+
+ 'email template (`email_template`) in its own `template` key, with `templateData` filling its '
358+
+ 'placeholders: the email and in-app inbox channels render that template in each recipient\'s '
359+
+ 'locale. Otherwise the node carries inline `title`/`message`. The messaging service\'s '
360+
+ '`sys_notification_template` rows are read only by the `email` and `sms` channels, `email` '
361+
+ 'only when the node names no template. '
359362
+ 'Run `os migrate meta --from 16` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand.',
360363
),
361364
recipients: retiredKey(

0 commit comments

Comments
 (0)