bullswarm 0.40.2 → 0.41.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 (37) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/data/openrouter-benchmarks.json +12380 -12405
  3. package/docs/design/tidy-0.35.1/frames/real-stats-model-120.txt +1 -1
  4. package/docs/design/tidy-0.35.1/frames/real-stats-model-200.txt +1 -1
  5. package/docs/design/tidy-0.35.1/frames/real-stats-model-55.txt +1 -1
  6. package/docs/design/tidy-0.35.1/frames/real-stats-spending-120.txt +2 -2
  7. package/docs/design/tidy-0.35.1/frames/real-stats-spending-200.txt +2 -2
  8. package/docs/design/tidy-0.35.1/frames/real-stats-spending-55.txt +2 -2
  9. package/docs/guide/concepts.md +1 -1
  10. package/docs/guide/observing.md +2 -3
  11. package/docs/guide/routing.md +1 -1
  12. package/docs/guide/workflows.md +1 -1
  13. package/docs/reference/cli.md +3 -3
  14. package/docs/reference/program.md +1 -1
  15. package/package.json +1 -1
  16. package/skill/references/recovery.md +1 -1
  17. package/src/lib/quota.js +113 -10
  18. package/src/lib/spend.js +55 -5
  19. package/src/providers/_schema.json +1 -1
  20. package/src/workflow/cli-capabilities.js +1 -1
  21. package/src/workflow/dashboard-page-help.js +0 -1
  22. package/src/workflow/dashboard-page-stats.js +1 -2
  23. package/src/workflow/dashboard-pages.js +1 -1
  24. package/src/workflow/dashboard-render.js +18 -5
  25. package/src/workflow/dashboard-rows.js +57 -2
  26. package/src/workflow/dashboard.js +36 -15
  27. package/src/workflow/day-key.js +18 -2
  28. package/src/workflow/evidence-runner.js +23 -4
  29. package/src/workflow/history-view.js +25 -0
  30. package/src/workflow/home-view.js +2 -2
  31. package/src/workflow/metrics.js +6 -0
  32. package/src/workflow/short-id.js +31 -32
  33. package/src/workflow/stat-kit.js +2 -3
  34. package/src/workflow/stats-model.js +1 -1
  35. package/src/workflow/stats-view.js +127 -31
  36. package/src/workflow/tokens-model.js +163 -0
  37. package/src/workflow/v2-dispatch.js +9 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.41.0 — Lighter dashboard, a Tokens tab and stricter Cloudflare limit wording
6
+
7
+ - Cloudflare's own rate-limit wording (codes 3021 and 971) now counts only where its error framing sits right before it (an error class or code such as `AiError:`, `Error:` or `429`, also after a log prefix; a JSON `"message"` value; or a leading `Too Many Requests`), or on a line that is the bare phrase; then a long body counts too. Before, a bare or long body was read as a provider failure and hopped pools, and a worker's prose quoting the wording was read as a throttle. A `Too Many Requests:` line that mentions "unauthorized" or "not authenticated" is no longer taken for a sign-in failure.
8
+ - A rate-limited attempt whose pool reached its concurrency cap during the backoff now waits for a slot on that pool and retries there. Before, the cap wait dropped the backoff, and the step failed with "no retry: no pool can take it now" after a single wait. Seen on cf:deepseek slices on 24 Nov, with the pool at cap 2 and 4 running.
9
+ - Cloudflare's API-level rate limit (code 971, "Please wait and consider throttling your request speed") is now a `throttle`, like 3021. More generally, any `Too Many Requests: {...}` line (HTTP 429's reason phrase with a JSON body) counts as a rate-limit notice, whatever code the provider puts inside.
10
+ - A rate-limit `why` quotes the provider's own message from a JSON body, for example "rate limiting: inference request per min rate reached", not the start of the JSON.
11
+ - The dashboard (`bullswarm` with no arguments) no longer holds a CPU core. Every paint, including the spinner's every 400 ms, rebuilt the Stats and Budget aggregates and deep-copied the whole model, rollup index and all, to show pool labels. Now the aggregates are rebuilt only when the index, the pools, the prices, the period or the minute change, and each object's labelled copy is reused while the object is unchanged. Measured on a home with 850 runs: Home page 66-86% CPU before, 10-27% after; memory no longer climbs past 500 MB in 3 minutes.
12
+ - The dashboard's Runs page and its refresh now read only what changed. The run list re-reads a run directory only when one of its files changes, so a run that finished days ago is parsed once, not on every 15 s rebuild. The usage reload (every 10 s) indexes the decision log once instead of re-reading all of it for each pair of meter readings. A finished run's table row is built once, not on every spinner tick, and day keys are cached. Measured on a home with 1,225 runs (147 MB of run state), side by side with 0.40.4: Runs page 35-114% CPU before, 3-18% after; Home 11-123% before, 2-14% after (median about 6%).
13
+ - Stats has a Tokens tab in place of Pool, which showed what Spending shows. It charts input and output tokens per day (per week on `all`), stacked the way Cloudflare's Workers AI chart is, with the input and output totals in the title, and lists tokens by pool, model and project with each share. Input is the uncached read plus cache read and cache write; output includes reasoning. Only counts a provider reported are added: a byte estimate is counted as an estimate, and an attempt with no token data as not reported. Each attempt in the history index now records its uncached input and output; older index lines hold only a total, shown as `not split` until `bullswarm workflow reindex --force` rewrites them.
14
+ - Stats Spending is by pool only: the `By Pool` / `By Model` switch (and its `v` key) is gone, because the Model tab already shows the by-model view. The Pool tab's Licence / reset history panel went with it.
15
+ - A command check can run under a machine's test-slot queue: `BULLSWARM_EVIDENCE_WRAP` (an absolute path to an executable) runs it as `<wrap> /bin/sh -c <cmd>`, and `BULLSWARM_EVIDENCE_SLOT_WAIT_SEC` (0-3600) adds the longest queue wait to its timeout. Unset, relative or not a file, the check runs as before. Schema checks are never wrapped.
16
+
17
+ ## 0.40.3 — Cloudflare rate limit waits on the same pool
18
+
19
+ - Cloudflare Workers AI's per-model rate limit (code 3021, `rate limiting: inference request per min rate reached`, HTTP 429) is now a `throttle`: the step backs off on the same pool and keeps its one retry. Before, it read as a provider failure, so each hit spent the retry on another pool (one step went Inkling, DeepSeek, then gpt-oss-120b). A notice line that opens with HTTP 429's reason phrase (`Too Many Requests: {...}`) now counts as a provider notice.
20
+ - The throttle backoff is jittered: 20-30 s, then 60-90 s, instead of exactly 20 s and 60 s, so parallel workers that hit one per-minute limit do not all retry in the same second. A wait the provider names is kept as named.
21
+ - A long limit notice (a 429 JSON body) is quoted in `why` from the matched phrase, so the line stays short.
22
+
5
23
  ## 0.40.2 — Routing fixes for lane-limited and pay-per-token pools
6
24
 
7
25
  - `strategy set-lanes <pool> analyze` no longer empties the pool's medium and low rungs at the next `strategy apply`. A lane limit decides which work a pool takes, not which effort tiers it keeps. Before, grok (limited to analyze on 17 Nov) took no work at all after the nightly apply, not even analyze at medium.