@ra3orblade/swarm 0.8.0 → 0.10.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.
package/web/index.html CHANGED
@@ -88,9 +88,11 @@
88
88
  kbd{font:var(--fs-mono) var(--mono);background:var(--panel-2);border:1px solid var(--line);border-radius:var(--r-xs);padding:1px 5px;color:var(--fg-2)}
89
89
  code{font:var(--fs-md) var(--mono);color:var(--fg-2)}
90
90
 
91
- /* collapsed sidebar */
92
- body.nosb{grid-template-columns:0 1fr}
93
- body.nosb>aside{display:none}
91
+ /* collapsed sidebar = icon rail (M9.1): views stay one click away; projects via ⌘K */
92
+ body.nosb{grid-template-columns:46px 1fr}
93
+ body.nosb>aside{padding:12px 5px;overflow:hidden}
94
+ body.nosb #viewnav a.nav{justify-content:center;padding:7px 0}
95
+ body.nosb #viewnav .nm,body.nosb #viewnav h4,body.nosb #viewnav .navcount,body.nosb #projects{display:none}
94
96
  body>aside{grid-column:1;grid-row:2}
95
97
  body>main{grid-column:2;grid-row:2}
96
98
  #projects h4{display:flex;align-items:center;gap:5px}
@@ -124,6 +126,13 @@
124
126
 
125
127
  /* sidebar */
126
128
  body>aside{border-right:1px solid var(--line);background:var(--panel);padding:12px 10px;overflow:auto;display:flex;flex-direction:column}
129
+ /* view nav (M9.1): grouped views in the sidebar, generated from VIEW_DEFS; header holds only chrome */
130
+ #viewnav{display:flex;flex-direction:column;gap:1px;flex:none;margin-bottom:4px}
131
+ #viewnav a.nav{display:flex;align-items:center;gap:9px;color:var(--dim);padding:5px 8px;border-radius:var(--r-sm);font-weight:500;transition:color var(--t-fast),background var(--t-fast)}
132
+ #viewnav a.nav:hover{color:var(--fg-2);background:var(--panel-2)}
133
+ #viewnav a.nav.on{color:var(--fg);background:var(--panel-2)}
134
+ #viewnav a.nav .nm{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
135
+ #viewnav .navcount{margin-left:auto}
127
136
  body>aside h4{margin:14px 8px 6px;color:var(--faint);font-size:var(--fs-xs);font-weight:600;text-transform:uppercase;letter-spacing:.09em}
128
137
  body>aside h4:first-child{margin-top:2px}
129
138
  .proj{padding:var(--pad-row);border-radius:var(--r-sm);cursor:pointer;display:flex;align-items:center;gap:9px;
@@ -153,6 +162,11 @@
153
162
  .dr-rule select{background:var(--panel-2);color:var(--fg);border:1px solid var(--line);border-radius:var(--r-sm);padding:2px 4px}
154
163
  .dr-flaky{padding:6px 8px;border:1px solid var(--line);border-radius:var(--r-sm);margin:6px 0;background:var(--panel-2)}
155
164
  table.plain{width:100%;border-collapse:collapse;font-size:var(--fs-sm)} table.plain td{padding:3px 6px;border-top:1px solid var(--line);vertical-align:top}
165
+ /* ⌘K palette (M9.1): top-anchored .pk variant; rows reuse .pk-row */
166
+ .pk.pal{align-self:start;margin-top:9vh}
167
+ .pal .pk-list{min-height:120px;max-height:min(440px,62vh)}
168
+ .pal .pk-row.on{background:var(--acc-soft);color:var(--fg)}
169
+ .pal .pk-row .grp{margin-left:auto;color:var(--faint);font-size:var(--fs-xs);text-transform:uppercase;letter-spacing:.07em}
156
170
  #picker:empty{display:none}
157
171
  #picker{position:fixed;inset:0;background:var(--overlay);display:grid;place-items:center;z-index:50}
158
172
  .pk{width:min(560px,92vw);max-height:78vh;display:flex;flex-direction:column;background:var(--panel);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow-pop);overflow:hidden}
@@ -228,6 +242,12 @@
228
242
  h2{font-size:var(--fs-md);margin:0 0 12px;color:var(--dim);font-weight:600;text-transform:uppercase;
229
243
  letter-spacing:.07em;display:flex;gap:10px;align-items:baseline}
230
244
  h2 span{font-weight:500;text-transform:none;letter-spacing:0;color:var(--faint);font-size:var(--fs-md)}
245
+ /* section-header actions (New worktree, Collect stale, Dispatch clear, timeline ranges):
246
+ small buttons, not shouting header text — normal case, centered icon, hover chip */
247
+ h2 .nav{display:inline-flex;align-items:center;gap:5px;font:500 var(--fs-md) var(--sans);text-transform:none;letter-spacing:0;color:var(--acc);text-decoration:none;padding:2px 8px;border-radius:var(--r-sm);transition:background var(--t-fast)}
248
+ h2 .nav:hover{background:var(--acc-soft)}
249
+ h2 .nav.on{background:var(--acc-soft)}
250
+ h2 .nav .ph{display:block}
231
251
  h2 .back{color:var(--fg-2);text-transform:none;letter-spacing:0;font-weight:600;font-size:var(--fs-md);display:inline-flex;align-items:center;gap:5px;padding:5px 11px 5px 8px;border:1px solid var(--line);border-radius:var(--r-pill);background:var(--panel);transition:border-color var(--t-fast),color var(--t-fast)}
232
252
 
233
253
  /* tables */
@@ -292,6 +312,7 @@
292
312
  .badge.warn{color:var(--warn);background:var(--warn-soft)}
293
313
  .badge.acc{color:var(--acc);background:var(--acc-soft)}
294
314
  .badge.ok{color:var(--ok);background:var(--ok-soft)}
315
+ .badge.bad{color:var(--bad);background:var(--bad-soft)}
295
316
  .badge.agent{color:var(--violet);background:color-mix(in srgb,var(--violet) 14%,transparent);font-weight:600}
296
317
 
297
318
  /* empty */
@@ -420,7 +441,7 @@
420
441
  /* icons (Phosphor regular, inline) */
421
442
  .ph{display:inline-block;vertical-align:middle;flex:none}
422
443
  header .nav{display:inline-flex;align-items:center;gap:6px}
423
- header .navcount{font:600 var(--fs-xs) var(--mono);color:var(--warn);background:var(--warn-soft);border-radius:var(--r-pill);padding:1px 6px;line-height:1.4}
444
+ .navcount{font:600 var(--fs-xs) var(--mono);color:var(--warn);background:var(--warn-soft);border-radius:var(--r-pill);padding:1px 6px;line-height:1.4}
424
445
  header .nav .ph{opacity:.75}
425
446
  header .nav.on .ph{opacity:1;color:var(--acc)}
426
447
  .icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border-radius:var(--r-sm);
@@ -519,6 +540,43 @@
519
540
  .seg a:hover{color:var(--fg-2)}
520
541
  .seg a.on{background:var(--acc-soft);color:var(--acc)}
521
542
  .chip b{font-weight:700}
543
+ /* workflow step chips (M7.8) */
544
+ .wf-steps{display:inline-flex;gap:6px;flex-wrap:wrap}
545
+ .wfs{font:500 var(--fs-sm) var(--sans);color:var(--dim);background:var(--panel-2);border:1px solid var(--line);border-radius:var(--r-pill);padding:1px 8px;white-space:nowrap}
546
+ .wfs.ok{color:var(--ok);background:var(--ok-soft);border-color:transparent}
547
+ .wfs.run{color:var(--acc);background:var(--acc-soft);border-color:transparent}
548
+ .wfs.bad{color:var(--warn);background:var(--warn-soft);border-color:transparent}
549
+ /* M5.7: timeline ticks, idle-gap thin bars, claim lane; sidebar spend sparks; gate history */
550
+ .tl-track u{position:absolute;top:4px;bottom:4px;width:2px;border-radius:1px;opacity:.95}
551
+ .tl-track i.thin{opacity:.25}
552
+ .tl-row.claimlane .tl-name{font-size:var(--fs-2xs);text-transform:uppercase;letter-spacing:.06em}
553
+ .tl-track i.claim{top:7px;height:4px;border-radius:2px;background:var(--violet);opacity:.6}
554
+ .tl-track i.claim.orphaned{background:var(--warn);opacity:.9}
555
+ .tl-track i.claim.expired{background:var(--faint)}
556
+ .proj-spark{flex:none;width:44px;display:inline-flex;opacity:.7}
557
+ .proj-spark .spark{width:44px;height:14px}
558
+ .gh-strip{display:inline-flex;gap:12px;font-weight:400}
559
+ .gh{font-size:var(--fs-sm);color:var(--dim);display:inline-flex;align-items:center;gap:3px}
560
+ .gh i{width:7px;height:7px;border-radius:2px;display:inline-block}
561
+ .gh i.ok{background:var(--ok)} .gh i.bad{background:var(--warn)}
562
+ /* session message thread (M7.6) */
563
+ .msgs{display:flex;flex-direction:column;gap:6px;max-height:220px;overflow:auto;margin-bottom:8px}
564
+ .msg{background:var(--panel-2);border:1px solid var(--line);border-radius:var(--r-sm);padding:6px 9px;font-size:var(--fs-md);color:var(--fg-2);word-break:break-word}
565
+ .msg.out{background:var(--acc-soft);border-color:transparent}
566
+ .msg-f{display:block;font-size:var(--fs-2xs);color:var(--dim);margin-bottom:2px}
567
+ .msg-compose{display:flex;gap:6px}
568
+ .msg-compose input{flex:1;background:var(--panel-2);border:1px solid var(--line);color:var(--fg);border-radius:var(--r-sm);padding:6px 9px;font:400 var(--fs-md) var(--sans)}
569
+ .msg-compose input:focus{border-color:var(--acc);outline:none}
570
+ .msg-compose button{background:var(--acc-soft);border:1px solid transparent;color:var(--acc);border-radius:var(--r-sm);padding:6px 10px;cursor:pointer}
571
+ /* first-run onboarding card */
572
+ .onboard{background:var(--panel);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);padding:28px 30px;display:flex;flex-direction:column;gap:16px;align-items:flex-start;max-width:640px;margin:40px auto}
573
+ .onboard h3{font-size:var(--fs-xl);color:var(--fg)}
574
+ .onboard .px{margin:0 auto}
575
+ .ob-steps{display:flex;flex-direction:column;gap:12px}
576
+ .ob-step{display:flex;gap:12px;align-items:flex-start;color:var(--fg-2);line-height:1.5}
577
+ .ob-step.done{color:var(--dim)}
578
+ .ob-n{flex:none;width:22px;height:22px;border-radius:50%;border:1px solid var(--line);display:inline-flex;align-items:center;justify-content:center;font:600 var(--fs-sm) var(--sans);color:var(--dim);margin-top:1px}
579
+ .ob-step.done .ob-n{background:var(--ok-soft);color:var(--ok);border-color:transparent}
522
580
  /* star nudge (once a month, dismissable) */
