bullswarm 0.38.17 → 0.38.18
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.
- package/CHANGELOG.md +13 -0
- package/bin/bullswarm.js +12 -2
- package/data/openrouter-benchmarks.json +8812 -8351
- package/mods/bullswarm/hooks/pools.ts +54 -0
- package/mods/bullswarm/hooks/register.ts +43 -6
- package/package.json +1 -1
- package/src/cli.js +53 -16
- package/src/help.js +8 -4
- package/src/lib/cli-flags.js +4 -4
- package/src/lib/pools-cache.js +211 -0
- package/src/workflow/runs-cli.js +45 -21
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.38.18 — one shared status-line cache for pools, workflow runs and assignments
|
|
6
|
+
|
|
7
|
+
Why: every Claude session's mod ran `bullswarm pools --json` on its own timer. On 2026-10-20 there were 11 at once, each a 260-345 MB node process (about 3 GB together), on a Mac close to running out of swap.
|
|
8
|
+
|
|
9
|
+
- A shared pools cache. `bullswarm pools --json --max-age <seconds>` answers from `<home>/cache/pools.json` when it is at most that old, before the rest of the CLI loads (measured: 46 MB and 0.07 s, against 363 MB and 2.7 s for a rebuild). When the cache is older, one caller takes a file lock (`pools.lock`) and rebuilds it. The others answer at once with the last good set (`cache.source: "stale"`), or wait for the build if there is no cache yet. A lock older than two minutes belongs to a refresher that died and is broken. Every whole-set `pools --json` refreshes the cache. `--max-age` refuses `--pool` and `--force`.
|
|
10
|
+
- The mod reads that file directly while it is under 60 s old, so a refresh starts no process. When the file is older it asks `pools --json --max-age 60`. N sessions now cost one meter build a minute, not N.
|
|
11
|
+
- The same shared cache for the mod's other two reads, `workflow runs --json` and `assignments --json`, each a full CLI load (~280 MB). On 2026-10-21 there were 14 of each in two minutes across 14 sessions, up to 9 at once. Each cache is its own file (`runs.json`, `assignments.json`, each with its own lock). Their `--max-age` forms print exactly what the plain form prints, plus `cache` on the runs object; `assignments` stays a bare array. Every unfiltered plain `--json` read refreshes its file. A filtered runs list (`--all`, `--name`, …) never touches it, and `--max-age` refuses one.
|
|
12
|
+
- The mod takes runs and assignments at most 60 s old while nothing is in flight, 15 s while something is, and 3 s with a running step open, so progress keeps pace with its refresh. Pools stay at 60 s.
|
|
13
|
+
- The cache lock, after an independent review (grok, run qnkeas):
|
|
14
|
+
- A lock over two minutes old is broken only when its holder process is gone.
|
|
15
|
+
- A caller releases the lock only while it still holds its own token.
|
|
16
|
+
- A caller that stops waiting for another's build now stores what it built.
|
|
17
|
+
|
|
5
18
|
## 0.38.17 — one per-round count; the low-yield stop fires at 1 to 3 new
|
|
6
19
|
|
|
7
20
|
Why: the 0.38.16 benchmark (benchmark-0.38.16-report.md) found 3, 4, 6, 3, 3, 1 new findings a round. The low-yield stop never fired, because it needed two rounds in a row of 1 or 2. The out-of-rounds wake also said "new per round 3, 4, 7, 4", but the result's `findings.rounds` said 3, 4, 6, 3: the event added findings reported still open again, and the result did not.
|
package/bin/bullswarm.js
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// bullswarm — route work across coding-agent CLI subscriptions.
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { cachedCall, cachedCallMain } from '../src/lib/pools-cache.js';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const argv = process.argv.slice(2);
|
|
7
|
+
|
|
8
|
+
// `pools`, `workflow runs` and `assignments` with `--json --max-age <s>` are
|
|
9
|
+
// what every Claude session's mod asks on a timer: answer them from the shared
|
|
10
|
+
// cache before loading the rest of the CLI, which alone is ~280 MB RSS. Only
|
|
11
|
+
// the caller that rebuilds loads it.
|
|
12
|
+
const run = cachedCall(argv) !== null
|
|
13
|
+
? cachedCallMain(argv)
|
|
14
|
+
: import('../src/cli.js').then((m) => m.main(argv));
|
|
15
|
+
|
|
16
|
+
run.then(
|
|
7
17
|
(code) => { process.exitCode = code; },
|
|
8
18
|
(err) => {
|
|
9
19
|
console.error(err?.message ?? err);
|