Commit fd3013a
* feat(spec,automation)!: converge `script` to a function call and parse script/subflow config at execute time (#4343)
A `script` node had four ways to name what it ran and only one of them ran
anything. `actionType: 'email' | 'slack'` were logger-backed stubs that wrote a
line, reported success and delivered nothing under any configuration, with
`template` / `recipients` / `variables` addressing a message no channel sent.
Inline `config.script` was recognized and never executed (no server-side JS
sandbox). Every other `actionType` value was shorthand for a registered-function
name, and `'invoke_function'` was a marker that named nothing on its own.
All five keys are tombstoned (`retiredKey`) and `config.function` becomes
required, which is also what made the contract parseable: while the legal key set
depended on `actionType`, a flat parse would either reject valid shapes or wave
everything through. `script` and `subflow` now run their config through the
execute-time contract parse #4277 gave the flat builtins — a violation refuses
the node as a guard, un-routable by a `fault` edge (#3863). `decision` stays
export-only: its one key is optional, so a parse would check nothing.
The ADR-0087 D2 conversion `flow-node-script-branch-keys-removed` rewrites stored
sources — a shorthand `actionType` moves into `function` (that is what it named)
unless `function` already won; the other keys drop, nothing having read them.
Retired from the load path with the rest of the keys retired for misdescribing
themselves, so `os migrate meta --from 16` is what rewrites an authored source.
`registerFlow` still replays it (#3903 — a stored row has no author to teach), so
an old email-stub node arrives stripped and then refuses for naming no callable,
where it used to report success.
Also: the `SCRIPT_BUILTIN_ACTION_TYPES` / `SCRIPT_INVOKE_FUNCTION_ACTION_TYPE`
constants and `ScriptBuiltinActionType` are removed; `os validate` names a retired
key and its replacement; the examples move to `notify` (real delivery) and `http`
(Slack webhook), and the showcase gains a registered function so its `script` node
demonstrates the one form that works.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ct9NXp2JumjKuARtQnrbPf
* fix(spec): accept a lowered handler ref in `functions`, so `defineStack({ functions })` survives a build (#4343)
`objectstack build` lowers every inline callable to a serialisable string ref
BEFORE the stack is parsed — it must, since `z.function()` wraps callables and
would break the ref mapping — so a built manifest holds `{ myFn: 'myFn' }`.
`FlowFunctionEntrySchema` accepted only a function or a `{ handler, effect }`
declaration, so the parse rejected what the build had just produced: a
documented, first-class authoring mechanism could not survive a build.
Nothing had noticed because no bundled example used `functions`. #4343 turns
that from latent into blocking: `config.function` becomes the only thing a
`script` node runs, so registering one is now mandatory for any app with a
script node — which is what the showcase demo in this branch hit.
`Hook.handler` already declared exactly this pair (a string post-build, an
inline function pre-build), so this puts `functions` on the platform's existing
shape rather than a new one. A string carries no callable and
`normalizeFlowFunctionEntry` still drops it by design — the real functions ride
in the sibling ESM module the build emits and are merged by name — so
hand-authoring one registers nothing and fails loudly at execute rather than
silently.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ct9NXp2JumjKuARtQnrbPf
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 061406d commit fd3013a
28 files changed
Lines changed: 1209 additions & 410 deletions
File tree
- .changeset
- content/docs
- automation
- references/automation
- docs
- audits
- examples
- app-showcase
- src/automation/flows
- app-todo/src/flows
- packages
- lint/src
- services/service-automation/src
- builtin
- spec
- src
- automation
- conversions
- migrations
- skills/objectstack-automation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
236 | 251 | | |
237 | 252 | | |
238 | 253 | | |
| |||
Lines changed: 56 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| |||
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
62 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
63 | 89 | | |
64 | | - | |
| 90 | + | |
65 | 91 | | |
66 | | - | |
| 92 | + | |
67 | 93 | | |
68 | | - | |
| 94 | + | |
69 | 95 | | |
70 | | - | |
| 96 | + | |
71 | 97 | | |
72 | | - | |
| 98 | + | |
73 | 99 | | |
74 | | - | |
| 100 | + | |
75 | 101 | | |
76 | | - | |
| 102 | + | |
77 | 103 | | |
78 | | - | |
| 104 | + | |
79 | 105 | | |
80 | | - | |
| 106 | + | |
81 | 107 | | |
82 | | - | |
| 108 | + | |
83 | 109 | | |
84 | | - | |
| 110 | + | |
85 | 111 | | |
86 | | - | |
| 112 | + | |
87 | 113 | | |
88 | | - | |
| 114 | + | |
89 | 115 | | |
90 | | - | |
| 116 | + | |
91 | 117 | | |
92 | | - | |
| 118 | + | |
93 | 119 | | |
94 | 120 | | |
95 | 121 | | |
| |||
144 | 170 | | |
145 | 171 | | |
146 | 172 | | |
147 | | - | |
148 | | - | |
| 173 | + | |
149 | 174 | | |
150 | 175 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
155 | 181 | | |
156 | 182 | | |
157 | 183 | | |
| |||
0 commit comments