bullswarm 0.23.2 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/AGENTS.md +6 -4
  2. package/CHANGELOG.md +154 -0
  3. package/README.md +122 -39
  4. package/data/openrouter-benchmarks.json +14751 -14202
  5. package/docs/claude-dynamic-workflow-mechanics.md +18 -4
  6. package/docs/design/2026-09-06-caller-first-cli.md +173 -0
  7. package/docs/experiments/2026-09-06-caller-planner-evaluation.md +257 -0
  8. package/docs/workflow-simplification.md +214 -0
  9. package/package.json +1 -1
  10. package/skill/SKILL.md +128 -121
  11. package/skill/references/operations.md +83 -22
  12. package/src/delegate.js +44 -5
  13. package/src/help.js +208 -19
  14. package/src/lib/watch.js +20 -7
  15. package/src/workflow/action-validator.js +13 -2
  16. package/src/workflow/cli.js +805 -77
  17. package/src/workflow/dashboard.js +103 -34
  18. package/src/workflow/execution-policy.js +23 -0
  19. package/src/workflow/goal.js +18 -2
  20. package/src/workflow/ledger.js +34 -3
  21. package/src/workflow/ownership.js +46 -6
  22. package/src/workflow/runs-cli.js +12 -4
  23. package/src/workflow/short-id.js +46 -3
  24. package/src/workflow/steering.js +13 -2
  25. package/src/workflow/v2-cancellation.js +12 -0
  26. package/src/workflow/v2-dispatch.js +8 -2
  27. package/src/workflow/v2-outcome.js +32 -14
  28. package/src/workflow/v2-planner.js +229 -14
  29. package/src/workflow/v2-presentation.js +51 -0
  30. package/src/workflow/v2-process.js +69 -0
  31. package/src/workflow/v2-runtime.js +569 -87
  32. package/src/workflow/v2-scheduler.js +16 -6
  33. package/src/workflow/v2-state.js +52 -5
  34. package/src/workflow/v2-workspace.js +13 -3
  35. package/src/workflow/watch-cli.js +44 -9
  36. package/src/workflow/workspace-report.js +33 -0
package/AGENTS.md CHANGED
@@ -29,10 +29,12 @@ content. Published as `bullswarm` on npm.
29
29
  stored under `~/.bullswarm/drafts/<name>/` and are runnable by name
30
30
  without an upfront JSON. JSON is still the durable artifact — drafts
31
31
  are JSON documents, just built one mutation at a time.
32
- 8. Goal-driven execution is zero-graph by default: `bullswarm workflow goal`
33
- internalizes the planner contract, chooses the orchestrator and workers,
34
- persists the generated workflow, and can detach so observation never
35
- depends on the initiating agent or CLI process.
32
+ 8. New goal workflows are caller-planned programs in a shared workspace.
33
+ `bullswarm workflow goal --program` executes the graph; `--orchestrator`
34
+ explicitly delegates planning. File territories are advisory scheduling
35
+ hints, and the graph finishes without automatic gap rounds. `verified`
36
+ separately records requirement evidence. `--isolation` opts into strict
37
+ per-worker worktrees. Saved V2 runs preserve their original semantics.
36
38
 
37
39
  ## Development
38
40
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,159 @@
1
1
  # bullswarm changelog
2
2
 
