bullswarm 0.33.0 → 0.33.2

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 (85) hide show
  1. package/CHANGELOG.md +216 -0
  2. package/README.md +5 -3
  3. package/data/openrouter-benchmarks.json +9501 -9389
  4. package/data/plan-prices.json +149 -3
  5. package/docs/design/owner-review-2026-09-18/budget-page-current-0.33.1.png +0 -0
  6. package/docs/design/owner-review-2026-09-18/budget-page-target-0.33.1.png +0 -0
  7. package/docs/design/owner-review-2026-09-18/home-licence-today-missing-codex-0.33.1.png +0 -0
  8. package/docs/design/owner-review-2026-09-18/run-plan-strip-desktop-0.33.1.png +0 -0
  9. package/docs/design/owner-review-2026-09-18/stats-models-stacked-bars-0.33.1.png +0 -0
  10. package/docs/design/owner-review-2026-09-19/stats-overview-current.png +0 -0
  11. package/docs/design/prototype-frames-0.33.1/budget-120-v2.txt +21 -0
  12. package/docs/design/prototype-frames-0.33.1/budget-120-v3.txt +33 -0
  13. package/docs/design/prototype-frames-0.33.1/budget-120.txt +40 -0
  14. package/docs/design/prototype-frames-0.33.1/budget-55-v2.txt +21 -0
  15. package/docs/design/prototype-frames-0.33.1/budget-55-v3.txt +33 -0
  16. package/docs/design/prototype-frames-0.33.1/budget-55.txt +26 -0
  17. package/docs/design/prototype-frames-0.33.1/budget-README.md +53 -0
  18. package/docs/design/prototype-frames-0.33.1/home-today-120-v2.txt +11 -0
  19. package/docs/design/prototype-frames-0.33.1/home-today-120.txt +20 -0
  20. package/docs/design/prototype-frames-0.33.1/home-today-55-v2.txt +17 -0
  21. package/docs/design/prototype-frames-0.33.1/home-today-55.txt +34 -0
  22. package/docs/design/prototype-frames-0.33.1/home-today-README.md +35 -0
  23. package/docs/design/stats-frames-0.33.2/README.md +24 -0
  24. package/docs/design/stats-frames-0.33.2/budget-120.png +0 -0
  25. package/docs/design/stats-frames-0.33.2/budget-55.png +0 -0
  26. package/docs/design/stats-frames-0.33.2/spending-120.txt +22 -0
  27. package/docs/design/stats-frames-0.33.2/spending-55.txt +47 -0
  28. package/docs/design/stats-frames-0.33.2/stats-spending-120.png +0 -0
  29. package/docs/design/stats-refactor-0.33.2.md +571 -0
  30. package/docs/guide/observing.md +222 -10
  31. package/docs/guide/routing.md +41 -9
  32. package/docs/plans/0.33.1.goal.txt +14 -0
  33. package/docs/plans/0.33.1.program.json +361 -0
  34. package/docs/plans/0.33.2-stats.goal.txt +9 -0
  35. package/docs/plans/0.33.2-stats.program.json +126 -0
  36. package/docs/plans/handoff.goal.txt +8 -0
  37. package/docs/plans/handoff.program.json +117 -0
  38. package/docs/plans/handoff.rev2.json +136 -0
  39. package/docs/plans/handoff.rev3.json +165 -0
  40. package/docs/reference/cli.md +68 -5
  41. package/docs/reference/providers.md +12 -0
  42. package/mods/bullswarm/README.md +9 -0
  43. package/mods/bullswarm/hooks/pane.tsx +53 -13
  44. package/mods/bullswarm/hooks/register.ts +46 -2
  45. package/mods/bullswarm/hooks/runs.ts +49 -12
  46. package/package.json +1 -1
  47. package/skill/references/operations.md +9 -5
  48. package/src/cli.js +79 -5
  49. package/src/help.js +9 -6
  50. package/src/lib/agent-events.js +72 -1
  51. package/src/lib/assignments.js +13 -1
  52. package/src/lib/attempt-stream.js +233 -0
  53. package/src/lib/glyphs.js +2 -0
  54. package/src/lib/prices.js +177 -2
  55. package/src/lib/probe.js +209 -0
  56. package/src/lib/route.js +176 -107
  57. package/src/lib/state.js +1 -1
  58. package/src/lib/strategy.js +7 -0
  59. package/src/lib/tasks.js +148 -0
  60. package/src/lib/update.js +101 -22
  61. package/src/lib/usage-basis.js +37 -0
  62. package/src/lib/usage.js +106 -14
  63. package/src/lib/watch.js +115 -7
  64. package/src/meters/framework.js +7 -5
  65. package/src/provider-cli.js +28 -0
  66. package/src/providers/README.md +86 -0
  67. package/src/providers/_schema.json +29 -1
  68. package/src/providers/claude-code/connector.json +17 -4
  69. package/src/providers/claude-code/provider.mjs +94 -10
  70. package/src/workflow/budget-model.js +287 -21
  71. package/src/workflow/budget-view.js +204 -118
  72. package/src/workflow/dash-kit.js +246 -26
  73. package/src/workflow/dashboard.js +1371 -335
  74. package/src/workflow/fleet-view.js +16 -3
  75. package/src/workflow/history-view.js +140 -31
  76. package/src/workflow/history.js +26 -3
  77. package/src/workflow/rollup.js +36 -2
  78. package/src/workflow/stat-kit.js +1032 -0
  79. package/src/workflow/stats-model.js +136 -4
  80. package/src/workflow/stats-view.js +456 -1587
  81. package/src/workflow/usage-view.js +1 -142
  82. package/src/workflow/v2-dispatch.js +400 -29
  83. package/src/workflow/v2-runtime.js +140 -5
  84. package/src/workflow/v2-state.js +145 -1
  85. package/src/workflow/watch-cli.js +28 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,221 @@