523
581
  .nudge{position:fixed;right:18px;bottom:18px;z-index:40;max-width:400px;background:var(--panel);border:1px solid var(--line);
524
582
  border-radius:var(--r);box-shadow:var(--shadow-pop);padding:14px 16px;display:flex;gap:12px;align-items:flex-start;
@@ -535,21 +593,15 @@
535
593
  <header>
536
594
  <button class="icon-btn" id="sbToggle" title="Toggle sidebar" aria-label="Toggle sidebar"><i data-icon="arrow-bar-left"></i></button>
537
595
  <span class="logo"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 11" shape-rendering="crispEdges"><rect x="2" y="1" width="1" height="1" fill="#a3e635"/><rect x="6" y="1" width="1" height="1" fill="#7cc02f"/><rect x="7" y="1" width="1" height="1" fill="#7cc02f"/><rect x="8" y="1" width="1" height="1" fill="#7cc02f"/><rect x="9" y="1" width="1" height="1" fill="#4f7d24"/><rect x="4" y="3" width="1" height="1" fill="#a3e635"/><rect x="7" y="3" width="1" height="1" fill="#7cc02f"/><rect x="8" y="3" width="1" height="1" fill="#7cc02f"/><rect x="9" y="3" width="1" height="1" fill="#7cc02f"/><rect x="10" y="3" width="1" height="1" fill="#7cc02f"/><rect x="11" y="3" width="1" height="1" fill="#7cc02f"/><rect x="12" y="3" width="1" height="1" fill="#4f7d24"/><rect x="1" y="5" width="1" height="1" fill="#a3e635"/><rect x="5" y="5" width="1" height="1" fill="#a3e635"/><rect x="6" y="5" width="1" height="1" fill="#a3e635"/><rect x="7" y="5" width="1" height="1" fill="#a3e635"/><rect x="8" y="5" width="1" height="1" fill="#a3e635"/><rect x="9" y="5" width="1" height="1" fill="#a3e635"/><rect x="10" y="5" width="1" height="1" fill="#a3e635"/><rect x="11" y="5" width="1" height="1" fill="#a3e635"/><rect x="12" y="5" width="1" height="1" fill="#a3e635"/><rect x="13" y="5" width="1" height="1" fill="#4f7d24"/><rect x="4" y="7" width="1" height="1" fill="#a3e635"/><rect x="7" y="7" width="1" height="1" fill="#7cc02f"/><rect x="8" y="7" width="1" height="1" fill="#7cc02f"/><rect x="9" y="7" width="1" height="1" fill="#7cc02f"/><rect x="10" y="7" width="1" height="1" fill="#7cc02f"/><rect x="11" y="7" width="1" height="1" fill="#4f7d24"/><rect x="2" y="9" width="1" height="1" fill="#a3e635"/><rect x="6" y="9" width="1" height="1" fill="#7cc02f"/><rect x="7" y="9" width="1" height="1" fill="#7cc02f"/><rect x="8" y="9" width="1" height="1" fill="#7cc02f"/><rect x="9" y="9" width="1" height="1" fill="#4f7d24"/></svg>Swarm</span>
538
- <a href="#" data-view="fleet" class="nav on"><i data-icon="squares-four"></i>Fleet</a>
539
- <a href="#" data-view="board" class="nav"><i data-icon="stack"></i>Board</a>
540
- <a href="#" data-view="incidents" class="nav"><i data-icon="warning"></i>Incidents<b id="incCount" class="navcount" hidden></b></a>
541
- <a href="#" data-view="prs" class="nav"><i data-icon="git-pull-request"></i>PRs</a>
542
- <a href="#" data-view="timeline" class="nav"><i data-icon="clock-counter-clockwise"></i>Timeline</a>
543
- <a href="#" data-view="spend" class="nav"><i data-icon="coins"></i>Spend</a>
544
- <a href="#" data-view="stats" class="nav"><i data-icon="chart-bar"></i>Stats</a>
545
- <a href="#" data-view="search" class="nav"><i data-icon="magnifying-glass"></i>Search</a>
546
596
  <span class="sp"></span>
547
597
  <span id="today"></span>
548
598
  <span id="daemon"><span class="dot"></span><span class="lbl">Daemon</span></span>
599
+ <button class="icon-btn" id="palBtn" title="Jump to view, project or session (⌘K)" aria-label="Open command palette"><i data-icon="magnifying-glass"></i></button>
549
600
  <button class="icon-btn" id="feedback" title="Send feedback (opens a GitHub issue)" aria-label="Send feedback"><i data-icon="comment-text"></i></button>
550
601
  <button class="icon-btn" id="settings" title="Settings" aria-label="Settings"><i data-icon="sliders"></i></button>
551
602
  </header>
552
603
  <aside>
604
+ <nav id="viewnav"></nav>
553
605
  <div id="projects"></div>
554
606
  </aside>
555
607
  <main id="main"></main>
@@ -1,2 +1,2 @@
1
1
  // generated by tools/build.ts from CHANGELOG.md
2
- window.RELEASE_NOTES = {"0.8.0":{"date":"2026-08-23","html":"<p>The trust release: Swarm becomes something a team and a security reviewer can rely on, without giving up local-first. An org can pin the rules that matter and they hold even when the daemon is down; every record says who did it; the daemon has a credential; what is stored is exportable and redactable; a second agent can be the reviewer. And the dashboard stopped looking like a list of tables.</p>\n<h4>Added</h4>\n<ul><li><b>Org policy layer</b> — a third config file, <code>~/.swarm/policy.toml</code> (or <code>$SWARM_POLICY</code>), sits under global and repo config and may declare <code>locked = [\"rules.destructive_git\", \"rules.protected\", …]</code>: dotted keys or whole subtrees the layers below cannot change. A locked key keeps the policy's value, every attempt to override it is a <code>policy</code> incident, and <code>swarm doctor</code> shows which file set each value and who tried to change it. <code>GET /v1/policy</code> exposes provenance (M8.1).</li><li><b>Tamper detection</b> — on every session start the daemon checks that all ten hook entries are still in <code>~/.claude/settings.json</code> with a sane timeout, that no lower config layer fights a locked key, and that <code>SWARM_GUARD=off</code> isn't set while the policy locks rules (it is then ignored). Each finding opens a <code>policy</code> incident once; <code>swarm doctor</code> prints the same (M8.1b).</li><li><b>Fail-closed for locked rules</b> — while the policy locks any rule the daemon keeps <code>~/.swarm/policy.cache.json</code> (locked modes + a snapshot of live sessions and held worktrees, integrity-hashed). If the daemon is unreachable on a tool call, the hook shim enforces exactly those rules from the cache; everything else still fails open (M8.1c, OQ-3 resolved).</li><li><b>Who did it</b> — every ledger record and every event carries an <code>actor</code> (<code>human</code> / <code>agent</code> / <code>run</code> / <code>daemon</code> + id); existing rows were back-filled from the owner strings clients always sent. Schema changes now go through versioned migrations (<code>/v1/health</code> and <code>doctor</code> report the schema version) (M8.2a).</li><li><b>Daemon token</b> — the daemon creates <code>~/.swarm/token</code> on first start; the CLI, MCP server, hook shim and <code>swarm ui</code> send it. Local callers may still omit it by default; <code>[daemon] auth = \"required\"</code> makes every call carry it, a wrong token is always refused, and anything that isn't loopback always needs it (M8.2b).</li><li><b>Audit log + export</b> — the ledger-changing subset of events (claims, worktrees, PRs, questions, dispatch, resources, processes, gates, handoffs, permissions, incidents, run results, session start/end), with actor: <code>swarm audit export [--since 30d] [-p] [--type …] [--format jsonl|csv|json]</code> and <code>GET /v1/audit</code>. Retention is split — <code>[events] retain_days = 30</code> for chatter, <code>[audit] retain_days = 0</code> (forever) for audit rows (M8.2c).</li><li><b>Privacy on ingest</b> — <code>[privacy] store_prompts = false</code> keeps the event but not the prompt text, <code>store_reasoning = false</code> keeps token counts but not assistant text, <code>redact = [\"ACME-[0-9]+\"]</code> scrubs stored strings; API-key-looking tokens and <code>Bearer …</code> credentials are always redacted. Global-only keys an org can lock (M8.2c).</li><li><b>Review as a gate</b> — <code>[gates.review] builtin = \"review\"</code> (optional <code>model</code>, <code>timeout</code>) spawns a read-only <code>claude -p</code> over the worktree's diff with a fixed rubric. The verdict is derived from the findings (any blocker/major fails, whatever the reviewer claims), findings are the evidence, and a reviewer that times out or won't answer in JSON is a fail with that reason. Same registry, logs, incidents and triggers as executed gates (M7.9).</li><li><b>Project settings</b> — sidebar menu → <b>Settings…</b>: name, icon (any emoji — a quick row, a browse-all grid, or the OS picker — or an image file, downsized to a square), a color slot, pinned. The glyph replaces the folder icon everywhere the project appears.</li><li><b>Board that is a board</b> — a KPI strip (live / held / worktrees / ready / incidents), tasks as a kanban (Ready · In progress · Blocked · Done), and a worktree map of tiles grouped by project and colored by live / dirty / unpushed / merged. Tasks and Worktrees keep a Cards | Table toggle.</li><li><b>Row menus</b> — every row on the Board, PRs and Incidents has one menu (hover kebab, right-click, or Enter) carrying its actions — open, diff, PR, run, claim, gates, release, stop, ack, codify, merge, copy — instead of inline links; destructive ones last and confirmed. Menus are wider and labels never ellipsize.</li></ul><h4>Changed</h4>\n<ul><li><code>doctor</code> reports the daemon and schema version, per-event hook coverage, and the policy file with its locked keys.</li><li><code>/v1/health</code> reports <code>schema</code> and <code>auth</code>.</li></ul><h4>Fixed</h4>\n<ul><li>Scratch repositories under the OS temp dir (test fixtures, spawned-run clones) no longer appear as projects in the sidebar.</li><li>Fleet's <code>now</code> column had no room; ended sessions show their last assistant line instead of \"session ended\".</li><li>Incidents show the command's gist (the leading <code>cd … &amp;&amp;</code> stripped) and <code>(removed)</code> instead of a raw id for a deleted project; Spend's attribution tables lost their empty first column.</li><li>Emoji tiles and the icon preview no longer clip in the desktop app's WebKit view.</li></ul>"},"0.7.0":{"date":"2026-08-23","html":"<p>The orchestrate release: Swarm runs a task end to end on its own and you stay in control. New worktrees start warm, gates execute instead of being vouched for, <code>swarm dispatch</code> hands ready tasks to autonomous runs whose outcome is derived from the ledger, an agent that needs a human decision can ask for one, and a budget keeps the bill in bounds.</p>\n<h4>Added</h4>\n<ul><li><b>Budgets</b> — <code>[budget] daily = 25</code> / <code>weekly = 100</code> in <code>.swarm.toml</code> puts a spend ceiling on a repo, judged from the same transcript-priced numbers as the Spend view. At <code>warn_at</code> (80%) a <code>budget</code> incident opens; past 100% <code>on_exceed</code> decides: <code>\"warn\"</code>, <code>\"ask\"</code> (every Bash / Edit / Write in the repo asks first), or <code>\"stop\"</code> (spawned runs stopped, dispatch queue cleared). One incident per level per day; a budget tile on the Spend view.</li><li><b>Run profiles</b> — <code>swarm run --profile no-edits|read-only</code> (and the Run / Dispatch drawers, <code>[dispatch] profile</code>) narrow what a spawned agent may do: <code>no-edits</code> keeps the shell but not the file tools, <code>read-only</code> keeps only read and search.</li><li><b><code>swarm_context</code></b> — an agent can re-read what Swarm told it at session start, current as of now (holds, lease left, handoff, gates, resources, rule modes), plus answers to its questions. <code>GET /v1/context</code>. And <code>swarm install</code> now registers the same MCP server with <b>Codex CLI</b> and <b>Gemini CLI</b> when they're installed, so they get the <code>swarm_*</code> tools too (M7.10).</li><li><b>Ask the human</b> — an agent that hits a decision only a person can make calls <code>swarm_ask</code> (with optional suggested answers). The question shows on the session page under <b>waiting on you</b> with the options as buttons, the session gets an <b>Asking</b> badge on Fleet, and a desktop notification fires. Answer there, or <code>swarm answer &lt;id&gt; &lt;text&gt;</code>; <code>swarm questions</code> lists what's open. The answer reaches the agent by itself — stdin for a spawned run, <code>[swarm]</code> context on the next tool call for an interactive session, <code>swarm_inbox</code> on demand — and a session starting later in the same task's worktree is told about open questions and answers that never arrived (M7.7).</li><li><b>Dispatch</b> — <code>swarm dispatch --ready</code> (or pick tasks; the <b>Dispatch</b> chip on the Board's Tasks; <code>swarm_dispatch</code> from a lead agent) hands ready tasks to autonomous runs: each gets its own claim and worktree and a <code>claude -p</code> run told to work there, run the gates, hand off and open the PR; <code>[dispatch] max_parallel</code> (default 2) run at once per repo, the rest queue. When a run ends Swarm derives the outcome from the ledger — executable gates re-run by the daemon, PR looked up on the forge — and reports <b>done</b>, <b>gates-failed</b>, <b>no-pr</b>, <b>crashed</b> or <b>stopped</b>; anything short of done opens a <code>dispatch_failed</code> incident and keeps the claim for you to resume or release. A dispatched run never edits the task list. <code>swarm dispatch status | clear</code>, <code>GET/POST/DELETE /v1/dispatch</code>, a <b>Dispatch</b> section on the Board (M7.5).</li><li><b>Diff and Open PR</b> — every worktree row on the Board (and a session page whose cwd is a worktree) gets <b>Diff</b>: the commits and files it carries beyond the main checkout's branch, uncommitted and untracked changes included, with a coloured unified diff per file. <b>PR</b> pushes the branch and opens a pull request (<code>gh</code>) or merge request (<code>glab</code>) prefilled from the task's title, the latest handoff, the required gates as a checklist and the file list — editable before it goes; refuses uncommitted changes, reuses an open PR for the branch. <code>swarm wt diff</code>, <code>swarm pr open [--dry-run]</code>, MCP <code>swarm_pr_open</code>; a <code>pr.opened</code> event on the Timeline (M7.3).</li><li><b>Gates that run themselves</b> — a gate with a command in <code>.swarm.toml</code> (<code>[gates.tests] cmd = \"bun test\"</code>, optional <code>timeout</code> / <code>cwd</code>) is executed rather than vouched for: <code>swarm gate run &lt;task&gt;</code> (or <code>swarm_gate_run</code> from the agent, or <b>Gates</b> on a held task row on the Board) runs every required gate that has a command inside the task's worktree and records the verdict — exit 0 passes, the rubric is the command and how it ended, the evidence is the output tail, the log lives in <code>~/.swarm/logs</code>. Runs go through the process registry and are killed at <code>timeout</code>. When a session in a held worktree ends, the daemon runs them on its own and writes the verdicts into that session's auto-handoff (<code>[gates] auto = \"session-end\" | \"stop\" | \"off\"</code>) (M7.4).</li><li><b>Worktrees without a task</b> — <code>swarm wt create &lt;name&gt;</code> makes a worktree for a spike or a review checkout (under <code>~/.swarm/worktrees/&lt;project&gt;/</code>, branch <code>wt/&lt;name&gt;</code>, bootstrapped like a claim); <code>swarm wt</code> lists every worktree with <b>drift</b> against the main checkout's branch (<em>N behind</em>, <em>merged</em>); <code>swarm wt open</code> opens it with <code>[worktree] open = \"code {path}\"</code> or the file manager; <code>swarm wt rm</code> removes it with the same refusals as <code>release</code> (dirty, unpushed, never the main checkout, never a held claim); <code>swarm wt gc [--apply]</code> finds worktrees whose branch was merged or whose claim was released and the folder left behind. The Board's Worktrees section gets the drift column, <b>Open</b> / <b>Remove</b> per row, <b>New worktree</b> and <b>Collect stale</b> (M7.2).</li><li><b>Warm worktrees</b> — <code>.swarm.toml [worktree] copy = [\".env.local\"]</code> and <code>setup = \"bun install\"</code> bootstrap every new worktree: the files are copied from the main checkout as the claim is made and <code>setup</code> runs inside the worktree in the background (log in <code>~/.swarm/logs/&lt;project&gt;/bootstrap-&lt;task&gt;.log</code>, a <code>worktree.bootstrapped</code> event on the Timeline). <code>swarm run</code> waits for it before starting the agent; an interactive <code>swarm claim</code> prints the log path and returns at once. A failing setup opens a <code>bootstrap_failed</code> incident but never takes the claim away. Paths are repo-relative only (M7.1).</li></ul><h4>Fixed</h4>\n<ul><li>The Fleet agent badge no longer renders a stray \"…\" after the pill: badge-only cells clip instead of ellipsizing, and the column got a few more pixels.</li></ul>"},"0.6.0":{"date":"2026-08-23","html":"<p>The learn release: the data Swarm has been collecting starts paying back. Replay what an agent did, see what each task cost, turn an incident into a rule, resume a session that died, try a rule on history before switching it on, read your backlog from GitHub or Linear, and search everything Swarm remembers.</p>\n<h4>Added</h4>\n<ul><li><b>Session Replay</b> — a <b>Replay</b> button on any session steps through its tool calls one at a time, showing the full input and output of each (Prev/Next, a slider, ←/→ keys). See exactly what an agent did, in order (M4.1).</li><li><b>Cost by task</b> — the Spend view attributes cost and tokens to each task (matched to a claim by the session's worktree), plus a <b>Context budget</b> table ranking sessions by how much context they re-processed — a signal for agents re-reading the same material. <code>GET /v1/attribution</code> (M4.2).</li><li><b>Codify an incident</b> — the Incidents feed has a <b>Codify</b> action that turns an incident into a <code>.swarm.toml</code> rule snippet and a CLAUDE.md lesson, both copyable. A rule that keeps firing as <code>ask</code> suggests hardening to <code>deny</code> (M4.3).</li><li><b>Desktop notifications</b> — opt-in native notifications (settings menu) for a spawned run waiting on a permission, or a claim orphaned with unfinished work; clicking opens the Allow/Deny card or the Board. Quiet while you're looking at the dashboard (M4.7).</li><li><b>Auto-handoff, and resume where it died</b> — whenever a session working in a claimed worktree pauses or ends, Swarm derives a handoff from what it did: files edited, the last verification-looking command, the last request, the last thing it said. One <code>auto:</code> handoff per session, replaced on every pause, silenced by a handoff left on purpose. An ended session's page gets <b>Resume where it died</b>, which spawns a run on the task from that handoff plus the session's last actions; <code>swarm run resume &lt;session-id&gt;</code>; <code>GET/POST /v1/sessions/:id/resume</code> (M4.4).</li><li><b>Rule dry-run</b> — <b>Dry-run rules</b> on the Incidents view replays a project's recorded tool calls through the rules under modes you pick: what would have been asked or denied, per rule, before you switch anything on. It also flags <b>flaky signals</b> — a rule that keeps firing on the same command that is then allowed through anyway. Nothing is recorded. <code>swarm rules dryrun [--set rule=mode,…]</code>; <code>GET /v1/rules/dryrun</code> (M4.6).</li><li><b>GitHub Issues and Linear as task sources</b> — <code>[tasks] source = \"github\"</code> reads the repo's issues through the logged-in <code>gh</code> (optional <code>labels</code> filter); <code>source = \"linear\"</code> reads Linear through its API with <code>LINEAR_API_KEY</code> from the daemon's environment (optional <code>team</code>). Both land in the Board's Tasks, <code>swarm tasks</code> and <code>swarm_next_task</code> like a markdown backlog: closed/completed is done, in-progress is active, <em>depends on #n</em> / <em>blocked by</em> become dependencies. Read-only; no credential stored (M4.8).</li><li><b>What's New in the app</b> — the dashboard shows the release notes for the running version: a <b>What's New</b> item in the settings menu, in the desktop app's <b>Swarm</b> menu, and in the tray. It also opens once on its own the first time you run a new version. Notes are parsed from <code>CHANGELOG.md</code> into <code>release-notes.js</code> at build time, so they work offline with no repo checkout.</li><li>The desktop <b>Check for Updates…</b> is in the system menu bar (Swarm menu), not only the tray.</li></ul>"},"0.5.0":{"date":"2026-08-22","html":"<p>The drive release: Swarm doesn't just watch agents now — it starts them, in a claimed worktree, and brokers what they're allowed to do. Plus the coordination primitives that make an autonomous run safe to leave alone: leases that renew themselves, gates that gate, and a handoff the next session reads on its own.</p>\n<h4>Added</h4>\n<ul><li><b><code>swarm run</code></b> — spawn an agent on a task. <code>swarm run --task login-form --prompt \"…\"</code> claims the task and the daemon starts <code>claude -p</code> in its worktree with stream-json on both ends. Steer it with <code>swarm run send</code>, stop it with <code>swarm run stop</code> (stdin closed, then the process registry's pid-based TERM/KILL — never by pattern), list with <code>swarm run ls</code>. The session shows in Fleet as ▶ spawned and is ingested like any other; every finished turn is a <code>run.result</code> event with cost and turns (M3.1).</li><li><b>Run from the dashboard</b> — Ready (or held) task rows on the Board get a <b>Run</b> action: a drawer with the prompt prefilled from the task, permission mode, model and max turns (⌘⏎ to submit). The spawned session opens with a stdin box to steer it and a <b>Stop</b> button (M3.3).</li><li><b>Permission broker</b> — a <code>swarm run</code> agent's tool-permission prompts go through the same rules as your interactive sessions: a rule <code>deny</code> auto-denies with the reason, an unflagged tool auto-allows so the agent can make progress, and anything the rules mark <code>ask</code> is held and surfaced on the session as an <b>Allow / Deny</b> card. No blocking on a terminal you can't see. Uses <code>--permission-prompt-tool stdio</code>; <code>POST /v1/runs/:id/permissions/:reqId</code> (M3.2).</li><li><b>Leases renew themselves.</b> A session working inside a claimed worktree extends the lease on any activity (hook or transcript growth) once it is past half-way — no more <code>swarm renew</code> in a long session. Expired leases whose worktree still holds uncommitted or unpushed work are marked <b>Orphaned</b> within a minute and open an <code>orphaned_claim</code> incident; nothing is removed automatically (M1.2).</li><li><b>Handoffs, injected on start</b> — <code>swarm handoff &lt;task&gt; --done … --remaining … [--files] [--verify]</code> (or <code>swarm_handoff</code>) records what the last holder leaves; <code>swarm resume</code> / <code>swarm_resume</code> reads it. The next session that starts inside that task's worktree gets it automatically as <code>SessionStart</code> context, along with what it holds and the lease left, gate status, held resources, and the repo's rule modes (M1.3).</li><li><b>Gates</b> — verification runs recorded against a task: <code>swarm gate record login-form review pass --rubric \"tests green, error paths read\"</code> (or <code>swarm_gate_record</code>). A run without a rubric is rejected; the latest run per gate decides; failed runs are never deleted and open a <code>gate_failed</code> incident. <code>.swarm.toml [gates] required = [\"review\"]</code> declares what every task must pass; the Board's Tasks grid shows ✓ / ✗ / — per gate and a <b>Recent gates</b> section lists the runs (M2.2).</li><li><b>The MCP tools finally connect.</b> <code>swarm_status</code>, <code>swarm_claim</code>, <code>swarm_next_task</code>, <code>swarm_handoff</code>, <code>swarm_gate_record</code>, <code>swarm_acquire_resource</code> and the rest are reachable from Claude Code — see the fix below.</li><li>Dashboard deep links (<code>?view=board&amp;project=&lt;id&gt;&amp;session=&lt;id&gt;</code>) and a screenshot carousel with a lightbox on the website; <code>tools/screens.ts</code> re-captures the shots with Playwright at 2×.</li></ul><h4>Fixed</h4>\n<ul><li><b>Swarm's MCP tools were never reachable.</b> <code>swarm install</code> wrote <code>mcpServers.swarm</code> into <code>~/.claude/settings.json</code>, which Claude Code ignores — user-scope MCP servers live in <code>~/.claude.json</code> (what <code>claude mcp add -s user</code> edits). Install now registers there (and cleans the stale settings.json entry); <code>claude mcp list</code> shows <code>swarm ✔ Connected</code>. <b>Re-run <code>swarm install</code> after upgrading.</b></li><li><b>The daemon reads global config from where its state lives.</b> <code>[rules]</code> / <code>[gates]</code> / <code>[tasks]</code> in <code>~/.swarm/config.toml</code> are resolved against the daemon's home (<code>SWARM_HOME</code>), matching the DB and logs — spawned runs, which execute in a worktree without the repo's <code>.swarm.toml</code>, still see machine-wide rules.</li></ul>"},"0.4.1":{"date":"2026-08-22","html":"<h4>Fixed</h4>\n<ul><li><b>PRs view went dark under the desktop app.</b> A daemon launched from the Dock gets macOS's bare GUI <code>PATH</code>, so Homebrew's <code>gh</code> / <code>glab</code> were invisible and the forge silently returned nothing. The daemon now also looks in <code>/opt/homebrew/bin</code>, <code>/usr/local/bin</code>, Linuxbrew and <code>~/.local/bin</code>; <code>swarm doctor</code> reports forge CLI auth and warns when <code>glab</code> relies on a shell-only <code>GITLAB_TOKEN</code>.</li><li>Icons are vertically centred on their text again (<code>vertical-align: middle</code> instead of a fixed <code>-3px</code> tuned for the old type scale).</li><li>npm publish moves to <b>trusted publishing</b> (OIDC, no <code>NPM_TOKEN</code>), the same setup as fancy-menus.</li></ul>"},"0.4.0":{"date":"2026-08-22","html":"<p>The enforcement release: rules that watch file writes, not just Bash; a backlog Swarm can read; servers Swarm starts and stops by pid; and an Incidents feed you can clear.</p>\n<h4>Added</h4>\n<ul><li><b>Rules on file writes</b> — two new rules evaluated on <code>Write</code> / <code>Edit</code> / <code>MultiEdit</code> / <code>NotebookEdit</code> paths (and Bash working directories), not only Bash commands. <code>no_foreign_worktree</code> (default <code>ask</code>) stops a session from editing inside a worktree another claim holds — <em>never touch a worktree you don't hold</em> is now a hook decision, with holding inferred from the session's cwd. <code>claim_required_to_write</code> (opt-in) makes a repo's shared checkout read-only without a claim: claim a task, get a worktree, write there. Both per repo as <code>ask | deny | off</code>.</li><li><b>Incidents view</b> — the denied-action feed as its own tab: Open / All, per-rule counts, reason and session per row, <b>Ack</b> and <b>Ack all</b>; the open count sits in the nav. <code>GET /v1/incidents?open=1&amp;project=</code>, <code>POST /v1/incidents/:seq/ack</code>, <code>POST /v1/incidents/ack</code>, <code>/v1/state.openIncidents</code>. The Board keeps a short open-only section.</li><li><b>Task source</b> — <code>.swarm.toml</code> <code>[tasks] source = \"docs/plan.md\"</code> points at a markdown file whose <code>ID | Task | Depends | Status</code> tables are the backlog (✅ / 🟡 / ⚪, dependencies by task id or milestone prefix). The Board gets a <b>Tasks</b> section (Ready / Open / All, <em>Claim</em> per row), the CLI <code>swarm tasks [--ready]</code>, and agents <code>swarm_next_task</code> — the first unclaimed task whose dependencies are done. Swarm's own roadmap is its task source. Markdown only (OQ-5 decided).</li><li><b><code>swarm serve</code> / <code>swarm proc</code></b> — <code>swarm serve start --name web -- npm run dev</code> allocates a free port (ledger + bind probe), runs the command detached with <code>PORT</code> set and logs under <code>~/.swarm/logs/&lt;project&gt;/</code>, registers pid + start time, and acquires the singleton — so a second <code>web</code> fails closed and the port is protected for every other session with no config. <code>serve ls | stop [name|pid]</code>, <code>proc start | ls | stop</code> for workers without a port. Stop signals registry pids only, verified by start time; nothing is ever killed by pattern. <code>POST /v1/ports/allocate</code>, <code>GET/POST/DELETE /v1/processes</code>; <b>Processes</b> section on the Board with <em>Stop</em>.</li><li><b>Star nudge</b> — once a month at most, never on first open, the dashboard asks for a GitHub star. <em>Later</em> snoozes 30 days, <em>Don't ask again</em> is final; localStorage only.</li><li><b>Sidebar drag-and-drop</b> — pinned projects reorder by dragging; the order persists on the daemon (<code>PUT /v1/projects/order</code>, <code>Project.order</code>).</li><li><b>Desktop app menu</b> — a real application menu (Swarm / Edit / View / Window): ⌘C/⌘V work, <b>View › Zoom In / Zoom Out / Actual Size</b> (<code>⌘+</code> <code>⌘−</code> <code>⌘0</code>) scale the dashboard (persisted), plus Reload and Full Screen.</li></ul><h4>Fixed</h4>\n<ul><li><b>Shared-tree rules no longer lose sight of a session mid-turn.</b> <code>shared_tree</code> / <code>destructive_git</code> keyed on a 2-minute last-seen window fed only by hooks, so a neighbour three minutes into a long turn became invisible — and its uncommitted work unguarded. Transcript growth now counts as activity (the tailer bumps <code>last_seen_at</code>), and the liveness window is the daemon's 10-minute idle threshold (<code>LIVE_WINDOW_MS</code>). A false positive costs one confirmation; a false negative cost someone's work.</li><li><code>destructive_git</code> also matches <code>git stash drop</code>, <code>git stash clear</code> and <code>git branch -D</code>.</li><li>Dashboard type scale is one step larger across the board (base 13 → 14 px; the smallest labels 10 → 11 px) — it had drifted too small, especially in the desktop app.</li><li>The <b>PRs</b> tab icon (and the branch/commit glyphs) were near-invisible at 15 px; they use the pixelarticons <em>sharp</em> variants now.</li><li>The daemon dot stayed red for up to 15 s after load on a healthy connection (the SSE stream sent nothing until its first heartbeat); the stream now flushes immediately.</li><li>The nav flashed \"Fleet\" before the restored tab was applied; session-detail event kinds (<code>userpromptsubmit</code>) no longer overflow into the message column; \"Unpinned · seen, not pinned\" keeps its spacing.</li></ul><h4>Changed — docs</h4>\n<ul><li>README and site now say what the code does: Codex CLI and Grok sessions are tailed alongside Claude Code; the requirements and architecture diagram list all three.</li><li>Rules are described as <b>guardrails against accidents, not a sandbox</b> — the guide has a new \"What rules are — and aren't\" section spelling out that a denied Bash command can be routed around (script, heredoc, direct file edit), and that worktree isolation via claims is the real fix. The site's feature cards lead with claims, rules and resources instead of Fleet and Spend.</li></ul><h4>Changed — performance</h4>\n<ul><li><b>Daemon never spawns <code>git</code> on a request.</b> Worktree status (<code>git worktree list</code> + <code>status</code>/<code>rev-list</code> per worktree, ~0.8 s across a fleet) moves to a 15 s background refresh with async <code>Bun.spawn</code>; <code>/v1/state</code> serves the cache (612 ms → ~15 ms). Claim/release invalidate it.</li><li><b>Hook round-trips are two indexed statements</b>, not two <code>git rev-parse</code> spawns plus a transcript-directory scan: <code>cwd → project</code> is cached 60 s, the inline transcript tail is debounced to once per 2 s per session (the 5 s tailer covers steady state), and subagent directories are re-listed only when their mtime moves.</li><li><b>Events store ~2 KB, not ~10 KB.</b> <code>tool_input</code> is clipped at 2 KB and <code>tool_response</code> at 4 KB in <code>payload</code> (<code>{truncated, bytes, preview}</code>), and the tool I/O is no longer duplicated in <code>raw</code>. Existing databases are rewritten once on boot and <code>VACUUM</code>ed (96 MB → 27 MB here). Retention: events older than 30 days are pruned daily (incidents kept), <code>raw</code> is cleared after 7 days.</li><li><b>Wire shape.</b> SSE frames, <code>GET /v1/events</code> replays and <code>GET /v1/sessions/:id/events</code> carry <code>seq/ts/type/projectId/sessionId/payload{hook,summary,…}</code> only — no <code>raw</code>, no tool I/O (a 5.5 MB session fetch is now ~150 KB). <code>GET /v1/events/:seq</code> returns one stored event in full; <code>?full=1</code> on the SSE replay does the same. <code>?since=0</code> replays the last 200 events, not the table.</li><li><b>Incremental session view</b> — <code>GET /v1/sessions/:id/events?after=&lt;seq&gt;&amp;afterTs=&lt;iso&gt;</code>; the dashboard appends instead of re-fetching 500 events + 500 turns on every hook.</li><li><b>Dashboard render loop</b> — one <code>requestAnimationFrame</code> scheduler, snapshot <code>seq</code> short-circuit, paused while the tab is hidden, exponential SSE reconnect backoff; session log merges two sorted lists and caches rendered rows; data-grid memoises persisted layout and uses one <code>Intl.Collator</code>; charts memoise the turn strip.</li><li>SQLite: indexes on <code>events(type, seq)</code> and <code>turns(ts)</code>, <code>mmap_size</code> 256 MB, cached prepared statements (<code>db.query</code>), <code>sessions</code>/<code>spend</code>/<code>incidents</code> memoised per write generation; <code>/v1/spend</code> is its own endpoint.</li><li>Background tick: Codex/Grok discovery every 15 s when idle; Grok <code>summary.json</code> re-read only on mtime change.</li></ul>"},"0.3.0":{"date":"2026-08-22","html":"<p>The coordination release: rules you can configure, runtime resources agents can hold, and the merge queue at the end of the loop.</p>\n<h4>Added</h4>\n<ul><li><b>Config system</b> — <code>~/.swarm/config.toml</code> (global) deep-merged with an optional <code>&lt;repo&gt;/.swarm.toml</code>. Lenient validation: bad config can never take the daemon down. Daemon port preference is <code>SWARM_PORT</code> &gt; config &gt; 7777. See <code>docs/13-config.md</code>.</li><li><b>Rule engine v2</b> — every rule is per-repo configurable as <code>ask | deny | off</code>: <code>shared_tree</code>, <code>destructive_git</code>, <code>pattern_kill</code>, and the new <code>protected_ports</code> (kill/free of a configured port — <code>lsof | kill</code>, <code>fuser -k</code>, <code>kill-port</code> — is asked or denied). <code>deny</code> is returned to Claude Code as a real permission denial.</li><li><b>Incidents</b> — every non-allow decision is recorded (<code>incident.opened</code>: rule, action, command, reason), exposed at <code>GET /v1/incidents</code>, included in <code>/v1/state</code>, and shown on the Board.</li><li><b>Runtime resources (Phase 1)</b> — named singletons for what agents fight over at runtime (dev servers, databases, ports). Fail-closed acquire: holdings live while their pid runs or their lease hasn't expired; the same owner refreshes; dead holdings reap instead of blocking. Release is fail-closed too (owner required, <code>--force</code> overrides). Held ports automatically join the protected-ports rule — acquiring <code>db</code> on 5432 guards <code>lsof -ti:5432 | xargs kill</code> for every other agent, no config needed. HTTP <code>GET/POST /v1/resources</code>, <code>DELETE /v1/resources/:name</code>; MCP <code>swarm_acquire_resource</code> / <code>swarm_release_resource</code> / <code>swarm_resources</code>; CLI <code>swarm res ls|acquire|release</code>.</li><li><b>PRs view</b> — one merge queue across GitHub and GitLab. Forge detection from the git remote (ssh/https, GitLab subgroups, self-hosted), polled through the locally-authenticated <code>gh</code> / <code>glab</code> CLIs with the project root as cwd — no tokens stored, 2-minute per-project cache floor. <code>GET /v1/prs</code>, <code>POST /v1/prs/merge</code> (squash). Merge is offered only on green, mergeable, non-draft rows, behind a confirm.</li><li><b>Board view</b> — Claims, Worktrees, Resources, and Incidents move out of Fleet into their own view; Fleet shows sessions only (Live + Earlier). Last view and project selection persist across reloads.</li><li><b>Stats view</b> — <code>GET /v1/stats</code>; activity line, calendar heatmap, and streaks (daily buckets in local time, DST-immune). <code>swarm stats</code> on the CLI.</li><li><b>Data-grid everywhere</b> — Claims, Worktrees, Resources, Incidents, PRs, and all six Spend tables render through the same sortable / resizable / reorderable grid with per-column filters, a column-visibility menu, and persisted layouts. Header ticks and tooltips make the affordances discoverable.</li><li><b>Desktop: Check for Updates…</b> in the tray menu, wired to the Tauri updater with native dialogs (available / up-to-date / failed) and install-and-restart on accept.</li><li><b>Agent badge</b> on every Fleet and session row, so mixed-agent fleets are labelled consistently.</li><li><b>Website</b> — getswarm.vercel.app: OS-detected downloads from the latest GitHub release, the <code>bunx</code> one-liner, sharing tags with hero art, and (this release) rendered docs and release notes.</li><li><b>Design tokens</b> — the dashboard's CSS contains zero raw hex / rgba / font-size / duration values; the system is documented in <code>docs/12-design-tokens.md</code> with a drift grep.</li><li>Swarm now dogfoods its own rules via the repo's <code>.swarm.toml</code> (<code>shared_tree</code> / <code>destructive_git</code> deny, daemon port protected).</li></ul><h4>Fixed</h4>\n<ul><li><b>Hook resilience</b> — the PreToolUse hook falls back to the default port when <code>daemon.json</code> points at a dead daemon, so a crashed daemon no longer silently disables the guard (this was the gap behind a real <code>git add -A</code> collision).</li><li>Resource liveness: pid 0 was treated as a live process (<code>kill(0)</code> addresses the process group), so those holdings never reaped; tracked pids are now <code>&gt; 0</code>. <code>heldPorts()</code> is one SELECT on the hook path; lazy reap on acquire, sweep on the 5 s tick. Unknown session IDs on acquire no longer mint phantom sessions.</li><li>Session view is two equal columns again (a bare <code>aside</code> selector in the sidebar-collapse CSS captured the session side panel); the log keeps your scroll position across live updates and follows the tail only when pinned to the bottom.</li><li>A pinned project whose root vanished is merged into the live same-name entry (repo renames produced duplicate sidebar rows); the sidebar <code>⋯</code> appears on hover in the count's slot and reserves no space.</li><li>Desktop: quit actually quits, window close hides (macOS convention) and the dock icon restores it, and the <code>swarmd</code> sidecar dies with the app. Dev builds serve the repo's live dashboard instead of a stale staged snapshot.</li><li>Release pipeline: npm publish is skipped cleanly when <code>NPM_TOKEN</code> is absent (since 0.4.1: trusted publishing, no token).</li></ul>"},"0.2.2":{"date":"2026-08-21","html":"<h4>Added</h4>\n<ul><li>Publishable <code>@ra3orblade/swarm</code> npm package (bundled bins + dashboard); <code>bunx @ra3orblade/swarm setup</code> onboarding.</li><li>Enterprise data-grid for Fleet with a collapsible sidebar; pixel-art icon set and bespoke empty-state illustrations; folder picker; green chart palette.</li><li>Desktop: macOS window chrome, animated pixel-logo splash, free-port daemon startup.</li></ul><h4>Fixed</h4>\n<ul><li>Release builds bundle every platform target; Linux ships <code>.deb</code> + <code>.rpm</code> (AppImage disabled until <code>linuxdeploy</code> on GitHub runners is debugged).</li></ul>"},"0.0.6":{"date":"2026-08-21","html":"<p>First signed and notarized macOS desktop build; <code>release.yml</code> became a three-OS matrix (macOS / Windows / Linux) with a native sidecar per runner.</p>"}};
2
+ window.RELEASE_NOTES = {"0.10.0":{"date":"2026-08-24","html":"<p>The team release: Swarm outgrows one laptop. A self-hosted team daemon gives a group one view — machines, cluster-wide claims, spend by person — while every laptop stays local-first and keeps working offline. Two more agent brands land (six total), and the dashboard starts reading the fleet's behaviour, not just its numbers: outcomes, stalls, collisions.</p>\n<h4>Added</h4>\n<ul><li><b>Team daemon</b> — <code>swarm-teamd</code> (<code>packages/team</code>), a second, self-hosted service your machines <em>forward</em> to: audit events, spend rollups and claims — never transcript text unless a machine opts in, and always after your redaction rules. The local daemon queues everything in an outbox (batched, at-least-once, never on the hook path) and drains it when the team daemon is reachable; <code>swarm doctor</code> shows the lag. One SQLite file of state, TLS by reverse proxy, <a href=\"https://getswarm.vercel.app/docs/11-teams\" target=\"_blank\" rel=\"noopener\">guide</a> (M8.3). <em>Licensing: this one package is source-available (<a href=\"https://github.com/ra3orblade/swarm/blob/main/packages/team/LICENSE.md\" target=\"_blank\" rel=\"noopener\">FSL-1.1-ALv2</a>, Apache-2.0 after two years); everything else is and stays Apache-2.0 — one machine free, a second person is the product (OQ-15).</em></li><li><b><code>swarm login</code></b> — OIDC device-code sign-in against the team daemon (which is the OAuth client — your laptop never holds an OIDC credential; a static shared token or open mode for labs). First user becomes admin; roles are viewer / developer / admin. Login registers the machine (its token is bound to you) and pins the org's policy signing key. <code>swarm install --config-url &lt;url&gt;</code> is the one-flag fleet onboarding (M8.3c/f).</li><li><b>Cluster-wide claims</b> — a claim taken on one machine registers upstream; a second machine claiming the same task is refused with the holder's name (<code>alice@her-laptop</code>), and if the cluster says someone else holds it, the local claim is revoked — the worktree is never touched. Offline degrades to local-only, fail-closed as ever (M8.3d).</li><li><b>Team dashboard</b> — served by the team daemon: machines (live / quiet), active cluster claims, spend today / by project / <b>by user</b> / by machine / by day, and the forwarded activity feed, live over SSE (M8.3e).</li><li><b>Signed org policy</b> — an admin posts the org's <code>policy.toml</code> once; every machine fetches it, verifies the ed25519 signature against the key pinned at login, and installs it as the org layer — locked rules included. A tampered policy is reported and never installed (M8.3f, closes the OQ-3 signing deferral).</li><li><b>Team budgets + chargeback</b> — org / user / project ceilings (daily + monthly) set on the team daemon and enforced with the same semantics as the local <code>[budget]</code>: warn incident, <code>ask</code> on spending tools, or stop spawned runs. Monthly export by user, machine, model or <b>task — your ticket ids</b> when the task source is GitHub Issues or Linear: <code>GET /t1/spend/export?month=…&amp;by=task&amp;format=csv</code> (M8.4).</li><li><b>Model allow-list</b> — <code>[models] allow = [\"claude-*\"]</code> (org-lockable): spawned runs and dispatch refuse a disallowed model; an interactive session on one opens a single incident — observed, never interrupted (M8.4).</li><li><b>Aider + opencode adapters</b> — six agents now show up with sessions, turns, tokens and cost: Claude Code, Codex, Grok, Gemini CLI, <b>Aider</b> (its own <code>.aider.chat.history.md</code>, one file holding many sessions) and <b>opencode</b> (its SQLite database, read-only). Both report their exact spend themselves, so their turns carry it verbatim and repricing never touches them (M5.4; Cline deferred).</li><li><b>Outcomes</b> — did the agent's work survive? Branches join sessions → PR → merged / reverted, with per-model and per-agent scorecards: merge rate, median session-start→merge, $ per merge. New <b>Outcomes</b> view under Insight (M9.2).</li><li><b>Stuck badge</b> — the daemon watches live sessions' recent tool calls for repeat-and-failing loops and all-failing streaks (conservative: <code>git status</code> polling never counts) and marks the session <b>Stuck</b> on Fleet with a desktop notification. A heuristic; nothing is interrupted (M9.3).</li><li><b>Collision graph</b> — a live bipartite graph of running sessions × the files they touch; a file two sessions hold with at least one writer glows red as a merge conflict waiting to happen. New <b>Graphs</b> view with a contested-count badge (M9.12).</li><li><b>Sidebar navigation + ⌘K</b> — the flat header links became a grouped sidebar nav (Observe / Work / Insight / Guard) that collapses to an icon rail, and ⌘K opens a palette over every view, project and session, falling through to Search (M9.1).</li><li><b>Ops</b> — <code>swarm backup</code> (a consistent <code>VACUUM INTO</code> snapshot of <code>~/.swarm</code>, zero downtime) and <code>swarm restore</code>; <code>swarm doctor --migrate</code>; Prometheus metrics at the team daemon's <code>/t1/metrics</code>; <code>[notify] webhook</code> POSTs every incident as Slack-compatible JSON (M8.5).</li></ul><h4>Fixed</h4>\n<ul><li>Replay, <em>Resume where it died</em> and the dry-run <em>Re-run</em> buttons were unreachable — dead click targets on the session page.</li><li>The user guide caught up: a Teams page, the M8 commands, all six agents, and the <code>SWARM_GUARD=off</code> description (org-locked rules stay enforced — true since 0.8, documented wrong until now).</li></ul><h4>Notes</h4>\n<ul><li>The privacy posture is unchanged and now stated precisely: with no <code>[team] url</code> and no <code>[notify] webhook</code> configured, nothing about your sessions leaves the machine — the <a href=\"https://getswarm.vercel.app/docs/10-privacy-and-faq\" target=\"_blank\" rel=\"noopener\">privacy page</a> lists the five opt-in egress paths.</li><li>The team daemon package is not yet on npm; run it from a clone (<code>bun packages/team/src/bin.ts</code>). Pricing for the paid tier is still open.</li></ul>"},"0.9.0":{"date":"2026-08-24","html":"<p>The crew release: the agents on your machine stop being strangers. They message each other and you, follow a declared workflow instead of a hopeful prompt, and every major CLI brand now shows up — Claude, Codex, Gemini, Grok. Plus the first-run and update experience a launch deserves.</p>\n<h4>Added</h4>\n<ul><li><b>Agent messaging</b> — <code>swarm_send(to, text)</code> reaches another session (id or unique prefix), whoever holds a task, or <code>\"lead\"</code> (your interactive session in the project). Delivery: on the recipient's next tool call as injected context, immediately over stdin to a spawned run, or pulled with <code>swarm_inbox</code> (which now returns answers <em>and</em> messages) — exactly once. A <b>messages</b> thread with compose box on every session page; <code>swarm msg send|ls</code> (M7.6, OQ-12 decided).</li><li><b>Workflows</b> — <code>[[workflows]] name = \"ship\" steps = [\"implement\", \"gate:tests\", \"gate:review\", \"pr\"]</code> in <code>.swarm.toml</code>; <code>swarm workflow ship &lt;task&gt;</code> and the daemon advances it: run steps spawn an agent in the task's worktree (told what the workflow will do itself), gate steps execute — only a pass advances — and <code>pr</code> pushes and opens the pull request from the ledger. A failed step stops with a <code>workflow_failed</code> incident; a daemon restart marks in-flight workflows stopped, honestly. <b>Workflows</b> on the Board with per-step chips (M7.8).</li><li><b>Gemini CLI adapter</b> — <code>~/.gemini</code> chat recordings are discovered and priced like every other agent: sessions, turns, tokens, cost, sparkline, Timeline, Spend. Schema from upstream source; first real-session validation pending (M5.4).</li><li><b>Timeline that shows the work</b> — bars are now a faint base with a tick per turn: bursts and idle stretches are visible instead of painted over. A thin claims lane per project shows lease spans (held / expired / orphaned). Recent gates carries a per-gate pass/fail history strip; every pinned project gets a 14-day spend sparkline in the sidebar (M5.7).</li><li><b><code>swarm demo</code></b> — a seeded demo dashboard on its own home and port: four agent brands, a live lease, an orphaned claim, gate history, incidents, a question, a message, a workflow mid-flight. Tailers are off in demo mode, so it never ingests your real logs — and your real data is never touched (delete <code>~/.swarm/demo</code> to reset).</li><li><b>Update that actually updates</b> — after an upgrade the dashboard notices the newer version on disk and offers a one-click daemon restart (the daemon re-execs into the new build and the page reloads). Long-lived tabs re-check every 5 minutes.</li><li><b>First-run onboarding</b> — an empty Fleet now explains the three steps (hook in — with a live <em>not installed</em> badge —, open any agent session, watch it appear) instead of showing a blank table.</li></ul><h4>Fixed</h4>\n<ul><li>External links in the desktop app (PR titles, Documentation, feedback, the just-opened PR) open in the browser — the webview silently swallowed them before.</li><li>Section-header actions (New worktree, Collect stale, timeline ranges) are proper small buttons instead of shouting uppercase with off-baseline icons.</li><li>The timeline claims lane no longer collides with the kanban's styles; a test file that broke lint on main is formatted.</li></ul><h4>Notes</h4>\n<ul><li>Windows builds are produced by CI as before but this release had no human Windows smoke test — reports welcome.</li></ul>"},"0.8.0":{"date":"2026-08-23","html":"<p>The trust release: Swarm becomes something a team and a security reviewer can rely on, without giving up local-first. An org can pin the rules that matter and they hold even when the daemon is down; every record says who did it; the daemon has a credential; what is stored is exportable and redactable; a second agent can be the reviewer. And the dashboard stopped looking like a list of tables.</p>\n<h4>Added</h4>\n<ul><li><b>Org policy layer</b> — a third config file, <code>~/.swarm/policy.toml</code> (or <code>$SWARM_POLICY</code>), sits under global and repo config and may declare <code>locked = [\"rules.destructive_git\", \"rules.protected\", …]</code>: dotted keys or whole subtrees the layers below cannot change. A locked key keeps the policy's value, every attempt to override it is a <code>policy</code> incident, and <code>swarm doctor</code> shows which file set each value and who tried to change it. <code>GET /v1/policy</code> exposes provenance (M8.1).</li><li><b>Tamper detection</b> — on every session start the daemon checks that all ten hook entries are still in <code>~/.claude/settings.json</code> with a sane timeout, that no lower config layer fights a locked key, and that <code>SWARM_GUARD=off</code> isn't set while the policy locks rules (it is then ignored). Each finding opens a <code>policy</code> incident once; <code>swarm doctor</code> prints the same (M8.1b).</li><li><b>Fail-closed for locked rules</b> — while the policy locks any rule the daemon keeps <code>~/.swarm/policy.cache.json</code> (locked modes + a snapshot of live sessions and held worktrees, integrity-hashed). If the daemon is unreachable on a tool call, the hook shim enforces exactly those rules from the cache; everything else still fails open (M8.1c, OQ-3 resolved).</li><li><b>Who did it</b> — every ledger record and every event carries an <code>actor</code> (<code>human</code> / <code>agent</code> / <code>run</code> / <code>daemon</code> + id); existing rows were back-filled from the owner strings clients always sent. Schema changes now go through versioned migrations (<code>/v1/health</code> and <code>doctor</code> report the schema version) (M8.2a).</li><li><b>Daemon token</b> — the daemon creates <code>~/.swarm/token</code> on first start; the CLI, MCP server, hook shim and <code>swarm ui</code> send it. Local callers may still omit it by default; <code>[daemon] auth = \"required\"</code> makes every call carry it, a wrong token is always refused, and anything that isn't loopback always needs it (M8.2b).</li><li><b>Audit log + export</b> — the ledger-changing subset of events (claims, worktrees, PRs, questions, dispatch, resources, processes, gates, handoffs, permissions, incidents, run results, session start/end), with actor: <code>swarm audit export [--since 30d] [-p] [--type …] [--format jsonl|csv|json]</code> and <code>GET /v1/audit</code>. Retention is split — <code>[events] retain_days = 30</code> for chatter, <code>[audit] retain_days = 0</code> (forever) for audit rows (M8.2c).</li><li><b>Privacy on ingest</b> — <code>[privacy] store_prompts = false</code> keeps the event but not the prompt text, <code>store_reasoning = false</code> keeps token counts but not assistant text, <code>redact = [\"ACME-[0-9]+\"]</code> scrubs stored strings; API-key-looking tokens and <code>Bearer …</code> credentials are always redacted. Global-only keys an org can lock (M8.2c).</li><li><b>Review as a gate</b> — <code>[gates.review] builtin = \"review\"</code> (optional <code>model</code>, <code>timeout</code>) spawns a read-only <code>claude -p</code> over the worktree's diff with a fixed rubric. The verdict is derived from the findings (any blocker/major fails, whatever the reviewer claims), findings are the evidence, and a reviewer that times out or won't answer in JSON is a fail with that reason. Same registry, logs, incidents and triggers as executed gates (M7.9).</li><li><b>Project settings</b> — sidebar menu → <b>Settings…</b>: name, icon (any emoji — a quick row, a browse-all grid, or the OS picker — or an image file, downsized to a square), a color slot, pinned. The glyph replaces the folder icon everywhere the project appears.</li><li><b>Board that is a board</b> — a KPI strip (live / held / worktrees / ready / incidents), tasks as a kanban (Ready · In progress · Blocked · Done), and a worktree map of tiles grouped by project and colored by live / dirty / unpushed / merged. Tasks and Worktrees keep a Cards | Table toggle.</li><li><b>Row menus</b> — every row on the Board, PRs and Incidents has one menu (hover kebab, right-click, or Enter) carrying its actions — open, diff, PR, run, claim, gates, release, stop, ack, codify, merge, copy — instead of inline links; destructive ones last and confirmed. Menus are wider and labels never ellipsize.</li></ul><h4>Changed</h4>\n<ul><li><code>doctor</code> reports the daemon and schema version, per-event hook coverage, and the policy file with its locked keys.</li><li><code>/v1/health</code> reports <code>schema</code> and <code>auth</code>.</li></ul><h4>Fixed</h4>\n<ul><li>Scratch repositories under the OS temp dir (test fixtures, spawned-run clones) no longer appear as projects in the sidebar.</li><li>Fleet's <code>now</code> column had no room; ended sessions show their last assistant line instead of \"session ended\".</li><li>Incidents show the command's gist (the leading <code>cd … &amp;&amp;</code> stripped) and <code>(removed)</code> instead of a raw id for a deleted project; Spend's attribution tables lost their empty first column.</li><li>Emoji tiles and the icon preview no longer clip in the desktop app's WebKit view.</li></ul>"},"0.7.0":{"date":"2026-08-23","html":"<p>The orchestrate release: Swarm runs a task end to end on its own and you stay in control. New worktrees start warm, gates execute instead of being vouched for, <code>swarm dispatch</code> hands ready tasks to autonomous runs whose outcome is derived from the ledger, an agent that needs a human decision can ask for one, and a budget keeps the bill in bounds.</p>\n<h4>Added</h4>\n<ul><li><b>Budgets</b> — <code>[budget] daily = 25</code> / <code>weekly = 100</code> in <code>.swarm.toml</code> puts a spend ceiling on a repo, judged from the same transcript-priced numbers as the Spend view. At <code>warn_at</code> (80%) a <code>budget</code> incident opens; past 100% <code>on_exceed</code> decides: <code>\"warn\"</code>, <code>\"ask\"</code> (every Bash / Edit / Write in the repo asks first), or <code>\"stop\"</code> (spawned runs stopped, dispatch queue cleared). One incident per level per day; a budget tile on the Spend view.</li><li><b>Run profiles</b> — <code>swarm run --profile no-edits|read-only</code> (and the Run / Dispatch drawers, <code>[dispatch] profile</code>) narrow what a spawned agent may do: <code>no-edits</code> keeps the shell but not the file tools, <code>read-only</code> keeps only read and search.</li><li><b><code>swarm_context</code></b> — an agent can re-read what Swarm told it at session start, current as of now (holds, lease left, handoff, gates, resources, rule modes), plus answers to its questions. <code>GET /v1/context</code>. And <code>swarm install</code> now registers the same MCP server with <b>Codex CLI</b> and <b>Gemini CLI</b> when they're installed, so they get the <code>swarm_*</code> tools too (M7.10).</li><li><b>Ask the human</b> — an agent that hits a decision only a person can make calls <code>swarm_ask</code> (with optional suggested answers). The question shows on the session page under <b>waiting on you</b> with the options as buttons, the session gets an <b>Asking</b> badge on Fleet, and a desktop notification fires. Answer there, or <code>swarm answer &lt;id&gt; &lt;text&gt;</code>; <code>swarm questions</code> lists what's open. The answer reaches the agent by itself — stdin for a spawned run, <code>[swarm]</code> context on the next tool call for an interactive session, <code>swarm_inbox</code> on demand — and a session starting later in the same task's worktree is told about open questions and answers that never arrived (M7.7).</li><li><b>Dispatch</b> — <code>swarm dispatch --ready</code> (or pick tasks; the <b>Dispatch</b> chip on the Board's Tasks; <code>swarm_dispatch</code> from a lead agent) hands ready tasks to autonomous runs: each gets its own claim and worktree and a <code>claude -p</code> run told to work there, run the gates, hand off and open the PR; <code>[dispatch] max_parallel</code> (default 2) run at once per repo, the rest queue. When a run ends Swarm derives the outcome from the ledger — executable gates re-run by the daemon, PR looked up on the forge — and reports <b>done</b>, <b>gates-failed</b>, <b>no-pr</b>, <b>crashed</b> or <b>stopped</b>; anything short of done opens a <code>dispatch_failed</code> incident and keeps the claim for you to resume or release. A dispatched run never edits the task list. <code>swarm dispatch status | clear</code>, <code>GET/POST/DELETE /v1/dispatch</code>, a <b>Dispatch</b> section on the Board (M7.5).</li><li><b>Diff and Open PR</b> — every worktree row on the Board (and a session page whose cwd is a worktree) gets <b>Diff</b>: the commits and files it carries beyond the main checkout's branch, uncommitted and untracked changes included, with a coloured unified diff per file. <b>PR</b> pushes the branch and opens a pull request (<code>gh</code>) or merge request (<code>glab</code>) prefilled from the task's title, the latest handoff, the required gates as a checklist and the file list — editable before it goes; refuses uncommitted changes, reuses an open PR for the branch. <code>swarm wt diff</code>, <code>swarm pr open [--dry-run]</code>, MCP <code>swarm_pr_open</code>; a <code>pr.opened</code> event on the Timeline (M7.3).</li><li><b>Gates that run themselves</b> — a gate with a command in <code>.swarm.toml</code> (<code>[gates.tests] cmd = \"bun test\"</code>, optional <code>timeout</code> / <code>cwd</code>) is executed rather than vouched for: <code>swarm gate run &lt;task&gt;</code> (or <code>swarm_gate_run</code> from the agent, or <b>Gates</b> on a held task row on the Board) runs every required gate that has a command inside the task's worktree and records the verdict — exit 0 passes, the rubric is the command and how it ended, the evidence is the output tail, the log lives in <code>~/.swarm/logs</code>. Runs go through the process registry and are killed at <code>timeout</code>. When a session in a held worktree ends, the daemon runs them on its own and writes the verdicts into that session's auto-handoff (<code>[gates] auto = \"session-end\" | \"stop\" | \"off\"</code>) (M7.4).</li><li><b>Worktrees without a task</b> — <code>swarm wt create &lt;name&gt;</code> makes a worktree for a spike or a review checkout (under <code>~/.swarm/worktrees/&lt;project&gt;/</code>, branch <code>wt/&lt;name&gt;</code>, bootstrapped like a claim); <code>swarm wt</code> lists every worktree with <b>drift</b> against the main checkout's branch (<em>N behind</em>, <em>merged</em>); <code>swarm wt open</code> opens it with <code>[worktree] open = \"code {path}\"</code> or the file manager; <code>swarm wt rm</code> removes it with the same refusals as <code>release</code> (dirty, unpushed, never the main checkout, never a held claim); <code>swarm wt gc [--apply]</code> finds worktrees whose branch was merged or whose claim was released and the folder left behind. The Board's Worktrees section gets the drift column, <b>Open</b> / <b>Remove</b> per row, <b>New worktree</b> and <b>Collect stale</b> (M7.2).</li><li><b>Warm worktrees</b> — <code>.swarm.toml [worktree] copy = [\".env.local\"]</code> and <code>setup = \"bun install\"</code> bootstrap every new worktree: the files are copied from the main checkout as the claim is made and <code>setup</code> runs inside the worktree in the background (log in <code>~/.swarm/logs/&lt;project&gt;/bootstrap-&lt;task&gt;.log</code>, a <code>worktree.bootstrapped</code> event on the Timeline). <code>swarm run</code> waits for it before starting the agent; an interactive <code>swarm claim</code> prints the log path and returns at once. A failing setup opens a <code>bootstrap_failed</code> incident but never takes the claim away. Paths are repo-relative only (M7.1).</li></ul><h4>Fixed</h4>\n<ul><li>The Fleet agent badge no longer renders a stray \"…\" after the pill: badge-only cells clip instead of ellipsizing, and the column got a few more pixels.</li></ul>"},"0.6.0":{"date":"2026-08-23","html":"<p>The learn release: the data Swarm has been collecting starts paying back. Replay what an agent did, see what each task cost, turn an incident into a rule, resume a session that died, try a rule on history before switching it on, read your backlog from GitHub or Linear, and search everything Swarm remembers.</p>\n<h4>Added</h4>\n<ul><li><b>Session Replay</b> — a <b>Replay</b> button on any session steps through its tool calls one at a time, showing the full input and output of each (Prev/Next, a slider, ←/→ keys). See exactly what an agent did, in order (M4.1).</li><li><b>Cost by task</b> — the Spend view attributes cost and tokens to each task (matched to a claim by the session's worktree), plus a <b>Context budget</b> table ranking sessions by how much context they re-processed — a signal for agents re-reading the same material. <code>GET /v1/attribution</code> (M4.2).</li><li><b>Codify an incident</b> — the Incidents feed has a <b>Codify</b> action that turns an incident into a <code>.swarm.toml</code> rule snippet and a CLAUDE.md lesson, both copyable. A rule that keeps firing as <code>ask</code> suggests hardening to <code>deny</code> (M4.3).</li><li><b>Desktop notifications</b> — opt-in native notifications (settings menu) for a spawned run waiting on a permission, or a claim orphaned with unfinished work; clicking opens the Allow/Deny card or the Board. Quiet while you're looking at the dashboard (M4.7).</li><li><b>Auto-handoff, and resume where it died</b> — whenever a session working in a claimed worktree pauses or ends, Swarm derives a handoff from what it did: files edited, the last verification-looking command, the last request, the last thing it said. One <code>auto:</code> handoff per session, replaced on every pause, silenced by a handoff left on purpose. An ended session's page gets <b>Resume where it died</b>, which spawns a run on the task from that handoff plus the session's last actions; <code>swarm run resume &lt;session-id&gt;</code>; <code>GET/POST /v1/sessions/:id/resume</code> (M4.4).</li><li><b>Rule dry-run</b> — <b>Dry-run rules</b> on the Incidents view replays a project's recorded tool calls through the rules under modes you pick: what would have been asked or denied, per rule, before you switch anything on. It also flags <b>flaky signals</b> — a rule that keeps firing on the same command that is then allowed through anyway. Nothing is recorded. <code>swarm rules dryrun [--set rule=mode,…]</code>; <code>GET /v1/rules/dryrun</code> (M4.6).</li><li><b>GitHub Issues and Linear as task sources</b> — <code>[tasks] source = \"github\"</code> reads the repo's issues through the logged-in <code>gh</code> (optional <code>labels</code> filter); <code>source = \"linear\"</code> reads Linear through its API with <code>LINEAR_API_KEY</code> from the daemon's environment (optional <code>team</code>). Both land in the Board's Tasks, <code>swarm tasks</code> and <code>swarm_next_task</code> like a markdown backlog: closed/completed is done, in-progress is active, <em>depends on #n</em> / <em>blocked by</em> become dependencies. Read-only; no credential stored (M4.8).</li><li><b>What's New in the app</b> — the dashboard shows the release notes for the running version: a <b>What's New</b> item in the settings menu, in the desktop app's <b>Swarm</b> menu, and in the tray. It also opens once on its own the first time you run a new version. Notes are parsed from <code>CHANGELOG.md</code> into <code>release-notes.js</code> at build time, so they work offline with no repo checkout.</li><li>The desktop <b>Check for Updates…</b> is in the system menu bar (Swarm menu), not only the tray.</li></ul>"},"0.5.0":{"date":"2026-08-22","html":"<p>The drive release: Swarm doesn't just watch agents now — it starts them, in a claimed worktree, and brokers what they're allowed to do. Plus the coordination primitives that make an autonomous run safe to leave alone: leases that renew themselves, gates that gate, and a handoff the next session reads on its own.</p>\n<h4>Added</h4>\n<ul><li><b><code>swarm run</code></b> — spawn an agent on a task. <code>swarm run --task login-form --prompt \"…\"</code> claims the task and the daemon starts <code>claude -p</code> in its worktree with stream-json on both ends. Steer it with <code>swarm run send</code>, stop it with <code>swarm run stop</code> (stdin closed, then the process registry's pid-based TERM/KILL — never by pattern), list with <code>swarm run ls</code>. The session shows in Fleet as ▶ spawned and is ingested like any other; every finished turn is a <code>run.result</code> event with cost and turns (M3.1).</li><li><b>Run from the dashboard</b> — Ready (or held) task rows on the Board get a <b>Run</b> action: a drawer with the prompt prefilled from the task, permission mode, model and max turns (⌘⏎ to submit). The spawned session opens with a stdin box to steer it and a <b>Stop</b> button (M3.3).</li><li><b>Permission broker</b> — a <code>swarm run</code> agent's tool-permission prompts go through the same rules as your interactive sessions: a rule <code>deny</code> auto-denies with the reason, an unflagged tool auto-allows so the agent can make progress, and anything the rules mark <code>ask</code> is held and surfaced on the session as an <b>Allow / Deny</b> card. No blocking on a terminal you can't see. Uses <code>--permission-prompt-tool stdio</code>; <code>POST /v1/runs/:id/permissions/:reqId</code> (M3.2).</li><li><b>Leases renew themselves.</b> A session working inside a claimed worktree extends the lease on any activity (hook or transcript growth) once it is past half-way — no more <code>swarm renew</code> in a long session. Expired leases whose worktree still holds uncommitted or unpushed work are marked <b>Orphaned</b> within a minute and open an <code>orphaned_claim</code> incident; nothing is removed automatically (M1.2).</li><li><b>Handoffs, injected on start</b> — <code>swarm handoff &lt;task&gt; --done … --remaining … [--files] [--verify]</code> (or <code>swarm_handoff</code>) records what the last holder leaves; <code>swarm resume</code> / <code>swarm_resume</code> reads it. The next session that starts inside that task's worktree gets it automatically as <code>SessionStart</code> context, along with what it holds and the lease left, gate status, held resources, and the repo's rule modes (M1.3).</li><li><b>Gates</b> — verification runs recorded against a task: <code>swarm gate record login-form review pass --rubric \"tests green, error paths read\"</code> (or <code>swarm_gate_record</code>). A run without a rubric is rejected; the latest run per gate decides; failed runs are never deleted and open a <code>gate_failed</code> incident. <code>.swarm.toml [gates] required = [\"review\"]</code> declares what every task must pass; the Board's Tasks grid shows ✓ / ✗ / — per gate and a <b>Recent gates</b> section lists the runs (M2.2).</li><li><b>The MCP tools finally connect.</b> <code>swarm_status</code>, <code>swarm_claim</code>, <code>swarm_next_task</code>, <code>swarm_handoff</code>, <code>swarm_gate_record</code>, <code>swarm_acquire_resource</code> and the rest are reachable from Claude Code — see the fix below.</li><li>Dashboard deep links (<code>?view=board&amp;project=&lt;id&gt;&amp;session=&lt;id&gt;</code>) and a screenshot carousel with a lightbox on the website; <code>tools/screens.ts</code> re-captures the shots with Playwright at 2×.</li></ul><h4>Fixed</h4>\n<ul><li><b>Swarm's MCP tools were never reachable.</b> <code>swarm install</code> wrote <code>mcpServers.swarm</code> into <code>~/.claude/settings.json</code>, which Claude Code ignores — user-scope MCP servers live in <code>~/.claude.json</code> (what <code>claude mcp add -s user</code> edits). Install now registers there (and cleans the stale settings.json entry); <code>claude mcp list</code> shows <code>swarm ✔ Connected</code>. <b>Re-run <code>swarm install</code> after upgrading.</b></li><li><b>The daemon reads global config from where its state lives.</b> <code>[rules]</code> / <code>[gates]</code> / <code>[tasks]</code> in <code>~/.swarm/config.toml</code> are resolved against the daemon's home (<code>SWARM_HOME</code>), matching the DB and logs — spawned runs, which execute in a worktree without the repo's <code>.swarm.toml</code>, still see machine-wide rules.</li></ul>"},"0.4.1":{"date":"2026-08-22","html":"<h4>Fixed</h4>\n<ul><li><b>PRs view went dark under the desktop app.</b> A daemon launched from the Dock gets macOS's bare GUI <code>PATH</code>, so Homebrew's <code>gh</code> / <code>glab</code> were invisible and the forge silently returned nothing. The daemon now also looks in <code>/opt/homebrew/bin</code>, <code>/usr/local/bin</code>, Linuxbrew and <code>~/.local/bin</code>; <code>swarm doctor</code> reports forge CLI auth and warns when <code>glab</code> relies on a shell-only <code>GITLAB_TOKEN</code>.</li><li>Icons are vertically centred on their text again (<code>vertical-align: middle</code> instead of a fixed <code>-3px</code> tuned for the old type scale).</li><li>npm publish moves to <b>trusted publishing</b> (OIDC, no <code>NPM_TOKEN</code>), the same setup as fancy-menus.</li></ul>"},"0.4.0":{"date":"2026-08-22","html":"<p>The enforcement release: rules that watch file writes, not just Bash; a backlog Swarm can read; servers Swarm starts and stops by pid; and an Incidents feed you can clear.</p>\n<h4>Added</h4>\n<ul><li><b>Rules on file writes</b> — two new rules evaluated on <code>Write</code> / <code>Edit</code> / <code>MultiEdit</code> / <code>NotebookEdit</code> paths (and Bash working directories), not only Bash commands. <code>no_foreign_worktree</code> (default <code>ask</code>) stops a session from editing inside a worktree another claim holds — <em>never touch a worktree you don't hold</em> is now a hook decision, with holding inferred from the session's cwd. <code>claim_required_to_write</code> (opt-in) makes a repo's shared checkout read-only without a claim: claim a task, get a worktree, write there. Both per repo as <code>ask | deny | off</code>.</li><li><b>Incidents view</b> — the denied-action feed as its own tab: Open / All, per-rule counts, reason and session per row, <b>Ack</b> and <b>Ack all</b>; the open count sits in the nav. <code>GET /v1/incidents?open=1&amp;project=</code>, <code>POST /v1/incidents/:seq/ack</code>, <code>POST /v1/incidents/ack</code>, <code>/v1/state.openIncidents</code>. The Board keeps a short open-only section.</li><li><b>Task source</b> — <code>.swarm.toml</code> <code>[tasks] source = \"docs/plan.md\"</code> points at a markdown file whose <code>ID | Task | Depends | Status</code> tables are the backlog (✅ / 🟡 / ⚪, dependencies by task id or milestone prefix). The Board gets a <b>Tasks</b> section (Ready / Open / All, <em>Claim</em> per row), the CLI <code>swarm tasks [--ready]</code>, and agents <code>swarm_next_task</code> — the first unclaimed task whose dependencies are done. Swarm's own roadmap is its task source. Markdown only (OQ-5 decided).</li><li><b><code>swarm serve</code> / <code>swarm proc</code></b> — <code>swarm serve start --name web -- npm run dev</code> allocates a free port (ledger + bind probe), runs the command detached with <code>PORT</code> set and logs under <code>~/.swarm/logs/&lt;project&gt;/</code>, registers pid + start time, and acquires the singleton — so a second <code>web</code> fails closed and the port is protected for every other session with no config. <code>serve ls | stop [name|pid]</code>, <code>proc start | ls | stop</code> for workers without a port. Stop signals registry pids only, verified by start time; nothing is ever killed by pattern. <code>POST /v1/ports/allocate</code>, <code>GET/POST/DELETE /v1/processes</code>; <b>Processes</b> section on the Board with <em>Stop</em>.</li><li><b>Star nudge</b> — once a month at most, never on first open, the dashboard asks for a GitHub star. <em>Later</em> snoozes 30 days, <em>Don't ask again</em> is final; localStorage only.</li><li><b>Sidebar drag-and-drop</b> — pinned projects reorder by dragging; the order persists on the daemon (<code>PUT /v1/projects/order</code>, <code>Project.order</code>).</li><li><b>Desktop app menu</b> — a real application menu (Swarm / Edit / View / Window): ⌘C/⌘V work, <b>View › Zoom In / Zoom Out / Actual Size</b> (<code>⌘+</code> <code>⌘−</code> <code>⌘0</code>) scale the dashboard (persisted), plus Reload and Full Screen.</li></ul><h4>Fixed</h4>\n<ul><li><b>Shared-tree rules no longer lose sight of a session mid-turn.</b> <code>shared_tree</code> / <code>destructive_git</code> keyed on a 2-minute last-seen window fed only by hooks, so a neighbour three minutes into a long turn became invisible — and its uncommitted work unguarded. Transcript growth now counts as activity (the tailer bumps <code>last_seen_at</code>), and the liveness window is the daemon's 10-minute idle threshold (<code>LIVE_WINDOW_MS</code>). A false positive costs one confirmation; a false negative cost someone's work.</li><li><code>destructive_git</code> also matches <code>git stash drop</code>, <code>git stash clear</code> and <code>git branch -D</code>.</li><li>Dashboard type scale is one step larger across the board (base 13 → 14 px; the smallest labels 10 → 11 px) — it had drifted too small, especially in the desktop app.</li><li>The <b>PRs</b> tab icon (and the branch/commit glyphs) were near-invisible at 15 px; they use the pixelarticons <em>sharp</em> variants now.</li><li>The daemon dot stayed red for up to 15 s after load on a healthy connection (the SSE stream sent nothing until its first heartbeat); the stream now flushes immediately.</li><li>The nav flashed \"Fleet\" before the restored tab was applied; session-detail event kinds (<code>userpromptsubmit</code>) no longer overflow into the message column; \"Unpinned · seen, not pinned\" keeps its spacing.</li></ul><h4>Changed — docs</h4>\n<ul><li>README and site now say what the code does: Codex CLI and Grok sessions are tailed alongside Claude Code; the requirements and architecture diagram list all three.</li><li>Rules are described as <b>guardrails against accidents, not a sandbox</b> — the guide has a new \"What rules are — and aren't\" section spelling out that a denied Bash command can be routed around (script, heredoc, direct file edit), and that worktree isolation via claims is the real fix. The site's feature cards lead with claims, rules and resources instead of Fleet and Spend.</li></ul><h4>Changed — performance</h4>\n<ul><li><b>Daemon never spawns <code>git</code> on a request.</b> Worktree status (<code>git worktree list</code> + <code>status</code>/<code>rev-list</code> per worktree, ~0.8 s across a fleet) moves to a 15 s background refresh with async <code>Bun.spawn</code>; <code>/v1/state</code> serves the cache (612 ms → ~15 ms). Claim/release invalidate it.</li><li><b>Hook round-trips are two indexed statements</b>, not two <code>git rev-parse</code> spawns plus a transcript-directory scan: <code>cwd → project</code> is cached 60 s, the inline transcript tail is debounced to once per 2 s per session (the 5 s tailer covers steady state), and subagent directories are re-listed only when their mtime moves.</li><li><b>Events store ~2 KB, not ~10 KB.</b> <code>tool_input</code> is clipped at 2 KB and <code>tool_response</code> at 4 KB in <code>payload</code> (<code>{truncated, bytes, preview}</code>), and the tool I/O is no longer duplicated in <code>raw</code>. Existing databases are rewritten once on boot and <code>VACUUM</code>ed (96 MB → 27 MB here). Retention: events older than 30 days are pruned daily (incidents kept), <code>raw</code> is cleared after 7 days.</li><li><b>Wire shape.</b> SSE frames, <code>GET /v1/events</code> replays and <code>GET /v1/sessions/:id/events</code> carry <code>seq/ts/type/projectId/sessionId/payload{hook,summary,…}</code> only — no <code>raw</code>, no tool I/O (a 5.5 MB session fetch is now ~150 KB). <code>GET /v1/events/:seq</code> returns one stored event in full; <code>?full=1</code> on the SSE replay does the same. <code>?since=0</code> replays the last 200 events, not the table.</li><li><b>Incremental session view</b> — <code>GET /v1/sessions/:id/events?after=&lt;seq&gt;&amp;afterTs=&lt;iso&gt;</code>; the dashboard appends instead of re-fetching 500 events + 500 turns on every hook.</li><li><b>Dashboard render loop</b> — one <code>requestAnimationFrame</code> scheduler, snapshot <code>seq</code> short-circuit, paused while the tab is hidden, exponential SSE reconnect backoff; session log merges two sorted lists and caches rendered rows; data-grid memoises persisted layout and uses one <code>Intl.Collator</code>; charts memoise the turn strip.</li><li>SQLite: indexes on <code>events(type, seq)</code> and <code>turns(ts)</code>, <code>mmap_size</code> 256 MB, cached prepared statements (<code>db.query</code>), <code>sessions</code>/<code>spend</code>/<code>incidents</code> memoised per write generation; <code>/v1/spend</code> is its own endpoint.</li><li>Background tick: Codex/Grok discovery every 15 s when idle; Grok <code>summary.json</code> re-read only on mtime change.</li></ul>"},"0.3.0":{"date":"2026-08-22","html":"<p>The coordination release: rules you can configure, runtime resources agents can hold, and the merge queue at the end of the loop.</p>\n<h4>Added</h4>\n<ul><li><b>Config system</b> — <code>~/.swarm/config.toml</code> (global) deep-merged with an optional <code>&lt;repo&gt;/.swarm.toml</code>. Lenient validation: bad config can never take the daemon down. Daemon port preference is <code>SWARM_PORT</code> &gt; config &gt; 7777. See <code>docs/13-config.md</code>.</li><li><b>Rule engine v2</b> — every rule is per-repo configurable as <code>ask | deny | off</code>: <code>shared_tree</code>, <code>destructive_git</code>, <code>pattern_kill</code>, and the new <code>protected_ports</code> (kill/free of a configured port — <code>lsof | kill</code>, <code>fuser -k</code>, <code>kill-port</code> — is asked or denied). <code>deny</code> is returned to Claude Code as a real permission denial.</li><li><b>Incidents</b> — every non-allow decision is recorded (<code>incident.opened</code>: rule, action, command, reason), exposed at <code>GET /v1/incidents</code>, included in <code>/v1/state</code>, and shown on the Board.</li><li><b>Runtime resources (Phase 1)</b> — named singletons for what agents fight over at runtime (dev servers, databases, ports). Fail-closed acquire: holdings live while their pid runs or their lease hasn't expired; the same owner refreshes; dead holdings reap instead of blocking. Release is fail-closed too (owner required, <code>--force</code> overrides). Held ports automatically join the protected-ports rule — acquiring <code>db</code> on 5432 guards <code>lsof -ti:5432 | xargs kill</code> for every other agent, no config needed. HTTP <code>GET/POST /v1/resources</code>, <code>DELETE /v1/resources/:name</code>; MCP <code>swarm_acquire_resource</code> / <code>swarm_release_resource</code> / <code>swarm_resources</code>; CLI <code>swarm res ls|acquire|release</code>.</li><li><b>PRs view</b> — one merge queue across GitHub and GitLab. Forge detection from the git remote (ssh/https, GitLab subgroups, self-hosted), polled through the locally-authenticated <code>gh</code> / <code>glab</code> CLIs with the project root as cwd — no tokens stored, 2-minute per-project cache floor. <code>GET /v1/prs</code>, <code>POST /v1/prs/merge</code> (squash). Merge is offered only on green, mergeable, non-draft rows, behind a confirm.</li><li><b>Board view</b> — Claims, Worktrees, Resources, and Incidents move out of Fleet into their own view; Fleet shows sessions only (Live + Earlier). Last view and project selection persist across reloads.</li><li><b>Stats view</b> — <code>GET /v1/stats</code>; activity line, calendar heatmap, and streaks (daily buckets in local time, DST-immune). <code>swarm stats</code> on the CLI.</li><li><b>Data-grid everywhere</b> — Claims, Worktrees, Resources, Incidents, PRs, and all six Spend tables render through the same sortable / resizable / reorderable grid with per-column filters, a column-visibility menu, and persisted layouts. Header ticks and tooltips make the affordances discoverable.</li><li><b>Desktop: Check for Updates…</b> in the tray menu, wired to the Tauri updater with native dialogs (available / up-to-date / failed) and install-and-restart on accept.</li><li><b>Agent badge</b> on every Fleet and session row, so mixed-agent fleets are labelled consistently.</li><li><b>Website</b> — getswarm.vercel.app: OS-detected downloads from the latest GitHub release, the <code>bunx</code> one-liner, sharing tags with hero art, and (this release) rendered docs and release notes.</li><li><b>Design tokens</b> — the dashboard's CSS contains zero raw hex / rgba / font-size / duration values; the system is documented in <code>docs/12-design-tokens.md</code> with a drift grep.</li><li>Swarm now dogfoods its own rules via the repo's <code>.swarm.toml</code> (<code>shared_tree</code> / <code>destructive_git</code> deny, daemon port protected).</li></ul><h4>Fixed</h4>\n<ul><li><b>Hook resilience</b> — the PreToolUse hook falls back to the default port when <code>daemon.json</code> points at a dead daemon, so a crashed daemon no longer silently disables the guard (this was the gap behind a real <code>git add -A</code> collision).</li><li>Resource liveness: pid 0 was treated as a live process (<code>kill(0)</code> addresses the process group), so those holdings never reaped; tracked pids are now <code>&gt; 0</code>. <code>heldPorts()</code> is one SELECT on the hook path; lazy reap on acquire, sweep on the 5 s tick. Unknown session IDs on acquire no longer mint phantom sessions.</li><li>Session view is two equal columns again (a bare <code>aside</code> selector in the sidebar-collapse CSS captured the session side panel); the log keeps your scroll position across live updates and follows the tail only when pinned to the bottom.</li><li>A pinned project whose root vanished is merged into the live same-name entry (repo renames produced duplicate sidebar rows); the sidebar <code>⋯</code> appears on hover in the count's slot and reserves no space.</li><li>Desktop: quit actually quits, window close hides (macOS convention) and the dock icon restores it, and the <code>swarmd</code> sidecar dies with the app. Dev builds serve the repo's live dashboard instead of a stale staged snapshot.</li><li>Release pipeline: npm publish is skipped cleanly when <code>NPM_TOKEN</code> is absent (since 0.4.1: trusted publishing, no token).</li></ul>"},"0.2.2":{"date":"2026-08-21","html":"<h4>Added</h4>\n<ul><li>Publishable <code>@ra3orblade/swarm</code> npm package (bundled bins + dashboard); <code>bunx @ra3orblade/swarm setup</code> onboarding.</li><li>Enterprise data-grid for Fleet with a collapsible sidebar; pixel-art icon set and bespoke empty-state illustrations; folder picker; green chart palette.</li><li>Desktop: macOS window chrome, animated pixel-logo splash, free-port daemon startup.</li></ul><h4>Fixed</h4>\n<ul><li>Release builds bundle every platform target; Linux ships <code>.deb</code> + <code>.rpm</code> (AppImage disabled until <code>linuxdeploy</code> on GitHub runners is debugged).</li></ul>"},"0.0.6":{"date":"2026-08-21","html":"<p>First signed and notarized macOS desktop build; <code>release.yml</code> became a three-OS matrix (macOS / Windows / Linux) with a native sidecar per runner.</p>"}};
package/web/viz.js CHANGED
@@ -131,7 +131,7 @@ function turnStripRender(turns, height) {
131
131
  * Session lanes over a time window. sessions: [{id,title,agent,projectId,startedAt,lastSeenAt,state,costUsd}]
132
132
  * One row per session, grouped by project; bar from start to last-seen, coloured by agent.
133
133
  */
134
- function timeline(sessions, { from, to, projName, now = Date.now() } = {}) {
134
+ function timeline(sessions, { from, to, projName, now = Date.now(), detail = null } = {}) {
135
135
  const span = Math.max(1, to - from);
136
136
  const x = (t) => Math.min(100, Math.max(0, (100 * (t - from)) / span));
137
137
  const byProj = new Map();
@@ -150,10 +150,27 @@ function timeline(sessions, { from, to, projName, now = Date.now() } = {}) {
150
150
  const b = Math.min(to, new Date(s.lastSeenAt).getTime());
151
151
  const live = s.state === "active" || s.state === "waiting";
152
152
  const tip = `<b>${attr(s.title ?? s.id.slice(0, 8))}</b><br><i style="background:${agentColor(s.agent)}"></i>${agentName(s.agent)} · ${s.state}<br>${hm(s.startedAt)} → ${hm(s.lastSeenAt)} · ${fmtUsd(s.costUsd)} · ${s.turns} turns`;
153
- return `<div class="tl-row" data-s="${s.id}"><span class="tl-name">${attr(s.title ?? s.id.slice(0, 8))}</span><span class="tl-track">${gridLines}<i data-tip="${attr(tip)}" class="${live ? "live" : ""}" style="left:${x(a)}%;width:${Math.max(0.4, x(b) - x(a))}%;background:${agentColor(s.agent)};color:${agentColor(s.agent)}"></i></span></div>`;
153
+ // M5.7: with per-turn timestamps the bar is a faint base + a tick per turn the blank
154
+ // stretches between ticks are the idle gaps, visible instead of painted over.
155
+ const ts = (detail?.turns?.[s.id] ?? []).filter((t) => t >= a && t <= b);
156
+ const ticks = ts.map((t) => `<u style="left:${x(t)}%;background:${agentColor(s.agent)}"></u>`).join("");
157
+ const barCls = `${live ? "live" : ""}${ts.length ? " thin" : ""}`;
158
+ return `<div class="tl-row" data-s="${s.id}"><span class="tl-name">${attr(s.title ?? s.id.slice(0, 8))}</span><span class="tl-track">${gridLines}<i data-tip="${attr(tip)}" class="${barCls}" style="left:${x(a)}%;width:${Math.max(0.4, x(b) - x(a))}%;background:${agentColor(s.agent)};color:${agentColor(s.agent)}"></i>${ticks}</span></div>`;
154
159
  })
155
160
  .join("");
156
- return `<div class="tl-group"><div class="tl-proj">${attr(projName(pid))}<small>${list.length}</small></div>${rows}</div>`;
161
+ // M5.7: claim & lease overlay — one thin lane per project when any claim overlaps the window
162
+ const spans = (detail?.claims ?? []).filter((c) => c.projectId === pid && new Date(c.expiresAt).getTime() >= from && new Date(c.acquiredAt).getTime() <= to);
163
+ const lane = spans.length
164
+ ? `<div class="tl-row claimlane"><span class="tl-name dim">claims</span><span class="tl-track">${gridLines}${spans
165
+ .map((c) => {
166
+ const a = Math.max(from, new Date(c.acquiredAt).getTime());
167
+ const b = Math.min(to, new Date(c.expiresAt).getTime());
168
+ const tip = `<b>${attr(c.task)}</b><br>${c.state} · ${attr(c.owner || "?")}<br>lease ${hm(c.acquiredAt)} → ${hm(c.expiresAt)}`;
169
+ return `<i data-tip="${attr(tip)}" class="claim ${c.state}" style="left:${x(a)}%;width:${Math.max(0.4, x(b) - x(a))}%"></i>`;
170
+ })
171
+ .join("")}</span></div>`
172
+ : "";
173
+ return `<div class="tl-group"><div class="tl-proj">${attr(projName(pid))}<small>${list.length}</small></div>${lane}${rows}</div>`;
157
174
  });
158
175
  return `<div class="tl"><div class="tl-row head"><span class="tl-name"></span><span class="tl-track">${axis}${nowLine}</span></div>${groups.join("")}</div>`;
159
176
  }