3
+ ## 0.25.0 — shared programs that finish with the graph
4
+
5
+ - New goal workflows share the target worktree by default. File territories
6
+ guide scheduling; newly created files and edits survive worker failure or
7
+ cancellation. Use `--isolation` for strict per-worker worktrees and exact-file
8
+ ownership. Saved older runs keep their original execution policy.
9
+ - Independent actions run concurrently, and dependents start as soon as their
10
+ own inputs finish. An unrestricted integrator (`build`, empty `ownedFiles`)
11
+ runs alone after its writers and can reconcile shared files.
12
+ - Programs finish when their graph finishes, without automatic gap-planning
13
+ rounds. `completed` describes execution; `verified` separately records
14
+ passing requirement evidence. Negative evidence stays visible, and further
15
+ repairs use explicitly authored programs.
16
+ - Unexpected worker errors become action failures; independent branches keep
17
+ running. Quiet workers retain a kernel heartbeat, dead kernels are identified
18
+ in the TUI, and resume preserves durable successes and published results.
19
+ - Cancellation intent survives concurrent kernel writes. Resume uses a kernel
20
+ lease and tracks delegate process groups; SIGTERM/SIGINT produce a resumable
21
+ interruption, and surviving delegates are drained before replacement work.
22
+ Durable completion receipts recover both successful worker output and partial
23
+ isolated integration without replaying the worker.
24
+ - Failed/interrupted isolated workspaces are retained, conflicting user edits
25
+ block integration, and submodule file trees no longer break manifest capture.
26
+ - Program dashboards show dependency levels instead of keyword-inferred phases,
27
+ including for saved runs. Independent levels can overlap as actions become ready.
28
+ - Plain dependencies no longer need artificial artifact declarations. Evidence
29
+ prompts can inspect product JSON/output formats without being mistaken for
30
+ instructions to replace the kernel's verdict format.
31
+ - The agent skill now presents one short choose → plan → launch → inspect flow,
32
+ with advanced operations in a separate reference. It distinguishes a planning
33
+ contract from a launch and passing evidence from guaranteed correctness.
34
+ - Isolated ownership checks exclude dependency trees at every depth and handle
35
+ literal filenames containing glob metacharacters.
36
+
37
+ ## 0.24.0 — the calling agent is the Workflow Planner
38
+
39
+ **BREAKING.** `bullswarm workflow goal` now needs a program. Add
40
+ `--orchestrator auto` to any existing invocation to keep the previous
41
+ behaviour, or pass the program you authored with `--program <file.json>`.
42
+
43
+ - **Caller-first by default.** `workflow goal "<goal>"` with no
44
+ `--program`, `--scout`, or `--orchestrator` exits 2, launches nothing, and
45
+ prints the commands that come next (`{"error": "program-required", "next":
46
+ {contract, validate, launch, scout, orchestrator}}` under `--json`). The
47
+ kernel never plans on the caller's behalf unless the caller asks for it by
48
+ name. Exit codes are a contract: 0 done or paused durably for the caller
49
+ (nothing running), 1 the run ended without completing, 2 usage or validation
50
+ error with nothing launched.
51
+
52
+ - `bullswarm workflow goal --program <file.json>` makes the invoking agent the
53
+ Workflow Planner. The kernel validates the caller-authored V2 program against
54
+ the exact requirement ledger before anything launches, executes it with zero
55
+ planner and (by default) zero scout dispatches, and keeps every kernel-owned
56
+ guarantee: quota routing, isolated worktrees and changed-path ownership,
57
+ independent evidence, the requirement ledger, completion, and the stable
58
+ result envelope. This is Bullswarm's equivalent of Claude Code's `Workflow`
59
+ tool: the frontier model writes the program once and is consulted again only
60
+ at a real planning boundary. `--scout` alone has the kernel survey the
61
+ repository first and pause at the initial boundary for the caller's program.
62
+
63
+ - **Flag surface.** `--planner dispatched|caller` is removed; the presence of
64
+ `--orchestrator auto|<pool>` is the switch. `--strict-orchestrator <pool>`
65
+ becomes `--orchestrator <pool> --orchestrator-strict` and remains as a
66
+ deprecated alias for one release. `--suggested-plan`, `--no-scout`,
67
+ `--orchestrator-model`, and `--orchestrator-strict` are rejected without
68
+ `--orchestrator`: when the caller is the planner, the plan is the program.
69
+
70
+ - **New commands.** `workflow plan validate "<goal>" --program <file>` dry-runs
71
+ a program against the contract (same validator, same preview state, no run
72
+ created) and exits 0 with the accepted actions or 2 with the issues.
73
+ `workflow cancel <runId>` is a first-class verb that finalizes a run paused
74
+ for its caller planner inline, and `workflow resume <runId>` is the verb form
75
+ of `goal --resume`; `goal --resume` and `tui --cancel` remain as aliases.
76
+
77
+ - **`delegate`.** For workflow-shaped work it now returns the planning contract
78
+ (`action: "plan-required"`) plus the exact launch line, instead of launching
79
+ an orchestrated run on the caller's behalf. `--orchestrator auto|<pool>`
80
+ passes through for callers that do not want to plan.
81
+
82
+ - **Requirement granularity is surfaced, never forced.** When a goal collapses
83
+ to a single requirement, `plan contract` adds an `advice.requirements` line
84
+ and `delegate` adds the same text to its `handoff` (printed as
85
+ `Requirements ·`): one requirement means one pass/fail verdict for the whole
86
+ goal, and any gap reopens all of it, so numbering distinct deliverables
87
+ (`1. ... 2. ...`) buys a tracked requirement, a separate verdict, and gap
88
+ rounds scoped to the part that failed. A goal that already splits into
89
+ several requirements never carries the advice, and the text says explicitly
90
+ not to invent clauses to split a genuinely holistic outcome.
91
+
92
+ - New `bullswarm workflow plan` surface: `plan contract "<goal>"` prints the
93
+ requirement IDs the kernel will derive, the planning rules, the generic action
94
+ fields, the validation it enforces, and a worked example; `plan show <run>`
95
+ prints the durable planner request a paused run left behind (boundary,
96
+ context, consolidated gaps, known actions); `plan submit <run> --program
97
+ <file>` (or `--exhausted --reason <text>`) validates the response against the
98
+ exact durable state, records it as the next program revision with the same
99
+ counters a dispatched planner turn would produce (planner turn, expansion
100
+ round, program revision) plus a `planner.finished` event tagged
101
+ `source: "caller"` (no `planner.started` and no planner attempt is recorded,
102
+ because nothing was dispatched), and relaunches the kernel.
103
+
104
+ - Caller-planner pauses are authoritative and lossless. A resume without a
105
+ submission re-pauses on the same boundary and turn, even when steering was
106
+ queued meanwhile: the request is refreshed to list the pending steering
107
+ (`pendingSteering`), `plan show` does the same refresh, and a submission
108
+ marks exactly the listed steering delivered; steering queued after that stays
109
+ pending and opens a steering boundary after the resume. A cancellation
110
+ requested while paused refuses every submission and `plan show`, `watch`, and
111
+ the TUI point at the one `workflow goal --resume` that finalizes the
112
+ cancelled result; finalizing always clears the pause record, and the state
113
+ validator rejects a terminal run that still claims to be waiting. A caller
114
+ program supplied at launch is kept in the run directory until applied, so an
115
+ interruption during an opt-in scout does not lose it. Bare value flags
116
+ (`--program` with no file) are usage errors instead of a silent
117
+ dispatched-mode launch, and `plan submit` checks the goal directory before
118
+ touching state.
119
+
120
+ - Caller-planner runs pause durably instead of dispatching: at a planning
121
+ boundary the kernel writes `planner-request-turn-N.json`, records
122
+ `planner.awaiting` in state, emits `planner.awaiting_caller`, sets the run to
123
+ `waiting`, and exits. `workflow watch` ends at that pause (exit 0) and prints
124
+ the `plan show` command; `runs result` and the TUI Next line explain the
125
+ pause; resuming without a submission re-pauses on the same request. An
126
+ invalid initial program supplied through `--program` at launch is rejected
127
+ synchronously; one that fails only against live state pauses with a
128
+ correction request instead of dispatching anything.
129
+
130
+ - The dispatched planner prompt and the caller-facing contract now render from
131
+ one shared rulebook (`v2PlannerContractRules`), so the two planning modes
132
+ cannot drift. A durable `exhausted` planner decision now survives resume: the
133
+ kernel finalizes the partial result instead of reopening the boundary.
134
+
135
+ - `workflow capabilities` reports `plannerModes` and the `callerPlanner`
136
+ feature; the `bullswarm` skill and operations reference document the
137
+ caller-planner loop for frontier agents.
138
+
139
+ - Fixed (ledger): evidence records now carry the ledger-wide `workspaceRevision`
140
+ they inspected, and semantic evidence recorded on a newer workspace
141
+ supersedes older evidence for the same requirement (`stale: true`,
142
+ `staleReason: "workspace-superseded"`). Before, a cross-cutting requirement
143
+ such as "the full suite passes 19/19" kept its first failed verdict alive
144
+ forever, because no work action listed it in `affects`; a later passing
145
+ verdict then conflicted with it and the requirement stayed `blocked` on every
146
+ gap round. Same-workspace disagreement between two verifiers still blocks,
147
+ and a mechanical (pending) record never supersedes a judgment. Found live
148
+ while driving a caller-planner run.
149
+
150
+ - Fixed: a one-line goal with inline numbered clauses (`"1. Fix the parser.
151
+ 2. Update the docs."`) produced a single requirement; only the
152
+ newline-separated form split. Both forms now yield one requirement per
153
+ clause, so `plan contract` advertises the IDs the run will enforce. Inline
154
+ markers are honored only when the list starts at 1, so prose such as
155
+ "version 2. Then" is not split.
156
+
3
157
  ## 0.22.1 — unified workflow dashboard navigation
