M26: the swarm view #40

Closed
opened 2026-10-02 04:07:04 +00:00 by jhgaylor · 5 comments
Owner

Depends on: #37, #38, #39 (with one host, it needs only M23 and M24)

Swarm track. The view itself: every pane at once, clustered, with what needs you lifted out to a rail.


There's a prototype with fake data, built from the "hundreds of panes, self-clustering" idea.

  • Where it lives: a Swarm view (/#swarm) beside the tabs, and in the host menu. It works with one daemon too.
  • The field:
    • every pane is a tile colored by kind, with brightness from activity;
    • tiles are pulled toward their cluster's center in proportion to how busy they are, so busy panes sit in the middle and idle ones drift outward;
    • Canvas 2D: S16 drew 2,000 panes at 60 fps on the laptop and 36 fps on a 4x-throttled phone proxy, so WebGL isn't needed below about 2,000;
    • physics is about half of each frame, so it sleeps once clusters settle and wakes on a regroup, a new pane or attention.
  • Cluster by:
    • panes outside any git repo (most of them: S16 found 97 of 105 real commands) group by their cwd's top directory under home, not into one "none" cluster;
    • project, machine, kind, session or pulse (pouring, ticking, idle, asleep);
    • switching animates the panes to their new clusters;
    • the choice is remembered per device.
  • Zoom (semantic):
    • far out, a pane is a tile;
    • closer, the tile shows stubs of its last lines;
    • closer still, it shows live preview text (M23's on-demand previews);
    • clicking a pane opens it in its tab, connected for real;
    • hover peeks at its last lines, and clicking a cluster's name zooms to it.
  • The "needs you" rail:
    • a pane with an M24 reason flares in place, then flies to a card on the rail, with a thread back to its cluster;
    • cards bundle by the reason's bundle key ("11 failed on build-03", "3 agents ask in illogical"), with bundle actions ("Rerun all 11");
    • acting sends the panes back to the swarm;
    • when the rail is full, the rest pulse in place and the rail says how many are waiting;
    • done cards clear themselves after a while.
  • Correlation: when several panes fail together and share a machine or project you aren't grouped by, offer to cluster by it ("11 panes on build-03 failed within a few seconds").
  • Keyboard: j/k through the rail, a allow, d deny, r rerun, x dismiss, Enter open, f fit.
  • Phone: the rail becomes a strip of cards along the bottom, pinch to zoom, tap to open. Push notifications deep-link to the card.
  • A fake fleet for tests and screenshots: a daemon flag or test harness that runs a few hundred scripted panes (builds, tests, agents, servers, prompts), plus a "make trouble" switch that fails one machine at once. It serves the Playwright tests and just screenshots.
  • Done when:
    • geek's and jake-mini's real panes drive the view;
    • 500 panes draw at 60 fps on the laptop and 30 fps on the phone;
    • a real Claude Code question can be allowed from the rail and the agent continues;
    • a failed cargo test reruns from its card;
    • Playwright covers clustering, bundling and each action against the fake fleet.
**Depends on:** #37, #38, #39 (with one host, it needs only M23 and M24) *Swarm track. The view itself: every pane at once, clustered, with what needs you lifted out to a rail.* -------- There's a prototype with fake data, built from the "hundreds of panes, self-clustering" idea. - **Where it lives:** a Swarm view (`/#swarm`) beside the tabs, and in the host menu. It works with one daemon too. - **The field:** - every pane is a tile colored by kind, with brightness from activity; - tiles are pulled toward their cluster's center in proportion to how busy they are, so busy panes sit in the middle and idle ones drift outward; - Canvas 2D: S16 drew 2,000 panes at 60 fps on the laptop and 36 fps on a 4x-throttled phone proxy, so WebGL isn't needed below about 2,000; - physics is about half of each frame, so it sleeps once clusters settle and wakes on a regroup, a new pane or attention. - **Cluster by:** - panes outside any git repo (most of them: S16 found 97 of 105 real commands) group by their cwd's top directory under home, not into one "none" cluster; - project, machine, kind, session or pulse (pouring, ticking, idle, asleep); - switching animates the panes to their new clusters; - the choice is remembered per device. - **Zoom (semantic):** - far out, a pane is a tile; - closer, the tile shows stubs of its last lines; - closer still, it shows live preview text (M23's on-demand previews); - clicking a pane opens it in its tab, connected for real; - hover peeks at its last lines, and clicking a cluster's name zooms to it. - **The "needs you" rail:** - a pane with an M24 reason flares in place, then flies to a card on the rail, with a thread back to its cluster; - cards bundle by the reason's bundle key ("11 failed on build-03", "3 agents ask in illogical"), with bundle actions ("Rerun all 11"); - acting sends the panes back to the swarm; - when the rail is full, the rest pulse in place and the rail says how many are waiting; - `done` cards clear themselves after a while. - **Correlation:** when several panes fail together and share a machine or project you aren't grouped by, offer to cluster by it ("11 panes on build-03 failed within a few seconds"). - **Keyboard:** `j`/`k` through the rail, `a` allow, `d` deny, `r` rerun, `x` dismiss, `Enter` open, `f` fit. - **Phone:** the rail becomes a strip of cards along the bottom, pinch to zoom, tap to open. Push notifications deep-link to the card. - **A fake fleet for tests and screenshots:** a daemon flag or test harness that runs a few hundred scripted panes (builds, tests, agents, servers, prompts), plus a "make trouble" switch that fails one machine at once. It serves the Playwright tests and `just screenshots`. - **Done when:** - geek's and jake-mini's real panes drive the view; - 500 panes draw at 60 fps on the laptop and 30 fps on the phone; - a real Claude Code question can be allowed from the rail and the agent continues; - a failed `cargo test` reruns from its card; - Playwright covers clustering, bundling and each action against the fake fleet.
Author
Owner

Part of the Swarm MVP (#44). The MVP cut of this ticket is listed there; anything not on that list is after the MVP.

Part of the Swarm MVP (#44). The MVP cut of this ticket is listed there; anything not on that list is after the MVP.
Author
Owner

Also depends on #46 (team answers on the rail) and #47 (the team's fleet, and cluster by person) for the MVP.

Also depends on #46 (team answers on the rail) and #47 (the team's fleet, and cluster by person) for the MVP.
Author
Owner

From S16:

  • Canvas 2D is enough up to about 2,000 panes. Physics is half of each frame, so it sleeps once clusters settle.
  • "By project" needs a fallback group: only 8 of 105 real commands on geek ran inside a git repo.
From S16: - Canvas 2D is enough up to about 2,000 panes. Physics is half of each frame, so it sleeps once clusters settle. - "By project" needs a fallback group: only 8 of 105 real commands on geek ran inside a git repo.
Author
Owner

Done 2026-10-02, cut to the MVP (#44), apart from real phones. Merged in 06e1d7b.

What landed:

  • /#swarm, opened from a Swarm button beside the tabs, the host menu or the phone's sheet. It shows every pane in the fleet, and works with one daemon too.
  • The field: Canvas 2D, ported from the prototype.
    • Tiles are coloured by kind, lit by activity, and pulled toward their cluster's centre by how busy they are.
    • The physics sleeps once things settle.
  • Cluster by project, machine, kind, session or person (M30's person).
    • Panes outside a git project group by their directory's top folder under home (~/scratch), or else by their first path component (/tmp), never into one "none" group.
    • Switching animates, and the choice is remembered per device.
  • On the field: hover peeks at a pane's last lines (from capture), a click opens it in its tab, a click on a cluster's name zooms to it, and Fit brings everything back.
  • The rail:
    • M24's reasons appear as cards, bundled by their keys ("3 failed on build-02", "2 agents ask"). A pane flares, then flies to its card, with a thread back to its cluster.
    • The buttons act on every pane in the bundle: Allow all, Deny all, Dismiss all.
    • AskUserQuestion is answered on the card itself. A permission card shows Claude Code's details and suggestions, using the card now shared with the terminal's (ui/answer-card.tsx).
    • After an answer, the card says who answered and offers M29's follow-up box. Viewers get no buttons.
    • When the rail is full, the rest pulse in place with a count. Done cards clear after 15 s.
  • Phone: a strip of cards along the bottom, pinch to zoom, tap to open.
  • Notifications: one with a reason opens at its card (/#swarm=[daemon.]N).
  • A fake fleet:
    • e2e/fake-fleet.ts and just fake-fleet run daemons with stand-in builds, tests, servers, logs and editors, plus an agent that asks through the real hooks.
    • trouble(machine) makes trouble on one machine.
    • src/swarm/fake.ts adds synthetic panes for frame-rate checks and screenshots.
  • Screenshots: site/img/swarm.png and swarm-phone.png, from just screenshots.

Frame rate at 500 panes: 60 fps on the laptop and 60 fps on a 4x-throttled phone viewport (1.1 ms and 4.3 ms of work per frame), matching S16.

Tests:

  • e2e/swarm.spec.ts:
    • clustering in every mode, with the fallback groups;
    • bundling;
    • allow, deny, answer, dismiss and follow-up, from the rail and from the phone's strip;
    • done cards and a full rail;
    • peek, zoom, open and the deep link.
  • e2e/swarm-fps.spec.ts.
  • e2e/swarm-real.spec.ts (opt-in): a real Claude Code permission allowed from the rail, after which the agent carries on.

Not covered (after the MVP):

  • live preview text;
  • pulse clustering;
  • the correlation toast;
  • keyboard shortcuts;
  • rerun on failure cards (M24's later actions).

Real phones are still out of reach: the phone figures come from the 4x throttle.

**Done 2026-10-02, cut to the MVP (#44), apart from real phones.** Merged in 06e1d7b. **What landed:** - **`/#swarm`**, opened from a Swarm button beside the tabs, the host menu or the phone's sheet. It shows every pane in the fleet, and works with one daemon too. - **The field:** Canvas 2D, ported from the prototype. - Tiles are coloured by kind, lit by activity, and pulled toward their cluster's centre by how busy they are. - The physics sleeps once things settle. - **Cluster by** project, machine, kind, session or person (M30's `person`). - Panes outside a git project group by their directory's top folder under home (`~/scratch`), or else by their first path component (`/tmp`), never into one "none" group. - Switching animates, and the choice is remembered per device. - **On the field:** hover peeks at a pane's last lines (from capture), a click opens it in its tab, a click on a cluster's name zooms to it, and Fit brings everything back. - **The rail:** - M24's reasons appear as cards, bundled by their keys ("3 failed on build-02", "2 agents ask"). A pane flares, then flies to its card, with a thread back to its cluster. - The buttons act on every pane in the bundle: Allow all, Deny all, Dismiss all. - AskUserQuestion is answered on the card itself. A permission card shows Claude Code's details and suggestions, using the card now shared with the terminal's (`ui/answer-card.tsx`). - After an answer, the card says who answered and offers M29's follow-up box. Viewers get no buttons. - When the rail is full, the rest pulse in place with a count. Done cards clear after 15 s. - **Phone:** a strip of cards along the bottom, pinch to zoom, tap to open. - **Notifications:** one with a reason opens at its card (`/#swarm=[daemon.]N`). - **A fake fleet:** - `e2e/fake-fleet.ts` and `just fake-fleet` run daemons with stand-in builds, tests, servers, logs and editors, plus an agent that asks through the real hooks. - `trouble(machine)` makes trouble on one machine. - `src/swarm/fake.ts` adds synthetic panes for frame-rate checks and screenshots. - **Screenshots:** `site/img/swarm.png` and `swarm-phone.png`, from `just screenshots`. **Frame rate at 500 panes:** 60 fps on the laptop and 60 fps on a 4x-throttled phone viewport (1.1 ms and 4.3 ms of work per frame), matching S16. **Tests:** - `e2e/swarm.spec.ts`: - clustering in every mode, with the fallback groups; - bundling; - allow, deny, answer, dismiss and follow-up, from the rail and from the phone's strip; - done cards and a full rail; - peek, zoom, open and the deep link. - `e2e/swarm-fps.spec.ts`. - `e2e/swarm-real.spec.ts` (opt-in): a real Claude Code permission allowed from the rail, after which the agent carries on. **Not covered (after the MVP):** - live preview text; - pulse clustering; - the correlation toast; - keyboard shortcuts; - rerun on failure cards (M24's later actions). Real phones are still out of reach: the phone figures come from the 4x throttle.
Author
Owner

Done per PLAN.md (#### M26) and shipped in v0.3.0. Merge commit: 06e1d7b ("Merge M26: the swarm view"). The real-phone checks move to Needs Jake on #55 ("M26/M30: check on real phones and different networks"). Closing.

Done per PLAN.md (#### M26) and shipped in v0.3.0. Merge commit: 06e1d7b ("Merge M26: the swarm view"). The real-phone checks move to *Needs Jake* on #55 ("M26/M30: check on real phones and different networks"). Closing.
Commenting is not possible because the repository is archived.
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jhgaylor/illogical#40
No description provided.