@@ -269,4 +286,50 @@ function niceTicks(max, n) {
269
286
  });
270
287
  })();
271
288
 
272
- window.viz = { stackedColumns, line, calendar, streaks, localDay, heatmap, sparkline, compositionBar, hbars, turnStrip, timeline, legend, agentColor, agentName, AGENT_ORDER, agentSort };
289
+ /**
290
+ * Bipartite graph (M9.11/M9.12): sessions in the left column, files in the right, bezier edges
291
+ * between them. Deterministic — rows render in the order given, so positions stay stable across
292
+ * live refreshes. Writer edges are solid in the session's agent colour; reader edges are thin and
293
+ * dim. Contested files (≥2 sessions, ≥1 writer) get the danger colour.
294
+ * sessions: [{id, label, agent, files, writes}]; files: [{path, readers[], writers[], contested}].
295
+ */
296
+ function bipartite(sessions, files, { rowH = 30, maxFiles = 40 } = {}) {
297
+ const fs = files.slice(0, maxFiles);
298
+ const W = 1000;
299
+ const sx = 250, fx = 640; // where session labels end / file dots sit
300
+ const rows = Math.max(sessions.length, fs.length, 1);
301
+ const H = rows * rowH + 16;
302
+ const mid = (n) => (H - n * rowH) / 2 + rowH / 2 + 4; // centre a column of n rows
303
+ const sy = new Map(sessions.map((s, i) => [s.id, mid(sessions.length) + i * rowH]));
304
+ const fy = new Map(fs.map((f, i) => [f.path, mid(fs.length) + i * rowH]));
305
+ const tailPath = (p, n = 46) => (p.length <= n ? p : `…${p.slice(-n)}`);
306
+ const trunc = (t, n = 30) => (t.length <= n ? t : `${t.slice(0, n - 1)}…`);
307
+ const edge = (s, f, writer) => {
308
+ const y1 = sy.get(s), y2 = fy.get(f.path);
309
+ if (y1 == null || y2 == null) return "";
310
+ const sess = sessions.find((x) => x.id === s);
311
+ const stroke = writer ? agentColor(sess?.agent) : "var(--faint)";
312
+ return `<path d="M ${sx + 14} ${y1} C ${sx + 170} ${y1}, ${fx - 170} ${y2}, ${fx - 10} ${y2}" fill="none" stroke="${stroke}" stroke-width="${writer ? 2 : 1}" opacity="${writer ? 0.85 : 0.35}"/>`;
313
+ };
314
+ const edges = fs.flatMap((f) => [
315
+ ...f.writers.map((s) => edge(s, f, true)),
316
+ ...f.readers.map((s) => edge(s, f, false)),
317
+ ]);
318
+ const sessNodes = sessions.map((s) => {
319
+ const y = sy.get(s.id);
320
+ return `<g data-tip="${attr(s.label)}<br><span class='dim'>${attr(agentName(s.agent))} · ${s.files} file${s.files === 1 ? "" : "s"} · ${s.writes} write${s.writes === 1 ? "" : "s"}</span>">
321
+ <circle cx="${sx + 8}" cy="${y}" r="5" fill="${agentColor(s.agent)}"/>
322
+ <text x="${sx - 4}" y="${y + 4}" text-anchor="end" font-size="12" fill="var(--fg-2)">${attr(trunc(s.label))}</text></g>`;
323
+ });
324
+ const fileNodes = fs.map((f) => {
325
+ const n = f.writers.length + f.readers.length;
326
+ const tip = `${attr(f.path)}<br><span class='dim'>${f.writers.length} writing · ${f.readers.length} reading</span>${f.contested ? "<br><b>contested — a merge conflict waiting to happen</b>" : ""}`;
327
+ return `<g data-tip="${tip}">
328
+ <circle cx="${fx}" cy="${fy.get(f.path)}" r="${f.contested ? 6 : 4}" fill="${f.contested ? "var(--bad)" : n > 1 ? "var(--warn)" : "var(--faint)"}"/>
329
+ <text x="${fx + 12}" y="${fy.get(f.path) + 4}" font-size="11" font-family="var(--mono)" fill="${f.contested ? "var(--bad)" : "var(--dim)"}"${f.contested ? ' font-weight="600"' : ""}>${attr(tailPath(f.path))}</text></g>`;
330
+ });
331
+ const more = files.length > fs.length ? `<text x="${fx + 12}" y="${H - 2}" font-size="11" fill="var(--faint)">… ${files.length - fs.length} more file${files.length - fs.length === 1 ? "" : "s"}</text>` : "";
332
+ return `<svg viewBox="0 0 ${W} ${H}" width="100%" style="max-width:1100px" role="img" aria-label="File collision graph">${edges.join("")}${sessNodes.join("")}${fileNodes.join("")}${more}</svg>`;
333
+ }
334
+
335
+ window.viz = { stackedColumns, line, calendar, streaks, localDay, heatmap, sparkline, compositionBar, hbars, turnStrip, timeline, legend, agentColor, agentName, AGENT_ORDER, agentSort, bipartite };