4
158
 
5
159
  - The workflow dashboard now keeps V2 runs in the unified list and timeline
package/README.md CHANGED
@@ -79,7 +79,9 @@ bullswarm delegate --cwd ~/some-repo --prompt "Audit all commands, fix help, and
79
79
  bullswarm delegate --dry-run --json --cwd ~/some-repo --prompt "Your task" # bounded classification + decision/plan; no work dispatch
80
80
  bullswarm run --lane analyze --add-dir ~/some-repo --task-file /tmp/t.md --json
81
81
  bullswarm run --lane analyze --add-dir ~/some-repo --prompt "Inspect the parser" --json
82
- bullswarm workflow goal "Fix the failing tests and verify the change" --cwd ~/some-repo
82
+ bullswarm workflow plan contract "Fix the failing tests and verify the change" --cwd ~/some-repo --json # you are the planner
83
+ bullswarm workflow goal "Fix the failing tests and verify the change" --cwd ~/some-repo --program plan.json
84
+ bullswarm workflow goal "Fix the failing tests and verify the change" --cwd ~/some-repo --orchestrator auto # dispatch a planner agent
83
85
  bullswarm health # re-judge saved outputs; catch gate failures
84
86
  ```
85
87
 
@@ -89,7 +91,7 @@ bullswarm health # re-judge saved outputs; catch gate failures
89
91
  |---|---|
90
92
  | `setup` | Discover installed agent CLIs, show quota state, toggle pools, suggest a routing table, write config. Approval-gated, idempotent. |
91
93
  | `integrate` | Register or remove the canonical Bullswarm skill and global awareness rules for Codex, Claude, and Grok. |
92
- | `delegate` | Explain and execute the smallest reliable shape: one content-verified agent or an autonomous verified workflow. |
94
+ | `delegate` | Explain and execute the smallest reliable shape: one content-verified agent, or the planning contract for an autonomous workflow you author (`--orchestrator` dispatches a planner agent instead). |
93
95
  | `run` | route → dispatch → watch → verify → one JSON verdict |
94
96
  | `health` | Re-judge saved outputs against their verdicts; surface verify-gate failures and quarantine clusters |
95
97
  | `pools` | Show each pool's meter state, pace position, quarantine status |
@@ -226,35 +228,56 @@ phase/step/attempt tree.
226
228
 
227
229
  ## One-command autonomous goals
228
230
 
229
- For normal multi-step work, give Bullswarm the goal—not a JSON graph:
231
+ For normal multi-step work, give Bullswarm the goal and the program you authored
232
+ for it—not a JSON graph of phases:
230
233
 
231
234
  ```bash
