Repository navigation
Commit 1862d8d
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
- .changeset
- content/docs/references/automation
- packages/spec/src/automation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
357 | | - | |
358 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
359 | 362 | | |
360 | 363 | | |
361 | 364 | | |
| |||
0 commit comments