Skip to content

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: PM | Buddy pair, bell-only notices, Personal | Team picker (#3200)

0xdiego254e605ac4e61a
diff --git a/backend/integration/superTabDeletion.test.ts b/backend/integration/superTabDeletion.test.ts
index ca68c4632..feb4a8c1d 100644
--- a/backend/integration/superTabDeletion.test.ts
+++ b/backend/integration/superTabDeletion.test.ts
@@ -132,6 +132,16 @@ describe('deleting a Swarm', () => {
expect(await listed(w, owner)).toContain(personal)
})
+ it('marks only the reader\'s own Personal Swarm on the list', async () => {
+ const w = world(), f = await swarm(w)
+ const mine = (await w.store.create(owner, PERSONAL_SWARM_OPERATION, 'Personal')).id
+ const theirs = (await w.store.create(member, PERSONAL_SWARM_OPERATION, 'Personal')).id
+ const marks = async (who: AuthUser) => Object.fromEntries((await w.store.list(who)).tabs.map(t => [t.id, 'personal' in t ? t.personal : undefined]))
+ expect(await marks(owner)).toMatchObject({ [mine]: true, [f.tab]: undefined })
+ expect(await marks(member)).toMatchObject({ [theirs]: true, [f.tab]: undefined })
+ expect(Object.keys(await marks(member))).not.toContain(mine)
+ })
+
it('stops its agents through their host and releases the machine, whose host still confirms both', async () => {
const w = world(), f = await swarm(w)
await f.execute({ type: 'swarm.delete', name: 'Lampos' })
diff --git a/backend/src/superTabs/store.ts b/backend/src/superTabs/store.ts
index 7966d4d72..dfec79ceb 100644
--- a/backend/src/superTabs/store.ts
+++ b/backend/src/superTabs/store.ts
@@ -20,7 +20,7 @@ import { githubRepository } from '../github/repository.js'
import { isTeamSession, teamMachine, TEAM_SESSION_LIMITED, TEAM_SESSION_MESSAGE } from '../lib/teamSession.js'
import { machineShareGrant, sharedVia } from '../lib/machineSharePolicy.js'
import { machineBillingAllowsDataPlane } from '../lib/billingState.js'
-import { DELETED_SWARM_COMMANDS, DELETION_COMMANDS, notThere } from './deletion.js'
+import { DELETED_SWARM_COMMANDS, DELETION_COMMANDS, isPersonalSwarm, notThere } from './deletion.js'
import type { ApprovalRow, DroppedLine } from './ruleGuard.js'
import { applyCommand, authorizeCommandAccess, IGNORED_NOTE, SWARM_INVITATION_MS, LOOP_NOTICE_AT, mayResumeStart, operationSchema, postable, reserveHarnessSlot, worksInProjectChat, ruleProject, type Command, type CommandContext } from './commands.js'
import { redactCredentials } from './credentials.js'
@@ -1122,7 +1122,9 @@ export class SuperTabStore {
const heads = await this.heads(rows.slice(0, 100))
return { tabs: rows.slice(0, 100).flatMap(row => {
const head = heads.get(row.id)
- return head ? [{ id: row.id, name: head.name, ownerId: row.ownerId, revision: row.revision, paused: head.paused }] : []
+ return head ? [{ id: row.id, name: head.name, ownerId: row.ownerId, revision: row.revision, paused: head.paused,
+ // Only on the reader's own Personal Swarm: another person's is not theirs to be told apart.
+ ...(isPersonalSwarm(head) && head.ownerId === user.sub ? { personal: true as const } : {}) }] : []
}), next: rows.length > 100 ? rows[99]!.id : null }
}
diff --git a/cli/src/cable/cableSession.spec.ts b/cli/src/cable/cableSession.spec.ts
index 4f09f581c..37afe7399 100644
--- a/cli/src/cable/cableSession.spec.ts
+++ b/cli/src/cable/cableSession.spec.ts
@@ -5318,6 +5318,56 @@ describe('swarm cards', () => {
}
})
+ it('supertab frame says personal', async () => {
+ const state = { cards: [card('st1', [withBuddy()], { personal: true }), card('st2', [withBuddy()])] }
+ const { session, port } = await connect(cardHost(state))
+ try {
+ port.say(BUDDY)
+ await vi.waitFor(() => expect(ofType(port, 'supertab')).toHaveLength(2))
+ const frames = ofType(port, 'supertab')
+ expect(frames.find((f) => f.id === 'st1')?.personal).toBe(true)
+ expect(frames.find((f) => f.id === 'st2')).not.toHaveProperty('personal')
+ } finally { await session.stop() }
+ })
+
+ it('a swarmNeedsYou dial gets no Buddy quiet notice', async () => {
+ for (const hello of [{ ...BUDDY, swarmNeedsYou: 'v1' }, BUDDY]) {
+ const state = { cards: [card('st1', [withBuddy()])] }
+ const { session, port } = await connect(cardHost(state))
+ try {
+ port.say(hello)
+ await vi.waitFor(() => expect(ofType(port, 'supertab')).toHaveLength(1))
+ await settle(); await settle()
+ state.cards = [card('st1', [withBuddy({ notice: pmNotice('n1'), buddyNotice: buddyNotice('b1') })])]
+ await session.syncSwarmCards()
+ await vi.waitFor(() => expect(ofType(port, 'supertab.notice').length).toBeGreaterThan(0))
+ await new Promise((r) => setTimeout(r, 350))
+ expect(ofType(port, 'supertab.notice').map((n) => n.id)).toEqual(hello === BUDDY ? ['n1', 'b1'] : ['n1'])
+ } finally { await session.stop() }
+ }
+ })
+
+ it('a decision notice goes only to a swarmNeedsYou dial; any other dial keeps the tag notice it covers, or none', async () => {
+ const tagOne = { chat: 'group' as const, chatId: 'g1', id: 'tag1', text: 'Sam: look', at: 1792560000 }
+ const decided = { chat: 'lead' as const, chatId: 'lead1', id: 'dec1', text: 'Dee asks you: Ship it?', at: 1792560100, decision: true as const }
+ for (const [hello, covered] of [[{ ...BUDDY, swarmNeedsYou: 'v1' }, true], [BUDDY, true], [BUDDY, false]] as const) {
+ const state = { cards: [card('st1', [withBuddy()])] }
+ const { session, port } = await connect(cardHost(state))
+ try {
+ port.say(hello)
+ await vi.waitFor(() => expect(ofType(port, 'supertab')).toHaveLength(1))
+ await settle(); await settle()
+ state.cards = [card('st1', [withBuddy({ notice: covered ? { ...decided, tag: tagOne } : decided })])]
+ await session.syncSwarmCards()
+ await new Promise((r) => setTimeout(r, 350))
+ const ids = ofType(port, 'supertab.notice').map((n) => n.id)
+ expect(ids).toEqual('swarmNeedsYou' in hello ? ['dec1'] : covered ? ['tag1'] : [])
+ // Nothing a dial is sent names the daemon's own fields.
+ for (const n of ofType(port, 'supertab.notice')) { expect(n).not.toHaveProperty('decision'); expect(n).not.toHaveProperty('tag') }
+ } finally { await session.stop() }
+ }
+ })
+
// Review of #2500: with one Swarm Buddy, its one word badges every card; seeing the Buddy side clears them all.
it('showing the Buddy side reads the Swarm Buddy\'s notice on every card that shares it, and no other chat\'s', async () => {
const own = { ...buddyNotice('o1'), chatId: 'own-chat' }
diff --git a/cli/src/cable/cableSession.ts b/cli/src/cable/cableSession.ts
index 4600ddb5e..9efb355ee 100644
--- a/cli/src/cable/cableSession.ts
+++ b/cli/src/cable/cableSession.ts
@@ -776,6 +776,9 @@ export class CableSession {
* (`supertab.side`), each Lead carries `buddies` and the reader's Buddy, and the Buddy's word is a quiet notice. A
* swarmChat dial without it gets today's frames byte for byte. */
private swarmBuddy = false
+ /** `swarmNeedsYou: 'v1'` beside swarmChat (spec 2026-11-05-dial-lead-pm-buddy-pair): the bell and inbox hold only what needs the
+ * reader, so the Buddy's quiet notices are never sent to it. */
+ private swarmNeedsYou = false
/** `swarmThread: 'v1'` beside swarmChat (spec 2026-11-03-dial-thread-face): the dial draws the thread its face is in
* (`thread`, `threadTitle`, `threadReplies` on a Lead, `thread` on a recap) and leaves it with `supertab.thread.leave`. */
private swarmThread = false
@@ -795,14 +798,14 @@ export class CableSession {
/** For the greeting's log line: which capabilities this hello named, or nothing. */
private capabilitiesNamed(): string {
- const named = [this.swarmMembers && 'swarms', this.longRecap && 'recap', this.stepsActivity && 'activity', this.statsTurn && 'stats', this.playerCapable && 'player', this.superTabWaits && 'superTab', this.swarmCard && 'swarmCard', this.swarmChat && 'swarmChat', this.swarmBuddy && 'swarmBuddy', this.swarmThread && 'swarmThread', this.swarmReview && 'swarmReview']
+ const named = [this.swarmMembers && 'swarms', this.longRecap && 'recap', this.stepsActivity && 'activity', this.statsTurn && 'stats', this.playerCapable && 'player', this.superTabWaits && 'superTab', this.swarmCard && 'swarmCard', this.swarmChat && 'swarmChat', this.swarmBuddy && 'swarmBuddy', this.swarmNeedsYou && 'swarmNeedsYou', this.swarmThread && 'swarmThread', this.swarmReview && 'swarmReview']
.filter(Boolean)
return named.length ? ` caps ${named.join(',')}` : ''
}
private resetCapabilities(): void {
this.swarmMembers = this.longRecap = this.stepsActivity = this.statsTurn = this.playerCapable = this.superTabWaits = false
- this.swarmCard = this.swarmChat = this.swarmBuddy = this.swarmThread = this.swarmReview = false
+ this.swarmCard = this.swarmChat = this.swarmBuddy = this.swarmNeedsYou = this.swarmThread = this.swarmReview = false
this.dropCards()
this.seqOn = false
this.seq = 0
@@ -1374,6 +1377,7 @@ export class CableSession {
this.swarmChat = this.swarmCard && str('swarmChat') === 'v1'
this.swarmBuddy = this.swarmChat && str('swarmBuddy') === 'v1'
this.swarmThread = this.swarmChat && str('swarmThread') === 'v1'
+ this.swarmNeedsYou = this.swarmChat && str('swarmNeedsYou') === 'v1'
this.swarmReview = this.swarmChat && str('swarmReview') === 'v1'
this.wantCards(this.swarmCard)
this.seqOn = str('board') === 'pro'
@@ -2998,7 +3002,7 @@ export class CableSession {
if (this.leadThreads.has(key) && this.leadThreads.get(key) !== root && this.lastRecapGet?.key === key) this.lastRecapGet = null
this.leadThreads.set(key, root)
}
- const frame = { t: 'supertab', id: card.id, tab, name: card.name, count: card.count, ...(this.swarmBuddy ? { side: card.side ?? 'pm' } : {}),
+ const frame = { t: 'supertab', id: card.id, tab, name: card.name, count: card.count, ...(card.personal ? { personal: true } : {}), ...(this.swarmBuddy ? { side: card.side ?? 'pm' } : {}),
leads: card.leads.slice(0, SWARM_LEADS_MAX).map((l) => this.swarmBuddy ? buddyLead(l, this.swarmThread) : this.swarmChat ? chatLead(l, l.chat, this.swarmThread) : { id: l.id, projectId: l.projectId, project: l.project,
engine: l.engine, owner: l.owner, local: l.local, state: l.state, order: l.order, ...(l.since === undefined ? {} : { since: l.since }) }) }
// Every dial's guard drops a frame over 512 tokens whole, a round dial's too (task #2525).
@@ -3029,8 +3033,10 @@ export class CableSession {
for (const card of cards) {
for (const lead of card.leads.slice(0, SWARM_LEADS_MAX)) {
// The Buddy's quiet notice is held apart (spec 2026-10-29 Alerts), and only a swarmBuddy dial hears it.
- const notices: Array<[string, LeadNotice | undefined]> = [[`${card.id}:${lead.id}`, lead.notice]]
- if (this.swarmBuddy) notices.push([`${card.id}:${lead.id}:buddy`, lead.buddyNotice])
+ // A decision asked of the reader is heard by a swarmNeedsYou dial alone; any other keeps the tag it covers, else none.
+ const heard = lead.notice?.decision && !this.swarmNeedsYou ? lead.notice.tag : lead.notice
+ const notices: Array<[string, LeadNotice | undefined]> = [[`${card.id}:${lead.id}`, heard]]
+ if (this.swarmBuddy && !this.swarmNeedsYou) notices.push([`${card.id}:${lead.id}:buddy`, lead.buddyNotice])
for (const [key, notice] of notices) {
live.add(key)
await this.pushNotice(key, card.id, lead.id, notice, replay, open?.superTabId === card.id ? open : undefined)
diff --git a/cli/src/core/api.ts b/cli/src/core/api.ts
index b312a9661..973dbcaff 100644
--- a/cli/src/core/api.ts
+++ b/cli/src/core/api.ts
@@ -1258,7 +1258,9 @@ export interface SwarmLead {
/** One Swarm this account is in, as a Harness Pro's card: its Leads, most urgent first. */
/** `side` 'buddy' while a swarmBuddy dial keeps the Swarm on its Buddy side (spec 2026-10-29-round-dial-pm-buddy): the dial
* follows it as the daemon's, which a face alone cannot tell where no project has a Buddy chat (review of #2218). */
-export interface SwarmCard { id: string; name: string; count: number; leads: SwarmLead[]; side?: 'buddy' }
+export interface SwarmCard { id: string; name: string; count: number; leads: SwarmLead[]; side?: 'buddy'
+ /** The reader's own Personal Swarm (the list row's `personal: true`); never set on a Team Swarm. */
+ personal?: true }
/** A Lead's last message, for its card; `chatId` when it is the last message of the chat on the round dial's face, and
* `buddy` when that face is a swarmBuddy dial's (`CardChat` 'buddy'), so each dial takes only the recaps it asked for. */
export interface LeadRecap { tabId: string; leadId: string; text: string; at: number; none: boolean; chatId?: string; buddy?: true
@@ -1279,7 +1281,11 @@ export interface SwarmChat { kind: ChatKind; id: string; name: string; working:
* reader's Buddy chat or a Chat with PM (`pm`), or a task chat (`group`, #2965); or the newest message the reader's Buddy
* wrote in its chat (`buddy`, the quiet one). `thread`: the root of the thread it is in, when it is in that thread only; such
* a notice is read only where that thread is open. */
-export interface LeadNotice { chat: 'lead' | 'pm' | 'group' | 'buddy'; chatId: string; id: string; text: string; at: number; thread?: string }
+export interface LeadNotice { chat: 'lead' | 'pm' | 'group' | 'buddy'; chatId: string; id: string; text: string; at: number; thread?: string
+ /** A decision asked of the reader: only a swarmNeedsYou dial hears it. */
+ decision?: true
+ /** On a decision's notice: the tag notice it covers (never a decision), which a dial that hears no decisions keeps showing. */
+ tag?: LeadNotice }
/** The reader's own Buddy in a project, for a round dial's Buddy screen: its chat, name and engine, Desktop's pattern for
* its name (`cells`, the 15 half bits; `color`, `#rrggbb`), and `live` false while it is down. */
export interface SwarmBuddy { chatId: string; name: string; engine: string; cells: number; color: string; live: boolean
diff --git a/cli/src/superTabs/cards.spec.ts b/cli/src/superTabs/cards.spec.ts
index eec2e3769..bc9b2f86e 100644
--- a/cli/src/superTabs/cards.spec.ts
+++ b/cli/src/superTabs/cards.spec.ts
@@ -247,7 +247,7 @@ describe('lastAgentMessage in a chat or a thread', () => {
})
/** A fake backend: tabs by id with the time each last changed, a message store per conversation, and call counting. */
-function setup(tabs: Record<string, { lastChangedAt: number; state: Record<string, unknown> }>, extra: { activity?: Record<string, 'working' | 'idle'>; elapsed?: number; messages?: (path: string) => unknown; post?: () => { status: number; body: Record<string, unknown> }; delayMs?: number; mentions?: (path: string) => unknown[] } = {}) {
+function setup(tabs: Record<string, { lastChangedAt: number; state: Record<string, unknown> }>, extra: { activity?: Record<string, 'working' | 'idle'>; elapsed?: number; messages?: (path: string) => unknown; post?: () => { status: number; body: Record<string, unknown> }; delayMs?: number; mentions?: (path: string) => unknown[]; decisions?: (path: string) => unknown[]; decisionsMore?: () => boolean; personal?: string[] } = {}) {
const calls: string[] = []
// Message reads in flight now and at most, for a backend whose reads take `delayMs`.
let reading = 0, mostReading = 0
@@ -266,7 +266,7 @@ function setup(tabs: Record<string, { lastChangedAt: number; state: Record<strin
let page = pages[after ?? '']?.next !== undefined ? rest.slice(0, 1) : rest
let next = pages[after ?? ''] ? pages[after ?? ''].next : null
if (pageSize) { page = rest.slice(0, pageSize); next = page.length < rest.length ? page[page.length - 1] : null }
- return { status: 200, body: { success: true, data: { tabs: page.map(id => ({ id, name: String(tabs[id].state.name), ownerId: 'me', lastChangedAt: tabs[id].lastChangedAt, paused: false })), next } } }
+ return { status: 200, body: { success: true, data: { tabs: page.map(id => ({ id, name: String(tabs[id].state.name), ownerId: 'me', lastChangedAt: tabs[id].lastChangedAt, paused: false, ...(extra.personal?.includes(id) ? { personal: true } : {}) })), next } } }
}
const tab = /^\/api\/super-tabs\/([^/]+)\/(parts|changes)$/.exec(route)
if (tab) {
@@ -281,6 +281,7 @@ function setup(tabs: Record<string, { lastChangedAt: number; state: Record<strin
if (extra.delayMs) await new Promise(resolve => setTimeout(resolve, extra.delayMs))
// The reader's tags, as the backend lists them (mentions.ts listMentions).
if (/^\/api\/super-tabs\/[^/]+\/mentions$/.test(route)) return { status: 200, body: { success: true, data: { mentions: extra.mentions?.(path) ?? [] } } }
+ if (/^\/api\/super-tabs\/[^/]+\/decisions$/.test(route)) return { status: 200, body: { success: true, data: { more: extra.decisionsMore?.() ?? false, decisions: extra.decisions?.(path) ?? [] } } }
return { status: 200, body: { success: true, data: { ...(extra.messages?.(path) ?? { messages: [], next: null }) as object } } }
} finally { reading-- }
})
@@ -833,6 +834,118 @@ function tagSwarm(initial: Tag[] = []) {
return { ...t, tagged, said: said2, mentionReads, webLead, offline: (v: boolean) => { offline = v } }
}
+/** An open decision asked of the reader, as `/decisions?state=open` lists it (backend decisions.ts listDecisions). */
+const decision = (id: string, over: Record<string, unknown> = {}) => ({ id, batchId: `b-${id}`, projectId: 'web', projectName: 'web', conversationId: 'lead-web',
+ conversationTitle: 'Lead', askerAgentId: 'a1', askerName: 'Dee', question: 'Ship it?', options: ['yes', 'no'], recommended: 0,
+ createdAt: '2026-10-22T00:00:00.000Z', answeredAt: null, choice: null, note: null, ...over })
+type Decision = ReturnType<typeof decision>
+/** The digest the backend gives a list of open decision ids (any stable function of them will do for a fake). */
+const decisionsDigestOf = (ids: string[]) => `d-${[...ids].sort().join(',')}`
+function decisionSwarm(initial: Decision[] = []) {
+ let open = initial
+ const state = () => ({ ...chats({ conversations: [conv('lead-web', 'a1', { projectId: 'web' }), conv('lead-mobile', 'a2', { projectId: 'mobile' }), pm(), group()] }),
+ decisionsDigest: decisionsDigestOf(open.map(d => d.id)) })
+ const t = setup({ t1: { lastChangedAt: 1, state: state() } }, { decisions: path => { expect(path).toBe('/api/super-tabs/t1/decisions?state=open'); return open } })
+ const asked = async (...rows: Decision[]) => { open = rows; t.tabs.t1.lastChangedAt++; t.tabs.t1.state = state(); await t.cards.tick() }
+ return { ...t, asked, webLead: () => t.seen.at(-1)?.[0].leads.find(l => l.id === 'a1') }
+}
+
+describe('SwarmCards personal and decisions', () => {
+ it('a card carries personal from its list row', async () => {
+ const t = setup({ t1: { lastChangedAt: 1, state: swarm() }, t2: { lastChangedAt: 1, state: { ...swarm(), name: 'other' } } }, { personal: ['t1'] })
+ await t.cards.tick()
+ const cards = t.seen.at(-1)!
+ expect(cards.find(c => c.id === 't1')?.personal).toBe(true)
+ expect(cards.find(c => c.id === 't2')).not.toHaveProperty('personal')
+ })
+
+ it('an open decision asked of the reader becomes its project Lead\'s notice', async () => {
+ const t = decisionSwarm([decision('dec1')])
+ await t.cards.tick()
+ expect(t.webLead()).not.toHaveProperty('notice')
+ await t.asked(decision('dec1'), decision('dec2', { createdAt: '2026-10-22T00:05:00.000Z' }))
+ expect(t.webLead()?.notice).toEqual({ chat: 'lead', chatId: 'lead-web', id: 'dec2', text: 'Dee asks you: Ship it?', at: saidAt + 300, decision: true })
+ })
+
+ it('closed decision drops its notice', async () => {
+ const t = decisionSwarm()
+ await t.cards.tick()
+ await t.asked(decision('dec2'))
+ expect(t.webLead()?.notice).toMatchObject({ id: 'dec2' })
+ await t.asked()
+ expect(t.webLead()).not.toHaveProperty('notice')
+ })
+})
+
+/** Tags and decisions behind both digests of one Swarm read. */
+function bothSwarm(more: () => boolean = () => false) {
+ let waiting: Tag[] = [], open: Decision[] = []
+ const state = () => ({ ...chats({ conversations: [conv('lead-web', 'a1', { projectId: 'web' }), conv('lead-mobile', 'a2', { projectId: 'mobile' }), pm(), group()] }),
+ mentionsDigest: digestOf(waiting.map(w => w.id)), decisionsDigest: decisionsDigestOf(open.map(d => d.id)) })
+ const t = setup({ t1: { lastChangedAt: 1, state: state() } }, { mentions: () => waiting, decisions: () => open, decisionsMore: more })
+ const move = async (tags: Tag[], decisions: Decision[]) => { waiting = tags; open = decisions; t.tabs.t1.lastChangedAt++; t.tabs.t1.state = state(); await t.cards.tick() }
+ return { ...t, move, webLead: () => t.seen.at(-1)?.[0].leads.find(l => l.id === 'a1') }
+}
+
+describe('SwarmCards tags and decisions together', () => {
+ const NEW = '2026-10-22T00:10:00.000Z'
+ it('a decision asked in the reader\'s Buddy chat has the chat kind a tag there has', async () => {
+ const tagged = bothSwarm(); await tagged.cards.tick(); await tagged.move([tag('t1', 'pm-web')], [])
+ const asked = bothSwarm(); await asked.cards.tick(); await asked.move([], [decision('d1', { conversationId: 'pm-web' })])
+ expect(tagged.webLead()?.notice?.chat).toBe('pm')
+ expect(asked.webLead()?.notice?.chat).toBe('pm')
+ const group2 = bothSwarm(); await group2.cards.tick(); await group2.move([], [decision('d2', { conversationId: 'g-web' })])
+ expect(group2.webLead()?.notice?.chat).toBe('group')
+ })
+
+ it('the tag digest moving keeps a decision\'s notice', async () => {
+ const t = bothSwarm(); await t.cards.tick()
+ await t.move([], [decision('d1')])
+ expect(t.webLead()?.notice).toMatchObject({ id: 'd1', decision: true })
+ await t.move([tag('t0', 'g-web', { createdAt: '2026-10-21T00:00:00.000Z' })], [decision('d1')]) // an older tag arrives: the decision stays
+ expect(t.webLead()?.notice).toMatchObject({ id: 'd1', decision: true })
+ await t.move([], [decision('d1')]) // and the tag leaving drops nothing of the decision's
+ expect(t.webLead()?.notice).toMatchObject({ id: 'd1', decision: true })
+ })
+
+ it('the newer of a tag and a decision is the notice; a decision keeps the tag it covers for a dial that hears no decisions', async () => {
+ const t = bothSwarm(); await t.cards.tick()
+ await t.move([tag('t1', 'g-web')], [])
+ expect(t.webLead()?.notice).toMatchObject({ id: 't1' })
+ await t.move([tag('t1', 'g-web')], [decision('d1', { createdAt: NEW })])
+ expect(t.webLead()?.notice).toMatchObject({ id: 'd1', decision: true, tag: { id: 't1' } })
+ // A newer tag replaces the decision's notice.
+ await t.move([tag('t1', 'g-web'), tag('t2', 'g-web', { createdAt: '2026-10-22T00:20:00.000Z' })], [decision('d1', { createdAt: NEW })])
+ expect(t.webLead()?.notice).toMatchObject({ id: 't2' })
+ expect(t.webLead()?.notice).not.toHaveProperty('decision')
+ // And the decision closing leaves the tag's.
+ await t.move([tag('t1', 'g-web'), tag('t2', 'g-web', { createdAt: '2026-10-22T00:20:00.000Z' })], [])
+ expect(t.webLead()?.notice).toMatchObject({ id: 't2' })
+ })
+
+ it('closing the decision that covered a tag brings the tag\'s notice back', async () => {
+ const t = bothSwarm(); await t.cards.tick()
+ await t.move([tag('t1', 'g-web')], [])
+ await t.move([tag('t1', 'g-web')], [decision('d1', { createdAt: NEW })])
+ await t.move([tag('t1', 'g-web')], [])
+ expect(t.webLead()?.notice).toMatchObject({ id: 't1' })
+ expect(t.webLead()?.notice).not.toHaveProperty('decision')
+ })
+
+ it('a paged decisions read does not drop the notice of a decision missing from the page', async () => {
+ let more = false
+ const t = bothSwarm(() => more); await t.cards.tick()
+ await t.move([], [decision('d1')])
+ expect(t.webLead()?.notice).toMatchObject({ id: 'd1' })
+ more = true
+ await t.move([], [decision('d2', { createdAt: '2026-10-21T00:00:00.000Z' })]) // d1 is past the page, not closed
+ expect(t.webLead()?.notice).toMatchObject({ id: 'd1' })
+ more = false
+ await t.move([], []) // the whole list, and empty: d1 is closed
+ expect(t.webLead()).not.toHaveProperty('notice')
+ })
+})
+
describe('SwarmCards tag notices', () => {
it('takes the tags waiting at the first read as the baseline, and reads nothing when none wait', async () => {
const none = tagSwarm()
diff --git a/cli/src/superTabs/cards.ts b/cli/src/superTabs/cards.ts
index 2c8beadd4..e91c50e4d 100644
--- a/cli/src/superTabs/cards.ts
+++ b/cli/src/superTabs/cards.ts
@@ -65,6 +65,13 @@ const isSwarmBuddyChat = (conversation: Json): boolean => conversation.kind ===
/** A Chat with PM: a private conversation with an audience that is not a Buddy chat. Read-only once Buddies are on
* (backend commands.ts `PM_CHAT_READ_ONLY`), so words spoken to it on the dial would only be refused. */
const isChatWithPm = (conversation: Json): boolean => conversation.audience != null && !isBuddyChat(conversation)
+/** The chat kind of a notice raised in conversation `conversationId` of a project whose Lead conversation is `leadId`: `lead`
+ * in that conversation, `pm` in the reader's Buddy chat or a Chat with PM, `group` elsewhere. Tags and decisions both. */
+const noticeChat = (state: Json, conversationId: string, leadId: unknown): LeadNotice['chat'] => {
+ if (conversationId === leadId) return 'lead'
+ const conversation = list(state.conversations).find(c => c.id === conversationId)
+ return conversation && (isBuddyChat(conversation) || isChatWithPm(conversation)) ? 'pm' : 'group'
+}
/** The reader's own: the backend sends a Buddy chat to its owner alone (read/views.ts `groupView`), and the dial checks it
* again, so another person's Buddy chat never becomes a face, a buddy block or a notice whatever a read holds. */
const isReadersBuddyChat = (conversation: Json, me: string | undefined): boolean =>
@@ -311,6 +318,10 @@ export class SwarmCards {
/** The tags baseline: per Swarm, the mentions digest last read, and the ids of the tags seen waiting since the baseline. */
private tagDigests = new Map<string, string>()
private tagsSeen = new Map<string, string[]>()
+ /** The decisions asked of the reader, as the tags: the digest last read and the ids seen. */
+ private decisionDigests = new Map<string, string>()
+ private decisionsSeen = new Map<string, string[]>()
+ private personal = new Set<string>()
/** Each Lead's newest quiet notice from the reader's Buddy (`${tab}:${lead}`): apart, so it never hides the Lead's. */
private buddyNotices = new Map<string, LeadNotice>()
/** The side a swarmBuddy dial swiped to, per Swarm; cleared by the window's next focus change (the newest wins). */
@@ -569,6 +580,7 @@ export class SwarmCards {
for (const tabId of [...this.threads.keys()]) if (!known.has(tabId)) this.threads.delete(tabId)
for (const tabId of [...this.left.keys()]) if (!known.has(tabId)) this.left.delete(tabId)
this.rows = rows.map(row => ({ id: row.id as string, name: row.name }))
+ this.personal = new Set(rows.filter(row => row.personal === true).map(row => row.id as string))
}
const me = (await this.core.account.identity().catch(() => null))?.accountId
// Another person signed in: nothing of the last account's is kept, and the list is said again whatever it is.
@@ -598,7 +610,7 @@ export class SwarmCards {
return { ...lead, ...(notice ? { notice } : {}), ...(buddyNotice ? { buddyNotice } : {}) }
})
cards.push({ id: row.id, name: cut(String(tab.state.name ?? row.name ?? ''), NAME_BYTES), count, leads: noticed,
- ...(side === 'buddy' ? { side: 'buddy' as const } : {}) })
+ ...(side === 'buddy' ? { side: 'buddy' as const } : {}), ...(this.personal.has(row.id) ? { personal: true as const } : {}) })
}
// `since` moves every poll while a turn runs and the Pro counts on by itself, so it alone never re-sends the list.
// Nor does a clock that keeps its turn; one whose turn changed (the Lead's ended, a worker's goes on) does. The start is
@@ -653,12 +665,14 @@ export class SwarmCards {
}
watched.add(`${tabId}:mentions`)
await this.watchTags(tabId, state, projects)
+ watched.add(`${tabId}:decisions`)
+ await this.watchDecisions(tabId, state, projects)
}
// A Swarm or project that left the cards takes its baseline and notices with it.
for (const key of [...this.seen.keys()]) if (!watched.has(key)) this.seen.delete(key)
for (const key of [...this.failed]) if (!watched.has(key)) this.failed.delete(key)
for (const [key, notice] of this.buddyNotices) if (!watched.has(`${key.slice(0, key.indexOf(':'))}:${notice.chatId}`)) this.buddyNotices.delete(key)
- for (const tabId of [...this.tagDigests.keys()]) if (!this.tabs.has(tabId)) { this.tagDigests.delete(tabId); this.tagsSeen.delete(tabId) }
+ for (const tabId of [...this.tagDigests.keys()]) if (!this.tabs.has(tabId)) { this.tagDigests.delete(tabId); this.tagsSeen.delete(tabId); this.decisionDigests.delete(tabId); this.decisionsSeen.delete(tabId) }
for (const key of [...this.notices.keys()]) {
const [tabId, leadId] = key.split(':'), state = this.tabs.get(tabId)?.state
if (!state || !leadProjects(state).some(p => p.leadId === leadId)) this.notices.delete(key)
@@ -687,7 +701,12 @@ export class SwarmCards {
const known = new Set(seen)
this.raiseTags(tabId, state, projects, rows.filter(r => !known.has(r.id as string)))
}
- for (const { leadId } of projects) if (this.notices.has(recapKey(tabId, leadId)) && !waiting.has(this.notices.get(recapKey(tabId, leadId))!.id)) this.notices.delete(recapKey(tabId, leadId))
+ // A decision's notice is dropped by watchDecisions, not here; the tag under it goes with the tag.
+ for (const { leadId } of projects) {
+ const held = this.notices.get(recapKey(tabId, leadId))
+ if (held?.decision) { if (held.tag && !waiting.has(held.tag.id)) delete held.tag }
+ else if (held && !waiting.has(held.id)) this.notices.delete(recapKey(tabId, leadId))
+ }
this.tagsSeen.set(tabId, [...(seen ?? []).filter(id => !waiting.has(id)), ...waiting].slice(-MAX_TAGS_SEEN))
this.tagDigests.set(tabId, digest)
this.failed.delete(key)
@@ -699,24 +718,75 @@ export class SwarmCards {
} finally { this.recapsRunning-- }
}
+ /**
+ * The decisions asked of the reader, as the tags are (spec 2026-11-05-dial-lead-pm-buddy-pair, Notices): read only when the
+ * Swarm read's `decisionsDigest` moved. The server lists the reader's own open ones (`/decisions?state=open`; for a person
+ * it is never another's); the first digest seen is the baseline and never alerts, a decision id seen once is never new
+ * again, and the newest new one of a project is its Lead's notice, "<asker> asks you: <question>". The newest of a tag or a
+ * decision wins. One no longer open drops the notice it made. A failed read keeps the digest, so the next poll reads again.
+ */
+ private async watchDecisions(tabId: string, state: Json, projects: Array<{ project: Json; lead: Json; leadId: string }>): Promise<void> {
+ const digest = state.decisionsDigest, seen = this.decisionsSeen.get(tabId)
+ if (typeof digest !== 'string' || this.decisionDigests.get(tabId) === digest) return
+ if (this.recapsRunning >= MAX_RECAPS_IN_FLIGHT) return
+ const key = `${tabId}:decisions`
+ this.recapsRunning++
+ try {
+ const page = object(await backend(this.core, 'GET', `/api/super-tabs/${tabId}/decisions?state=open`))
+ // One page: with `more`, a decision missing from it may be open still, so none is taken as closed.
+ const more = page.more === true
+ const rows = list(page.decisions).filter(r => cardId(r.id) && (r.answeredAt === null || r.answeredAt === undefined))
+ const open = new Set(rows.map(r => r.id as string))
+ if (seen) {
+ const known = new Set(seen)
+ for (const row of rows.filter(r => !known.has(r.id as string))) {
+ const found = projects.find(p => projectKey(p.project) === row.projectId)
+ if (!found || !cardId(row.conversationId) || typeof row.question !== 'string') continue
+ const stamp = Date.parse(String(row.createdAt))
+ const asker = typeof row.askerName === 'string' && row.askerName ? row.askerName : 'Agent'
+ const notice: LeadNotice = { chat: noticeChat(state, row.conversationId, found.lead.id), chatId: row.conversationId, id: row.id as string,
+ text: cut(`${asker} asks you: ${row.question}`, RECAP_BYTES), at: Number.isFinite(stamp) ? Math.floor(stamp / 1000) : 0, decision: true }
+ const held = this.notices.get(recapKey(tabId, found.leadId))
+ if (held && held.at > notice.at) continue
+ // The tag it covers stays under it, for a dial that hears no decisions.
+ const tagBelow = held?.decision ? held.tag : held
+ this.notices.set(recapKey(tabId, found.leadId), tagBelow ? { ...notice, tag: tagBelow } : notice)
+ }
+ }
+ // A notice made by a decision that is no longer open goes (a tag's own is dropped by watchTags).
+ for (const { leadId } of projects) {
+ const held = this.notices.get(recapKey(tabId, leadId))
+ if (!more && held?.decision && !open.has(held.id)) {
+ if (held.tag) this.notices.set(recapKey(tabId, leadId), held.tag)
+ else this.notices.delete(recapKey(tabId, leadId))
+ }
+ }
+ this.decisionsSeen.set(tabId, [...(seen ?? []).filter(id => !open.has(id)), ...open].slice(-MAX_TAGS_SEEN))
+ this.decisionDigests.set(tabId, digest)
+ this.failed.delete(key)
+ } catch (error) {
+ if (!this.failed.has(key)) {
+ this.failed.add(key)
+ this.log(`[super-tabs] the decisions asked of you could not be read for the dial; tried again at the next poll: ${error instanceof Error ? error.message : String(error)}`)
+ }
+ } finally { this.recapsRunning-- }
+ }
+
/** New tags (`rows`, as `/mentions` lists them) as their project Lead's notice: the newest of each project, unless the one
* held is newer. Its chat is `lead` in the project's Lead conversation, `pm` in the reader's Buddy chat or a Chat with PM,
* and `group` elsewhere (a task chat); its text names who tagged. A tag of a project with no Lead makes none. */
private raiseTags(tabId: string, state: Json, projects: Array<{ project: Json; lead: Json; leadId: string }>, rows: Json[]): void {
- const conversations = list(state.conversations)
for (const row of rows) {
const found = projects.find(p => projectKey(p.project) === row.projectId)
if (!found || !cardId(row.conversationId) || typeof row.text !== 'string') continue
- const conversation = conversations.find(c => c.id === row.conversationId)
- const chat: LeadNotice['chat'] = row.conversationId === found.lead.id ? 'lead'
- : conversation && (isBuddyChat(conversation) || isChatWithPm(conversation)) ? 'pm' : 'group'
+ const chat = noticeChat(state, row.conversationId, found.lead.id)
const stamp = Date.parse(String(row.createdAt))
const at = Number.isFinite(stamp) ? Math.floor(stamp / 1000) : 0
const who = typeof row.leadName === 'string' && row.leadName ? `${row.leadName}: ` : ''
const notice: LeadNotice = { chat, chatId: row.conversationId, id: row.id as string, text: cut(`${who}${row.text}`, RECAP_BYTES), at,
...(identifier(row.threadId) ? { thread: row.threadId } : {}) }
const held = this.notices.get(recapKey(tabId, found.leadId))
- if (held && held.at > notice.at) continue
+ if (held && held.at > notice.at) { if (held.decision && (!held.tag || held.tag.at <= notice.at)) held.tag = notice; continue }
this.notices.set(recapKey(tabId, found.leadId), notice)
}
}
@@ -733,7 +803,7 @@ export class SwarmCards {
held.set(key, notice)
}
- private forgetNotices(): void { this.notices.clear(); this.buddyNotices.clear(); this.tagDigests.clear(); this.tagsSeen.clear(); this.failed.clear() }
+ private forgetNotices(): void { this.notices.clear(); this.buddyNotices.clear(); this.tagDigests.clear(); this.tagsSeen.clear(); this.decisionDigests.clear(); this.decisionsSeen.clear(); this.failed.clear() }
/** Which of the Leads that run here are in a turn, and since when (the core's windows' own measure of "working"). */
private async turnsHere(): Promise<Map<string, { inTurn: boolean; since?: number }>> {
diff --git a/cli/src/superTabs/fixtures/read/index.ts b/cli/src/superTabs/fixtures/read/index.ts
index f5aa457f6..26bc70616 100644
--- a/cli/src/superTabs/fixtures/read/index.ts
+++ b/cli/src/superTabs/fixtures/read/index.ts
@@ -45,13 +45,13 @@ export function hostForm(rows: unknown, options: { tabs?: string[]; pools?: unkn
export function partsOf(state: Json, options: { githubApp?: boolean; lastChangedAt?: number } = {}): Json {
const v = ++version
const part = (key: unknown, data: Json) => ({ key: String(key), version: v, changedAt: v, data })
- const { people, agents, conversations, machines, starts, otherProjectsWork, mentionsWaiting, mentionsDigest, teamAccounts, ...head } = state
+ const { people, agents, conversations, machines, starts, otherProjectsWork, mentionsWaiting, mentionsDigest, decisionsDigest, teamAccounts, ...head } = state
return { format: 2, tabId: String(state.id ?? 'tab'), cursor: `tab-${v}`, serverTime: v, lastChangedAt: options.lastChangedAt ?? v, epoch: 1,
...(options.githubApp ? { githubApp: true } : {}),
head: part('head', head), members: asList(people).map(p => part(p.id, p)), agents: asList(agents).map(a => part(a.id, a)),
groups: asList(conversations).map((c, i) => part(c.id ?? `group-${i}`, c)), machines: asList(machines).map(m => part(m.machineId, m)),
starts: asList(starts).map(s => part(s.id, s)), progress: [],
- derived: { ...(otherProjectsWork !== undefined ? { otherProjectsWork } : {}), ...(mentionsWaiting !== undefined ? { mentionsWaiting } : {}), ...(mentionsDigest !== undefined ? { mentionsDigest } : {}),
+ derived: { ...(otherProjectsWork !== undefined ? { otherProjectsWork } : {}), ...(mentionsWaiting !== undefined ? { mentionsWaiting } : {}), ...(mentionsDigest !== undefined ? { mentionsDigest } : {}), ...(decisionsDigest !== undefined ? { decisionsDigest } : {}),
...(teamAccounts === false ? { teamAccounts } : {}) } }
}
diff --git a/cli/src/superTabs/readContract.ts b/cli/src/superTabs/readContract.ts
index e086f8391..743e7f964 100644
--- a/cli/src/superTabs/readContract.ts
+++ b/cli/src/superTabs/readContract.ts
@@ -39,6 +39,8 @@ export interface Derived {
mentionsWaiting?: number
/** A person only: a digest of which of their tags wait, moving when one is made, answered or expires. */
mentionsDigest?: string
+ /** A person only: a digest of which decisions asked of them are open (backend read/views.ts). */
+ decisionsDigest?: string
/** False only in a Swarm Harness Team accounts are not tried in yet (backend machines.ts teamAccountSwarm). */
teamAccounts?: false
}
diff --git a/cli/src/superTabs/reassemble.ts b/cli/src/superTabs/reassemble.ts
index 3598bf668..4e6d85bb1 100644
--- a/cli/src/superTabs/reassemble.ts
+++ b/cli/src/superTabs/reassemble.ts
@@ -65,5 +65,6 @@ export function reassemble(store: PartsStore): Json {
if (derived.pmAccounts !== undefined) state.pmAccounts = derived.pmAccounts
if (derived.mentionsWaiting !== undefined) state.mentionsWaiting = derived.mentionsWaiting
if (derived.mentionsDigest !== undefined) state.mentionsDigest = derived.mentionsDigest
+ if (derived.decisionsDigest !== undefined) state.decisionsDigest = derived.decisionsDigest
return state
}
diff --git a/devices/harness-device/firmware/main/cable_client.c b/devices/harness-device/firmware/main/cable_client.c
index 3dd5e72bc..4287ae0a0 100644
--- a/devices/harness-device/firmware/main/cable_client.c
+++ b/devices/harness-device/firmware/main/cable_client.c
@@ -330,6 +330,9 @@ static void send_hello(void)
// A face in a thread (spec 2026-11-03-dial-thread-face): each Lead's `thread`, `threadTitle`, `threadReplies`, a recap
// that names its thread, and `supertab.thread.leave` back. Older daemons ignore it and send none.
msg_string(&root, "swarmThread", "v1");
+ // This dial hears only what needs the reader: no Buddy quiet notices, and a decision asked of the reader is a notice (spec
+ // 2026-11-05-dial-lead-pm-buddy-pair). Also the Swarm card's `personal`. Older daemons ignore it.
+ msg_string(&root, "swarmNeedsYou", "v1");
// No swarmReview: words for a Swarm chat are sent as any harness's are and reviewed only when held (Diego's dial,
// 2026-10-29), and a daemon that heard it would refuse every word not reviewed (docs/device-voice-swarm-chat.md).
// Which of the two dials this is (board.h) — informational, so a log or a bug report can say. A
@@ -989,6 +992,7 @@ static void handle_supertab(const cJSON *p)
// The Swarm's side, from a swarmBuddy daemon (review of #2218): the dial follows it. Anything else is none.
const char *side = str_of(p, "side");
card.side = !side ? HT_SIDE_NONE : !strcmp(side, "buddy") ? HT_SIDE_BUDDY : !strcmp(side, "pm") ? HT_SIDE_PM : HT_SIDE_NONE;
+ card.personal = cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "personal"));
const cJSON *l = NULL;
cJSON_ArrayForEach(l, cJSON_GetObjectItemCaseSensitive(p, "leads")) {
if (card.lead_n >= HT_SUPERTAB_LEADS_MAX) break;
diff --git a/devices/harness-device/firmware/main/ui/habitat/supertab.h b/devices/harness-device/firmware/main/ui/habitat/supertab.h
index be5e5a558..40ec7872c 100644
--- a/devices/harness-device/firmware/main/ui/habitat/supertab.h
+++ b/devices/harness-device/firmware/main/ui/habitat/supertab.h
@@ -38,6 +38,7 @@ typedef struct {
char id[ID_MAX], tab[ID_MAX], name[HT_SUPERTAB_NAME];
uint16_t count; // the Swarm's real project count; at most 12 Leads come
ht_side_t side;
+ bool personal; // the reader's own Swarm (swarmNeedsYou daemon); false from an older one
uint8_t lead_n;
ht_lead_t leads[HT_SUPERTAB_LEADS_MAX];
} ht_supertab_t;
diff --git a/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c b/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c
index 1f55cae30..4f6a767dd 100644
--- a/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c
+++ b/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c
@@ -92,7 +92,8 @@ typedef enum {
STOP,
MODELS,
MESSAGE,
- OTA
+ OTA,
+ SWARM_PICK
} view_t;
typedef enum {
A_NONE,
@@ -106,6 +107,8 @@ typedef enum {
A_ANSWER, A_QUESTION_READ, A_QUESTION_CHOICES, A_QUESTION_REVIEW, A_QUESTION_BACK, A_QUESTION_SAY,
A_TAB_LIST,
A_INBOX,
+ A_SIDE_PM, A_SIDE_BUDDY,
+ A_PICK_PERSONAL, A_PICK_TEAM,
A_NOTICE,
A_TABS,
A_TAB, A_TAB_REFRESH, A_TAB_DONE,
@@ -248,6 +251,7 @@ static EXT_RAM_BSS_ATTR struct {
unsigned bell_unread; // the bell's count at the last home render, to see a notice arrive
uint32_t notice_ms; // the face clock when it last went up, 0 = none since boot (the pet's alert bubble)
ht_focus_working_pick_t working_pick; // which working scene the shown agent's pet plays (Claude: chef or builder)
+ uint32_t pick_until; // when the Personal | Team picker (SWARM_PICK) returns to the face for want of a touch (clock_ms), 0 = never
uint32_t timer_at; // when the working line's elapsed text next changes (ms() clock), 0 = never (elapsed.h)
uint32_t pet_next_ms; // when the pet's (or the voice screen's listening scene's) drawn frame next changes (clock_ms), 0 = never
int start_x, start_y, last_x, last_y;
@@ -595,6 +599,7 @@ enum { SUPERTAB_RECAP_GET, SUPERTAB_OPEN, SUPERTAB_SELECT, SUPERTAB_SIDE, SUPERT
static EXT_RAM_BSS_ATTR ht_supertabs_t swarm;
static EXT_RAM_BSS_ATTR struct {
char tab[ID_MAX], lead[ID_MAX]; // the Swarm the dial is in ("" in a desk tab) and the Lead on its face
+ char last_team[ID_MAX]; // the last non-Personal card on the face: where Team goes (spec 2026-11-05)
char desk[ID_MAX]; // the desk tab that Swarm is listed at, "" when none (entered from the inbox)
int at; // that Lead's place, where the face lands when the Lead goes
bool retried; // its recap was asked for a second time
@@ -712,21 +717,16 @@ static void swarm_buddy_seen(void)
int i = swarm_on_buddy(l) ? swarm_heard_of(l->id) : -1;
if (i >= 0) sw.heard[i].lead[0] = 0;
}
-// Swipe up opens the Buddy side, down the PM side again (spec 2026-10-29 Switching); true when the swipe was the side's.
-// Down on the PM side is not: it still pulls the inbox. Without Buddies neither is.
-static bool swarm_side_swipe(int dy)
+// Tapping the other half of the pair shows that side (spec 2026-11-05 PM | Buddy pair): the side kept, told to the daemon,
+// its quiet badge read. The current half, a Lead without Buddies, or no link: nothing.
+static void swarm_side_set(bool buddy)
{
const ht_lead_t *l = swarm_lead();
- if (!l || !l->buddies || !s.connected) return false;
- bool buddy = swarm_side_buddy(sw.tab), up = dy < 0;
- if (!up && !buddy) return false;
- if (up != buddy) {
- swarm_side_put(sw.tab, up);
- swarm_side_send(sw.tab);
- swarm_buddy_seen();
- change();
- }
- return true;
+ if (!l || !l->buddies || !s.connected || swarm_side_buddy(sw.tab) == buddy) return;
+ swarm_side_put(sw.tab, buddy);
+ swarm_side_send(sw.tab);
+ swarm_buddy_seen();
+ change();
}
// The Lead at `i` comes onto the face: its recap is asked for afresh. `select` moves the desktop there too; a
// supertab.focus does not need it, the desktop is already there.
@@ -738,6 +738,7 @@ static void swarm_show(const ht_supertab_t *t, int i, bool select)
return;
}
COPY(sw.lead, t->leads[i].id); sw.at = i; sw.retried = false;
+ if (!t->personal) COPY(sw.last_team, t->id);
ht_supertabs_recap_open(&swarm, t->id, sw.lead, ms());
if (select) {
swarm_send(SUPERTAB_SELECT, t->id, sw.lead);
@@ -799,6 +800,46 @@ static void swarm_enter(const ht_supertab_t *t, const char *lead, bool select)
swarm_show(t, i < 0 ? 0 : i, select);
view(HOME);
}
+/*
+ * PERSONAL | TEAM (spec 2026-11-05): the picker opens from the project name only when the dial holds the reader's Personal
+ * card and at least one other. Team is the last non-Personal card on the face, else the first in list order.
+ */
+static bool swarm_pick_ok(void)
+{
+ bool personal = false, team = false;
+ if (!swarm_mode()) return false;
+ for (int i = 0; ht_supertabs_at(&swarm, i); i++) {
+ if (ht_supertabs_at(&swarm, i)->personal) personal = true; else team = true;
+ }
+ return personal && team;
+}
+static bool swarm_pick_open(void)
+{
+ if (s.view != HOME || !swarm_pick_ok()) return false;
+ s.pick_until = ms() + 5000; if (!s.pick_until) s.pick_until = 1;
+ view(SWARM_PICK);
+ return true;
+}
+static const ht_supertab_t *swarm_pick_target(bool team)
+{
+ const ht_supertab_t *first = NULL;
+ for (int i = 0; ht_supertabs_at(&swarm, i); i++) {
+ const ht_supertab_t *t = ht_supertabs_at(&swarm, i);
+ if (t->personal != !team) continue;
+ if (!team) return t;
+ if (!first) first = t;
+ if (!strcmp(t->id, sw.last_team)) return t;
+ }
+ return first;
+}
+// A half tapped: the other Swarm opens as a tab pick does (swarm_enter, the desktop follows); the filled half only returns.
+static void swarm_pick(bool team)
+{
+ const ht_supertab_t *t = swarm_pick_target(team), *here = swarm_here();
+ s.pick_until = 0;
+ if (!t || t == here) { view(HOME); return; }
+ swarm_enter(t, NULL, true);
+}
/*
* TABS lists exactly the desk tabs, as the desktop shows them (Diego, 2026-10-27). A desk tab linked to a Swarm keeps
* its place and name and enters that Swarm. A Swarm with no desk tab is not listed, with or without a window: the
@@ -1281,6 +1322,7 @@ static void surface_tick(uint32_t now)
if (s.pet_next_ms && (((s.view == HOME || s.view == AGENT) && !s.touch_down) || s.view == VOICE) &&
(int32_t)(now - s.pet_next_ms) >= 0) { s.pet_next_ms = 0; change(); }
if (s.timer_at && (s.view == HOME || s.view == AGENT) && (int32_t)(now - s.timer_at) >= 0) { s.timer_at = 0; change(); }
+ if (s.view == SWARM_PICK && s.pick_until && !s.touch_down && (int32_t)(now - s.pick_until) >= 0) { s.pick_until = 0; view(HOME); }
bool main = s.view == HOME || s.view == AGENT;
bool visible = !display_is_asleep() &&
((main && s.connected && !s.loading) || s.view == VOICE);
@@ -1409,12 +1451,41 @@ static void face_buddy_ring(ht_scene_t *f)
{
ht_ring_arc(f, 233 * 16, 233 * 16, 230 * 16, 3 * 16, 90, 180, color(mix_black(BUDDY_LILAC, 32)));
}
-// The upper dot lit on the PM side, the lower one (lilac) on the Buddy side. [replied]: on the PM side, the Buddy has a word
-// not yet heard, so the lower dot takes its colour, at its own place and size.
-static void face_buddy_dots(ht_scene_t *f, bool buddy, bool replied)
+/*
+ * THE PM | BUDDY PAIR (spec 2026-11-05): a dark pill 180 x 44 px at y 388 with two equal halves, the current side's filled.
+ * A tap on the other half shows that side. Four runs always (pill, current half, two labels), and the two hits.
+ */
+// One dark pill of two equal halves, the `right_on` one filled: a pill, the filled half, two labels (four runs).
+static void pill2(ht_scene_t *f, int x, int y, int w, int h, const char *left, const char *right, bool right_on)
{
- face_buddy_disc(f, 442, 218, buddy ? 9 : 12, buddy ? 0x55565fu : 0xeaeaf0u);
- face_buddy_disc(f, 442, 248, buddy ? 12 : 9, buddy || replied ? BUDDY_LILAC : 0x55565fu);
+ enum { INSET = 3 };
+ const ht_font_t *font = &ht_lv_inter_20.base;
+ uint16_t pill = color(0x141518), edge = color(0x2e3035), on = color(0x2b2d33), white = color(0xffffff), grey = color(0x9a9ca3);
+ int half = w / 2;
+ ht_box(f, x, y, w, h, h / 2, pill, edge);
+ ht_box(f, x + (right_on ? half : 0) + INSET, y + INSET, half - 2 * INSET, h - 2 * INSET, (h - 2 * INSET) / 2, on, on);
+ const char *names[2] = {left, right};
+ for (int k = 0; k < 2; k++) {
+ int tw = ht_measure(font, names[k]), cur = (k == 1) == right_on;
+ ht_text(f, x + k * half + (half - tw) / 2, y + (h - font->height) / 2, tw, font, cur ? white : grey, cur ? on : pill, names[k]);
+ }
+}
+static void swarm_pair(ht_scene_t *f, bool buddy)
+{
+ enum { X = 143, Y = 388, W = 180, H = 44, HALF = W / 2 };
+ pill2(f, X, Y, W, H, "PM", "Buddy", buddy);
+ s.hits[s.hit_count++] = (hit_t){{X, Y, HALF, H}, A_SIDE_PM, 0, true};
+ s.hits[s.hit_count++] = (hit_t){{X + HALF, Y, HALF, H}, A_SIDE_BUDDY, 0, true};
+}
+// The Personal | Team picker: "Swarm" on the top arc and one 200 x 44 pill at y 211, the half of the Swarm on the face filled.
+static void render_swarm_pick(ht_scene_t *f)
+{
+ enum { X = 133, Y = 211, W = 200, H = 44, HALF = W / 2 };
+ const ht_supertab_t *t = swarm_here();
+ ht_arc_title_face(f, FG, "Swarm", &ht_arc_inter_prop);
+ pill2(f, X, Y, W, H, "Personal", "Team", !(t && t->personal));
+ s.hits[s.hit_count++] = (hit_t){{X, Y, HALF, H}, A_PICK_PERSONAL, 0, true};
+ s.hits[s.hit_count++] = (hit_t){{X + HALF, Y, HALF, H}, A_PICK_TEAM, 0, true};
}
/*
* Desktop's agent pattern (avatar_art.dart superTabAgentPattern; the daemon sends its 15 half bits and colour): mirrored on
@@ -1450,7 +1521,7 @@ static void render_buddy_empty(ht_scene_t *f, const ht_lead_t *l)
focus_put(f, 63, 238, 340, &ht_lv_inter_28.base, color(0x8a8a99), BG, "No Buddy here yet", true);
focus_put(f, 63, 280, 340, &ht_lv_inter_20.base, color(0x6b6d78), BG, "Add one in the Harness app.", true);
face_buddy_ring(f);
- face_buddy_dots(f, true, false);
+ swarm_pair(f, true);
s.hits[s.hit_count++] = (hit_t){{83, 0, 300, 66}, A_AGENTS, 0, true};
}
/*
@@ -1482,7 +1553,7 @@ static void thread_rest(const char *cursor, char out[HT_TEXT_BYTES])
for (size_t i = 0; i < n; i++) out[i] = cursor[i] == '\n' ? ' ' : cursor[i];
out[n] = 0;
}
-static void face_thread(ht_scene_t *f, const ht_lead_t *l, bool buddy, const char *recap, const char *wait)
+static void face_thread(ht_scene_t *f, const ht_lead_t *l, bool buddy, const char *recap, const char *wait, bool bell_above)
{
// A Lead waiting on the person stays visible: the wait's text in the card, in the accent the main face writes it in.
if (wait) recap = wait;
@@ -1510,10 +1581,11 @@ static void face_thread(ht_scene_t *f, const ht_lead_t *l, bool buddy, const cha
char meta[40] = "";
if (recap && !wait && l->thread_replies >= 0)
snprintf(meta, sizeof meta, "%s · %ld repl%s", buddy ? "Buddy" : "PM", (long)l->thread_replies, l->thread_replies == 1 ? "y" : "ies");
- int rows = recap ? 0 : 1;
+ // The bell at y 346 (pair and bell both showing) leaves the card two lines: it would end at y 369 with three.
+ int rows = recap ? 0 : 1, max_rows = bell_above ? 2 : 3;
char text[3][HT_TEXT_BYTES] = {{0}};
- for (const char *p = recap; p && *p && rows < 3; rows++) {
- if (rows == 2) { thread_rest(p, text[rows++]); break; }
+ for (const char *p = recap; p && *p && rows < max_rows; rows++) {
+ if (rows == max_rows - 1) { thread_rest(p, text[rows++]); break; }
thread_line(&p, body, 304, text[rows]);
}
if (rows == 0) rows = 1;
@@ -1564,7 +1636,7 @@ static void render_swarm_face(ht_scene_t *f)
const ht_supertab_t *t = swarm_here();
ht_character_face_t f_ = {.recipient = l->project[0] ? l->project : "Untitled", .status = "", .hint = "",
.tab = t ? t->name : "", .engine = buddy ? "" : l->engine, .activity = working && !s.nap ? "Working" : "",
- .chat = !buddy && l->chat != HT_CHAT_LEAD && l->chat != HT_CHAT_BUDDY ? l->chat_name : NULL,
+ .chat = !buddy && l->chat != HT_CHAT_LEAD && l->chat != HT_CHAT_PM && l->chat != HT_CHAT_BUDDY ? l->chat_name : NULL,
.elapsed = since, .detail = "", .mood = character_mood(), .pose = character.motion.reaction.pose,
.asking = asking,
.clock_ms = (s.quiet || display_is_asleep()) ? 0 : clock,
@@ -1577,15 +1649,15 @@ static void render_swarm_face(ht_scene_t *f)
s.notice_ms = (clock - ht_focus_alert_pop_ms(&f_)) | 1;
f_.notice_ms = bell ? s.notice_ms : 0;
}
- if (thread) face_thread(f, l, buddy, recap, wait);
+ if (thread) face_thread(f, l, buddy, recap, wait, bell && l->buddies);
else ht_character_face(f, &character, &f_, ACCENT, recap);
s.pet_next_ms = focus_face && !thread ? ht_focus_pet_next_ms(&f_, recap) : 0;
ht_rect_t bubble = {0};
bool told = bell && focus_face && !thread && ht_focus_alert_shown(&f_, recap, &bubble);
- int bell_y = 400;
+ int bell_y = l->buddies ? 346 : 400; // clear of the pair
if (bell && !told) {
if (focus_face) focus_bell(f, unread, bell_y);
- else ht_notification_bell(f, unread, f_.ink);
+ else ht_notification_bell_at(f, unread, f_.ink, l->buddies ? bell_y : HT_NOTIFICATION_Y); // above the pair, else its own row
}
if (buddy && !thread) {
// The avatar stands where the pet does on Focus, at 233, 158 or higher: 8 px clear of the recap's card, which keeps
@@ -1611,14 +1683,25 @@ static void render_swarm_face(ht_scene_t *f)
face_buddy_ring(f);
}
if (l->buddies) {
- // The PM side's quiet sign of the Buddy's word: the lower dot's colour, and a line on the lower arc unless the bell or
- // the face has it. Empty runs in their place, so the count never moves.
- bool heard = !buddy && swarm_heard_of(l->id) >= 0, lower = bell && !told;
- face_buddy_dots(f, buddy, heard);
- for (int i = 0; i < f->count; i++) lower |= f->runs[i].arc == 2 && f->runs[i].text[0];
- ht_box(f, 0, 0, 1, 1, 0, BG, BG); ht_box(f, 0, 0, 1, 1, 0, BG, BG);
- if (heard && !lower && !thread) ht_arc_status_face(f, color(BUDDY_LILAC), "Your Buddy replied", &ht_arc_inter_lower);
- else ht_text(f, 0, 0, 1, &ht_lv_inter_20.base, BG, BG, "");
+ // The pair stands at the bottom, so the lower arc is bare: the face's hint goes, and its working line (and the PM side's
+ // "Your Buddy replied") is one centred line at y 318 in its place. Empty runs where nothing is said, so the count holds.
+ char say[HT_TEXT_BYTES] = "";
+ uint16_t say_fg = color(BUDDY_LILAC);
+ for (int i = 0; i < f->count; i++) {
+ ht_run_t *r = &f->runs[i];
+ if (r->arc != 2 || !r->text[0]) continue;
+ if (working) { snprintf(say, sizeof say, "%s", r->text); say_fg = r->fg; }
+ uint8_t at = f->count;
+ f->count = (uint8_t)i;
+ ht_text(f, 0, 0, 1, &ht_lv_inter_20.base, BG, BG, "");
+ f->count = at;
+ }
+ if (!say[0] && !buddy && !thread && swarm_heard_of(l->id) >= 0) snprintf(say, sizeof say, "Your Buddy replied");
+ const ht_font_t *lf = &ht_lv_inter_20.base;
+ int w = say[0] ? ht_measure(lf, say) : 1;
+ if (w > 360) w = 360;
+ ht_text(f, 233 - w / 2, 318, w, lf, say_fg, BG, say);
+ swarm_pair(f, buddy);
}
// The same targets as a pane's face: the name opens PANES, the bell the inbox, the rest talks (to a local Lead).
s.hits[s.hit_count++] = (hit_t){{83, 0, 300, 66}, A_AGENTS, 0, true};
@@ -2678,6 +2761,9 @@ bool habitat_scene_take(ht_scene_t *f)
case HOME:
render_home(f);
break;
+ case SWARM_PICK:
+ render_swarm_pick(f);
+ break;
case AGENTS:
render_agents(f);
break;
@@ -3000,6 +3086,7 @@ static void dispatch(action_t a)
view(HOME);
break;
case A_AGENTS: {
+ if (swarm_pick_open()) break; // a Swarm face with a Personal and a Team card: the picker, else PANES
view(AGENTS);
if (swarm_here()) { ht_tab_carousel_reset(&pane_carousel, swarm_here()->lead_n, sw.at); break; }
ht_tab_carousel_reset(&pane_carousel, s.count, s.active >= 0 && s.active < s.count ? s.active : 0);
@@ -3061,6 +3148,14 @@ static void dispatch(action_t a)
case A_INBOX:
notice_open();
break;
+ case A_PICK_PERSONAL:
+ case A_PICK_TEAM:
+ if (s.view == SWARM_PICK) swarm_pick(a.kind == A_PICK_TEAM);
+ break;
+ case A_SIDE_PM:
+ case A_SIDE_BUDDY:
+ swarm_side_set(a.kind == A_SIDE_BUDDY);
+ break;
case A_NOTICE: {
if (s.connected && a.id[0] && swarm_notice(a.id) >= 0) {
// The dial's own entry: enter that Swarm at that Lead, read-only for a remote one (spec §5).
@@ -3629,6 +3724,7 @@ void habitat_touch(bool down, int x, int y, uint32_t now)
s.start_x = x;
s.start_y = y;
s.touch_started = now;
+ if (s.view == SWARM_PICK) { s.pick_until = now + 5000; if (!s.pick_until) s.pick_until = 1; }
if (question_view(s.view)) s.q.drag=0;
s.draft_drag = 0;
s.tab_drag = 0;
@@ -3695,7 +3791,7 @@ void habitat_touch(bool down, int x, int y, uint32_t now)
change();
} else {
// A Swarm's face scrolls the Swarm chat the desktop has open (the daemon names its tab), once a vertical drag
- // has outlasted a flick: a quick flick up or down is still the side's (swarm_side_swipe) and sends nothing.
+ // has outlasted a flick: a quick flick up or down is still the side's (the pair's taps now) and sends nothing.
if (gesture.axis == 1 && !sw.drag_at) sw.drag_at = now | 1; // | 1: 0 is "not yet", so it may be now + 1
uint32_t dragged = sw.drag_at && (int32_t)(now - sw.drag_at) > 0 ? now - sw.drag_at : 0;
if (!scroll.live && surface && gesture.axis == 1 && swarm_scroll_reportable(dragged))
@@ -3845,8 +3941,8 @@ void habitat_touch(bool down, int x, int y, uint32_t now)
// Reading/choosing consumed this contact; motion cannot submit an answer.
} else if (s.view == SELECTION) {
// Its bounded reading cursor already consumed this vertical drag.
- } else if (surface && swarm_mode() && swarm_side_swipe(dy)) {
- // A Swarm project's PM side and Buddy side (spec 2026-10-29-round-dial-pm-buddy): up and back down.
+ } else if (surface && swarm_mode()) {
+ // A Swarm face's vertical swipe does nothing (spec 2026-11-05): the pair switches sides, the bell opens the inbox.
} else if (surface && character.id == HT_CHARACTER_FOCUS && dy > 0 && notice_unread(face_id())) {
// Pull down from the badge. The creature skins keep this drag inert — their footer
// badge is a target you tap — but on Focus the badge sits at the top edge and a pull
@@ -3966,8 +4062,8 @@ uint32_t habitat_next_wake_ms(void)
uint32_t left = elapsed >= due ? 1 : due - elapsed;
if (left < delay) delay = left;
}
- uint32_t deadlines[] = {s.pet_pose ? s.pet_until : 0, s.nap ? s.nap_until : 0,
- s.voice_retry_until};
+ uint32_t deadlines[] = {s.pet_pose ? s.pet_until : 0, s.nap ? s.nap_until : 0, s.view == SWARM_PICK && !s.touch_down ? s.pick_until : 0,
+ s.voice_retry_until}; // (the picker's idle waits for the lift: a held finger past it woke every pass)
for (unsigned i = 0; i < sizeof(deadlines) / sizeof(deadlines[0]); i++)
if (deadlines[i]) {
int32_t left = (int32_t)(deadlines[i] - now);
diff --git a/devices/harness-device/firmware/test/test_cable_supertab.py b/devices/harness-device/firmware/test/test_cable_supertab.py
index fd9f8e58f..fec9cf7a5 100644
--- a/devices/harness-device/firmware/test/test_cable_supertab.py
+++ b/devices/harness-device/firmware/test/test_cable_supertab.py
@@ -120,6 +120,8 @@ int main(void) {
assert(!strcmp(field(wire[0],"swarmBuddy"),"v1"));
// and swarmThread v1: each Lead's thread fields, a recap naming its thread, and supertab.thread.leave back.
assert(!strcmp(field(wire[0],"swarmThread"),"v1"));
+ // and swarmNeedsYou v1: a card may carry `personal`, a Swarm that is the reader's own.
+ assert(!strcmp(field(wire[0],"swarmNeedsYou"),"v1"));
// and no swarmReview: words for a Swarm chat are sent as any harness's are, reviewed only when held (Diego's dial,
// 2026-10-29), and a daemon that heard it would refuse every word not reviewed.
assert(!strcmp(field(wire[0],"swarmReview"),"<absent>"));
@@ -205,6 +207,15 @@ int main(void) {
feed(handle_supertab,"{\"id\":\"s1\",\"name\":\"n\",\"side\":1,\"leads\":[]}");
assert(got_card.side == HT_SIDE_NONE);
+ // `personal` is true only for JSON true: absent, false, or any other type is a plain Swarm.
+ assert(!got_card.personal);
+ feed(handle_supertab,"{\"id\":\"s1\",\"name\":\"n\",\"personal\":true,\"leads\":[]}");
+ assert(got_card.personal);
+ feed(handle_supertab,"{\"id\":\"s1\",\"name\":\"n\",\"personal\":false,\"leads\":[]}");
+ assert(!got_card.personal);
+ feed(handle_supertab,"{\"id\":\"s1\",\"name\":\"n\",\"personal\":1,\"leads\":[]}");
+ assert(!got_card.personal);
+
// supertab.notice and supertab.notice.read reach the ui calls with their fields; the UI decides the beep.
const unsigned beeps_before=beeps;
beep_next=true;
diff --git a/devices/harness-device/firmware/test/test_touch_ui.py b/devices/harness-device/firmware/test/test_touch_ui.py
index dbc40c015..95e37e026 100644
--- a/devices/harness-device/firmware/test/test_touch_ui.py
+++ b/devices/harness-device/firmware/test/test_touch_ui.py
@@ -71,6 +71,7 @@ static struct {
ht_focus_working_pick_t working_pick;
uint32_t pet_next_ms;
uint32_t timer_at;
+ uint32_t pick_until;
cable_swarm_t tabs[SWARMS_MAX];
struct { char id[64], name[96], state[16]; bool local; } machines[2];
char selected_tab[ID_MAX], pending_focus[ID_MAX], opening_notice[ID_MAX], title[80], message[256], stop_agent[ID_MAX];
@@ -228,7 +229,7 @@ swarm_parts = {
# with the last `swarms` list it keeps beside it
'swarms_apply': source[source.index('// The last `swarms` list as it came'):source.index('void ui_swarms_replace(')],
}
-for name in ['copy', 'recap_preview', 'notice_unread', 'notice_was_read', 'notice_forget_read', 'notice_flush_reads', 'notice_mark_read', 'habitat_scene_receipt', 'habitat_scene_presented', 'pane_memory', 'pane_memory_apply', 'dismiss_result', 'activity_text', 'ensure', 'input_cancel', 'view', 'notice_open', 'workspace_index', 'swarm_core', 'swarm_voice_id', 'voice_lead', 'tabs_open', 'workspace_failed', 'tab_request', 'tabs_sync', 'ui_scroll_reportable', 'focus_skin', 'focus_face_for', 'focus_chord', 'focus_put', 'focus_span', 'focus_take', 'focus_rows', 'ui_rows', 'ui_can_display', 'ui_wrap', 'text_in', 'control', 'home_footer', 'footer_control', 'text', 'center', 'render_brand', 'heading', 'question_view', 'question_rows', 'question_move', 'question_text', 'render_question', 'render_choices', 'render_answer_review', 'question_answer', 'send_answer', 'make_action', 'character_mood', 'voice_status', 'home_caption_rotates', 'home_caption_tick', 'status_animated', 'status_speed', 'status_wake_ms', 'surface_tick', 'command_face', 'render_workspace_preview', 'question_prompt', 'focus_bell', 'mix_black', 'face_buddy_disc', 'face_buddy_ring', 'face_buddy_dots', 'face_buddy_avatar', 'render_buddy_empty', 'thread_line', 'thread_rest', 'face_thread', 'render_swarm_face', 'render_home', 'render_voice', 'render_selection', 'render_form', 'draft_move', 'render_draft', 'render_draft_options', 'swarms_apply', 'ui_swarms_replace', 'ui_workspace_applied', 'ui_land_after_reload']:
+for name in ['copy', 'recap_preview', 'notice_unread', 'notice_was_read', 'notice_forget_read', 'notice_flush_reads', 'notice_mark_read', 'habitat_scene_receipt', 'habitat_scene_presented', 'pane_memory', 'pane_memory_apply', 'dismiss_result', 'activity_text', 'ensure', 'input_cancel', 'view', 'notice_open', 'workspace_index', 'swarm_core', 'swarm_voice_id', 'voice_lead', 'tabs_open', 'workspace_failed', 'tab_request', 'tabs_sync', 'ui_scroll_reportable', 'focus_skin', 'focus_face_for', 'focus_chord', 'focus_put', 'focus_span', 'focus_take', 'focus_rows', 'ui_rows', 'ui_can_display', 'ui_wrap', 'text_in', 'control', 'home_footer', 'footer_control', 'text', 'center', 'render_brand', 'heading', 'question_view', 'question_rows', 'question_move', 'question_text', 'render_question', 'render_choices', 'render_answer_review', 'question_answer', 'send_answer', 'make_action', 'character_mood', 'voice_status', 'home_caption_rotates', 'home_caption_tick', 'status_animated', 'status_speed', 'status_wake_ms', 'surface_tick', 'command_face', 'render_workspace_preview', 'question_prompt', 'focus_bell', 'mix_black', 'face_buddy_disc', 'face_buddy_ring', 'pill2', 'swarm_pair', 'render_swarm_pick', 'face_buddy_avatar', 'render_buddy_empty', 'thread_line', 'thread_rest', 'face_thread', 'render_swarm_face', 'render_home', 'render_voice', 'render_selection', 'render_form', 'draft_move', 'render_draft', 'render_draft_options', 'swarms_apply', 'ui_swarms_replace', 'ui_workspace_applied', 'ui_land_after_reload']:
code += swarm_parts[name] if name in swarm_parts else function(name)
code += function('render_settings') + function('ui_visit_state')
code += function('ui_project_known') + function('ui_focus_project') + function('ui_apply_pending_focus')
@@ -300,6 +301,8 @@ static void dispatch(action_t a) {
else if (a.kind == A_FIND) view(FORM);
else if (a.kind == A_AGENTS) panes_action(a); // ui_habitat.c's own: the pages open on the pane on the face
else if (a.kind == A_INBOX) notice_open();
+ else if (a.kind == A_SIDE_PM || a.kind == A_SIDE_BUDDY) swarm_side_set(a.kind == A_SIDE_BUDDY); // ui_habitat.c's own
+ else if (a.kind == A_PICK_PERSONAL || a.kind == A_PICK_TEAM) { if (s.view == SWARM_PICK) swarm_pick(a.kind == A_PICK_TEAM); } // ui_habitat.c's own
else if (a.kind == A_HOME) view(HOME);
else if (a.kind == A_NOTICE) notice_action(a);
else if (a.kind == A_RECAP_DISMISS) dismiss_result(a.id);
@@ -327,7 +330,8 @@ static void scene_take(void) {
else if (s.view == VOICE) render_voice(&scene);
else if (s.view == TABS || s.view == INBOX || s.view == MACHINES) render_list(&scene);
else if (s.view == AGENTS) render_agents(&scene);
- else if (s.view == SELECTION) render_selection(&scene); else render_home(&scene);
+ else if (s.view == SELECTION) render_selection(&scene);
+ else if (s.view == SWARM_PICK) render_swarm_pick(&scene); else render_home(&scene);
if (s.view == SETTINGS) { ht_scene_clear(&scene,BG); s.hit_count=0; render_settings(&scene); }
if (present_scene) habitat_scene_presented(habitat_scene_receipt());
}
@@ -1919,9 +1923,9 @@ static void swarm_chat_checks(const char *dir) {
assert(s.notice_count == 0);
assert(!chat_card("done", "pm", "pm1") && !chat_card("work", "pm", "pm1") && s.notice_count == 0);
- // The chat name under the project, on the inner arc: none for the Lead chat, "PM", a group's name cut at a word.
+ // The chat name under the project, on the inner arc: none for the Lead chat or the PM chat (spec 2026-11-05), a group's name cut at a word.
enter_at("s1", "C2"); assert(title_is("web") && !inner_arc());
- enter_at("s1", "C1"); assert(title_is("docs") && inner_arc() && !strcmp(inner_arc()->text, "PM"));
+ enter_at("s1", "C1"); assert(title_is("docs") && !inner_arc());
FOCUS_PAGE("swarm-6a");
card_begin("s1", "t1", "openharness");
chat_lead("C0", "mobile", "h0", "done", 0, -1, "group", "g1", "Fix the login redirect loop on Safari and Chrome");
@@ -2029,6 +2033,9 @@ static void drag_v(int from_y, int to_y) {
}
static void swipe_up(void) { swipe_v(330, 150); }
static void swipe_down(void) { swipe_v(150, 330); }
+// The PM | Buddy pair (spec 2026-11-05): a tap on a half, as the person switches sides now.
+static void pair_buddy(void) { fake_ms += 1000; tap(fake_ms, 278, 410); }
+static void pair_pm(void) { fake_ms += 1000; tap(fake_ms, 188, 410); }
static void swipe_next(void) {
fake_ms += 1000; habitat_touch(true, 320, 220, fake_ms); habitat_touch(false, 150, 220, fake_ms + 120); scene_take();
}
@@ -2080,11 +2087,26 @@ static bool clear_of_text(void) {
}
return true;
}
-static bool pm_dots(void) { return disc_at(442, 218, 12, 0xeaeaf0) && disc_at(442, 248, 9, 0x55565f); }
-static bool buddy_dots(void) { return disc_at(442, 218, 9, 0x55565f) && disc_at(442, 248, 12, 0xc49bff); }
-static bool any_dot(void) { return disc_at(442, 218, 12, 0xeaeaf0) || disc_at(442, 218, 9, 0x55565f); }
-// The Buddy's unheard word on the PM side: the lower dot itself turns lilac, at its own place and size.
-static bool badge(void) { return disc_at(442, 218, 12, 0xeaeaf0) && disc_at(442, 248, 9, 0xc49bff); }
+// The pair: the pill 180 wide at y 388, and the current half filled #2b2d33 (the side dots are gone with it).
+static bool pair_pill(void) {
+ for (int i = 0; i < scene.count; i++) {
+ const ht_run_t *r = &scene.runs[i];
+ if (r->box.h == 44 && r->w == 180 && r->x == 143 && r->y == 388 && r->box.fill == ht_rgb(0x141518)) return true;
+ }
+ return false;
+}
+static int pair_half(void) { // 0 PM, 1 Buddy, -1 none
+ for (int i = 0; i < scene.count; i++) {
+ const ht_run_t *r = &scene.runs[i];
+ if (r->box.h && r->box.fill == ht_rgb(0x2b2d33) && r->y == 391) return r->x < 233 ? 0 : 1;
+ }
+ return -1;
+}
+static bool pm_dots(void) { return pair_pill() && pair_half() == 0; }
+static bool buddy_dots(void) { return pair_pill() && pair_half() == 1; }
+static bool any_dot(void) { return pair_pill(); }
+// The Buddy's unheard word on the PM side: "Your Buddy replied", one line at y 318.
+static bool badge(void) { return scene_says("Your Buddy replied"); }
// Nothing drawn off the dots' line: the old badge, 7 px off the lower dot, smeared the two together.
static bool offset_disc(void) {
for (int i = 0; i < scene.count; i++) {
@@ -2140,7 +2162,7 @@ static void swarm_restart_checks(void) {
swarm_setup(); s.view = HOME; dispatch((action_t){.kind = A_TABS}); assert(s.view == TABS && !sw.auto_tabs);
COPY(s.selected_tab, "t1"); ui_supertab_focus("s1", "L2"); assert(!swarm_mode() && s.view == TABS);
// The side comes back too, and the new daemon, which remembers none, is told it.
- buddy_setup(); enter_at("s1", "B1"); s.view = HOME; swipe_up(); assert(swarm_side_buddy("s1"));
+ buddy_setup(); enter_at("s1", "B1"); s.view = HOME; pair_buddy(); assert(swarm_side_buddy("s1"));
ui_supertabs_clear(); assert(!swarm_side_buddy("s1")); fake_ms += 40000; swarm_sent = 0;
{ const char one[1][ID_MAX] = {"s1"}; ui_supertabs_ids(one, 1); }
buddy_card("lead");
@@ -2332,11 +2354,11 @@ static void swarm_buddy_checks(const char *dir) {
// kept scrolling).
{ int before = down_reports; habitat_touch(true, 233, 260, fake_ms + 700); habitat_touch(false, 233, 260, fake_ms + 760);
assert(down_reports == before + 1); }
- // A thumb that rests before it flicks still switches the side: the drag's time runs from when it starts to move.
+ // A thumb that rests before it flicks no longer switches the side (spec 2026-11-05): the pair's taps do.
buddy_setup(); down_reports = moves = ups = 0;
fake_ms += 1000; habitat_touch(true, 233, 330, fake_ms); habitat_touch(true, 233, 330, fake_ms + 400);
habitat_touch(true, 233, 240, fake_ms + 450); habitat_touch(false, 233, 150, fake_ms + 500); scene_take();
- assert(!moves && swarm_sent == 1 && !strcmp(swarm_wire[0], "side s1 buddy") && lilac_ring());
+ assert(!moves && swarm_sent == 0 && !lilac_ring() && pm_dots());
// A daemon that came back has forgotten the Lead open here (the dial's link dropped, as ui_set_connected(false)
// leaves it): the next frame tells it again, so a drag scrolls its Swarm and recaps reach the face (review of #2232).
buddy_setup(); sw.opened = false;
@@ -2348,9 +2370,9 @@ static void swarm_buddy_checks(const char *dir) {
buddy_setup();
// The PM chat's recap is on the face.
ui_supertab_recap("s1", "B0", "lead-web", "", "Merged.", 1792560000u, false); scene_take(); assert(scene_says("Merged."));
- // 7b swipe up: the dial says so, and draws the Buddy side at once: the ring, the avatar, the lower dot lit.
- swipe_up();
- // A flick is the side's: it scrolls nothing (it used to scroll the pane still active behind it).
+ // 7b tap Buddy: the dial says so, and draws the Buddy side at once: the ring, the avatar, the lower dot lit.
+ pair_buddy();
+ // The tap scrolls nothing (it used to scroll the pane still active behind it).
assert(!down_reports && !moves && !ups);
assert(swarm_sent == 1 && !strcmp(swarm_wire[0], "side s1 buddy"));
assert(s.view == HOME && title_is("web-api") && lilac_ring() && avatar() && buddy_dots());
@@ -2391,7 +2413,7 @@ static void swarm_buddy_checks(const char *dir) {
}
#undef AV
}
- // Swipe up on the Buddy side does nothing.
+ // A swipe up on the Buddy side does nothing.
swipe_up(); assert(swarm_sent == 2 && lilac_ring());
// The next project keeps the side, and the dial says it again with the move.
swipe_next();
@@ -2402,12 +2424,14 @@ static void swarm_buddy_checks(const char *dir) {
assert(scene_says("No Buddy here yet") && scene_says("Add one in the Harness app."));
FOCUS_PAGE("buddy-7c");
{ int before = starts; tap(fake_ms + 2000, 233, 260); assert(starts == before && s.view == HOME); }
- // Swipe down: back to the PM side.
- int sent = swarm_sent; swipe_down();
+ // Tap PM: back to the PM side.
+ int sent = swarm_sent; pair_pm();
assert(swarm_sent == sent + 1 && !strcmp(swarm_wire[sent], "side s1 pm") && pm_dots() && !lilac_ring() && !scene_says("No Buddy"));
- // On the PM side an unread Lead notice still opens the inbox on a pull down.
+ // On the PM side an unread Lead notice opens the inbox from the bell, not from a pull down.
assert(ui_supertab_notice("s1", "B0", HT_CHAT_LEAD, "lead-web", "", "Web is merged.", 1792560001u));
scene_take(); sent = swarm_sent; swipe_down();
+ assert(s.view == HOME && swarm_sent == sent);
+ tap(fake_ms += 1000, 233, 360);
assert(s.view == INBOX && swarm_sent == sent);
dispatch((action_t){.kind = A_HOME}); scene_take();
@@ -2417,11 +2441,11 @@ static void swarm_buddy_checks(const char *dir) {
scene_take(); assert(lilac_ring() && avatar() && swarm_sent == 0);
buddy_card("lead"); scene_take(); assert(!lilac_ring() && pm_dots() && swarm_sent == 0);
// A desktop focus moves the face without saying a side; only the person's own move does.
- swipe_up(); assert(swarm_sent == 1);
+ pair_buddy(); assert(swarm_sent == 1);
ui_supertab_focus("s1", "B1"); scene_take(); assert(!strcmp(sw.lead, "B1") && !wire_has(1, "side s1 buddy") && !wire_has(1, "side s1 pm"));
// The dial follows the daemon even right after its own move: the daemon keeps the side through the desktop move its
// select causes, so a turn away is always a newer desktop focus.
- buddy_setup(); swipe_up(); buddy_card("buddy"); swipe_next();
+ buddy_setup(); pair_buddy(); buddy_card("buddy"); swipe_next();
assert(!strcmp(sw.lead, "B1") && lilac_ring() && wire_has(0, "side s1 buddy"));
sent = swarm_sent; buddy_card("lead"); scene_take();
assert(!lilac_ring() && pm_dots() && swarm_sent == sent);
@@ -2434,7 +2458,7 @@ static void swarm_buddy_checks(const char *dir) {
const char ids[1][ID_MAX] = {"s1"}; ui_supertabs_ids(ids, 1);
card_begin("s1", "t1", "openharness"); buddy_lead("B2", "docs", "h2", "lead", "lead-docs", NULL, NULL); card.side = HT_SIDE_PM; card_send();
enter_at("s1", "B2"); swarm_sent = 0;
- swipe_up(); assert(scene_says("No Buddy here yet") && swarm_sent == 1);
+ pair_buddy(); assert(scene_says("No Buddy here yet") && swarm_sent == 1);
// The daemon took the swipe: its frame says the Buddy side, and the empty screen stays.
card_begin("s1", "t1", "openharness"); buddy_lead("B2", "docs", "h2", "lead", "lead-docs", NULL, NULL); card.side = HT_SIDE_BUDDY; card_send();
scene_take(); assert(scene_says("No Buddy here yet"));
@@ -2460,11 +2484,11 @@ static void swarm_buddy_checks(const char *dir) {
assert(scene.count == off.count && !memcmp(&scene, &off, sizeof scene));
}
// Buddies turned off while on the Buddy side: the PM face, no dots.
- buddy_setup(); swipe_up(); assert(lilac_ring());
+ buddy_setup(); pair_buddy(); assert(lilac_ring());
card_begin("s1", "t1", "openharness"); chat_lead("B0", "web-api", "h0", "done", 0, -1, "lead", "lead-web", "Lead"); card_send();
scene_take(); assert(!lilac_ring() && !any_dot() && !avatar());
// A Buddy removed while its side is open (Buddies still on, no block): the empty state, no voice.
- buddy_setup(); swipe_up();
+ buddy_setup(); pair_buddy();
card_begin("s1", "t1", "openharness"); buddy_lead("B0", "web-api", "h0", "lead", "lead-web", NULL, NULL); card_send(); scene_take();
assert(scene_says("No Buddy here yet") && lilac_ring());
{ int before = starts; tap(fake_ms + 2000, 233, 260); assert(starts == before); }
@@ -2478,22 +2502,22 @@ static void swarm_buddy_checks(const char *dir) {
int entries = s.notice_count; int woke = wakes;
assert(!ui_supertab_notice("s1", "B0", HT_CHAT_BUDDY, "b0", "", "Cache it.", 1792560002u));
scene_take();
- assert(s.notice_count == entries && wakes == woke && badge() && !pm_dots() && !offset_disc() && scene_says("Your Buddy replied") && scene.count == pm_runs);
+ assert(s.notice_count == entries && wakes == woke && badge() && pm_dots() && !offset_disc() && scene_says("Your Buddy replied") && scene.count == pm_runs);
FOCUS_PAGE("buddy-7d");
// Another project shows none; back on web-api it is still there.
swipe_next(); assert(!badge() && !scene_says("Your Buddy replied"));
swarm_show(ht_supertabs_find(&swarm, "s1"), 0, true); scene_take(); assert(badge());
// Opening the Buddy side reads it.
- swipe_up(); assert(!badge()); swipe_down(); assert(!badge() && !scene_says("Your Buddy replied"));
- // The resting face keeps its own line on the lower arc: there the badge alone tells it.
+ pair_buddy(); assert(!badge()); pair_pm(); assert(!badge() && !scene_says("Your Buddy replied"));
+ // The resting face has no lower-arc hint with the pair, so the line stands at y 318 here too.
ui_supertab_recap("s1", "B0", "lead-web", "", "", 1792560000u, true);
assert(!ui_supertab_notice("s1", "B0", HT_CHAT_BUDDY, "b0", "", "Later.", 1792560002u));
- scene_take(); assert(badge() && !offset_disc() && !scene_says("Your Buddy replied"));
- swipe_up(); swipe_down(); assert(!badge() && pm_dots());
+ scene_take(); assert(badge() && !offset_disc());
+ pair_buddy(); pair_pm(); assert(!badge() && pm_dots());
// A Buddy word while its side is open is read there; the desktop opening the Buddy chat reads one too.
- swipe_up(); buddy_card("buddy");
+ pair_buddy(); buddy_card("buddy");
assert(!ui_supertab_notice("s1", "B0", HT_CHAT_BUDDY, "b0", "", "Done.", 1792560003u));
- swipe_down(); assert(!badge());
+ pair_pm(); assert(!badge());
assert(!ui_supertab_notice("s1", "B0", HT_CHAT_BUDDY, "b0", "", "Again.", 1792560004u)); scene_take(); assert(badge());
ui_supertab_notice_read("s1", "B0", "other"); scene_take(); assert(badge());
ui_supertab_notice_read("s1", "B0", "b0"); scene_take(); assert(!badge());
@@ -2501,7 +2525,7 @@ static void swarm_buddy_checks(const char *dir) {
assert(ui_supertab_notice("s1", "B1", HT_CHAT_LEAD, "lead-fw", "", "Flashed.", 1792560005u) && s.notice_count == entries + 1);
// 7e-7g voice on the Buddy side: the Buddy's engine's pet, the ring kept, and "Sending to your Buddy".
- buddy_setup(); swipe_up(); buddy_card("buddy"); scene_take();
+ buddy_setup(); pair_buddy(); buddy_card("buddy"); scene_take();
tap(fake_ms + 2000, 233, 260);
assert(s.view == VOICE && !strcmp(target, "h0") && !strcmp(s.voice_engine, "codex") && lilac_ring());
FOCUS_PAGE("buddy-7e");
@@ -2516,7 +2540,7 @@ static void swarm_buddy_checks(const char *dir) {
FOCUS_PAGE("buddy-7g");
dispatch((action_t){.kind = A_VOICE_ABORT}); scene_take();
// On the PM side voice is today's: the Lead's engine, no ring, no Buddy line.
- swipe_down(); tap(fake_ms + 2000, 233, 260);
+ pair_pm(); tap(fake_ms + 2000, 233, 260);
assert(s.view == VOICE && !strcmp(target, "h1") && !strcmp(s.voice_engine, "claude") && !lilac_ring());
s.voice_waiting = true; recording = false; scene_take(); assert(!scene_says("Sending to your Buddy"));
dispatch((action_t){.kind = A_VOICE_ABORT}); s.voice_waiting = false;
@@ -2533,7 +2557,7 @@ static void swarm_buddy_checks(const char *dir) {
assert(!lilac_ring() && !scene_says("Sending to your Buddy"));
dispatch((action_t){.kind = A_VOICE_ABORT}); s.voice_waiting = false;
// Started on the Buddy side; the desktop then opens another conversation.
- buddy_setup(); swipe_up(); buddy_card("buddy"); scene_take(); tap(fake_ms + 2000, 233, 260);
+ buddy_setup(); pair_buddy(); buddy_card("buddy"); scene_take(); tap(fake_ms + 2000, 233, 260);
assert(s.view == VOICE && lilac_ring());
if (waiting) { s.voice_waiting = true; recording = false; }
buddy_card("lead"); scene_take();
@@ -2542,7 +2566,231 @@ static void swarm_buddy_checks(const char *dir) {
assert(lilac_ring() && scene_says("Sending to your Buddy"));
dispatch((action_t){.kind = A_VOICE_ABORT}); s.voice_waiting = false;
}
- puts("Swarm Buddies: swipe up for the Buddy (ring, avatar, dots, its recap), down for the PM, side kept across projects and following the daemon, the empty state, Buddies off unchanged, the quiet badge, voice with the Buddy's engine PASS");
+ puts("Swarm Buddies: tap Buddy on the pair (ring, avatar, its recap), PM for the PM, side kept across projects and following the daemon, the empty state, Buddies off unchanged, the quiet badge, voice with the Buddy's engine PASS");
+}
+// The PM | Buddy pair (spec 2026-11-05): the bottom pill, the bell above it, vertical swipes inert, no "PM" line.
+static bool run_at(const char *text, int y) {
+ for (int i = 0; i < scene.count; i++) if (!strcmp(scene.runs[i].text, text) && scene.runs[i].y == y) return true;
+ return false;
+}
+static bool arc2_text(void) {
+ for (int i = 0; i < scene.count; i++) if (scene.runs[i].arc == 2 && scene.runs[i].text[0]) return true;
+ return false;
+}
+static bool bell_at(int y) {
+ for (int i = 0; i < scene.count; i++) if (scene.runs[i].box.h == 32 && scene.runs[i].y == y && scene.runs[i].box.fill == ht_rgb(0x006fff)) return true;
+ return false;
+}
+static void pair_lead(const char *id, const char *project, const char *state, long since, bool buddies, const char *chat, const char *chat_name) {
+ ht_lead_in_t in = {.id = id, .project = project, .engine = "claude", .local = "h0", .state = state, .order = card.lead_n, .since = since,
+ .chat = chat, .chat_id = "c0", .chat_name = chat_name, .buddies = buddies,
+ .buddy = {.present = buddies, .chat_id = "b0", .name = "diego's Buddy", .engine = "codex", .color = "#d6a79a", .cells = 25513, .live = true}};
+ assert(ht_supertab_lead_add(&card, &in));
+}
+static void pair_face(const char *state, long since, bool buddies, const char *chat, const char *chat_name) {
+ buddy_setup();
+ card_begin("s1", "t1", "openharness"); pair_lead("B0", "web-api", state, since, buddies, chat, chat_name);
+ pair_lead("B1", "firmware", "done", -1, buddies, "lead", "Lead"); assert(!card_send());
+ enter_at("s1", "B0"); swarm_sent = 0; scene_take();
+}
+// No side or select frame went out after wire slot `from`: a vertical swipe sends nothing (a recap retry may still go out with time).
+static bool no_side_since(int from) {
+ for (int k = from; k < swarm_sent; k++) if (strstr(swarm_wire[k], "side") || strstr(swarm_wire[k], "select")) return false;
+ return true;
+}
+// PERSONAL | TEAM (spec 2026-11-05): cards by id in list order; "sp" is the reader's Personal Swarm, "s1" and "s3" are Team.
+static void pick_card(const char *id, const char *tab, const char *name, const char *lead, bool personal) {
+ card_begin(id, tab, name); card.personal = personal;
+ pair_lead(lead, "web-api", "done", -1, false, "lead", "Lead"); assert(!card_send());
+}
+static void pick_setup(bool personal, int teams, const char *face) {
+ reset(); ht_character_select(&character, HT_CHARACTER_FOCUS); fake_ms = 100000; desk_open();
+ const char ids[3][ID_MAX] = {"sp", "s1", "s3"}; char list[3][ID_MAX]; int n = 0;
+ if (personal) COPY(list[n++], ids[0]);
+ for (int i = 0; i < teams; i++) COPY(list[n++], ids[1 + i]);
+ ui_supertabs_ids(list, n);
+ if (personal) pick_card("sp", "t2", "Personal", "P0", true);
+ if (teams > 0) pick_card("s1", "t1", "Team A", "A0", false);
+ if (teams > 1) pick_card("s3", "t0", "Team B", "B0", false);
+ enter_at(face, NULL); swarm_sent = 0; scene_take();
+}
+static bool pick_half(void) { // the filled half: 0 Personal, 1 Team, -1 none
+ for (int i = 0; i < scene.count; i++) {
+ const ht_run_t *r = &scene.runs[i];
+ if (r->box.h && r->box.fill == ht_rgb(0x2b2d33) && r->y == 214) return r->x < 233 ? 0 : 1;
+ }
+ return -1;
+}
+static bool pick_pill(void) {
+ for (int i = 0; i < scene.count; i++) {
+ const ht_run_t *r = &scene.runs[i];
+ if (r->box.h == 44 && r->w == 200 && r->x == 133 && r->y == 211 && r->box.fill == ht_rgb(0x141518)) return true;
+ }
+ return false;
+}
+static void swarm_pick_checks(const char *dir) {
+ // The title opens the picker: "Swarm" on the top arc, one pill, the Swarm on the face (Team) filled.
+ pick_setup(true, 1, "s1");
+ fake_ms += 1000; tap(fake_ms, 233, 30);
+ assert(s.view == SWARM_PICK && scene_says("Swarm") && scene_says("Personal") && scene_says("Team") && pick_pill() && pick_half() == 1);
+ portrait(dir, "pick-team");
+ // Personal: the Personal card's first Lead on the face, the desktop told as for a tab pick.
+ fake_ms += 1000; tap(fake_ms, 183, 233);
+ assert(s.view == HOME && !strcmp(sw.tab, "sp") && !strcmp(sw.lead, "P0") && wire_has(0, "select sp P0"));
+ fake_ms += 1000; tap(fake_ms, 233, 30);
+ assert(s.view == SWARM_PICK && pick_half() == 0);
+ portrait(dir, "pick-personal");
+ // The filled half only returns, unchanged and silent.
+ swarm_sent = 0; fake_ms += 1000; tap(fake_ms, 183, 233);
+ assert(s.view == HOME && !strcmp(sw.tab, "sp") && swarm_sent == 0);
+ // Team goes to the last non-Personal card shown, else the first in list order.
+ pick_setup(true, 2, "s3");
+ swarm_enter(ht_supertabs_find(&swarm, "sp"), NULL, true); scene_take();
+ fake_ms += 1000; tap(fake_ms, 233, 30); assert(s.view == SWARM_PICK);
+ fake_ms += 1000; tap(fake_ms, 283, 233);
+ assert(s.view == HOME && !strcmp(sw.tab, "s3") && !strcmp(sw.lead, "B0") && wire_has(0, "select s3 B0"));
+ pick_setup(true, 2, "sp");
+ fake_ms += 1000; tap(fake_ms, 233, 30); assert(s.view == SWARM_PICK);
+ fake_ms += 1000; tap(fake_ms, 283, 233);
+ assert(s.view == HOME && !strcmp(sw.tab, "s1") && !strcmp(sw.lead, "A0"));
+ // Idle: 5 s with no touch returns to the same Lead and side, and sends no select or side frame.
+ pick_setup(true, 1, "s1");
+ fake_ms += 1000; tap(fake_ms, 233, 30); assert(s.view == SWARM_PICK);
+ swarm_sent = 0; fake_ms += 4000; surface_tick(fake_ms); assert(s.view == SWARM_PICK);
+ fake_ms += 1000; surface_tick(fake_ms); scene_take();
+ assert(s.view == HOME && !strcmp(sw.tab, "s1") && !strcmp(sw.lead, "A0") && no_side_since(0)); // (a recap retry may still go out with time)
+ // A finger held down past the idle deadline does not make the wake 1 ms on every pass (the picker waits for the lift).
+ pick_setup(true, 1, "s1");
+ fake_ms += 1000; tap(fake_ms, 233, 30); assert(s.view == SWARM_PICK && s.pick_until);
+ sw.retried = true; // the recap's own 5 s retry is not under test
+ s.touch_down = true; fake_ms = s.pick_until + 500; assert(habitat_next_wake_ms() > 1); s.touch_down = false;
+ assert(habitat_next_wake_ms() == 1); // and once lifted the deadline is due
+ // No picker without both a Personal card and another: the name keeps opening PANES.
+ pick_setup(true, 0, "sp");
+ fake_ms += 1000; tap(fake_ms, 233, 30); assert(s.view == AGENTS);
+ pick_setup(false, 2, "s1");
+ fake_ms += 1000; tap(fake_ms, 233, 30); assert(s.view == AGENTS);
+}
+static void swarm_pair_checks(const char *dir) {
+ // Drawn: 180 x 44 at y 388, "PM" lit, no side dots, no lower-arc hint, no unread bell.
+ buddy_setup();
+ assert(pair_pill() && pm_dots() && scene_says("PM") && scene_says("Buddy") && !arc2_text() && !bell_at(346) && !bell_at(400));
+ assert(!disc_at(442, 218, 12, 0xeaeaf0) && !disc_at(442, 218, 9, 0x55565f));
+ FOCUS_PAGE("pair-pm");
+ // A notice off the face: the bell stands at y 346, clear of the pair.
+ assert(ui_supertab_notice("s1", "B1", HT_CHAT_LEAD, "lead-fw", "", "Flashed.", 1792560001u));
+ scene_take(); assert(bell_at(346) && !bell_at(400) && pair_pill());
+ FOCUS_PAGE("pair-bell");
+ // Tap Buddy: the side switches and the daemon is told; tapping it again does nothing; PM goes back.
+ pair_buddy();
+ assert(swarm_side_buddy("s1") && wire_has(0, "side s1 buddy") && swarm_sent == 1 && buddy_dots() && lilac_ring());
+ FOCUS_PAGE("pair-buddy");
+ pair_buddy(); assert(swarm_sent == 1 && buddy_dots());
+ pair_pm();
+ assert(!swarm_side_buddy("s1") && wire_has(1, "side s1 pm") && swarm_sent == 2 && pm_dots() && !lilac_ring());
+ pair_pm(); assert(swarm_sent == 2);
+ // Vertical swipes are inert on the face, with or without a notice: no side, no inbox, no frame.
+ int sent = swarm_sent;
+ swipe_up(); assert(!swarm_side_buddy("s1") && s.view == HOME && no_side_since(sent));
+ swipe_down(); assert(!swarm_side_buddy("s1") && s.view == HOME && no_side_since(sent));
+ pair_buddy(); sent = swarm_sent;
+ swipe_up(); swipe_down(); assert(swarm_side_buddy("s1") && s.view == HOME && no_side_since(sent));
+ pair_pm();
+ // The bell opens the inbox.
+ tap(fake_ms += 1000, 233, 360); assert(s.view == INBOX);
+ dispatch((action_t){.kind = A_HOME}); scene_take();
+ // Hits: the halves, 90 x 44 at y 388.
+ { bool pm = false, bu = false;
+ for (int i = 0; i < s.hit_count; i++) {
+ if (s.hits[i].action == A_SIDE_PM) pm = s.hits[i].rect.x == 143 && s.hits[i].rect.y == 388 && s.hits[i].rect.w == 90 && s.hits[i].rect.h == 44;
+ if (s.hits[i].action == A_SIDE_BUDDY) bu = s.hits[i].rect.x == 233 && s.hits[i].rect.y == 388 && s.hits[i].rect.w == 90 && s.hits[i].rect.h == 44;
+ }
+ assert(pm && bu); }
+ // The empty Buddy side keeps the pair, so the person can come back.
+ pair_face("done", -1, true, "lead", "Lead"); card_begin("s1", "t1", "openharness");
+ { ht_lead_in_t in = {.id = "B0", .project = "web-api", .engine = "claude", .local = "h0", .state = "done", .order = 0, .since = -1,
+ .chat = "lead", .chat_id = "c0", .chat_name = "Lead", .buddies = true}; assert(ht_supertab_lead_add(&card, &in)); }
+ card_send(); pair_buddy(); assert(scene_says("No Buddy here yet") && buddy_dots());
+ pair_pm(); assert(pm_dots() && !scene_says("No Buddy"));
+ // No pair without Buddies: the bell keeps y 400, vertical swipes are still inert.
+ pair_face("done", -1, false, "lead", "Lead");
+ assert(!pair_pill() && !scene_says("Buddy") && !run_at("PM", 399));
+ assert(ui_supertab_notice("s1", "B1", HT_CHAT_LEAD, "lead-fw", "", "Flashed.", 1792560001u));
+ scene_take(); assert(bell_at(400) && !bell_at(346));
+ sent = swarm_sent; swipe_up(); swipe_down(); assert(s.view == HOME && no_side_since(sent));
+ // No "PM" line under the name for the PM chat; a group keeps its name.
+ pair_face("done", -1, false, "pm", "PM");
+ assert(!scene_says("PM"));
+ pair_face("done", -1, true, "pm", "PM");
+ for (int i = 0; i < scene.count; i++) assert(strcmp(scene.runs[i].text, "PM") || scene.runs[i].y >= 388);
+ pair_face("done", -1, false, "group", "Launch crew");
+ assert(scene_says("Launch crew"));
+ // Working: the line is centred at y 318, none on the lower arc.
+ pair_face("work", 12, true, "lead", "Lead");
+ assert(pair_pill() && !arc2_text());
+ { bool found = false;
+ for (int i = 0; i < scene.count; i++) {
+ const ht_run_t *r = &scene.runs[i];
+ if (r->y == 318 && r->text[0] && !r->arc && strstr(r->text, "0:12")) { found = true; assert(r->x + r->w / 2 >= 231 && r->x + r->w / 2 <= 235); }
+ }
+ assert(found); }
+ FOCUS_PAGE("pair-working");
+ // "Your Buddy replied" is the same line, at y 318, beside a bell.
+ buddy_setup();
+ ui_supertab_recap("s1", "B0", "lead-web", "", "Assigned #2083.", 1792560000u, false);
+ assert(!ui_supertab_notice("s1", "B0", HT_CHAT_BUDDY, "b0", "", "Cache it.", 1792560002u));
+ assert(ui_supertab_notice("s1", "B1", HT_CHAT_LEAD, "lead-fw", "", "Flashed.", 1792560003u));
+ scene_take(); assert(run_at("Your Buddy replied", 318) && bell_at(346) && !arc2_text());
+ FOCUS_PAGE("pair-replied");
+ // A thread face: the pair replaces its side dots, and a sideways swipe still leaves the thread.
+ buddy_setup();
+ card_begin("s1", "t1", "openharness");
+ { ht_lead_in_t in = {.id = "B0", .project = "web-api", .engine = "claude", .local = "h0", .state = "done", .order = 0, .since = -1,
+ .chat = "pm", .chat_id = "pm1", .chat_name = "PM", .thread = "m9", .thread_title = "Fix the login bug", .thread_replies = 1,
+ .buddies = true, .buddy = {.present = true, .chat_id = "b0", .name = "diego's Buddy", .engine = "codex", .color = "#d6a79a", .cells = 25513, .live = true}};
+ assert(ht_supertab_lead_add(&card, &in)); }
+ assert(!card_send()); enter_at("s1", "B0"); swarm_sent = 0; scene_take();
+ assert(scene_says("Thread") && pair_pill() && pm_dots());
+ FOCUS_PAGE("pair-thread");
+ pair_buddy(); assert(swarm_side_buddy("s1") && buddy_dots());
+ pair_pm();
+ swipe_next(); assert(wire_has(0, "thread-leave s1 B0"));
+ // Audit: a creature skin draws its bell above the pair too, and its tap opens the inbox from there.
+ pair_face("done", -1, true, "lead", "Lead"); ht_character_select(&character, HT_CHARACTER_TIM);
+ assert(ui_supertab_notice("s1", "B1", HT_CHAT_LEAD, "lead-fw", "", "Flashed.", 1792560001u));
+ scene_take();
+ { bool above = false, under = false;
+ for (int i = 0; i < scene.count; i++) if (scene.runs[i].font == &ht_bell_footer) { if (scene.runs[i].y < 388 && scene.runs[i].y + scene.runs[i].font->height <= 388) above = true; else under = true; }
+ assert(above && !under && pair_pill());
+ bool hit = false;
+ for (int i = 0; i < s.hit_count; i++) if (s.hits[i].action == A_INBOX && s.hits[i].rect.y == 346 - 18) hit = true;
+ assert(hit); }
+ pair_buddy(); assert(swarm_side_buddy("s1")); pair_pm(); assert(!swarm_side_buddy("s1"));
+ tap(fake_ms += 1000, 233, 350); assert(s.view == INBOX);
+ dispatch((action_t){.kind = A_HOME});
+ // Without Buddies a creature skin keeps its bell where it was, under the companion at HT_NOTIFICATION_Y.
+ pair_face("done", -1, false, "lead", "Lead"); ht_character_select(&character, HT_CHARACTER_TIM);
+ assert(ui_supertab_notice("s1", "B1", HT_CHAT_LEAD, "lead-fw", "", "Flashed.", 1792560001u));
+ scene_take();
+ { bool home = false; for (int i = 0; i < scene.count; i++) if (scene.runs[i].font == &ht_bell_footer) { assert(scene.runs[i].y == HT_NOTIFICATION_Y); home = true; }
+ assert(home && !pair_pill()); }
+ dispatch((action_t){.kind = A_HOME});
+ // Audit: a thread face with the pair and the bell holds its card to two lines, clear of the bell at y 346.
+ buddy_setup();
+ card_begin("s1", "t1", "openharness");
+ { ht_lead_in_t in = {.id = "B0", .project = "web-api", .engine = "claude", .local = "h0", .state = "done", .order = 0, .since = -1,
+ .chat = "pm", .chat_id = "pm1", .chat_name = "PM", .thread = "m9", .thread_title = "Fix the login bug on Safari when the session expires", .thread_replies = 2,
+ .buddies = true, .buddy = {.present = true, .chat_id = "b0", .name = "diego's Buddy", .engine = "codex", .color = "#d6a79a", .cells = 25513, .live = true}};
+ assert(ht_supertab_lead_add(&card, &in)); }
+ pair_lead("B1", "firmware", "done", -1, true, "lead", "Lead");
+ assert(!card_send()); enter_at("s1", "B0"); swarm_sent = 0;
+ ui_supertab_recap("s1", "B0", "pm1", "m9", "Taken: Milo fixes the login bug now and Quinn reviews it before the end of the day, then we ship the release to everyone on the beta channel.", 1792560000u, false);
+ assert(ui_supertab_notice("s1", "B1", HT_CHAT_LEAD, "lead-fw", "", "Flashed.", 1792560001u));
+ scene_take();
+ assert(scene_says("PM \xc2\xb7 2 replies") && bell_at(346));
+ for (int i = 0; i < scene.count; i++) { const ht_run_t *r = &scene.runs[i]; if (r->text[0] && r->y < 388 && ht_run_bounds(r).y + ht_run_bounds(r).h > 340 && r->y > 100 && r->font != &ht_bell_footer && r->box.h != 32 && r->x < 150) { fprintf(stderr, "card run y=%d \"%s\"\n", r->y, r->text); assert(false); } }
+ { bool dots = false; for (int i = 0; i < scene.count; i++) if (strstr(scene.runs[i].text, "\xe2\x80\xa6")) dots = true; assert(dots); }
+ puts("Swarm PM | Buddy pair: drawn at y 388, taps switch sides, vertical swipes inert, the bell opens the inbox at y 346 (400 without Buddies), no PM line, the working line at y 318 PASS");
}
int main(int argc, char **argv) {
test_character = getenv("HABITAT_TEST_TUX") ? HT_CHARACTER_TUX : HT_CHARACTER_TIM;
@@ -4102,6 +4350,8 @@ int main(int argc, char **argv) {
swarm_chat_checks(argc>1 ? argv[1] : NULL);
swarm_restart_checks();
swarm_buddy_checks(argc>1 ? argv[1] : NULL);
+ swarm_pair_checks(argc>1 ? argv[1] : NULL);
+ swarm_pick_checks(argc>1 ? argv[1] : NULL);
swarm_thread_checks(argc>1 ? argv[1] : NULL);
swarm_thread_notice_checks();
swarm_tag_notice_checks();
diff --git a/docs/plans/2026-11-05-dial-lead-pm-buddy-pair-plan.md b/docs/plans/2026-11-05-dial-lead-pm-buddy-pair-plan.md
new file mode 100644
index 000000000..8fbc2d8c3
--- /dev/null
+++ b/docs/plans/2026-11-05-dial-lead-pm-buddy-pair-plan.md
@@ -0,0 +1,141 @@
+# Round dial: PM | Buddy pair, bell-only notices, Personal | Team — 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:** On the round dial's Swarm face, switch PM/Buddy with a bottom pair, open notices only from the bell (needs-you only), pick Personal | Team from the project name, and drop the "PM" line.
+
+**Architecture:** The backend list read marks the reader's Personal Swarm; the cards service carries it to the `supertab` frame and adds open decisions asked of the reader as Lead notices; the firmware draws the pair and the picker, routes taps, and stops vertical swipes on the Swarm face.
+
+**Tech Stack:** TypeScript (backend, cli, vitest), C (ESP-IDF round dial firmware, host tests via Python harness).
+
+**Spec:** `docs/specs/2026-11-05-dial-lead-pm-buddy-pair.md`
+
+## Global Constraints
+
+- Pair: 180 × 44 px pill at y 388, `#141518` fill, 1 px `#2e3035`, fully rounded; halves "PM" and "Buddy" in Inter 20; current half `#2b2d33` + white, other text `#9a9ca3`. Bell at y 346 when the pair shows.
+- Picker: "Swarm" on the top arc; one 200 × 44 px pill at y 211, same style, halves "Personal" and "Team"; 5 s idle returns.
+- Working line / "Your Buddy replied" move to one centred line at y 318 when the pair shows; no lower-arc hint, no Buddy side dots.
+- Decision notice text: `<asker> asks you: <question>`, cut to `RECAP_BYTES` like tags.
+- Capability name: `swarmNeedsYou`. Card field: `personal` (true only). List row field: `personal: true` only on the reader's own Personal Swarm.
+- Harness Pro firmware is out of scope; old firmware and old daemons must keep working (see spec Compatibility).
+
+## Review Focus
+
+1. A Lead without Buddies: no pair, the bell keeps y 400, vertical swipe still inert on the Swarm face (Task 4 test "no pair without Buddies").
+2. Only the Personal card on the dial (no Team), or no `personal` at all: tapping the name opens PANES as today (Task 5 test "no picker without both").
+3. Several Team Swarms: Team opens the last non-Personal card shown, else the first in list order (Task 5 test "team goes to the last shown").
+4. A decision open when the dial arrived never alerts; one answered or closed removes its notice (Task 2 tests "baseline" and "closed decision drops its notice").
+5. The picker left idle 5 s returns to the same Lead and side, with no frame sent (Task 5 test "idle returns").
+
+---
+
+### Task 1: The list read marks the reader's Personal Swarm
+
+**Files:**
+- Modify: `backend/src/superTabs/store.ts` (`list`, ~:1119-1127)
+- Test: `backend/integration/superTabRead.test.ts` (or the existing list test there)
+
+**Interfaces:**
+- Produces: list rows `{ id, name, ownerId, revision, paused, personal?: true }`.
+
+- [ ] **Step 1: Write the failing test** "the list marks only the reader's own Personal Swarm": owner O has a Personal Swarm P and a Team Swarm T; member M is in T and has their own Personal Swarm PM. `list(O)` gives P `personal: true`, T no `personal`; `list(M)` gives PM `personal: true`, T no `personal` (O's P is not M's).
+- [ ] **Step 2: Run** `cd backend && NODE_ENV=test npx vitest run integration/superTabRead.test.ts -t "Personal Swarm"`. Expected: FAIL (no `personal`).
+- [ ] **Step 3: Implement** in `list`: add `...(isPersonalSwarm(head) && head.ownerId === user.sub ? { personal: true as const } : {})` to each row (`isPersonalSwarm` from `deletion.ts`; the head carries id/environment/ownerId, or use the row's).
+- [ ] **Step 4: Run** the same command. Expected: PASS. Then `npx tsc --noEmit -p .`. Expected: no errors.
+- [ ] **Step 5: Commit** `git add backend/src/superTabs/store.ts backend/integration/superTabRead.test.ts && git commit -m "Swarm list: mark the reader's own Personal Swarm"`
+
+### Task 2: Cards carry `personal`; decisions asked of the reader become notices
+
+**Files:**
+- Modify: `cli/src/core/api.ts` (`SwarmCard`), `cli/src/superTabs/cards.ts`, `cli/src/cable/cableSession.ts` (supertab frame ~:3001; buddy notices ~:3033; hello capabilities)
+- Test: `cli/src/superTabs/cards.spec.ts`, `cli/src/cable/cableSession.spec.ts`
+
+**Interfaces:**
+- Consumes: Task 1's `personal` on list rows.
+- Produces: `SwarmCard.personal?: true`; `supertab` frame field `"personal": true`; capability `swarmNeedsYou` read from the dial's hello (`this.swarmNeedsYou: boolean`).
+
+- [ ] **Step 1: Write the failing tests**
+ - cards.spec: "a card carries personal from its list row" — list row `personal: true` → card `personal: true`; other card has no `personal`.
+ - cards.spec: "an open decision asked of the reader becomes its project Lead's notice" — Swarm read with `decisionsDigest` d0 then d1, `/decisions` answering one open decision asked of the reader (asker "Dee", question "Ship it?") at d1 → that Lead's `notice` with `text` "Dee asks you: Ship it?"; at d0 (baseline) no notice.
+ - cards.spec: "closed decision drops its notice" — next digest lists none → the notice goes.
+ - cableSession.spec: "supertab frame says personal" — a card with `personal: true` → frame has `personal: true`; none → field absent.
+ - cableSession.spec: "a swarmNeedsYou dial gets no Buddy quiet notice" — hello with `swarmNeedsYou` and a Lead with `buddyNotice` → no `supertab.notice` with chat `buddy`; without the capability → sent as today.
+- [ ] **Step 2: Run** `cd cli && npx vitest run src/superTabs/cards.spec.ts src/cable/cableSession.spec.ts -t "personal|decision|swarmNeedsYou"`. Expected: FAIL.
+- [ ] **Step 3: Implement**
+ - `SwarmCard.personal?: true` from the list row in cards.ts where cards are built.
+ - Decisions: mirror the tags path (`tagsSeen`/`tagDigests`, `/mentions?state=waiting`) with `decisionsSeen`/`decisionDigests` reading `GET /api/super-tabs/:tabId/decisions` (the person's open decisions; check the route's query in `backend/src/routes/superTabs.ts` `personDecisionQuery`) when `decisionsDigest` moves; the newest new one per project becomes the Lead's `notice` (newest of tag/decision wins).
+ - cableSession: add `personal: true` to the supertab frame when set; read `swarmNeedsYou` from hello capabilities; skip pushing `buddyNotice` keys when set.
+- [ ] **Step 4: Run** the same command, then `npx vitest run src/cable src/superTabs` and `npx tsc --noEmit -p .`. Expected: all pass, no type errors.
+- [ ] **Step 5: Commit** `git add cli/src/core/api.ts cli/src/superTabs/cards.ts cli/src/cable/cableSession.ts cli/src/superTabs/cards.spec.ts cli/src/cable/cableSession.spec.ts && git commit -m "Round dial: cards say Personal; decisions asked of you notify; swarmNeedsYou drops Buddy notices"`
+
+### Task 3: Firmware model — `personal` on a card, `swarmNeedsYou` announced
+
+**Files:**
+- Modify: `devices/harness-device/firmware/main/ui/habitat/supertab.h` (`ht_supertab_t`: `bool personal`), `supertab.c` if init clears fields, `devices/harness-device/firmware/main/cable_client.c` (`handle_supertab`, hello capabilities)
+- Test: `devices/harness-device/firmware/test/test_cable_supertab.py`
+
+**Interfaces:**
+- Produces: `ht_supertab_t.personal` (false unless the frame says `"personal": true`); hello capability string `swarmNeedsYou`.
+
+- [ ] **Step 1: Write the failing test** in test_cable_supertab.py: feed a `supertab` frame with `"personal":true` → the stored card's `personal` is true; a frame without it → false; the hello sent includes `swarmNeedsYou`.
+- [ ] **Step 2: Run** `cd devices/harness-device/firmware && python3 test/test_cable_supertab.py`. Expected: FAIL.
+- [ ] **Step 3: Implement** the field, its parse (`cJSON_IsTrue`), and the capability in the hello list.
+- [ ] **Step 4: Run** the same. Expected: PASS.
+- [ ] **Step 5: Commit** `git add devices/harness-device/firmware/main/ui/habitat/supertab.h devices/harness-device/firmware/main/ui/habitat/supertab.c devices/harness-device/firmware/main/cable_client.c devices/harness-device/firmware/test/test_cable_supertab.py && git commit -m "Round dial: a card says Personal; the dial announces swarmNeedsYou"`
+
+### Task 4: The PM | Buddy pair, bell-only notices, no "PM" line
+
+**Files:**
+- Modify: `devices/harness-device/firmware/main/ui/habitat/ui_habitat.c` (`render_swarm_face` ~:1534-1632, gesture routing ~:3848-3854, new action kinds near `A_INBOX` ~:108)
+- Test: `devices/harness-device/firmware/test/test_touch_ui.py`
+
+**Interfaces:**
+- Consumes: `swarm_side_put`, `swarm_side_send`, `swarm_buddy_seen`, `swarm_side_buddy`, `swarm_lead`, `focus_bell`.
+- Produces: actions `A_SIDE_PM`, `A_SIDE_BUDDY`; `static void swarm_pair(ht_scene_t *f, bool buddy)`.
+
+- [ ] **Step 1: Write the failing tests** (new `swarm_pair_checks(dir)` called from main, with `buddy_card("lead")` as setup):
+ - "pair drawn": `scene_says("PM") && scene_says("Buddy")`, a box run 180 wide at y 388; the bell run at y 346 when a notice is unread.
+ - "tap Buddy switches": `tap(t, 278, 410)` → `swarm_side_buddy("s1")` and `wire_has(0, "side s1 buddy")`; `tap(t, 188, 410)` → back to PM.
+ - "vertical swipe inert": `swipe_up()` and `swipe_down()` on the face → side unchanged, view not INBOX, no frame sent.
+ - "bell opens inbox": with a notice unread, `tap(t, 233, 360)` → view INBOX.
+ - "no pair without Buddies": a Lead with `buddies=false` → no "Buddy" run, bell at y 400.
+ - "no PM line": a Lead whose chat is `HT_CHAT_PM` with `chat_name` "PM" → `!scene_says("PM")` except the pair's own half (assert the run at the old label y 52-82 is absent).
+ - "working line moves": a working Lead with the pair → the "Working…" text run is centred at y 318 and no arc-2 run.
+- [ ] **Step 2: Run** `cd devices/harness-device/firmware && python3 test/test_touch_ui.py`. Expected: FAIL at the first new assertion.
+- [ ] **Step 3: Implement**
+ - In `render_swarm_face`: when `l->buddies`, call `swarm_pair(f, buddy)`, set `bell_y = 346`, skip the lower-arc hint and the side dots, draw the working / "Your Buddy replied" line at y 318; add hits `{{143,388,90,44}, A_SIDE_PM}` and `{{233,388,90,44}, A_SIDE_BUDDY}` before the `A_PET` catch-all.
+ - Chat label: also NULL for `HT_CHAT_PM` (`:1567`).
+ - Dispatch `A_SIDE_PM`/`A_SIDE_BUDDY`: if it differs from `swarm_side_buddy(sw.tab)`, do what `swarm_side_swipe` did for that direction.
+ - Gesture routing (~:3848-3854): on a Swarm surface, a vertical swipe returns without action (remove the `swarm_side_swipe` and the inbox pull for `swarm_mode()`; keep the pull for non-Swarm faces).
+- [ ] **Step 4: Run** `python3 test/test_touch_ui.py`, then the whole suite `bash test/run.sh`. Expected: all pass; update existing tests that relied on swipe ↑/↓ on a Swarm face to tap the pair instead (record each in the commit message).
+- [ ] **Step 5: Commit** `git add devices/harness-device/firmware/main/ui/habitat/ui_habitat.c devices/harness-device/firmware/test/test_touch_ui.py && git commit -m "Round dial: PM | Buddy pair, bell-only notices, no PM line"`
+
+### Task 5: The Personal | Team picker
+
+**Files:**
+- Modify: `devices/harness-device/firmware/main/ui/habitat/ui_habitat.c` (new view `SWARM_PICK` in `view_t` ~:75-96, `render_swarm_pick`, title tap on the Swarm face ~:1624, dispatch)
+- Test: `devices/harness-device/firmware/test/test_touch_ui.py`
+
+**Interfaces:**
+- Consumes: Task 3's `ht_supertab_t.personal`; the existing tab pick path (`A_TAB` / `tab_index_of` / `tab_swarm`); `swarm_pair`'s drawing style (reuse a shared `pill2(f, x, y, w, h, left, right, right_on)` helper extracted in this task).
+- Produces: view `SWARM_PICK`; actions `A_PICK_PERSONAL`, `A_PICK_TEAM`; `sw.last_team[ID_MAX]` (last non-Personal card shown).
+
+- [ ] **Step 1: Write the failing tests** (`swarm_pick_checks(dir)`):
+ - "title opens picker": cards Personal (`personal=true`) and Team; on Team's face `tap(t, 233, 30)` → view `SWARM_PICK`, `scene_says("Swarm") && scene_says("Personal") && scene_says("Team")`, Team half filled.
+ - "pick Personal": `tap(t, 183, 233)` → the face shows the Personal card's first Lead and the tab-pick frame was sent as for `A_TAB`.
+ - "team goes to the last shown": cards Personal, Team A, Team B; face on B, open picker from Personal, tap Team → B; with no Team shown before → A (list order).
+ - "idle returns": open picker, advance `fake_ms` by 5000 → back to the same Lead and side, no frame sent.
+ - "no picker without both": only a Personal card, or no card with `personal` → title tap opens PANES (today's `A_AGENTS`).
+- [ ] **Step 2: Run** `python3 test/test_touch_ui.py`. Expected: FAIL.
+- [ ] **Step 3: Implement** the view, its render (arc title "Swarm", pill at y 211), hits `{{133,211,100,44},A_PICK_PERSONAL}` and `{{233,211,100,44},A_PICK_TEAM}` (the two halves of the 200-wide pill centred at x 233; tests tap 183,233 and 283,233), the 5 s idle via the existing view timer, `sw.last_team` set whenever a non-Personal card's Lead is shown, and the title tap choosing `SWARM_PICK` only when both a Personal and a non-Personal card exist.
+- [ ] **Step 4: Run** `python3 test/test_touch_ui.py` then `bash test/run.sh`. Expected: all pass.
+- [ ] **Step 5: Commit** `git add devices/harness-device/firmware/main/ui/habitat/ui_habitat.c devices/harness-device/firmware/test/test_touch_ui.py && git commit -m "Round dial: Personal | Team picker from the project name"`
+
+### Task 6: Spec, portraits, final check
+
+**Files:**
+- Modify: `docs/specs/2026-11-05-dial-lead-pm-buddy-pair.md` only if the implementation ruled differently (note each ruling).
+
+- [ ] **Step 1:** Render portraits `HABITAT_PREVIEW_DIR=<scratch> python3 test/test_touch_ui.py` and compare the pair, bell, picker and thread faces against `devices/harness-device/mockup/round-swarm-v2/lead-v4.html`.
+- [ ] **Step 2:** Run `cd backend && npx tsc --noEmit -p . && NODE_ENV=test npx vitest run integration/superTabRead.test.ts`, `cd cli && npx tsc --noEmit -p . && npx vitest run src/cable src/superTabs`, `cd devices/harness-device/firmware && bash test/run.sh`. Expected: all green.
+- [ ] **Step 3: Commit** any spec rulings with the message "Spec: rulings from the dial pair build".
diff --git a/docs/specs/2026-11-05-dial-lead-pm-buddy-pair.md b/docs/specs/2026-11-05-dial-lead-pm-buddy-pair.md
new file mode 100644
index 000000000..cd2f83a77
--- /dev/null
+++ b/docs/specs/2026-11-05-dial-lead-pm-buddy-pair.md
@@ -0,0 +1,101 @@
+# Round dial: PM | Buddy pair, bell-only notices, Personal | Team (Diego, 2026-11-05)
+
+## What Diego asked
+
+On the round dial's Lead face (a Swarm project's face), change only these, keep everything else:
+
+1. Switch between the PM and the Buddy with a **PM | Buddy** pair at the bottom (as in his reference: the bell pill above a
+ two-part pill), instead of swiping up and down.
+2. Notices open **only by tapping the bell**; pulling down no longer opens them.
+3. In a Swarm, tapping the **project name** opens a picker with two choices only, **Personal | Team** (mockup option B: one
+ pill, the current half filled).
+4. In a Swarm, the bell and its page hold **only what needs you**.
+5. The "PM" line under the project name goes.
+
+Mockup: `devices/harness-device/mockup/round-swarm-v2/lead-v4.html` (picker options in `swarm-picker-options.html`, B chosen).
+
+Today the vertical swipe does three things on the Lead face (up: Buddy side, down: PM side or the inbox when something is
+unread), so it often does the wrong one. After this change a vertical swipe on the Lead face does nothing.
+
+## How it works today (main ff98d60f3)
+
+- `ui_habitat.c:717` `swarm_side_swipe`: up opens the Buddy side, down the PM side; down on the PM side pulls the inbox
+ (`:3850`, `view(INBOX)` when `notice_unread`). Only for a Lead with Buddies (`l->buddies`) and a connected daemon.
+- `:1587` the bell (`focus_bell`, blue pill, `bell_y = 400`) shows while `notice_unread(l->id) > 0`; it is already a tap target
+ (`:1630`, `A_INBOX`).
+- `:1624` the name on the top arc is a tap target that opens PANES (`A_AGENTS`).
+- `:1567` the line under the name is the chat label: `chat_name` for any chat but the Lead conversation and the Buddy chat,
+ so the PM chat shows "PM".
+- Notices: the cards service (`cli/src/superTabs/cards.ts`) makes a Lead's notice only from the reader's **waiting tags**
+ in its project (#2965); the Buddy's own messages are a separate quiet notice (`buddyNotices`). Decisions asked of the
+ reader do not reach the dial.
+- A Swarm card does not say whether it is the reader's Personal Swarm. The backend knows (`deletion.ts isPersonalSwarm`), the
+ list read does not send it.
+
+## Behaviour
+
+### The PM | Buddy pair (firmware)
+
+- A Lead whose Swarm has Buddies (`l->buddies`) shows the pair centred at the bottom: a dark pill (`#141518`, 1 px `#2e3035`
+ border, fully rounded) 180 × 44 px at y 388, two equal halves "PM" and "Buddy" in Inter 20, the current side's half filled
+ `#2b2d33` with white text, the other `#9a9ca3`. Without Buddies, no pair.
+- Tapping the other half switches the side exactly as the swipe did (`swarm_side_put`, `swarm_side_send`, `swarm_buddy_seen`).
+ Tapping the current half does nothing.
+- The bell moves up to y 346 whenever the pair is shown, on Focus and on the creature skins alike (it keeps its look and its
+ tap target). Without the pair it stays where it is today.
+- With the pair shown, the face draws no lower-arc hint ("Tap to talk", "Say the word") and no Buddy side dots. The working line
+ ("Composing… 2:14") and "Your Buddy replied" move from the lower arc to one centred line at y 318 in the same colour.
+- A thread face keeps its layout; the pair replaces its side dots too. With the pair and the bell both showing, its card
+ holds two lines (the second ends in "…") so it stays clear of the bell.
+
+### Notices (firmware + daemon)
+
+- On a Swarm face, a vertical swipe does nothing: no side switch, no inbox. The inbox opens only from the bell (and from the
+ alert bubble, as today).
+- On a Swarm dial, the bell's count and the inbox list only what needs the reader:
+ - the reader's waiting tags (today's Lead notice, unchanged);
+ - **decisions asked of the reader** that are open: the cards service reads them like tags, from
+ `GET /api/super-tabs/:tabId/decisions` when the Swarm read's `decisionsDigest` moves, baseline first (decisions open when the
+ dial arrived never alert), and a new one becomes its project Lead's notice (text "<asker> asks you: <question>", the newest
+ of a project wins over an older tag, as two tags do today);
+ - a Lead waiting on the person on this Mac (today's local wait), unchanged.
+- A decision's notice reaches only a dial that announces `swarmNeedsYou`. It keeps the tag notice it covered underneath; any
+ other dial (the Pro, older round firmware) keeps seeing that tag, or nothing, and the tag returns when the decision closes.
+ A paged decisions read (`more`) never takes a missing decision as closed.
+- The Buddy's quiet notices never count on the bell and never list in the inbox of a dial that announces the capability
+ `swarmNeedsYou`; "Your Buddy replied" still shows on the face as today.
+
+### Personal | Team (backend + daemon + firmware)
+
+- The Swarm list (`/api/super-tabs/list`) marks the reader's own Personal Swarm: `personal: true` on its row only.
+- The cards service copies it to the card (`SwarmCard.personal`), and the `supertab` frame carries `"personal": true` for it.
+- On a Swarm face, tapping the project name opens the picker **when the dial holds the reader's Personal card and at least one
+ other card**; otherwise the name keeps today's behaviour (PANES).
+- The picker is its own screen: black glass, the word "Swarm" on the top arc, and one pill centred (200 × 44 px at y 211,
+ same style as the PM | Buddy pair) with "Personal" and "Team". The half of the Swarm on the face is filled.
+- Tapping the other half switches Swarm: Personal opens the Personal card; Team opens the last non-Personal card that was on
+ the face, else the first non-Personal card in the list order. The dial lands on that card's first Lead (as choosing a tab does
+ today, `A_TAB`) and the desktop follows as it does for a tab pick.
+- Tapping the filled half, or 5 s with no touch, returns to the face unchanged.
+
+### The "PM" line
+
+- The chat label under the name is not drawn for the PM chat (`HT_CHAT_PM`) either. A group chat keeps its name.
+
+## Design
+
+- **Growth:** none stored. The decision baseline is in memory per Swarm in the cards service, like the tag baseline.
+- **Concurrency:** one cards service; a decision read runs only when `decisionsDigest` moved, at most one in flight per Swarm
+ (as tags).
+- **Read cost:** no new periodic reads; one `/decisions` read per digest change. The list row gains one boolean.
+- **Scale:** at 10x Swarms, still one boolean per row and one read per changed digest; the `supertab` frame grows by one field
+ per card, inside `fitFrame`.
+- **Compatibility:** old firmware ignores `personal` and keeps swipes; new firmware with an old daemon shows no picker (no
+ `personal`), keeps the pair and bell-only notices; an old backend sends no `personal`, so no picker. `swarmNeedsYou` gates the
+ Buddy-notice change; the Pro is unaffected (it never announces it).
+- **Migration + rollback:** none.
+- **Audience:** `personal` is set only on the reader's own row; decisions are read with the reader's own account, as tags are.
+- **Identity:** the signed-in person's reads and the dial's own side choice, as today.
+- **Failure:** a failed decisions read is retried at the next digest change and alerts nothing; a missing `personal` hides the
+ picker; nothing else changes.
+- **Platforms:** round dial firmware (harness-device), the daemon (cli), the backend list read. Harness Pro: not in scope.