232
- # Default: starts independently, prints observation/result commands, and returns.
235
+ # 1. What the kernel will enforce: requirement IDs, rules, action schema, example.
236
+ bullswarm workflow plan contract \
237
+ "1. Fix the failing tests with the smallest correct change. 2. Verify them." \
238
+ --cwd ~/some-repo --json
239
+
240
+ # 2. Launch with your program. Starts independently, prints observation
241
+ # commands, and returns. Add --watch to follow low-noise progress.
233
242
  bullswarm workflow goal \
234
- "Fix the failing tests with the smallest correct change and verify them" \
235
- --cwd ~/some-repo
243
+ "1. Fix the failing tests with the smallest correct change. 2. Verify them." \
244
+ --cwd ~/some-repo --program plan.json --watch
236
245
 
237
- # Follow low-noise semantic progress immediately after launch.
246
+ # Don't want to plan? Ask for a Workflow Planner agent explicitly.
238
247
  bullswarm workflow goal \
239
248
  "Audit and repair the parser, then run its acceptance tests" \
240
- --cwd ~/some-repo --watch
249
+ --cwd ~/some-repo --orchestrator auto --watch
241
250
  ```
242
251
 
252
+ `workflow goal` needs a program: with neither `--program`, `--scout`, nor
253
+ `--orchestrator` it exits 2, launches nothing, and prints the commands above.
254
+ That is deliberate — the kernel never plans on the caller's behalf unless the
255
+ caller asks for it by name.
256
+
243
257
  `--max-agents`, `--max-actions`, and `--max-expansion-rounds` are soft V2
244
258
  planning targets. They encourage the Workflow Planner to consolidate optional
245
259
  work, but the kernel never stops or rejects essential work merely because a
246
260
  target was reached. `--concurrency` still bounds simultaneous dispatches so
247
261
  the scheduler can batch a wider useful program safely.
248
262
 
249
- Bullswarm first runs optional read-only reconnaissance, then invokes one
250
- logical, resumable Workflow Planner conversation. The planner proposes a
251
- complete bounded program of generic actions. Work actions produce artifacts;
252
- evidence actions independently judge named requirements. The kernel rejects
253
- malformed, cyclic, overlapping, or needlessly serialized proposals before
254
- dispatch, runs dependency-ready file-disjoint actions concurrently, and
255
- updates the requirement ledger from schema-valid evidence. Only real
256
- consolidated gaps re-enter the planner. There are no formal reviewer or repair
257
- roles and no automatic semantic repair/reverify loop.
263
+ The caller authors a complete program, or explicitly asks for a dispatched
264
+ planner. The kernel validates the graph, executes it, and returns every action
265
+ result. Independent agents share the target worktree. `ownedFiles` describes
266
+ intended territory and lets the scheduler serialize overlapping writers; it
267
+ does not reject or discard edits. A dependent starts as soon as its own inputs
268
+ finish, without waiting for unrelated siblings. A failed action skips its
269
+ dependents while other branches continue.
270
+
271
+ After a parallel implementation wave, plan one integrator depending on all its
272
+ writers. Give it `lane: "build"` and `ownedFiles: []` to run alone with permission
273
+ to fix any file. Its prompt should read worker outputs, apply cross-territory
274
+ requests, reconcile shared files, and run the repository acceptance commands.
275
+ Analyze actions remain read-only. Evidence actions are optional and report
276
+ independent judgments; negative evidence does not open another planner round.
277
+ The graph ends with `completed` when all actions succeeded, or `partial` when
278
+ some failed or were blocked. `verified` separately records whether all mandatory
279
+ requirements have fresh passing evidence. Read that qualification and the
280
+ actual outputs before claiming acceptance. Further repairs use a new program.
258
281
 
259
282
  Lane and effort are separate decisions for every proposed action. `analyze` is
260
283
  read-only investigation, judgment, or evidence; `build` is contextual product,
@@ -269,7 +292,8 @@ then resolves through the High/Medium/Low routes configured by `bullswarm setup`
269
292
 
270
293
  The planner does not author phases or declare success/failure. The kernel
271
294
  derives stable presentation stages for the TUI and computes the final V2
272
- result. Old autonomous run directories are not migrated or resumed;
295
+ result. Saved V2 runs retain their original execution and workspace policy on
296
+ resume. V1 autonomous run directories are not migrated or resumed;
273
297
  explicitly naming one fails before any paid dispatch. Fixed JSON workflows and
274
298
  drafts remain a separate authored-graph feature with their existing step
275
299
  types.
@@ -286,25 +310,30 @@ bullswarm workflow events --json <shortId> --after 0
286
310
  bullswarm workflow action show --json <shortId> <actionId>
287
311
  ```
