Commit cf53bab
committed
test(automation): pin the control-flow trio's designer forms (#4045)
`loop` / `parallel` / `try_catch` had NO descriptor assertions — `config-schemas.test.ts`
covered the CRUD quartet, `assignment` and `screen`, so the designer's input for the
entire control-flow trio was unguarded and a change to those literals could not be
noticed.
These assertions pin intent, not just current bytes. All three publish a form
description that is deliberately SHALLOWER and LOOSER than its Zod counterpart in
`control-flow.zod.ts`:
- Region keys — `loop.body`, `parallel.branches[].nodes/edges`, `try_catch.try/catch`
— publish `{ type: 'array' }` with NO `items`, so a sub-graph stays opaque: it is
edited on the canvas, not in a property form. The Zod side is `FlowRegionSchema`
(`z.array(FlowNodeSchema)`), which would emit the whole FlowNode/FlowEdge
definition nested there.
- `collection` is `z.string().min(1)` and `iteratorVariable` is `.default('item')` in
Zod, yet the form publishes neither `minLength` nor `default`.
That difference corrects a premise this plan was resting on. #4045 — and my own
analysis on it — treated these three as redundant copies awaiting de-duplication by
a single Zod source, "pure deletion, most省力". They are not: they are a second
artifact with a different job (drive a form vs. validate a value), and the gaps are
deliberate. Naively generating them would nest a form for every node inside a loop
body. With the shapes pinned, any move toward a generated configSchema either keeps
these green or has to say out loud why the designer contract changed.
Verified to bite rather than merely pass: simulating what a naive `z.toJSONSchema`
swap would emit — deep `items` under `body.nodes` plus the Zod-only
`minLength`/`default` — turns both new `loop` tests red, naming
`loop.body.nodes must stay opaque (no items)`.
Test plan: service-automation 452 passed (4 new), ESLint clean. Tests only; empty
changeset since nothing releases.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QoA8AV99Ss1RRkLLAYmDzq1 parent 54c2627 commit cf53bab
2 files changed
Lines changed: 128 additions & 0 deletions
File tree
- .changeset
- packages/services/service-automation/src/builtin
| 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 | + | |
Lines changed: 98 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
42 | 51 | | |
43 | 52 | | |
44 | 53 | | |
| |||
99 | 108 | | |
100 | 109 | | |
101 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
102 | 200 | | |
103 | 201 | | |
104 | 202 | | |
| |||
0 commit comments