bullswarm 0.38.16 → 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 CHANGED
@@ -2,6 +2,26 @@
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
+
18
+ ## 0.38.17 — one per-round count; the low-yield stop fires at 1 to 3 new
19
+
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.
21
+
22
+ - One per-round definition. `perRound` counts new findings only, everywhere: the out-of-rounds event, the low-yield `loop.passed` event, the watch lines and the waiting note. It now matches the result's `findings.rounds`. Findings reported still open again are carried beside it as `reopenedPerRound`, which matches the result's `findings.stillOpen`, and are labelled `reopened per round …`. The field is present only when some round reopened one.
23
+ - The low-yield stop's default is now `{max: 3, rounds: 2}` (was `{max: 2, rounds: 2}`). The loop ends after 2 reviewed rounds in a row that each found 1 to 3 new findings at or above the floor, with every area reviewed in them. Only new findings count toward `max`. A round in which a finding was reported still open again never counts toward the stop, because a fix that did not hold keeps the loop going. On the benchmark's sequence, with its rounds 3 and 4 reopening one finding each, the loop now stops after round 6 and not before. 3, 4, 6, 5, 4 keeps going. `until.yield: {max, rounds}` and `until.yield: false` work as before.
24
+
5
25
  ## 0.38.16 — review areas must be mainly non-functional, a low-yield stop, and pool holds, reserves and 5h-seat routing
6
26
 
7
27
  Published 2026-10-15. 0.38.12 to 0.38.15 were never published on their own; their notes below ship in this release.
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 { main } from '../src/cli.js';
4
+ import { cachedCall, cachedCallMain } from '../src/lib/pools-cache.js';
5
5
 
6
- main(process.argv.slice(2)).then(
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);