288
312
 
289
- Resume a process-interrupted autonomous run from its persisted workflow:
313
+ Manage a run with first-class verbs:
290
314
 
291
315
  ```bash
292
- bullswarm workflow goal --resume <shortId> --json
316
+ bullswarm workflow steer <shortId> --message "<guidance>" # next planning boundary
317
+ bullswarm workflow cancel <shortId> --json # a paused run is finalized here
318
+ bullswarm workflow resume <shortId> --watch # verb form of goal --resume
293
319
  ```
294
320
 
295
321
  `--orchestrator <pool>` expresses a preference and immediately falls back to
296
- another eligible pool if that provider is quota-gated or unavailable. Ordinary
297
- use can leave selection on `auto`. For controlled provider QA only,
298
- `--strict-orchestrator <pool>` requires that exact pool and fails if it is not
299
- available. Controlled comparisons can additionally pin the exact planner
322
+ another eligible pool if that provider is quota-gated or unavailable; plain
323
+ `--orchestrator auto` leaves selection to the kernel. For controlled provider
324
+ QA only, add `--orchestrator-strict` to require that exact pool and fail if it
325
+ is not available. Controlled comparisons can additionally pin the exact planner
300
326
  and worker routes without changing global strategy:
301
327
 
302
328
  ```bash
303
329
  bullswarm workflow goal "Implement and verify the change" --cwd . \
304
- --strict-orchestrator codex --orchestrator-model gpt-5.6-sol \
330
+ --orchestrator codex --orchestrator-strict --orchestrator-model gpt-5.6-sol \
305
331
  --worker-pool opencode2 --worker-model kaihk/gpt-5.6-luna
306
332
  ```