1
1
  # bullswarm changelog
2
2
 
3
+ ## 0.33.2 — one way to draw a chart, and every bar answers
4
+
5
+ - stats: every Stats page now uses one shared set of panels, charts, legends,
6
+ summary cards, and hover regions; the old page-specific chart drawing is gone.
7
+ - stats: Spending puts its dated chart on the left and four real-data breakdowns
8
+ on the right, with a By Pool or By Model switch that changes both sides.
9
+ - stats: the tabs are now exactly Spending, Pool, Model, and Project, with the
10
+ same component order and spacing on every tab.
11
+ - stats: every Stats bar shows its name, value, and share on hover, and a click
12
+ pins the label until Escape or the next click without recolouring the bar.
13
+ - stats: Stats fits 55, 120, and 200 columns without horizontal scrolling, and
14
+ the saved 55- and 120-column Spending frames use real rollup data.
15
+ - stats: the guide now explains the four tabs and their controls, and the full
16
+ test suite is required to finish twice without failures or cancellations.
17
+ - bars: a reading worth anything at all now draws at least a sliver instead of
18
+ rounding down to an empty track. On a six-cell panel bar `codex` at 4.3%,
19
+ `grok` at 6% and `command-code` at 1% all painted nothing, which reads as a
20
+ pool that was never used. The sliver is one cell in the geometry too, so it
21
+ answers on hover like any other bar, and a true zero is still empty.
22
+ - stats: the two-column layout keeps its colour. At 80 columns and up the page
23
+ composes the dated chart on the left and the panel grid on the right, and
24
+ both composition steps padded their cells through the helper that strips the
25
+ colour codes, so every bar came out grey while the legend beside it stayed
26
+ coloured — a chart titled "by pool" painted all five pools identically.
27
+ - stats: no two series in one chart share a hue. Colours were hashed per name,
28
+ which put `claude-code:wati` and `codex` on the same blue.
29
+
30
+ ## 0.33.1 — say what a number is, or say you do not know
31
+
32
+ - budget: the page is the pool meters and nothing else. Every window a pool
33
+ reports gets its own row — a background-coloured bar whose fill says pace,
34
+ a white tick for how much of the window has elapsed, the used share right-
35
+ aligned in one column down the whole page, and a dim line under it with the
36
+ reset and the pace in percentage points. The `by bullswarm`, `other tools`,
37
+ `room for N more medium runs`, `so far ≈ $N` and `biggest` lines are gone:
38
+ the cost audit of 2026-09-18 traced every one of them to worker minutes
39
+ multiplied by a fitted rate, which produced 129% of a whole window for grok,
40
+ and to the byte-estimate money the same audit found 250 to 1,471 times too
41
+ low. Spend by run lives on Home and Stats. Credits stay with the window they
42
+ meter, and a pool that reports credits but no monthly window keeps them.
43
+ - accounts: two homes holding the same Anthropic login are now discovered as
44
+ one pool. Discovery deduplicated on the access-token string, but signing one
45
+ account in twice mints two unrelated tokens, so `~/.claude` and a
46
+ `~/.claude-<slug>` home on the same subscription surfaced as two pools —
47
+ each reporting the same usage, between them claiming twice the headroom that
48
+ exists, and letting routing delegate work straight back to the account
49
+ already running the session. Discovery now keys on the `accountUuid` that
50
+ `claude` records in each home's `.claude.json`, falling back to the token
51
+ when a home has no account recorded (a home written before the field, or one
52
+ whose credentials were installed by hand). `discoverClaudeConfigDirs` starts
53
+ at the default home, so first-wins keeps the caller's own login and drops the
54
+ duplicate delegate. Observed on a four-home machine where the default home
55
+ and one extra home were the same account: the extra pool was only absent
56
+ because its token had expired, and would have self-delegated the moment it
57
+ was refreshed. New `accountIdentity(configDir)` export.
58
+ - update: a global pnpm install is recognised as its own shape and upgraded with
59
+ `pnpm add -g`, verified through the link under the pnpm global node_modules.
60
+ It used to be read as an npm prefix — but pnpm's `.pnpm/<name>@<version>/`
61
+ is a per-version store directory, so `npm install -g --prefix` wrote into the
62
+ old version's folder and `bullswarm update` could never exit 0. A pnpm
63
+ project dependency is reported as unknown rather than upgraded globally.
64
+ - update: `--json` carries `verifiedAt`, the copy `after` was read from.
65
+ `install.root` is where the RUNNING copy was found, which pnpm leaves behind
66
+ on its old per-version store directory, so it cannot also mean "where
67
+ bullswarm lives now".
68
+ - workflow: a kernel that has taken SIGTERM or SIGINT can no longer write a
69
+ terminal lifecycle. The progress check reached `finalize()` without asking
70
+ whether the run had been signalled, so a run interrupted in that window was
71
+ recorded `cancelled` with a `finishedAt` and a result.json — terminal, and no
72
+ longer the resumable `interrupted` the durability contract promises. The
73
+ guard now sits in `finalize()` itself, the only place a lifecycle becomes
74
+ terminal, rather than at each call site.
75
+ - attempts: the prior-attempt handoff names a connector-default model as
76
+ `<pool> connector default` instead of `unknown`, keeps every `git diff --stat`
77
+ row exactly as git printed it (the first row used to lose its leading space),
78
+ and, when the prior pool declares no `eventStream`, says
79
+ `Last response events: none decoded (…)` instead of dropping the section.
80
+ The `watch` handoff line says `1 file`. An attempt interrupted by a kernel
81
+ `SIGKILL` now carries `outputFile`, `outputBytes`, `streamFile` and `diffFile`
82
+ after resume when those files exist on disk.
83
+ - attempts: every attempt now persists the event stream its connector's
84
+ `eventStream` adapter decodes, as `stream-<action>-attempt-<n>.jsonl` in the
85
+ run directory — one JSON object per line with `seq`, `at` (ISO, stamped by
86
+ the kernel), `source`, `providerType`, `kind`, `status`, and `summary`. A
87
+ `response` event keeps its text there up to the response cap; the live pane
88
+ keeps its 180-character summary. A connector with no `eventStream` gets a bounded plain
89
+ `stdout-<action>-attempt-<n>.log` instead. The JSONL file is bounded as a
90
+ head, one `{"truncated":true,"dropped":<n>}` marker line, and a tail; the
91
+ plain stdout fallback is a marker-free bounded tail. Head records are
92
+ appended synchronously, and an over-cap tail is flushed to `.tail` every 32
93
+ events or 2 seconds, whichever comes first, so a kernel `SIGKILL` can lose
94
+ only the unflushed tail window. Core allows 1048576 bytes per file and 64000
95
+ bytes per response, and a connector manifest may override either in an
96
+ optional `eventStream.capture` block that `bullswarm provider validate` now
97
+ accepts — a contributed connector takes part with no code.
98
+ - handoff: when an attempt ends without success and the step is retried (on
99
+ another pool or the same one; the schema-correction path is unchanged), the
100
+ task handed to the next attempt ends with a `## Prior attempt on this step`
101
+ block filled from on-disk facts: pool, model, start, end, duration, failure
102
+ kind and `why`; the files whose bytes changed inside the step's territory
103
+ (including new, staged, pre-dirty, and deleted files), with a `git diff
104
+ --stat` for tracked files and `+N lines (new)` for untracked files frozen at
105
+ the moment that worker exited, so a sibling's later edits are never blamed
106
+ on it; the path and byte count of its final or partial output; its last three
107
+ `response` events with timestamps, read back out of the persisted stream; the
108
+ stream's path, never its contents; and the sentence that the edits are
109
+ unverified and the new worker must report whether it kept, fixed, or reverted
110
+ them.
111
+ - attempts: the attempt record and the `attempt.finished` event now carry
112
+ `outputFile` with `outputBytes` whenever the file exists — including on
113
+ failure, where `outputFile` used to be `null` with the file sitting on disk —
114
+ plus `streamFile`, `diffFile`, `changedFileCount`, `lastResponse`, and
115
+ `handoff: { from, bytes }` on the receiving attempt. `workflow action show`
116
+ prints all of them, and `workflow watch` prints one line at the handoff
117
+ naming the file count and what the previous worker said last.
118
+
119
+ - routing: a rung that names a free model is checked for life before any work
120
+ is sent to it. Bullswarm sends the one-word prompt `PONG` through that pool's
121
+ own CLI, waits at most 30 seconds, and caches the answer per pool and model
122
+ for 15 minutes in `cache/free-model-probes.json`. A pool that answers is
123
+ dispatched to as before. A pool that does not is benched with the reason
124
+ (`404`, `provider error` or `timeout`), and the work falls through to the
125
+ metered pools — the reason reads `probe: timeout on <pool>` in `routeWhy`,
126
+ on `bullswarm pools` and on the Fleet page. The probe is deliberately
127
+ narrow: it never runs for a rung left on the CLI default, never for a paid
128
+ model, never asks a provider what other models it has, and never substitutes
129
+ a model of its own choosing.
130
+ - attempts: a worker that hits a provider stream error, recovers, and finishes
131
+ its task is no longer failed for the error. When the output it wrote is
132
+ usable the attempt succeeds, and the error is kept on the attempt as a note
133
+ (`kind: "recovered-stream-error"`) so the transport problem is still visible
134
+ without costing a retry.
135
+ - run: single `bullswarm run` tasks are visible everywhere workflow steps are.
136
+ Each dispatch's decision-log entry now records the task file, the output file
137
+ and the lane; a task in flight is read from `~/.bullswarm/assignments/*.json`
138
+ (source `run`). The Runs page lists in-flight tasks in its active block and
139
+ finished tasks as rows in the day table — glyph, lane, pool · model, ok or
140
+ reason, duration, time — Home's today band counts them alongside workflow
141
+ runs, and the Mod pane shows the task in flight instead of "No ongoing
142
+ workflow run". A task recorded before these fields existed still appears,
143
+ showing `—` for what it does not have, and is listed and counted once: the
144
+ day page and the task ledger both offer it, and the de-duplication used to
145
+ key on an `id` those rows do not have, so every one of them was drawn twice
146
+ and every day header double-counted them.
147
+ - budget: a provider's plan no longer has to be typed in. Each provider reports
148
+ the plan name it can detect for itself (Claude's `subscriptionType` /
149
+ `rateLimitTier` from `~/.claude/.credentials.json`, Codex's `plan_type`,
150
+ Command Code's plan, opencode's plan), and `data/plan-prices.json` maps a
151
+ plan name to a monthly USD figure only where a vendor page was actually read,
152
+ quoting its URL and the exact line the number came from. A plan with no
153
+ citable price stays `null` rather than guessed. Budget spends a detected
154
+ price exactly as it spends a declared one and labels which it is —
155
+ `detected` or `declared` — so an operator's own figure is never confused with
156
+ one bullswarm inferred. The plan table is keyed by provider, not by pool, so a
157
+ discovered per-account pool such as `claude-code:wati` resolves against
158
+ `claude-code`'s plans; it used to ask for `claude-code:wati`'s own plans and
159
+ find nothing, which left exactly the pools with one login per account
160
+ without a price.
161
+ - Mod: the pane's `usage` button works with no run in flight — it renders the
162
+ pools page instead of doing nothing — and a `run` assignment in flight is
163
+ shown on the otherwise-empty pane.
164
+ - budget: every meter window a pool actually reports is shown, not just the
165
+ first one: the 5-hour, 7-day and monthly windows each with their local reset
166
+ time and their pace. The header says how old the numbers are (`sampled 5m
167
+ ago`) so a stale reading cannot be mistaken for a live one.
168
+ - run page: attempts record how many output bytes they had written over time,
169
+ so the Run and Step pages draw a live output sparkline from the durable
170
+ record (bounded at 240 samples per attempt). The plan strip prints a pool
171
+ name whole or leaves it out — never `openc…`. A retry after a kernel restart
172
+ still receives its `## Prior attempt on this step` handoff block, rebuilt
173
+ from the durable attempt record rather than from the lost in-memory one. And
174
+ `medianMinutes` — the p50 on `strategy rungs` and the Usage page — no longer
175
+ counts stalled attempts, so a silence timeout cannot inflate a pool's
176
+ typical duration. Dispatch count and ok share are unchanged.
177
+ - run page: the plan section groups its steps by presentation phase instead of
178
+ listing them flat, and Home's licence tile lists every metered pool that did
179
+ work today rather than only the busiest one.
180
+ - stats: hovering a bar in a stacked chart labels the slice under the cursor —
181
+ which series, which day, and its value — and Enter pins that slice's detail
182
+ so it can be read without holding the cursor still.
183
+ - routing: the last-mile 5-hour guard is relaxed. A step may now run a pool all
184
+ the way to 100% of its 5-hour window, because attempt handoff briefs the
185
+ retry on what the stopped worker had already written, so hitting the wall
186
+ mid-attempt costs a handoff rather than the work. Between 75% and the wall a
187
+ pool is only softly penalised in the ordering while another eligible pool is
188
+ behind pace, and a forecast that runs past the wall sorts last but stays
189
+ eligible. `BURST_BLOCK_PCT` moves from 90 to 100; the reason says
190
+ `last mile: <pool> 94.0% of 5h, handoff covers the wall`.
191
+ - home: the today band is rebuilt. Finished work of today is on the left — one
192
+ card-style line per workflow run and per single task, with what it was for
193
+ and its project — and today's measured licence spend per pool is on the
194
+ right, with the share each pool's workflows, single runs and minutes
195
+ depleted. Every figure that is an estimate rather than a measurement says so.
196
+ - usage: attempts now record the provider's own numbers instead of inferring
197
+ them. An attempt keeps the token totals, the cost and the session id the
198
+ provider reported, Claude prompt-cache writes are priced rather than treated
199
+ as free, and `tokenSource` widened to name where each figure came from
200
+ (`provider-reported`, `transcript-summed`, `estimated:utf8-bytes/4`,
201
+ `unknown`). The attempt's provider conversation is durable as
202
+ `attempt.session` — pool, model, session id, generation, and when it was
203
+ opened and last used.
204
+ - usage: every money figure in the dashboard says what kind of figure it is —
205
+ measured from the provider, summed from a transcript, estimated from bytes,
206
+ or unknown — so a byte estimate can no longer be read as a bill. The views
207
+ also report how many of the attempts behind a total were measured.
208
+ - usage: figures recorded before this release stay byte estimates. The 0.33.2
209
+ reprice back-fill will recompute them from the providers' own totals, and
210
+ when it does the spend history will jump by roughly one to two orders of
211
+ magnitude. That jump is the old estimate being corrected, not new spending.
212
+
213
+ The Budget verdict redesign is not in this release: it remains prototype frames
214
+ under `docs/design/prototype-frames-0.33.1/` (`budget-55.txt`,
215
+ `budget-120.txt`, `home-today-55.txt`, `home-today-120.txt` and their READMEs),
216
+ drawn from the real pool figures of 2026-09-18.
217
+
218
+
3
219
  ## 0.33.0 — the dashboard release
4
220
 
5
221
  - dashboard: the phone `Home` no longer hides data behind its width. The
package/README.md CHANGED
@@ -190,9 +190,11 @@ instead.
190
190
  mechanical chores — not assigned to a fixed pool ahead of time.
191
191
  - Among the pools that can do the work, the one furthest behind its own quota
192
192
  pace (the most unspent surplus) wins, so quota doesn't expire unused.
193
- - A pool that's about to hit its rolling 5-hour usage ceiling is passed over in
194
- favor of one with headroom, based on where the clock actually is in that
195
- window, not a flat percentage.
193
+ - A pool close to its rolling 5-hour usage ceiling gives way to one with
194
+ headroom only while another pool is actually behind its own pace — it is an
195
+ ordering penalty, not a cutoff. A step may run a pool all the way to 100% of
196
+ that window, because if the provider stops the worker at the wall the retry
197
+ is briefed on what it had already written.
196
198
  - A pool whose weekly or monthly subscription window is about to reset gets
197
199
  priority for its remaining surplus, so quota doesn't run out the clock
198
200
  unspent.