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.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Round dial: thumb-friendly PM | Buddy, instant recap on swipe, no jump into a thread after voice, notice badge on the pet (#3231)
0xdiego256cd24e375bee
diff --git a/cli/src/cable/cableSession.spec.ts b/cli/src/cable/cableSession.spec.tsindex 37afe7399..869d2581b 100644--- a/cli/src/cable/cableSession.spec.ts+++ b/cli/src/cable/cableSession.spec.ts@@ -5559,38 +5559,24 @@ describe('swarm cards', () => {} finally { await session.stop() }})- it('a voice post that starts a thread opens it in the window, for a swarmThread dial only', async () => {- const started = { said: true as const, thread: { tabId: 'st1', conversationId: 'lead-c1', root: 'm9' } }- for (const [hello, calls] of [[THREAD, [['st1', 'lead-c1', 'm9']]], [BUDDY, []]] as const) {- const swarmSay = vi.fn(async () => started)- const host = cardHost({ cards: [card('st1', [withBuddy({ local: 'h1', sideChat: { kind: 'lead', id: 'lead-c1', name: 'Lead', working: false } })])] },+ it('words said on the face stay there: they start no thread and open nothing in the window (Diego, 2026-11-05)', async () => {+ for (const sideChat of [{ kind: 'lead' as const, id: 'lead-c1', name: 'Lead', working: false }, { kind: 'group' as const, id: 'g1', name: 'Fix login', working: false }]) {+ const swarmSay = vi.fn(async (..._args: unknown[]) => ({ said: true as const }))+ const host = cardHost({ cards: [card('st1', [withBuddy({ local: 'h1', sideChat })])] },{ transcribe: vi.fn(async () => 'build it'), route: vi.fn(), swarmSay })const { session, port } = await connect(host)try {- port.say(hello); await settle()+ port.say(THREAD); await settle()voice(port, 'h1')await vi.waitFor(() => expect(swarmSay).toHaveBeenCalled())await settle(); await settle()- // A thread start is no project pick: nothing but the thread frame reaches the window.- expect(vi.mocked(host.superTabThread!).mock.calls).toEqual(calls)+ expect(swarmSay.mock.calls[0][5]).toEqual({ thread: null })+ expect(host.superTabThread).not.toHaveBeenCalled()expect(host.superTabSelected).not.toHaveBeenCalled()} finally { await session.stop() }}})- it('a group face\'s thread is opened in the window the same way', async () => {- const swarmSay = vi.fn(async () => ({ said: true as const, thread: { tabId: 'st1', conversationId: 'g1', root: 'm9' } }))- const host = cardHost({ cards: [card('st1', [withBuddy({ local: 'h1', sideChat: { kind: 'group', id: 'g1', name: 'Fix login', working: false } })])] },- { transcribe: vi.fn(async () => 'status'), route: vi.fn(), swarmSay })- const { session, port } = await connect(host)- try {- port.say(THREAD); await settle()- voice(port, 'h1')- await vi.waitFor(() => expect(host.superTabThread).toHaveBeenCalled())- expect(vi.mocked(host.superTabThread!).mock.calls).toEqual([['st1', 'g1', 'm9']])- } finally { await session.stop() }- })-it('words to a Lead\'s terminal tile start no thread, but are held to the face\'s thread', async () => {const swarmSay = vi.fn(async (..._args: unknown[]) => ({ said: true as const }))const host = cardHost({ cards: [card('st1', [threaded()])] }, { transcribe: vi.fn(async () => 'build it'), route: vi.fn(), swarmSay,@@ -5604,7 +5590,7 @@ describe('swarm cards', () => {expect(swarmSay.mock.calls[0][5]).toEqual({ thread: 'm9' })voice(port, 'h1')await vi.waitFor(() => expect(swarmSay).toHaveBeenCalledTimes(2))- expect(swarmSay.mock.calls[1][5]).toEqual({ thread: 'm9', threaded: true })+ expect(swarmSay.mock.calls[1][5]).toEqual({ thread: 'm9' })} finally { await session.stop() }})@@ -5633,11 +5619,6 @@ describe('swarm cards', () => {port.say({ t: 'supertab.thread.leave', tab: 'st1', lead: 'lead1' }); await settle(); await settle()await get()expect(swarmCardRecap).toHaveBeenCalledTimes(3)- // Its words starting one.- voice(port, 'h1')- await vi.waitFor(() => expect(host.superTabThread).toHaveBeenCalledTimes(2))- await get()- expect(swarmCardRecap).toHaveBeenCalledTimes(4)} finally { now.mockRestore(); await session.stop() }})})@@ -5652,7 +5633,7 @@ describe('swarm cards', () => {port.say(hello); await settle()voice(port, 'h1')await vi.waitFor(() => expect(swarmSay).toHaveBeenCalled())- expect(swarmSay.mock.calls[0].slice(5)).toEqual(threaded ? [{ thread: null, threaded: true }] : [])+ expect(swarmSay.mock.calls[0].slice(5)).toEqual(threaded ? [{ thread: null }] : [])} finally { await session.stop() }}})diff --git a/cli/src/cable/cableSession.ts b/cli/src/cable/cableSession.tsindex 9efb355ee..7f9535873 100644--- a/cli/src/cable/cableSession.ts+++ b/cli/src/cable/cableSession.ts@@ -929,8 +929,6 @@ export class CableSession {/** The chat on this dial's face for that agent's Swarm project as the person began to speak: the words go there or* nowhere, and a Buddy chat's never reach a terminal (review of #2146). */swarmFace?: SwarmFace;- /** The words are said from the dial's own Swarm face, not for a Lead's terminal tile: only these may start its thread. */- onFace?: true;/** That Lead runs on another machine: named by its Swarm id, it has no terminal here. */swarmRemote?: true } | null = nullprivate voiceSearch?: SelectionCommand@@ -1827,7 +1825,6 @@ export class CableSession {this.voice = {agentId,...(swarmFace ? { swarmFace } : {}),- ...(dialFace ? { onFace: true as const } : {}),...((swarmFace && agentId && !this.swarmLeadHere(agentId)) || swarmId ? { swarmRemote: true } : {}),cmd: str('cmd'),lang: str('lang') ?? this.host.voiceLang(),@@ -2445,10 +2442,10 @@ export class CableSession {const state = this.voiceDraft.create({ agentId: recipient, name: `${face.project} · ${face.name}`, text: transcript,context: 'Swarm chat',submit: async words => {- const [chat] = this.sayArgs(face, turn.onFace)- const said = await say(recipient, turn.cmd ? `/${turn.cmd} ${words}` : words, chat, face.id, true, ...(this.swarmThread ? [this.sayOptions(face, turn.onFace)!] as const : []))+ const [chat] = this.sayArgs(face)+ const said = await say(recipient, turn.cmd ? `/${turn.cmd} ${words}` : words, chat, face.id, true, ...(this.swarmThread ? [this.sayOptions(face)!] as const : [])).catch((): SaidOnCard => ({ said: false }))- if (said.said) { this.threadStarted(said); return { ok: true } }+ if (said.said) return { ok: true }return { ok: false, error: said.refused?.message ?? (face.kind === 'buddy' ? 'Could not reach your Buddy. Try again.' : 'Could not reach the Swarm. Try again.') }} })if (!state.ok) { await reply({ t: 'voice.error', message: state.error }); return }@@ -2482,14 +2479,13 @@ export class CableSession {// refused post for a read-only Chat with PM was typed into the PM's terminal.if (turn.agentId && !carried && !selection?.ok && this.host.swarmSay) {const face = turn.swarmFace- const said = await this.host.swarmSay(agentId, instruction, ...this.sayArgs(face, turn.onFace)).catch((err: Error): SaidOnCard => {+ const said = await this.host.swarmSay(agentId, instruction, ...this.sayArgs(face)).catch((err: Error): SaidOnCard => {this.log(`cable: voice → Swarm chat of ${agentId.slice(0, 8)} failed (${err?.message ?? err})`)return { said: false }})if (!current()) returnif (said.said) {this.log(`cable: voice → Swarm chat of ${agentId.slice(0, 8)}`)- this.threadStarted(said)await reply({ t: 'voice.transcript', routeId: '', text: transcript, agentId, agentName, needsConfirm: false })return}@@ -2892,22 +2888,22 @@ export class CableSession {}/** The extra arguments of words spoken to a Swarm Lead: the dial's chat flag, and the chat they were spoken to. */- private sayArgs(face: SwarmFace | undefined, onFace?: true): [chat?: CardChat, chatId?: string, reviewed?: boolean, options?: SayOptions] {+ private sayArgs(face: SwarmFace | undefined): [chat?: CardChat, chatId?: string, reviewed?: boolean, options?: SayOptions] {// A chat flag with no id means "the chat open on the desktop" to the Swarm service: a Pro sends neither unless its words// were for the face chat it showed (voiceFaceOf), and then names that chat.if (this.seqOn && !face) return []const [chat] = this.chatFlag()if (chat === undefined) return []- const options = this.sayOptions(face, onFace)+ const options = this.sayOptions(face)if (options) return [chat, face?.id, false, options]return face ? [chat, face.id] : [chat]}- /** A swarmThread dial's words are held to the thread on the face as the person began to speak (none included), and may start- * its thread only when spoken from the face (spec 2026-11-03-dial-thread-face). */- private sayOptions(face: SwarmFace | undefined, onFace?: true): SayOptions | undefined {+ /** A swarmThread dial's words are held to the thread on the face as the person began to speak (none included). They never+ * start a thread: the face stays where it was when the person spoke (Diego, 2026-11-05: it jumped into the new thread). */+ private sayOptions(face: SwarmFace | undefined): SayOptions | undefined {if (!this.swarmThread) return undefined- return { ...(face ? { thread: face.thread?.root ?? null } : {}), ...(onFace ? { threaded: true } : {}) }+ return face ? { thread: face.thread?.root ?? null } : {}}/** The extra argument a swarmChat dial's requests carry ('buddy' for a swarmBuddy dial's); none for any other device, whose@@ -3192,13 +3188,6 @@ export class CableSession {else this.host.superTabSelected?.(tab, projectId)}- /** Words said on a swarmThread dial that started its thread: the window opens it beside the chat, with no project pick. */- private threadStarted(said: SaidOnCard): void {- if (!said.said || !said.thread || !this.swarmThread) return- this.lastRecapGet = null- this.host.superTabThread?.(said.thread.tabId, said.thread.conversationId, said.thread.root)- }-/** The dial left the thread on its face: the cards forget it, and the window closes its thread pane (the project stays). */private async threadLeave(tab: string, lead: string): Promise<void> {const left = await this.host.swarmThreadLeave?.(tab, lead, this.chatFlag()[0]).catch((err: Error) => { this.log(`cable: thread leave failed (${err.message})`); return null })diff --git a/devices/harness-device/firmware/main/ui/habitat/supertab.c b/devices/harness-device/firmware/main/ui/habitat/supertab.cindex d4b29f560..0c6d469c2 100644--- a/devices/harness-device/firmware/main/ui/habitat/supertab.c+++ b/devices/harness-device/firmware/main/ui/habitat/supertab.c@@ -204,6 +204,24 @@ static ht_lead_t *lead_of(ht_supertabs_t *s, const char *tab, const char *lead)for (int i = 0; t && lead && i < t->lead_n; i++) if (!strcmp(t->leads[i].id, lead)) return &t->leads[i];return NULL;}+// The recap on the face, as its Lead's remembered one: in its own place, else a free one, else the oldest's.+static void remember(ht_supertabs_t *s)+{+ int at = -1, oldest = 0;+ for (int i = 0; i < HT_RECAP_REMEMBERED && at < 0; i++)+ if (s->remembered[i].used && !strcmp(s->remembered[i].tab, s->recap.tab) && !strcmp(s->remembered[i].lead, s->recap.lead)) at = i;+ for (int i = 0; i < HT_RECAP_REMEMBERED && at < 0; i++) if (!s->remembered[i].used) at = i;+ for (int i = 1; i < HT_RECAP_REMEMBERED; i++) if (s->remembered[i].used < s->remembered[oldest].used) oldest = i;+ ht_recap_memo_t *r = &s->remembered[at < 0 ? oldest : at];+ put_text(r->tab, sizeof r->tab, s->recap.tab);+ put_text(r->lead, sizeof r->lead, s->recap.lead);+ put_text(r->chat_id, sizeof r->chat_id, s->recap.chat_id);+ put_text(r->thread, sizeof r->thread, s->recap.thread);+ put_text(r->text, sizeof r->text, s->recap.text);+ r->at = s->recap.at;+ r->empty = s->recap.state == HT_RECAP_EMPTY;+ r->used = ++s->remembered_n;+}void ht_supertabs_recap_open(ht_supertabs_t *s, const char *tab, const char *lead, uint32_t now_ms){bool open = lead && *lead && tab && *tab;@@ -217,6 +235,21 @@ void ht_supertabs_recap_open(ht_supertabs_t *s, const char *tab, const char *leareturn;}}+ // A Lead that was on the face before shows the recap it had, while still its chat's and thread's.+ const ht_lead_t *face = open ? lead_of(s, tab, lead) : NULL;+ for (int i = 0; face && i < HT_RECAP_REMEMBERED; i++) {+ const ht_recap_memo_t *r = &s->remembered[i];+ if (!r->used || strcmp(r->tab, tab) || strcmp(r->lead, lead) || strcmp(r->chat_id, face->chat_id) || strcmp(r->thread, face->thread_root)) continue;+ put_text(s->recap.tab, sizeof s->recap.tab, tab);+ put_text(s->recap.lead, sizeof s->recap.lead, lead);+ put_text(s->recap.chat_id, sizeof s->recap.chat_id, r->chat_id);+ put_text(s->recap.thread, sizeof s->recap.thread, r->thread);+ put_text(s->recap.text, sizeof s->recap.text, r->text);+ s->recap.at = r->at;+ s->recap.asked_ms = now_ms;+ s->recap.state = r->empty ? HT_RECAP_EMPTY : HT_RECAP_LOADED;+ return;+ }put_text(s->recap.tab, sizeof s->recap.tab, open ? tab : "");put_text(s->recap.lead, sizeof s->recap.lead, open ? lead : "");s->recap.chat_id[0] = 0;@@ -240,6 +273,7 @@ bool ht_supertabs_recap_put(ht_supertabs_t *s, const char *tab, const char *leadput_text(s->recap.text, sizeof s->recap.text, none ? "" : text);s->recap.at = at;s->recap.state = s->recap.text[0] ? HT_RECAP_LOADED : HT_RECAP_EMPTY;+ remember(s);return true;}bool ht_supertabs_thread_leave(ht_supertabs_t *s, const char *tab, const char *lead)diff --git a/devices/harness-device/firmware/main/ui/habitat/supertab.h b/devices/harness-device/firmware/main/ui/habitat/supertab.hindex 40ec7872c..17ea0abaa 100644--- a/devices/harness-device/firmware/main/ui/habitat/supertab.h+++ b/devices/harness-device/firmware/main/ui/habitat/supertab.h@@ -43,6 +43,9 @@ typedef struct {ht_lead_t leads[HT_SUPERTAB_LEADS_MAX];} ht_supertab_t;typedef enum { HT_RECAP_NONE, HT_RECAP_LOADING, HT_RECAP_LOADED, HT_RECAP_EMPTY } ht_recap_state_t;+// How many Leads' last recaps the dial remembers, so a swipe back shows one at once.+enum { HT_RECAP_REMEMBERED = 8 };+typedef struct { char tab[ID_MAX], lead[ID_MAX], chat_id[ID_MAX], thread[ID_MAX], text[HT_SUPERTAB_TEXT]; uint32_t at, used; bool empty; } ht_recap_memo_t;typedef struct {ht_supertab_t tabs[HT_SUPERTABS_MAX]; // the records that have arrived, in arrival orderint n;@@ -51,6 +54,11 @@ typedef struct {// One slot: the recap of the Lead on the face, and nothing else.// `chat_id`: the chat the text is the last message of ("" from a daemon without swarmChat).struct { char tab[ID_MAX], lead[ID_MAX], chat_id[ID_MAX], thread[ID_MAX], text[HT_SUPERTAB_TEXT]; uint32_t at, asked_ms; ht_recap_state_t state; } recap;+ // The last recaps of the Leads that were on the face (LOADED or EMPTY), each for its chat and thread; `used` 0 is free.+ // Opening a Lead shows its own at once while the fresh one is asked for (Diego's dial, 2026-11-05: a swipe showed the+ // resting pet until it came).+ ht_recap_memo_t remembered[HT_RECAP_REMEMBERED];+ uint32_t remembered_n; // a counter for `used`, the newest the highest} ht_supertabs_t;typedef enum { HT_LEAD_RAISED_ASK, HT_LEAD_RAISED_STUCK, HT_LEAD_CLEARED } ht_lead_event_kind_t;typedef struct { ht_lead_event_kind_t kind; char tab[ID_MAX], lead[ID_MAX]; } ht_lead_event_t;@@ -77,7 +85,8 @@ const ht_supertab_t *ht_supertabs_find(const ht_supertabs_t *, const char *id);const ht_supertab_t *ht_supertabs_at(const ht_supertabs_t *, int i);const ht_supertab_t *ht_supertabs_for_desk(const ht_supertabs_t *, const char *desk_tab_id);const ht_lead_t *ht_supertabs_lead_by_local(const ht_supertabs_t *, const char *harness_id, const ht_supertab_t **tab);-// LOADING with no text; an empty lead closes the slot (NONE). A held recap is kept only for the same chat and thread.+// LOADING with no text; an empty lead closes the slot (NONE). A held recap is kept only for the same chat and thread, and a+// Lead opened again takes its remembered one (LOADED or EMPTY) for that chat and thread.void ht_supertabs_recap_open(ht_supertabs_t *, const char *tab, const char *lead, uint32_t now_ms);// false: not the open Lead, or not the chat on its face (`chat_id` "" is the Lead's own, from a daemon without swarmChat),// or not its thread (`thread` "" or NULL is the main chat).diff --git a/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c b/devices/harness-device/firmware/main/ui/habitat/ui_habitat.cindex 4f6a767dd..08151d9cc 100644--- a/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c+++ b/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c@@ -107,6 +107,7 @@ 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_PET_INBOX, // a tap on a companion that wears the notice badge: the inbox, while a swipe from it still swipesA_SIDE_PM, A_SIDE_BUDDY,A_PICK_PERSONAL, A_PICK_TEAM,A_NOTICE,@@ -1188,8 +1189,11 @@ static bool home_footer(action_kind_t action)// A_VOICE is the Focus face's [ say ]. It belongs here rather than on the A_PET path because a// bracket control is pressed and released like every other one, while A_PET reads a TAP as a boop// and only starts speech on a 650 ms hold — which is the creature's gesture, not a button's.+ // The PM | Buddy and Personal | Team halves too (Diego's dial, 2026-11-05: a thumb's press on the pair drifted out of a+ // tap and fell to the face, which started voice).return action == A_TABS || action == A_INBOX || action == A_AGENTS || action == A_RETURN ||- action == A_CARRY_DROP || action == A_VOICE || action == A_TAB_LIST;+ action == A_CARRY_DROP || action == A_VOICE || action == A_TAB_LIST ||+ action == A_SIDE_PM || action == A_SIDE_BUDDY || action == A_PICK_PERSONAL || action == A_PICK_TEAM;}static bool hit_contains(const hit_t *hit, int x, int y, bool surface){@@ -1451,6 +1455,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 NOTICE BADGE (Diego's dial, 2026-11-05, option B): the bell pill at y 346 sat on a long recap's last line, while the+ * space around the pet stood empty. So a face with a companion shows its unread count as a small blue badge on the+ * companion's top-right shoulder, and a tap on the companion opens the notices. A face with none (a thread) keeps the pill.+ */+// The face's companion as drawn: the largest sprite or round disc centred in the upper middle of the glass (the Focus pet,+// a creature, the Buddy's disc). False when there is none.+static bool companion_box(const ht_scene_t *f, ht_rect_t *out)+{+ long best = 0;+ for (int i = 0; i < f->count; i++) {+ const ht_run_t *r = &f->runs[i];+ bool disc = r->box.h && r->w == r->box.h && r->box.radius * 2 >= r->box.h;+ if (!r->sprite.width && !disc) continue;+ ht_rect_t b = ht_run_bounds(r);+ int cx = b.x + b.w / 2, cy = b.y + b.h / 2;+ long area = (long)b.w * b.h;+ if (cx < 153 || cx > 313 || cy < 60 || cy > 260 || area < 900 || area <= best) continue;+ best = area; *out = b;+ }+ return best > 0;+}+static void notice_badge(ht_scene_t *f, const ht_rect_t *pet, unsigned count)+{+ enum { BADGE_D = 30, BADGE_RING = 3 }; // a 30 px disc in a 3 px black ring+ int cx = pet->x + pet->w - 4, cy = pet->y + 4;+ char text[4];+ if (count > 9) snprintf(text, sizeof text, "9+"); else snprintf(text, sizeof text, "%u", count);+ const ht_font_t *font = &ht_lv_inter_20.base;+ int r = BADGE_D / 2 + BADGE_RING, tw = ht_measure(font, text);+ uint16_t blue = color(0x006fff);+ ht_box(f, cx - r, cy - r, 2 * r, 2 * r, r, BG, BG); // a black ring, so it reads apart from the art under it+ ht_box(f, cx - BADGE_D / 2, cy - BADGE_D / 2, BADGE_D, BADGE_D, BADGE_D / 2, blue, blue);+ ht_text(f, cx - tw / 2, cy - font->height / 2, tw, font, color(0xffffff), blue, text);+}/** 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.@@ -1474,8 +1513,9 @@ 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};+ // A thumb's targets, wider than the pill: 40 px each side, from just under the bell (its pill ends at y 378) to the edge.+ s.hits[s.hit_count++] = (hit_t){{X - 40, 382, HALF + 40, HT_HEIGHT - 382}, A_SIDE_PM, 0, true};+ s.hits[s.hit_count++] = (hit_t){{X + HALF, 382, HALF + 40, HT_HEIGHT - 382}, 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)@@ -1484,8 +1524,9 @@ static void render_swarm_pick(ht_scene_t *f)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};+ // A thumb's targets: each half 30 px wider and 40 px taller each way than it is drawn.+ s.hits[s.hit_count++] = (hit_t){{X - 30, Y - 40, HALF + 30, H + 80}, A_PICK_PERSONAL, 0, true};+ s.hits[s.hit_count++] = (hit_t){{X + HALF, Y - 40, HALF + 30, H + 80}, A_PICK_TEAM, 0, true};}/** Desktop's agent pattern (avatar_art.dart superTabAgentPattern; the daemon sends its 15 half bits and colour): mirrored on@@ -1655,10 +1696,6 @@ static void render_swarm_face(ht_scene_t *f)ht_rect_t bubble = {0};bool told = bell && focus_face && !thread && ht_focus_alert_shown(&f_, recap, &bubble);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_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// today's place (it rises with its lines). A creature skin keeps its creature.@@ -1682,6 +1719,14 @@ static void render_swarm_face(ht_scene_t *f)}face_buddy_ring(f);}+ // The count on the companion's shoulder; the pill only on a face with no companion (a thread).+ ht_rect_t pet = {0};+ bool badge = bell && !told && !thread && companion_box(f, &pet);+ if (badge) notice_badge(f, &pet, unread);+ else if (bell && !told) {+ if (focus_face) focus_bell(f, unread, bell_y);+ else ht_notification_bell_at(f, unread, f_.ink, l->buddies ? bell_y : HT_NOTIFICATION_Y); // above the pair, else its own row+ }if (l->buddies) {// 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.@@ -1710,7 +1755,9 @@ static void render_swarm_face(ht_scene_t *f)s.caption_arc = (ht_rect_t){r.x - 14, r.y - 14, r.w + 28, r.h + 28};break;}- if (bell && !told) s.hits[s.hit_count++] = (hit_t){{83, bell_y - 18, 300, 84}, A_INBOX, 0, true};+ // With the badge, the companion and its badge are the inbox's target; the rest of the face still talks.+ if (badge) s.hits[s.hit_count++] = (hit_t){{pet.x - 16, pet.y - 24, pet.w + 48, pet.h + 40}, A_PET_INBOX, 0, true};+ else if (bell && !told) s.hits[s.hit_count++] = (hit_t){{83, bell_y - 18, 300, 84}, A_INBOX, 0, true};if (told && bubble.w) s.hits[s.hit_count++] = (hit_t){{bubble.x - 14, bubble.y - 14, bubble.w + 28, bubble.h + 28}, A_INBOX, 0, true};s.hits[s.hit_count++] = focus_face ? (hit_t){{0, 66, HT_WIDTH, HT_HEIGHT - 66}, A_PET, 0, true}: (hit_t){{33, 66, 400, 316}, A_PET, 0, true};@@ -3146,6 +3193,7 @@ static void dispatch(action_t a)else if (a.kind==A_ANSWER) send_answer();break;case A_INBOX:+ case A_PET_INBOX: // released on the badged companion (the touch path dispatches A_INBOX itself)notice_open();break;case A_PICK_PERSONAL:@@ -3154,6 +3202,7 @@ static void dispatch(action_t a)break;case A_SIDE_PM:case A_SIDE_BUDDY:+ ESP_LOGI("habitat", "pair: %s", a.kind == A_SIDE_BUDDY ? "Buddy" : "PM");swarm_side_set(a.kind == A_SIDE_BUDDY);break;case A_NOTICE: {@@ -3863,7 +3912,7 @@ void habitat_touch(bool down, int x, int y, uint32_t now)} else if (result==HT_TOUCH_TAP || result==HT_TOUCH_HOLD) dispatch((action_t){.kind=A_TABS});}change();- } else if (surface && home_footer(pressed_action.kind)) {+ } else if ((surface || s.view == SWARM_PICK) && home_footer(pressed_action.kind)) {/** A BUTTON IS PRESSED AND RELEASED, not tapped within a tolerance.*@@ -3885,6 +3934,10 @@ void habitat_touch(bool down, int x, int y, uint32_t now)if (result == HT_TOUCH_TAP || (on_target && now - s.touch_started < 1800))dispatch(pressed_action);change();+ } else if (surface && pressed_action.kind == A_PET_INBOX && dx * dx + dy * dy < 24 * 24 && now - s.touch_started < 650) {+ // The companion wears the notice badge: a touch on it, read as a thumb's (the face's talk rule below), opens the+ // inbox. It is no footer button, so a swipe that starts on it still moves to the next project.+ dispatch((action_t){.kind = A_INBOX});} else if (surface && character.id == HT_CHARACTER_FOCUS && pressed_action.kind == A_PET &&!gesture.guarded && dx * dx + dy * dy < 24 * 24 && now - s.touch_started < 650) {/*@@ -3921,7 +3974,7 @@ void habitat_touch(bool down, int x, int y, uint32_t now)dispatch((action_t){.kind = A_VOICE_STOP, .value = 1});} else if (s.view == DRAFT && pressed_action.kind == A_DRAFT_EDIT) {pressed_action.kind = A_DRAFT_OPTIONS; dispatch(pressed_action);- } else if (surface && pressed_action.kind == A_PET)+ } else if (surface && (pressed_action.kind == A_PET || pressed_action.kind == A_PET_INBOX))tabs_open();} else if (result == HT_TOUCH_TAP) {if (pressed_action.kind == A_PET) {diff --git a/devices/harness-device/firmware/test/test_supertab.c b/devices/harness-device/firmware/test/test_supertab.cindex fb60d510c..2ae0d2b19 100644--- a/devices/harness-device/firmware/test/test_supertab.c+++ b/devices/harness-device/firmware/test/test_supertab.c@@ -241,7 +241,7 @@ static void chats(void)ht_supertabs_recap_open(&model, "s1", "L0", 260);assert(model.recap.state == HT_RECAP_LOADED && !strcmp(model.recap.text, "Tests green.") && model.recap.asked_ms == 260);assert(ht_supertabs_recap_put(&model, "s1", "L0", "g1", "", "Deployed.", 4, false) && !strcmp(model.recap.text, "Deployed."));- ht_supertabs_recap_open(&model, "s1", "L2", 270); ht_supertabs_recap_open(&model, "s1", "L2", 280);+ ht_supertabs_recap_open(&model, "s1", "L1", 270); ht_supertabs_recap_open(&model, "s1", "L1", 280); // L1 never had oneassert(model.recap.state == HT_RECAP_LOADING && model.recap.asked_ms == 280);// The face's chat moved on: what it holds is another chat's, and is not kept.ht_supertabs_recap_open(&model, "s1", "L0", 290);@@ -358,6 +358,69 @@ static void buddies(void)puts("supertab: Buddies on, the Buddy block and its avatar, a Buddy face, bad blocks dropped with the Lead kept PASS");}+// A swipe to another project shows the recap it last had at once, not the resting pet until the new one arrives (Diego's+// dial, 2026-11-05): the last few Leads' recaps are remembered, each only for the chat and thread it was for.+static void recap_memory(void)+{+ static ht_supertab_t t;+ ht_supertabs_reset(&model);+ const char ids[1][ID_MAX] = {"s1"};+ ht_supertabs_ids(&model, ids, 1, NULL, 0);+ assert(ht_supertab_init(&t, "s1", "", "openharness", 3));+ ht_lead_in_t a = lead("L0", "work", 0); a.chat = "group"; a.chat_id = "g1"; a.chat_name = "Fix login";+ ht_lead_in_t b = lead("L1", "done", 1); b.chat = "pm"; b.chat_id = "pm1"; b.chat_name = "PM";+ ht_lead_in_t c = lead("L2", "done", 2); c.chat = "pm"; c.chat_id = "pm2"; c.chat_name = "PM";+ assert(ht_supertab_lead_add(&t, &a) && ht_supertab_lead_add(&t, &b) && ht_supertab_lead_add(&t, &c));+ ht_supertabs_put(&model, &t, 0, NULL, 0);+ ht_supertabs_recap_open(&model, "s1", "L0", 100);+ assert(ht_supertabs_recap_put(&model, "s1", "L0", "g1", "", "Tests green.", 2, false));+ ht_supertabs_recap_open(&model, "s1", "L1", 110);+ assert(model.recap.state == HT_RECAP_LOADING); // never had one: still asked for+ assert(ht_supertabs_recap_put(&model, "s1", "L1", "pm1", "", "", 0, true) && model.recap.state == HT_RECAP_EMPTY);+ // Back to L0: its recap is on the face at once, and the fresh one still lands.+ ht_supertabs_recap_open(&model, "s1", "L0", 120);+ assert(model.recap.state == HT_RECAP_LOADED && !strcmp(model.recap.text, "Tests green.") && !strcmp(model.recap.chat_id, "g1"));+ assert(model.recap.asked_ms == 120 && model.recap.at == 2);+ assert(ht_supertabs_recap_put(&model, "s1", "L0", "g1", "", "Deployed.", 3, false) && !strcmp(model.recap.text, "Deployed."));+ // L1 had none: it comes back as none.+ ht_supertabs_recap_open(&model, "s1", "L1", 130);+ assert(model.recap.state == HT_RECAP_EMPTY && !model.recap.text[0]);+ // The newest text is the one remembered.+ ht_supertabs_recap_open(&model, "s1", "L0", 140);+ assert(model.recap.state == HT_RECAP_LOADED && !strcmp(model.recap.text, "Deployed."));+ // Its chat moved on: the remembered text was another chat's, so the face waits for the new one.+ ht_supertabs_recap_open(&model, "s1", "L2", 150);+ t.leads[0].chat_id[0] = 'h'; ht_supertabs_put(&model, &t, 0, NULL, 0);+ ht_supertabs_recap_open(&model, "s1", "L0", 160);+ assert(model.recap.state == HT_RECAP_LOADING && !model.recap.text[0] && !model.recap.chat_id[0]);+ // A reset forgets them all.+ ht_supertabs_recap_open(&model, "s1", "L1", 170);+ ht_supertabs_reset(&model);+ ht_supertabs_ids(&model, ids, 1, NULL, 0); ht_supertabs_put(&model, &t, 0, NULL, 0);+ ht_supertabs_recap_open(&model, "s1", "L1", 180);+ assert(model.recap.state == HT_RECAP_LOADING);+ // More Leads than it remembers: the oldest is forgotten, the rest kept.+ ht_supertabs_reset(&model);+ static ht_supertab_t many;+ assert(ht_supertab_init(&many, "s1", "", "openharness", HT_SUPERTAB_LEADS_MAX));+ char lid[HT_SUPERTAB_LEADS_MAX][8], cid[HT_SUPERTAB_LEADS_MAX][8];+ for (int i = 0; i < HT_SUPERTAB_LEADS_MAX; i++) {+ snprintf(lid[i], sizeof lid[i], "M%d", i); snprintf(cid[i], sizeof cid[i], "c%d", i);+ ht_lead_in_t m = lead(lid[i], "done", i); m.chat = "pm"; m.chat_id = cid[i]; m.chat_name = "PM";+ assert(ht_supertab_lead_add(&many, &m));+ }+ ht_supertabs_ids(&model, ids, 1, NULL, 0); ht_supertabs_put(&model, &many, 0, NULL, 0);+ for (int i = 0; i < HT_RECAP_REMEMBERED + 1; i++) {+ ht_supertabs_recap_open(&model, "s1", lid[i], 200 + i);+ assert(ht_supertabs_recap_put(&model, "s1", lid[i], cid[i], "", "said", 5, false));+ }+ ht_supertabs_recap_open(&model, "s1", lid[0], 300);+ assert(model.recap.state == HT_RECAP_LOADING);+ ht_supertabs_recap_open(&model, "s1", lid[2], 310);+ assert(model.recap.state == HT_RECAP_LOADED);+ puts("supertab: the last Leads' recaps come back at once on a swipe, only for their chat, oldest forgotten, reset clears PASS");+}+int main(void){order_and_limits();@@ -366,5 +429,6 @@ int main(void)chats();threads();buddies();+ recap_memory();return 0;}diff --git a/devices/harness-device/firmware/test/test_touch_ui.py b/devices/harness-device/firmware/test/test_touch_ui.pyindex 95e37e026..2e8522a18 100644--- a/devices/harness-device/firmware/test/test_touch_ui.py+++ b/devices/harness-device/firmware/test/test_touch_ui.py@@ -229,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', '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']:+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', 'companion_box', 'notice_badge', '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')@@ -2034,7 +2034,24 @@ 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.+// The notice badge on the companion's shoulder (option B, 2026-11-05): a 30 px blue disc.+static bool badge_rect(ht_rect_t *out) {+ for (int i = 0; i < scene.count; i++) {+ const ht_run_t *r = &scene.runs[i];+ if (r->box.h == 30 && r->w == 30 && r->box.fill == ht_rgb(0x006fff)) { if (out) *out = (ht_rect_t){r->x, r->y, 30, 30}; return true; }+ }+ return false;+}static void pair_buddy(void) { fake_ms += 1000; tap(fake_ms, 278, 410); }+// A thumb's press, not an ideal tap: it lands, drifts `dx`,`dy` px and lifts after `hold` ms (Diego's dial, 2026-11-05: such a+// press on the pair started voice).+static void thumb(int x, int y, int dx, int dy, uint32_t hold) {+ fake_ms += 1000;+ habitat_touch(true, x, y, fake_ms);+ habitat_touch(true, x + dx / 2, y + dy / 2, fake_ms + hold / 2);+ habitat_touch(false, x + dx, y + dy, fake_ms + hold);+ scene_take();+}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();@@ -2427,11 +2444,11 @@ static void swarm_buddy_checks(const char *dir) {// 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 opens the inbox from the bell, not from a pull down.+ // On the PM side an unread Lead notice opens the inbox from the badged pet, 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);+ { ht_rect_t b; assert(badge_rect(&b)); tap(fake_ms += 1000, b.x - 20, b.y + 30); }assert(s.view == INBOX && swarm_sent == sent);dispatch((action_t){.kind = A_HOME}); scene_take();@@ -2634,8 +2651,8 @@ static void swarm_pick_checks(const char *dir) {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);+ // Personal by a thumb's press (drifting, held): the Personal card's first Lead on the face, the desktop told as for a tab pick.+ thumb(183, 233, 14, 10, 500);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);@@ -2677,9 +2694,9 @@ static void swarm_pair_checks(const char *dir) {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.+ // A notice off the face: its count is a badge on the pet's shoulder, no pill.assert(ui_supertab_notice("s1", "B1", HT_CHAT_LEAD, "lead-fw", "", "Flashed.", 1792560001u));- scene_take(); assert(bell_at(346) && !bell_at(400) && pair_pill());+ scene_take(); assert(badge_rect(NULL) && !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();@@ -2696,14 +2713,14 @@ static void swarm_pair_checks(const char *dir) {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);+ // The pet, with its badge, opens the inbox.+ { ht_rect_t b; assert(badge_rect(&b)); tap(fake_ms += 1000, b.x - 20, b.y + 30); assert(s.view == INBOX); }dispatch((action_t){.kind = A_HOME}); scene_take();- // Hits: the halves, 90 x 44 at y 388.+ // Hits: the halves as a thumb's targets, 130 px wide each from y 382 (under the bell) to the edge, meeting at x 233.{ 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;+ if (s.hits[i].action == A_SIDE_PM) pm = s.hits[i].rect.x == 103 && s.hits[i].rect.y == 382 && s.hits[i].rect.w == 130 && s.hits[i].rect.h == HT_HEIGHT - 382;+ if (s.hits[i].action == A_SIDE_BUDDY) bu = s.hits[i].rect.x == 233 && s.hits[i].rect.y == 382 && s.hits[i].rect.w == 130 && s.hits[i].rect.h == HT_HEIGHT - 382;}assert(pm && bu); }// The empty Buddy side keeps the pair, so the person can come back.@@ -2716,7 +2733,7 @@ static void swarm_pair_checks(const char *dir) {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));+ scene_take(); assert(badge_rect(NULL) && !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");@@ -2740,7 +2757,7 @@ static void swarm_pair_checks(const char *dir) {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());+ scene_take(); assert(run_at("Your Buddy replied", 318) && badge_rect(NULL) && !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();@@ -2787,9 +2804,55 @@ static void swarm_pair_checks(const char *dir) {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));+ assert(scene_says("PM \xc2\xb7 2 replies") && bell_at(346) && !badge_rect(NULL)); // a thread has no pet: the pillfor (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); }+ // A thumb's press on a half switches the side and never starts voice: drifting 16 px, held half a second, or landing+ // just off the drawn pill (below it, or beside it).+ pair_face("done", -1, true, "lead", "Lead");+ thumb(270, 404, 14, 8, 500); assert(swarm_side_buddy("s1") && s.view == HOME && !s.voice_open);+ thumb(190, 404, -12, 10, 450); assert(!swarm_side_buddy("s1") && s.view == HOME && !s.voice_open);+ thumb(300, 446, 0, 0, 120); assert(swarm_side_buddy("s1") && !s.voice_open); // under the pill+ thumb(130, 410, 0, 0, 120); assert(!swarm_side_buddy("s1") && !s.voice_open); // beside it+ // Dragged far off the pill it is no press: nothing switches.+ thumb(278, 410, 0, -150, 300); assert(!swarm_side_buddy("s1") && !s.voice_open);+ // Option B (Diego's dial, 2026-11-05): over a four-line reply the badge sits on the pet, well above the card, and nothing+ // overlaps the card; a tap on the pet opens the notices, and with nothing unread it talks as before.+ {+ const char *say = "Noted. That doesn't look like work for this project, so I'm not opening anything for it. If you want a task, tell me which project and what done looks like.";+ pair_face("done", -1, true, "lead", "Lead");+ ui_supertab_recap("s1", "B0", "c0", "", say, 1792560000u, false); scene_take();+ ht_rect_t b;+ assert(!badge_rect(NULL));+ int card_top = HT_HEIGHT;+ for (int i = 0; i < scene.count; i++) if (scene.runs[i].box.h > 100 && scene.runs[i].w >= 300) card_top = scene.runs[i].y;+ assert(card_top < 300);+ tap(fake_ms += 1000, 233, 112); assert(s.view != INBOX);+ if (s.view != HOME) dispatch((action_t){.kind = A_HOME});+ pair_face("done", -1, true, "lead", "Lead");+ ui_supertab_recap("s1", "B0", "c0", "", say, 1792560000u, false);+ assert(ui_supertab_notice("s1", "B1", HT_CHAT_LEAD, "lead-fw", "", "Flashed.", 1792560001u));+ scene_take();+ assert(badge_rect(&b) && b.y + b.h + 3 < card_top && !bell_at(346));+ for (int i = 0; i < scene.count; i++) { // nothing blue on the card or the pair+ const ht_run_t *r = &scene.runs[i];+ if (r->box.h && r->box.fill == ht_rgb(0x006fff)) assert(r->y + r->box.h < card_top);+ }+ FOCUS_PAGE("badge-long");+ tap(fake_ms += 1000, 233, 112); assert(s.view == INBOX);+ dispatch((action_t){.kind = A_HOME}); scene_take();+ // A swipe that starts on the badged pet still moves to the next project; a hold still opens the tabs.+ assert(ui_supertab_notice("s1", "B1", HT_CHAT_LEAD, "lead-fw2", "", "Flashed again.", 1792560009u)); scene_take();+ assert(badge_rect(NULL) && !strcmp(sw.lead, "B0"));+ fake_ms += 1000; habitat_touch(true, 300, 120, fake_ms); habitat_touch(false, 130, 120, fake_ms + 120); scene_take();+ assert(!strcmp(sw.lead, "B1") && s.view == HOME);+ // The Buddy side: the badge on the Buddy's disc.+ buddy_setup();+ assert(ui_supertab_notice("s1", "B1", HT_CHAT_LEAD, "lead-fw", "", "Flashed.", 1792560001u));+ pair_buddy(); assert(swarm_side_buddy("s1") && badge_rect(&b) && !bell_at(346));+ FOCUS_PAGE("badge-buddy");+ pair_pm();+ }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) {