Skip to content

Commit 1a41859

Browse files
committed
docs(spec): notify recipients state the computed-address screen and email-field delivery the runtime now makes
The runtime half landed in d1e329e. A computed recipient that reads as an address, in a node whose channels include `email`, now resolves to the user who holds it or fails the node pointing to `{ emailField }`. An email-field recipient is mailed, read from the stored trigger row, one plain ASCII mailbox, at most 5 sends per address per hour, best-effort. The describes, the union description, the docblock and the changeset now say so, in place of the "planned" and "not live yet" sentences. Claude-Session: https://claude.ai/code/session_01PC4NPXPgPmpDRG9DdDnyXT Co-authored-by: Claude <noreply@anthropic.com>
1 parent f6c07d3 commit 1a41859

2 files changed

Lines changed: 39 additions & 22 deletions

File tree

‎.changeset/25696-notify-recipients-describe.md‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
'@objectstack/spec': minor
33
---
44

5-
docs(spec): a `notify` node's `recipients` names an email address written out as an author constant, not an audience selector
5+
docs(spec): a `notify` node's `recipients` names an email address written out as an author constant, not an audience selector, and states the computed-address and email-field behaviour the runtime makes
66

77
Clause-②: no
88
Metadata-protocol: semantic
99
Ruling-ref: 6386629237
1010

11-
The `recipients` text of a `notify` node config — its `describe()` (read by the reference docs and the JSON Schema), the union's description, and the sentence a refused `recipients` value leads with — now says what an email address in `recipients` means:
11+
The `recipients` text of a `notify` node config now says what an email address in `recipients` means, and what the notify node does with one. That text is the field's `describe()` (which the reference docs and the JSON Schema read), the union's description, and the sentence a refused `recipients` value leads with.
1212

13-
- **Written out as a string, it is an author constant.** `recipients: 'ops@example.com'` is no audience selector: it is sent as written, to the user who holds that address, or else, on the `email` channel, to the address itself. Nothing about it changes; the text stopped calling it an audience selector. The audience selectors are the prefixed forms, such as `team:ID`.
14-
- **An address a CEL envelope evaluates to is not one.** It resolves to the user who holds it. Failing the node on an address that no user holds, with a message pointing to `{ emailField }`, is **planned and not made yet**: until the runtime check lands, such an address is still handed to the messaging service as written, and the text says so rather than claim a refusal the runtime does not make.
13+
- **Written out as a string, it is an author constant.** `recipients: 'ops@example.com'` is no audience selector. It is sent as written: to the user who holds that address, or else, on the `email` channel, to the address itself. Nothing about it changes; the text no longer calls it an audience selector. The audience selectors are the prefixed forms, such as `team:ID`.
14+
- **An address a CEL envelope evaluates to is not one.** In a node whose `channels` include `email`, a computed recipient that reads as an address, bare or as `user:ADDRESS`, must belong to a user. One a user holds resolves to that user. One that no user holds fails the node, and the message points to `{ emailField }`. A node that does not name `email` (`inbox` alone, the default) mails nobody, so its computed recipients go to the messaging service as before. This is the current behaviour of the notify node; the channel scope is with the maintainer for confirmation.
15+
- **`{ emailField }` is delivered.** The text no longer says delivery is not live. The address is read from the stored trigger record when the node runs. It must be one plain ASCII mailbox, or the node fails and nothing is sent. One address receives at most 5 such emails per hour; the limit is best-effort.
1516