307
333
 
334
+ These pins, plus `--suggested-plan` and `--no-scout`, apply only with
335
+ `--orchestrator`. When you are the planner, the plan is the program.
336
+
308
337
  The worker lock covers scout, work actions, and evidence actions. A pool that cannot guarantee
309
338
  the requested model is ineligible rather than silently substituting another
310
339
  model.
@@ -324,15 +353,58 @@ hard-stop useful work. `--concurrency` is the actual bound on simultaneous
324
353
  dependency-ready dispatches. There is no default wall-clock timeout: fresh
325
354
  semantic/transport heartbeats allow a useful worker to continue, while silence
326
355
  is inspected rather than blindly killed.
327
- Interactive setup also records a worktree-isolation
328
- preference (`agent-decides`, `off`, or `required`); Bullswarm communicates that
329
- policy to the V2 kernel. Unless explicitly set to `off`, mutating autonomous
330
- actions use isolated worktrees; the kernel checks actual changed paths against
331
- declared ownership before integration. `off` serializes shared-workspace
332
- writers and still enforces the changed-path boundary.
356
+ New goal runs use the shared workspace regardless of the older setup
357
+ worktree-isolation preference. Add `--isolation` to `workflow goal` when you
358
+ explicitly want per-worker worktrees and strict ownership before integration.
359
+ Pass it to `workflow plan contract` and `workflow plan validate` as well so the
360
+ contract describes that run. Shared execution does no manifest scan, copying,
361
+ integration, or rollback. Its final Git inventory is advisory, includes
362
+ pre-existing/concurrent changes, and never prevents completion if unavailable.
333
363
 
334
364
  ## Building a workflow from the shell
335
365
 
366
+ ### You are the planner: `--program` and `workflow plan`
367
+
368
+ This is the default. The calling agent (Claude Code, Codex, or any frontier
369
+ model with the repository in context) is the Workflow Planner, instead of the
370
+ kernel paying for a dispatched scout and planner that cannot see the
371
+ conversation. The kernel handles graph validation, quota routing, scheduling,
372
+ mechanical retries, optional evidence, durable recovery, and the result envelope while the
373
+ caller supplies the program, exactly the division of labour Claude Code's
374
+ `Workflow` tool uses between the authoring model and its harness.
375
+
376
+ ```bash
377
+ bullswarm workflow plan contract "1. Fix the parser. 2. Update the docs." --cwd . --json
378
+ # → requirement IDs (requirement-1..n), rules, action fields, validation, example
379
+ bullswarm workflow plan validate "1. Fix the parser. 2. Update the docs." --cwd . --program plan.json --json
380
+ # → dry run against that contract; exit 0 valid, exit 2 with the issues; nothing launches
381
+ bullswarm workflow goal "1. Fix the parser. 2. Update the docs." --cwd . --program plan.json --watch
382
+ # → validated before launch; executes with zero planner/scout dispatches
383
+ bullswarm workflow plan show <shortId> --json # initial scout or explicit steering pause
384
+ bullswarm workflow plan submit <shortId> --program plan-2.json --watch
385
+ ```
386
+
387
+ Exit codes are a contract: **0** done or paused durably for you (nothing is
388
+ running), **1** the run ended without completing, **2** usage or validation
389
+ error with nothing launched. Every refusal names the commands that come next.
390
+
391
+ For foreground execution, exit 0 means the graph ran successfully or paused
392
+ durably; it does not imply independent verification. An independent launch
393
+ also returns 0 before the workers finish. Consume its eventual result.
394
+
395
+ `--program` accepts the planner response envelope or a bare
396
+ `bullswarm.workflow.program.v2` document. An invalid program exits 2 with the
397
+ validator's issues and nothing is launched. When the kernel reaches a planning
398
+ boundary for an initial plan or queued user steering, it writes
399
+ `planner-request-turn-N.json`, sets the run to `waiting`, exits, and `watch` prints the
400
+ `plan show` command. A submitted program contains only new actions and is
401
+ validated against the exact durable state at that boundary. Older saved V2
402
+ runs still support their original gap boundaries and `--exhausted` submissions.
403
+ `--scout` without
404
+ `--program` runs the kernel scout first and pauses at the initial boundary so
405
+ the caller plans against a real survey; scout units are advisory for a caller
406
+ planner.
407
+
336
408
  Use an explicit draft when the graph itself is a durable contract and should
