Repository navigation
Commit 5cc2dee
authored
Written-by: Dev
Fixes #3286
Owner: Dev
Reviewer: Reviewer
## What changed
A run created its node Bots one at a time, so a six-node line could not
fit the 60s batch deadline (`SPAWN_DEADLINE_MS`) and a five-node line
was a coin flip. `spawnAll` now creates up to `SPAWN_CONCURRENCY = 4` at
once (the width is a parameter tests can inject). A refused spawn starts
no further Bot, the ones already in flight are awaited and still land in
`error.spawned` (creation order), and the returned map keeps the graph's
node order whatever order the host answers in. The deadline sentence's
"needs about Ns" estimate now counts waves, and progress names the
last-started node the host has not answered, so #3282's node name and
reason still work with several spawns in flight.
## Before / after
- Before: serial 6 × ~11s ≈ 66s > 60s (wf-1cdf6ec5 failed three times);
5 × ~11s ≈ 55s, ~5s of slack (wf-7ed167b6 failed once at 10:45Z).
- After: ceil(6/4) = 2 waves × ~11s ≈ 22s; ceil(5/4) = 2 waves ≈ 22s.
The new test drives a fake clock with 10s per spawn: six nodes finish in
20s, with at most 4 in flight.
## Verification at the tip
Tip SHA: 534c2c8
Ran:
- `cd plugins/workflow && DSH_HARNESS=/opt/flybot node --import
./test/resolve.mjs --test "test/*.test.js"` — 544 tests, 544 pass, 0
fail.
- `node core/scripts/build-client.mjs --check` — ok (no client change).
- `node scripts/ds-bot-patches.mjs check` — ok, 10 patches.
- `node .github/scripts/changelog.mjs check` — ok.
- `node scripts/lint-plugins.mjs` and oxlint over `core` — 0 errors
(warnings are pre-existing).
Not run (and why):
- Full `npm run verify` could not complete on this box: `core` here has
no `dev/harness` oxlint install and `arch-docs` needs `git` +
`origin/main`, and this host has no `git`. The affected workflow suite,
the client check, the patch check, the changelog check and lint were run
as above; `core/` is untouched.
## Red first
Source unchanged, new test only
(`plugins/workflow/test/parallel-spawn.test.js`): 1 of 3 pass, 2 fail —
`never more than four spawns in flight: 1` (the serial loop) and `two
spawns are in flight: actual ["node-1"]`. The same two tests pass after
the change.
## Checkpoint
<!-- flybot:checkpoint -->
```json
{
"pr": 3287,
"claim": "Dev",
"issue": 3286,
"summary": "spawnAll creates run Bots four at a time instead of one after another, so a six-node lane needs two waves (~22s) and fits the 60s batch deadline. A refused spawn starts no new Bot, awaits the ones in flight, and error.spawned lists every Bot made in creation order. The returned map follows the graph's node order, and the timeout sentence's estimate counts waves.",
"files": ["plugins/workflow/src/ephemeral.js", "plugins/workflow/src/service.js", "plugins/workflow/test/parallel-spawn.test.js", "docs/subsystems/workflow.md", "changelog.d/3286.fixed.md"],
"checks": { "ran": "cd plugins/workflow && DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test 'test/*.test.js'", "result": "green", "at": "534c2c860eb0c8470cb2082ee437b5d75042cc6f" },
"next": "none — ready for review"
}
```
<!-- /flybot:checkpoint -->
1 parent 747e009 commit 5cc2dee
5 files changed
Lines changed: 190 additions & 24 deletions
File tree
- changelog.d
- docs/subsystems
- plugins/workflow
- src
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
48 | 55 | | |
49 | | - | |
50 | | - | |
51 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
52 | 72 | | |
53 | 73 | | |
54 | | - | |
55 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
56 | 82 | | |
57 | | - | |
| 83 | + | |
58 | 84 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
64 | 98 | | |
65 | 99 | | |
66 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
506 | | - | |
507 | | - | |
| 506 | + | |
| 507 | + | |
508 | 508 | | |
509 | 509 | | |
510 | | - | |
511 | | - | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
512 | 513 | | |
513 | 514 | | |
514 | 515 | | |
| |||
1411 | 1412 | | |
1412 | 1413 | | |
1413 | 1414 | | |
1414 | | - | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
1415 | 1418 | | |
1416 | 1419 | | |
1417 | 1420 | | |
1418 | 1421 | | |
1419 | | - | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
1420 | 1425 | | |
1421 | 1426 | | |
1422 | 1427 | | |
1423 | 1428 | | |
1424 | 1429 | | |
1425 | | - | |
1426 | | - | |
| 1430 | + | |
1427 | 1431 | | |
1428 | 1432 | | |
1429 | | - | |
1430 | 1433 | | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
1431 | 1437 | | |
1432 | 1438 | | |
1433 | 1439 | | |
| |||
| 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 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
0 commit comments