16-
No key, shape, default or accepted value changes; everything that parsed still parses, and authored metadata needs no change.
17+
No key, shape, default or accepted value changes. Everything that parsed still parses, and authored metadata needs no change.

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

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,9 @@ function notifyValuePhrase(value: unknown): string {
266266
// It is the WHOLE `recipients` value, never a list entry, and the node names
267267
// `email` as its only channel (the `superRefine` of `NotifyConfigSchema`): an
268268
// address that no user holds has no inbox, so the email channel is the one
269-
// that can deliver to it.
269+
// that can deliver to it. The runtime delivers it since #25721 (`d1e329e96d`):
270+
// service-automation's notify node reads the address off the STORED trigger
271+
// row and limits sends per address (see the `recipients` docblock below).
270272

271273
/** A field's machine name — the grammar of `FieldSchema.name`, which `emailField` names. */
272274
const FIELD_MACHINE_NAME = /^[a-z_][a-z0-9_]*$/;
@@ -371,14 +373,26 @@ function notifyRecipientsRefusal(input: unknown): string {
371373
* the whole value only, names an `email`-typed field of the triggering
372374
* record whose address is the recipient.
373375
*
374-
* An address a CEL value envelope EVALUATES to is not an author constant: one
375-
* a user holds resolves to that user, and one that NO user holds is to fail
376-
* the node with a located message pointing to `{ emailField }` (the same
377-
* ruling). That refusal is PLANNED, not made: the runtime half (#25647, which
378-
* may ride #25571's files) has not landed, so until it does such an address is
379-
* still handed to the messaging service as written. The describes below say
380-
* "planned" for that reason — ⛔ they claim no refusal the runtime does not
381-
* make yet; when the runtime half lands, it rewrites them as made.
376+
* An address a CEL value envelope EVALUATES to is not an author constant (the
377+
* same ruling, made by #25721, `d1e329e96d`: `screenComputedAddresses` in
378+
* service-automation's notify node). In a node whose `channels` include
379+
* `email` — the one channel that sends to the address itself — a computed
380+
* recipient that reads as an address, bare or as `user:ADDRESS`, must be a
381+
* user's: one a user holds resolves to that user's id, and one that NO user
382+
* holds fails the node with a located message pointing to `{ emailField }`,
383+
* as does one that cannot be looked up (no data engine, a failing lookup). A
384+
* node that does not name `email` (`inbox` alone, the messaging default)
385+
* mails nobody, and its computed recipients reach the messaging resolver
386+
* unscreened, as before. That channel scope is the runtime's current reading
387+
* of the ruling and is with the maintainer for confirmation, so the describes
388+
* below state it as the current behaviour, not as final.
389+
*
390+
* The same change delivers an email-field recipient: the address is read from
391+
* the STORED trigger row (never the run's `record` snapshot), must be one
392+
* plain ASCII mailbox, and one address receives at most 5 such sends per hour
393+
* across every flow — best-effort: a faulting `cache` counter admits the send
394+
* and says so once at `warn`. Each way there is no address fails the node and
395+
* sends nothing.
382396
*
383397
* An envelope that evaluates to `null` or a blank string adds no recipient,
384398
* as a token that resolved to nothing did, and the executor's guard still
@@ -410,8 +424,8 @@ const NotifyRecipientsSlotSchema = z.union([
410424
+ 'run (an entry that evaluates to a list adds each of its recipients); one envelope evaluating to a '
411425
+ 'recipient or a list; or `{ emailField }`, the address in an `email`-typed field of the triggering record '
412426
+ '— a `{…}` template token is refused. An email address written out as a string is an author constant, '
413-
+ 'sent as written; one an envelope evaluates to resolves to the user who holds it, and failing the node on '
414-
+ 'one no user holds, pointing to `{ emailField }`, is planned and not made yet',
427+
+ 'sent as written; in a node whose `channels` include `email`, one an envelope evaluates to must be a '
428+
+ 'user\'s: it resolves to that user, and one no user holds fails the node, pointing to `{ emailField }`',
415429
xExpression: 'value',
416430
});
417431

@@ -654,12 +668,14 @@ export const NotifyConfigSchema = lazySchema(() => strictObject({
654668
+ 'none; or one envelope evaluating to a recipient or a list. A `{…}` template token is refused. Or, as the '
655669
+ 'whole value, `{ emailField: \'applicant_email\' }`: the address in that `email`-typed field of the record '
656670
+ 'that triggered the flow, for a person who is not a user — the node then names `email` as its only channel. '
657-
+ 'Delivery to an email-field recipient is not live yet: until the messaging service resolves the form, a '
658-
+ 'run that reaches the node fails there. An email address written out as a string is no audience selector '
659-
+ 'but an author constant, sent as written: to the user who holds it, or else, on the `email` channel, to '
660-
+ 'the address itself. An address an envelope evaluates to is not one: it resolves to the user who holds it, '
661-
+ 'and one that no user holds is planned to fail the node, pointing to `{ emailField }` — that refusal is not '
662-
+ 'made yet, so until it is, such an address is still handed to the messaging service as written.',
671+
+ 'The address is read from the stored record when the node runs and must be one plain ASCII mailbox, or the '
672+
+ 'node fails and nothing is sent; one address receives at most 5 such emails per hour, best-effort. An email '
673+
+ 'address written out as a string is no audience selector but an author constant, sent as written: to the '
674+
+ 'user who holds it, or else, on the `email` channel, to the address itself. An address an envelope '
675+
+ 'evaluates to is not one: in a node whose `channels` include `email`, it must be a user\'s, written bare or '
676+
+ 'as `user:ADDRESS` — one a user holds resolves to that user, and one that no user holds fails the node, '
677+
+ 'pointing to `{ emailField }`. A node that does not name `email` mails nobody, and its computed recipients '
678+
+ 'go to the messaging service as before.',
663679
),
664680
/**
665681
* Inline notification title — the NON-localizable content path, and a

0 commit comments

Comments
 (0)