337
409
  not be planner-defined. `bullswarm workflow draft ...` lets you assemble it one
338
410
  mutation at a time. No upfront JSON required. Drafts persist under
@@ -393,8 +465,12 @@ After a workflow reaches a terminal state, agents should consume
393
465
  `workflow runs result <id> --json` instead of probing `state.json`, task files,
394
466
  or provider-specific output. Autonomous V2 returns the versioned
395
467
  `bullswarm.workflow.result.v2` envelope with kernel-computed status, fresh
396
- requirement evidence, action/artifact records, explicit gaps, usage, and
397
- verification qualification. Fixed authored workflows retain their existing
468
+ requirement evidence, per-action status/failure/output files, explicit gaps,
469
+ usage, and verification qualification. New programs include `executionMode:
470
+ "program"` and a `workspace` report with `changedFiles`, `baselineChangedFiles`,
471
+ and warnings. This is a Git status inventory, not attribution to individual
472
+ workers; files stay in the target directory. A completed program may be
473
+ unverified and contain negative evidence. Fixed authored workflows retain their existing
398
474
  result envelope. `runs show` remains the low-level debugging surface.
399
475
  Goal launch output includes an `instructions` handoff with four named paths:
400
476
  `agentInspect` for a machine-readable snapshot, `watch` for low-noise progress,
@@ -465,12 +541,19 @@ bullswarm workflow action show --json <id> <actionId>
465
541
  bullswarm workflow approval approve --json <id> # then resume the run
466
542
  ```
467
543
 
468
- Cancellation is persisted as `cancelling`, terminates an active child process,
469
- records its termination signal and latency evidence, then commits `cancelled`.
470
- `SIGTERM` and `SIGINT` use the same cooperative child termination path but
471
- commit a distinct resumable `interrupted` state. On every workflow command,
472
- active states with a dead/stale owner are automatically reconciled to
473
- `interrupted` instead of remaining falsely `running`.
544
+ Cancellation stops active delegates and commits `cancelled`. V2 goal workflows
545
+ keep the operator request in a separate durable file so kernel progress cannot
546
+ overwrite it; authored V1 graphs additionally expose a `cancelling` state.
547
+ `SIGTERM` and `SIGINT` stop delegate process groups and commit a resumable
548
+ `interrupted` state. A V2 resume holds an exclusive kernel lease, stops recorded
549
+ surviving delegates from the previous kernel, and finishes post-processing from
550
+ durable successful-attempt receipts instead of dispatching that work again.
551
+
552
+ Watchers identify dead kernels as interrupted; V2 state is reconciled on resume.
553
+ Unfinished attempts may execute again, so external side effects still require
554
+ idempotency. Shared edits are retained. Failed or interrupted isolated trees
555
+ are preserved for inspection; result warnings identify any retained trees.
556
+ Recovery refuses to overwrite conflicting user edits during integration.
474
557
 
475
558
  `workflow steer` is optional operator guidance, not hot-patching. It appends a
476
559
  durable instruction that is delivered only to the next not-yet-started