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.

cli: the cards port keeps a Swarm's `personal` and a decision notice's mark and covered tag (#3379)

0xdiego25082fbc889e4d
diff --git a/cli/src/superTabs/inCore/cards.spec.ts b/cli/src/superTabs/inCore/cards.spec.ts
index 5a1d8ccd6..bd7df57b7 100644
--- a/cli/src/superTabs/inCore/cards.spec.ts
+++ b/cli/src/superTabs/inCore/cards.spec.ts
@@ -41,6 +41,28 @@ describe('the Swarm cards on the devices', () => {
expect('side' in sent[1]).toBe(false)
})
+ it('passes the reader\'s own Personal Swarm on as `personal`, and nothing else as one (round dial Personal | Team)', () => {
+ const { cards, swarmCards } = setup()
+ cards.cards([card('t1', [lead('l1')], { personal: true }), card('t2', [lead('l2')]), card('t3', [lead('l3')], { personal: 'yes' })])
+ const sent = swarmCards.mock.calls.at(-1)?.[0] as Array<Record<string, unknown>>
+ // Diego's dial, 2026-11-06: the port rebuilt each card without it, so the dial never saw a Personal Swarm.
+ expect(sent.map((c) => c.personal)).toEqual([true, undefined, undefined])
+ expect('personal' in sent[1]).toBe(false)
+ })
+
+ it('keeps a decision notice\'s mark and the tag notice it covers, so only a swarmNeedsYou dial hears the decision', () => {
+ const { cards, swarmCards } = setup()
+ const tag = { chat: 'lead', chatId: 'c1', id: 'm1', text: 'River: look', at: 1792560000 }
+ const decision = { chat: 'group', chatId: 'g1', id: 'd1', text: 'River asks you: ship?', at: 1792560100, decision: true, tag }
+ cards.cards([card('t1', [lead('l1', { notice: decision }), lead('l2', { notice: { ...decision, tag: { ...tag, chat: 'nope' } } }), lead('l3', { notice: { ...tag, decision: 'yes', tag } })])])
+ const leads = (swarmCards.mock.calls.at(-1)?.[0] as Array<{ leads: Array<{ notice?: Record<string, unknown> }> }>)[0].leads
+ expect(leads[0].notice).toEqual(decision)
+ // An unsound covered tag is left out and the decision kept; a mark that is not `true` is no decision, and carries no tag.
+ expect(leads[1].notice).toEqual({ ...decision, tag: undefined })
+ expect('tag' in leads[1].notice!).toBe(false)
+ expect(leads[2].notice).toEqual(tag)
+ })
+
it('checks ids, counts and strings, and drops a malformed list whole, keeping the last good one', () => {
const { cards, swarmCards, log } = setup()
cards.cards([card('t1')])
diff --git a/cli/src/superTabs/inCore/cards.ts b/cli/src/superTabs/inCore/cards.ts
index 5f65b8948..3d43b51a6 100644
--- a/cli/src/superTabs/inCore/cards.ts
+++ b/cli/src/superTabs/inCore/cards.ts
@@ -74,8 +74,12 @@ function noticeIn(value: unknown, chats: ReadonlySet<string>): LeadNotice | null
if (typeof notice.chat !== 'string' || !chats.has(notice.chat) || !id(notice.chatId) || !id(notice.id) || typeof notice.text !== 'string' || !whole(notice.at)) return null
// A reply inside a thread names its root (#2463): without it the desktop and the dial read it by opening the chat.
const thread = typeof notice.thread === 'string' && notice.thread ? cut(notice.thread, THREAD_ROOT_BYTES) : undefined
+ // A decision asked of the reader is heard by a swarmNeedsYou dial alone, and any other keeps the tag it covers
+ // (cableSession): without the mark and the tag the devices sent every dial the decision (Diego's dial, 2026-11-06).
+ const decision = notice.decision === true
+ const tag = decision && notice.tag !== undefined ? noticeIn({ ...object(notice.tag), decision: undefined, tag: undefined }, chats) : null
return { chat: notice.chat as LeadNotice['chat'], chatId: notice.chatId, id: notice.id, text: cut(notice.text, RECAP_BYTES), at: notice.at,
- ...(thread ? { thread } : {}) }
+ ...(thread ? { thread } : {}), ...(decision ? { decision: true as const } : {}), ...(tag ? { tag } : {}) }
}
/** The reader's Buddy on a Lead, checked and cut; null when it is not one. */
@@ -125,7 +129,10 @@ function cardIn(value: unknown): SwarmCard | null {
if (!lead) return null
leads.push(lead)
}
- return { id: card.id, name: cut(card.name, NAME_BYTES), count: card.count, leads, ...(card.side === 'buddy' ? { side: 'buddy' as const } : {}) }
+ // `personal`: the reader's own Personal Swarm, for the round dial's Personal | Team picker. The port rebuilt each card without
+ // it, so no dial ever showed the picker (Diego's dial, 2026-11-06).
+ return { id: card.id, name: cut(card.name, NAME_BYTES), count: card.count, leads, ...(card.side === 'buddy' ? { side: 'buddy' as const } : {}),
+ ...(card.personal === true ? { personal: true as const } : {}) }
}
/** A recap the service sent, checked and cut; null when it is not one. */