Commit 190221e
committed
fix(cloud): reject malformed executionOrder instead of silently running in parallel
A workspace config.yaml was yaml.load'ed and straight-cast to
IWorkspaceConfig, so a wrong-shaped executionOrder was never checked. The
intuitive bare-list form made executionOrder an Array, .flowsOrder came back
undefined, resolveSequentialFlows returned [], and every flow ran in
parallel - same cost, wrong semantics, green run. The only symptom was
depends_on being null on every result row.
Add a zod schema as the single source of truth for the config shape
(src/services/workspace-config.schema.ts) and route all three former cast
sites through one validated loader, loadWorkspaceConfig:
- A malformed executionOrder is now fatal (exit 1), with a message showing
what was found next to the expected shape. A bare list is not valid
Maestro either, so there is nothing to accept - and a warning in CI logs
is exactly what got missed.
- Unrecognised top-level keys warn (and are preserved, since the config is
forwarded to the API as fields.workspaceConfig), catching flowOrder, a
top-level continueOnFailure, tags in place of includeTags, and flowTimeout.
- executionOrder on a single-file input warns instead of being dropped:
planSingleFile never sequences, so it was silently ignored even when
well-formed.
- continueOnFailure's real default (true) now lives in the schema instead of
being re-specified at three read sites.
- WORKSPACE_CONFIG_KEYS is derived from the schema so isWorkspaceConfigFile's
detection set can no longer drift from it.
- includeTags/excludeTags scalar coercion moves from readYamlFileAsJson into
the schema, so the loader is a plain YAML read and the validator is pure.
Warnings go through an injected callback: cloud.ts passes logger.warn (stderr,
so it survives --json), the MCP tool passes logStderr since its stdout is the
JSON-RPC channel.
Also fixes two test fixtures that used a tags: key the CLI never read.
Verified on dev: the bare-list form now exits 1 before anything is submitted,
and a well-formed executionOrder chains depends_on null -> 36962 -> 36963
across results 36962-36964.
Fixes #1101 parent 57711c6 commit 190221e
8 files changed
Lines changed: 412 additions & 89 deletions
File tree
- src
- commands
- mcp/tools
- services
- test
- fixtures
- integration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
572 | 575 | | |
573 | 576 | | |
574 | 577 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
12 | 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 | | - | |
| 13 | + | |
47 | 14 | | |
48 | 15 | | |
49 | 16 | | |
| |||
53 | 20 | | |
54 | 21 | | |
55 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
56 | 29 | | |
57 | 30 | | |
58 | 31 | | |
| |||
146 | 119 | | |
147 | 120 | | |
148 | 121 | | |
| 122 | + | |
149 | 123 | | |
150 | 124 | | |
151 | 125 | | |
152 | 126 | | |
153 | 127 | | |
| 128 | + | |
154 | 129 | | |
155 | 130 | | |
156 | 131 | | |
| |||
162 | 137 | | |
163 | 138 | | |
164 | 139 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 140 | + | |
170 | 141 | | |
171 | 142 | | |
172 | 143 | | |
| |||
199 | 170 | | |
200 | 171 | | |
201 | 172 | | |
| 173 | + | |
202 | 174 | | |
203 | 175 | | |
204 | 176 | | |
205 | 177 | | |
206 | 178 | | |
| 179 | + | |
207 | 180 | | |
208 | 181 | | |
209 | 182 | | |
| |||
232 | 205 | | |
233 | 206 | | |
234 | 207 | | |
235 | | - | |
236 | | - | |
237 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
238 | 219 | | |
239 | 220 | | |
240 | 221 | | |
| |||
386 | 367 | | |
387 | 368 | | |
388 | 369 | | |
| 370 | + | |
389 | 371 | | |
390 | 372 | | |
391 | 373 | | |
| |||
400 | 382 | | |
401 | 383 | | |
402 | 384 | | |
403 | | - | |
| 385 | + | |
404 | 386 | | |
405 | 387 | | |
406 | 388 | | |
| |||
420 | 402 | | |
421 | 403 | | |
422 | 404 | | |
423 | | - | |
424 | | - | |
425 | | - | |
| 405 | + | |
426 | 406 | | |
427 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
428 | 412 | | |
429 | 413 | | |
430 | 414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
6 | 12 | | |
7 | 13 | | |
8 | 14 | | |
| |||
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | 69 | | |
80 | 70 | | |
81 | 71 | | |
| |||
112 | 102 | | |
113 | 103 | | |
114 | 104 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 105 | + | |
129 | 106 | | |
130 | 107 | | |
131 | 108 | | |
132 | 109 | | |
133 | 110 | | |
134 | 111 | | |
135 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
136 | 133 | | |
137 | 134 | | |
138 | 135 | | |
| |||
0 commit comments