The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
Round dial: a Swarm is its chats — Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: The round dial's Swarm tab shows, per project, the chat the person has open (Lead by default, Chat with PM or a group when the desktop opens one): its last agent message, working only for a working group, and alerts only on new Lead or PM messages.
Architecture:
- The Super Tab service's
SwarmCards(cli/src/superTabs/cards.ts) decides, per Lead:- the chat on the face;
- its kind;
- whether it works;
- the newest Lead/PM message since a baseline.
- These ride on
SwarmLeadthrough the existing cards path. CableSessiongates the new frames on the device's helloswarmChat: "v1". The firmware draws them.- The desktop tells the daemon which conversation is open.
Tech Stack: TypeScript (CLI, vitest), Dart/Flutter (Desktop), C on ESP-IDF 5.5 with Python host tests (round firmware).
Spec: docs/superpowers/specs/2026-10-28-round-dial-swarm-chat-design.md
Global Constraints
- New behaviour only for a device whose hello has
swarmChat: "v1". Every other device (the Pro, round ≤ 0.0.94) gets byte-identical frames to today. - Chat kinds:
lead:project.leadConversationId;pm: a conversation withaudiencewhose project is this one;group: any other conversation of the project.
statefor aswarmChatdevice isworkonly for agroupchat whoseassignment.status === 'working', elsedone. It is neveraskorstuck.- Recap and notice text: the newest message whose
sourceis null and whoseauthor.idis an agent of the chat:- the Lead for
lead/pm; - the group's
agentIdsforgroup.
- the Lead for
- Alerts only for the Lead conversation and the Chat with PM, only for messages written by the project's Lead agent. Group messages never alert.
- Baseline: messages at or before the first sequence seen after the service starts, or when a device attaches, never alert.
- Names are cut to 48 bytes (
NAME_BYTES), texts to 1500 bytes (RECAP_BYTES/truncateUtf8(…, 1500)), and ids are checked withCARD_ID/cardId. - A Lead's own terminal question (the
questionframe withsuperTab) still alerts on the dial. - Firmware dev builds are
-DPROJECT_VER=0.0.99. Flash only with Diego's yes, naming MAC28:84:85:90:63:E8and the build. Never upload firmware or touch the OTA manifest. - Verified on 2026-10-28 (spec's first Unverified line): Chat with PM messages carry
author: {kind: 'agent', id: <Lead agent id>}andsource: null, the same shape as the Lead conversation.
Review Focus
- A device re-attaches or the daemon restarts while a Lead notice is in the cards. The cards replay must not beep
again. Tested in Task 3:
replays a held notice without sending it. - Two Lead messages land between two tab reads. One notice for the newest, not two beeps. A failed page read must
not advance the baseline, so the next move retries. Tested in Task 1:
one notice for the newest of two messagesanda failed read keeps the baseline. - The desktop already has the PM chat open when the PM writes. No beep: the notice is not sent, or is read at once.
Tested in Task 3:
does not send a notice for the chat the desktop has open. - The desktop opens a conversation of another project or another Swarm, or one that is archived. That project's
face stays on its Lead chat, and a recap for the old chat is dropped by the dial. Tested in Task 1
(
ignores a focus outside the project) and Task 5 (drops a recap for another chat). - An old dial or the Pro next to a new daemon. Frames are byte-identical to today, the Pro's recap is still the
Lead conversation, and talk still goes to the Lead conversation. Tested in Task 3:
a device without swarmChat gets today's frames.
Task 1: SwarmCards picks each project's chat, its recap and its Lead/PM notice
Files:
- Modify:
cli/src/core/api.ts:1218-1225(types)cli/src/superTabs/cards.ts(leadsOf,lastLeadMessage,SwarmCards.want/recap/open/say, a notice watcher)cli/src/superTabs/inCore/cards.ts(validate the new fields)
- Test:
cli/src/superTabs/cards.spec.ts,cli/src/superTabs/inCore/cards.spec.ts
Interfaces:
Produces (in
core/api.ts):export type ChatKind = 'lead' | 'pm' | 'group' export interface SwarmChat { kind: ChatKind; id: string; name: string; working: boolean; since?: number } export interface LeadNotice { chat: 'lead' | 'pm'; chatId: string; id: string; text: string; at: number } // SwarmLead gains: chat?: SwarmChat; notice?: LeadNotice // LeadRecap gains: chatId?: string export interface CardFocus { tabId: string; conversationId: string }Produces (in
cards.ts):leadsOf(state, machineId, live, me?, focus?: string).focusis the conversation the window has open in this tab. Every Lead getschat.statekeeps today's meaning, for old devices.lastAgentMessage(messages: Json[], agentIds: ReadonlySet<string>): { text: string; at: number; id: string; sequence: number } | null. It replaceslastLeadMessage, whose callers passnew Set([leadId]).SwarmCards:want(on: boolean, include?: string[], focus?: CardFocus | null): void. A focus change rebuilds the cards at once.recap(tabId, leadId, chat = false): Promise<LeadRecap>. Withchat, it reads the face chat with its agents and returnschatId.open(session, tabId, leadId, chat = false). Withchat, it watches the face chat's sequence.say(harnessId, text, chat = false). Withchat, it posts to the face chat's id.
Step 1: Write the failing tests in
cards.spec.ts:leadsOf(indescribe('leadsOf chats')):opens each project on its Lead chat:chatis{kind:'lead', id: leadConversationId, name:'Lead', working:false}.follows the window to the project's Chat with PM: focus = the audience conversation, giving{kind:'pm', name:'PM'}.follows the window to a group:{kind:'group', name: <group title cut to 48 bytes>}.workingis true only when that group'sassignment.status === 'working', andsincecomes from a live turn of one of its agents here.ignores a focus outside the project: a conversation of another project, an unknown id, or an archived group leaves the Lead chat.
lastAgentMessage:takes the newest row by any of the chat's agents, skipping the person and source rows.SwarmCardsnotices (use the existing fake backend and tab reads):records a baseline on the first read and sends no notice.notices a new Lead message in the Lead conversation, givingnotice = {chat:'lead', chatId, id, text, at}.notices a new Lead message in Chat with PM, giving{chat:'pm', …}.never notices a group message, the person's message or a system row.one notice for the newest of two messages.a failed read keeps the baseline: the read throws, then the next move notices the message.
SwarmCardsrecap:recap with chat reads the face chat and names its chatId;recap without chat is today's Lead recap.
SwarmCardssay:say with chat posts message.send to the face chat.- In
inCore/cards.spec.ts:keeps a sound chat and notice, drops a malformed one. Bad kind, non-idchatId, and over-long text are cut or dropped, and the Lead is kept without them.
Step 2: Run to verify they fail
Run:
cd cli && npx vitest run src/superTabs/cards.spec.ts src/superTabs/inCore/cards.spec.tsExpected: FAIL (nochat/notice,lastAgentMessageundefined).Step 3: Implement the types,
leadsOfchat selection,lastAgentMessage, and the notice watcher- Notice watcher:
SwarmCardskeepsseen: Map<conversationId, sequence>andnotices: Map<leadKey, LeadNotice>(lead key${tabId}:${leadId}). - On each tab read, for each project's Lead conversation and PM chat,
lastMessageSequence > seentriggers one page read, under theMAX_RECAPS_IN_FLIGHTlimit, taking the newest Lead-written message afterseen. - It sets
noticesand advancesseenonly after a successful read. A first sight setsseenwithout reading. - Clear both maps when the account changes (where
recaps.clear()is today). Drop a tab's entries when it leaves the cards. leadsOfcallers attachnoticefromnotices.
- Notice watcher:
Step 4: Run to verify they pass
Run:
cd cli && npx vitest run src/superTabs && npx tsc --noEmit -p .Expected: PASS, typecheck clean.Step 5: Commit
git add cli/src/core/api.ts cli/src/superTabs/cards.ts cli/src/superTabs/cards.spec.ts cli/src/superTabs/inCore/cards.ts cli/src/superTabs/inCore/cards.spec.tsgit commit -m "feat(swarm): cards carry each project's chat on the face and the Lead's newest message as a notice"
Task 2: The window's open conversation reaches SwarmCards, and the chat flags reach the service
Files:
- Modify:
cli/src/localWsServer.ts:234-262(appSwarmsFrom:conversationId)cli/src/cable/cableSession.ts:274(AppSwarmsrow type)cli/src/cable/cableHost.ts:activeSwarmProject()addsconversationId?;swarmCardRecap,swarmCardOpenandswarmSaytakechat = false.
cli/src/services/devices.ts:170, 226-233, 490-500:tellCardssendsfocus;- the
swarmshandler re-tells on a focus change; - the chat flags are passed on.
cli/src/core/devicesLink.ts:126-131: passfocusandchat.cli/src/superTabs/service.ts:348-362: readfocus(both idscardId) andchat === true.
- Test:
cli/src/localWsServer.spec.ts,cli/src/services/devices.spec.ts(or the existing devices-wiring spec),cli/src/superTabs/service.spec.ts
Interfaces:
Consumes:
CardFocus,SwarmCards.want/recap/open/say(Task 1).Produces:
DaemonCableHost.activeSwarmProject(): { superTabId; projectId; conversationId?; fromDevice } | null;swarmCardRecap(tabId, leadId, chat?: boolean),swarmCardOpen(session, tabId, leadId, chat?: boolean),swarmSay(harnessId, text, chat?: boolean);- service actions
cardsWanted {on, include, focus?},cardRecap {…, chat?},cardOpen {…, chat?},cardSay {…, chat?}.
Step 1: Write the failing tests
localWsServer.spec.ts:app_swarms keeps a Swarm tab's conversationId, and drops one that is not an id.- Devices spec:
tells the cards the window's open Swarm conversation, again only when it changes. service.spec.ts:cardsWanted passes focus to the cards; cardRecap, cardOpen and cardSay pass chat.
Step 2: Run to verify they fail
Run:
cd cli && npx vitest run src/localWsServer.spec.ts src/superTabs/service.spec.ts <devices spec>Expected: FAIL.Step 3: Implement the field and the pass-through.
focusis{tabId: superTabId, conversationId}of the window's active Swarm tab, or null when the active tab is not a Swarm or names no conversation.Step 4: Run to verify they pass
Run: same command, then
npx tsc --noEmit -p .Expected: PASS, clean.Step 5: Commit —
feat(swarm): the window's open Swarm conversation reaches the cards; the dial's chat flag reaches the service
Task 3: CableSession speaks swarmChat: "v1"
Files:
- Modify:
cli/src/cable/cableSession.ts:- hello parsing, around 1240:
this.swarmChat = str('swarmChat') === 'v1', reset with the others at 684; pushSwarmCards, around 2648;onSuperTabrecap/open, around 2720-2750;swarmCardRecap, around 2714;- the talk path that calls
host.swarmSay.
- hello parsing, around 1240:
- Test:
cli/src/cable/cableSession.spec.ts
Interfaces:
Consumes:
SwarmLead.chat/notice, the chat flags (Tasks 1–2).Produces, the wire for a
swarmChatdevice:supertablead entries addchat,chatIdandchatName;stateischat.working ? 'work' : 'done', andsinceischat.since(or none).supertab.recapaddschatId.- New frame
supertab.notice {tab, lead, chat, chatId, id, text, at}. - New frame
supertab.notice.read {tab, lead, chatId}.
Step 1: Write the failing tests in
describe('swarmChat'):a device without swarmChat gets today's frames: samesupertabbytes as before for a card withchat/noticeset. The recap is requested withoutchat, and talk withoutchat.a swarmChat device gets chat, chatId, chatName and work only for a working group.sends a notice once per id.replays a held notice without sending it: attach, or a forced cards push, with a notice already present sends nothing. A later new id is sent.does not send a notice for the chat the desktop has open: the activeconversationIdequalsnotice.chatId.sends notice.read when the desktop opens a chat with a sent notice.asks recaps and talks with chat, and passes chatId on the recap.- The frame size:
12 Leads with chats stay under the device's 512-token guard. Count tokens as the existing guard test does.
Step 2: Run to verify they fail
Run:
cd cli && npx vitest run src/cable/cableSession.spec.ts -t swarmChatExpected: FAIL.Step 3: Implement.
- Keep per session
sentNotices: Map<leadKey, noticeId>. On attach and onforce, fill it from the current cards without sending. - The notice-read check runs in
pushSwarmCardsagainsthost.activeSwarmProject()?.conversationId.
- Keep per session
Step 4: Run to verify they pass
Run:
cd cli && npx vitest run src/cable src/superTabs && npx tsc --noEmit -p .Expected: PASS, clean.Step 5: Commit —
feat(cable): swarmChat devices get the chat on the face, Lead/PM notices and chat recaps
Task 4: Desktop announces the open Swarm conversation
Files:
- Modify:
desktop/lib/state/app_state.dart:_announceOpenPanesToDialswarm rows, around 5660-5700: addconversationId;- the #1911 re-announce listener: also fire when the selected conversation changes.
- Test:
desktop/test/super_tab_dial_test.dart
Interfaces:
Produces: the
app_swarmsrow fieldconversationId. It is the controller'sselectedIdwhensnapshot.conversation(selectedId) != null, else absent.Step 1: Write the failing tests
a Swarm tab announces the open conversation's id: the Lead conversation, then the PM chat, then a group.selecting another conversation re-announces.a decisions view or an unloaded Swarm leaves conversationId out.
Step 2: Run to verify they fail
Run:
cd desktop && flutter test test/super_tab_dial_test.dartExpected: FAIL.Step 3: Implement next to the existing
projectIdline, with the samesuperTabs.peek(tabId)guard.Step 4: Run to verify they pass
Run:
cd desktop && flutter test test/super_tab_dial_test.dart && flutter analyze lib/state/app_state.dartExpected: PASS, no issues.dart formaton the touched files only.Step 5: Commit —
feat(desktop): tell the dial which Swarm conversation is open
Task 5: Firmware model and cable: parse the chat, the chat recap and the notices
Files:
- Modify:
devices/harness-device/firmware/main/ui/habitat/supertab.h:14-40:typedef enum { HT_CHAT_LEAD, HT_CHAT_PM, HT_CHAT_GROUP } ht_chat_kind_t;ht_lead_taddsht_chat_kind_t chat,chat_id[ID_MAX]andchat_name[HT_SUPERTAB_NAME];ht_lead_in_taddschat,chat_idandchat_name;- the recap struct adds
chat_id[ID_MAX].
supertab.c: copy the fields inht_supertab_lead_add/ht_supertabs_put.ht_supertabs_recap_puttakeschat_idand drops a recap whosechat_iddiffers from the face Lead's.main/cable_client.c:- hello
msg_string(&root, "swarmChat", "v1")beside line 323; handle_supertabreadschat/chatId/chatName;handle_supertab_recapreadschatId;- new
handle_supertab_noticeandhandle_supertab_notice_read, registered beside line 1375, callingui_supertab_noticeandui_supertab_notice_read.
- hello
main/cable_client.h: declare the twoui_functions next toui_supertab_focus.
- Test:
devices/harness-device/firmware/test/test_supertab.c,test/test_cable_supertab.py
Interfaces:
Produces (C):
void ui_supertab_notice(const char *tab, const char *lead, ht_chat_kind_t chat, const char *chat_id, const char *text, uint32_t at); void ui_supertab_notice_read(const char *tab, const char *lead, const char *chat_id);- A missing
chatmeansHT_CHAT_LEAD,chat_id"" andchat_name"", for frames from an old daemon.
- A missing
Step 1: Write the failing tests
test_supertab.c:lead keeps chat, chat_id, chat_name;drops a recap for another chat;a lead without chat fields reads as the Lead chat.
test_cable_supertab.py:hello says swarmChat v1;supertab with chat fields parses;supertab.notice and supertab.notice.read reach the ui calls with their fields;a notice with a non-id chatId or no lead is ignored.
Step 2: Run to verify they fail
Run:
source ~/esp/esp-idf/export.sh && make device-testExpected: the new cases FAIL.Step 3: Implement the fields, parsing and handlers. The
ui_bodies land in Task 6. Here, a weak stub in the test harness records the calls.Step 4: Run to verify they pass
Run:
make device-testExpected: all PASS.Step 5: Commit —
feat(dial): parse a Lead's chat, chat recaps and Lead/PM notices; say swarmChat v1
Task 6: Firmware face and alerts follow the chat
Files:
- Mockup first, not committed:
devices/harness-device/mockup/swarm-chat.htmlin the main checkout (gitignored).- It shows the face for a Lead chat, a PM chat, a long group name and a working group.
- Open it with
open, and get Diego's OK on how the chat name sits under the project before coding.
- Modify:
devices/harness-device/firmware/main/ui/habitat/ui_habitat.c:render_swarm_face(~1290);swarm_notice_raise/swarm_notice_drop(~4892-4930);ui_supertab_wait_close(~5051);- new
ui_supertab_noticeandui_supertab_notice_readafterui_supertab_focus(~5005).
- Test:
devices/harness-device/firmware/test/test_touch_ui.py(add the two functions to its lifted list at line 238)
Interfaces:
- Consumes: the
ht_lead_tchat fields and the twoui_declarations (Task 5).
Behaviour:
Face:
- The chat name is drawn under the project on the upper arc when
chat != HT_CHAT_LEAD. - The recap shows whenever it is loaded for the face's
chat_id. - The working pet and clock show only when
l->state == HT_LEAD_WORK. askingcomes only from an open wait.
- The chat name is drawn under the project on the upper arc when
Alerts:
ui_supertab_noticeraises the Lead's single entry with the text as its body. The grey line is the Swarm name, plus " · PM" forHT_CHAT_PM.- It beeps and wakes with the existing coalescing.
- It is read at once only when
on_face(lead)and the face Lead'schat_idequals the notice's. - A newer notice replaces the text and marks the entry unread.
ui_supertab_notice_readremoves the entry when itschat_idmatches.
ui_supertab_wait_close: when the Lead's state is notask/stuck, which is always the case with aswarmChatdaemon, the entry is dropped, as theelsebranch already does. Check that no change is needed there and add the test.Step 1: Write the failing tests in
test_touch_ui.py:swarm face shows PM under the project and the recap, no working;a working group shows the working pet,a done group shows its recap;notice for the face's chat is read at once and does not beep;notice for another chat stays unread and beeps once;notice.read removes the entry;a second notice replaces the text and is unread again;a Lead wait still raises its entry;no entry from a lead state change when chats are on.
Step 2: Run to verify they fail
Run:
make device-testExpected: the new cases FAIL.Step 3: Implement as described under Behaviour.
Step 4: Run to verify they pass, and build
Run:
make device-test, thenidf.py -C devices/harness-device/firmware -B build-dev99 -DIDF_TARGET=esp32s3 -DSDKCONFIG=build-dev99/sdkconfig.dev -DDEVICE_FORCE_PROD=1 -DPROJECT_VER=0.0.99 buildExpected: all PASS; build succeeds.Step 5: Commit —
feat(dial): the Swarm face shows the open chat; alerts come from Lead/PM notices
Task 7: Real check on Diego's round, and the docs
Files:
Modify:
docs/superpowers/specs/2026-10-23-round-swarm-tab-design.md: a short note at §4/§5 pointing to the new spec forswarmChatdevices;docs/swarms.md: the device part, if it describes dial alerts.
Step 1: Run the CLI from this branch on Diego's Mac only with his yes (
make install-cli, without--no-updates). Or wait for the release that carries Tasks 1–3.Step 2: Ask Diego, naming MAC
28:84:85:90:63:E8and the build (0.0.99 from this branch's HEAD). On his yes, flash with the round procedure:- quit the app;
- write the flasher flag;
harness stop;idf.py -p /dev/cu.usbmodem21301 flash;- remove the flag;
harness start;- reopen the app.
Check that the log shows
on fw 0.0.99withswarmChat.Step 3: Diego's checks:
- Swipe between projects: each opens on its Lead.
- Open Chat with PM, then a group, on the desktop: the dial follows.
- A working group shows working; the Lead chat never does.
- A new PM message alerts once; a group message does not.
Read the daemon log lines for each.
Step 4: Commit the docs:
docs: the round Swarm tab follows the chat for swarmChat devices.