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.

Remove the Product Managers chat for everyone (#2433)

0xken152c3bbcd888cb
diff --git a/backend/integration/oldLeads.test-support.ts b/backend/integration/oldLeads.test-support.ts
new file mode 100644
index 000000000..fcb5005ae
--- /dev/null
+++ b/backend/integration/oldLeads.test-support.ts
@@ -0,0 +1,27 @@
+import { randomUUID } from 'node:crypto'
+import type { PrismaClient } from '@prisma/client'
+import { swarmTransaction } from '../src/superTabs/cache.js'
+import { stableId, type Author } from '../src/superTabs/model.js'
+import * as parts from '../src/superTabs/parts/index.js'
+
+/** Stores the Leads conversation a Swarm from before its removal still has (model.ts leadsRemoved), where syncLeads made it,
+ * with one message posted there; nothing makes one now. Returns its id and the message's. */
+export async function storeOldLeads(db: PrismaClient, tab: string, agentIds: string[], author: Author, text = 'Who goes first?') {
+ const id = stableId(tab, 'leads'), messageId = `m-${randomUUID()}`
+ await swarmTransaction(db, async tx => {
+ const current = await parts.loadAll(tx, tab)
+ const state = parts.reassemble(current)
+ state.leadsConversationId = id
+ state.conversations.push({ id, kind: 'leads', title: 'Leads', leadId: null, agentIds, archived: false, brief: '', checks: [],
+ assignment: null, lastMessageSequence: 1, messageSeq: 1, lastMainSequence: 1, lastActivityAt: new Date().toISOString() })
+ const version = Math.max(current.head.version, ...[...current.members, ...current.agents, ...current.groups, ...current.machines,
+ ...current.starts, ...current.progress].map(p => p.version)) + 1
+ for (const model of [tx.swarmHead, tx.swarmMember, tx.swarmAgent, tx.swarmGroup, tx.swarmMachine, tx.swarmStart, tx.swarmProgress] as unknown as
+ Array<{ deleteMany(args: unknown): Promise<unknown> }>) await model.deleteMany({ where: { tabId: tab } })
+ await parts.insertParts(tx, { ...parts.split(state, { tabId: tab, version, now: Date.now(), visibilityEpoch: current.visibilityEpoch }),
+ sequenceBase: current.sequenceBase })
+ await tx.superTabMessage.create({ data: { id: messageId, tabId: tab, conversationId: id, sequence: 1, author: author as never, text,
+ thread: messageId, recipientIds: agentIds, mentions: [], createdAt: new Date() } })
+ })
+ return { id, messageId }
+}
diff --git a/backend/integration/superTabBuddies.test.ts b/backend/integration/superTabBuddies.test.ts
index bb2e9c90c..af63a527a 100644
--- a/backend/integration/superTabBuddies.test.ts
+++ b/backend/integration/superTabBuddies.test.ts
@@ -6,6 +6,7 @@ import { tmpdir } from 'node:os'
import { Readable } from 'node:stream'
import { crc32, deflateSync, inflateSync } from 'node:zlib'
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
+import { storeOldLeads } from './oldLeads.test-support.js'
import { MongoMemoryReplSet } from 'mongodb-memory-server-core'
import { PrismaClient } from '@prisma/client'
import type { AuthUser } from '../src/lib/ssoAuth.js'
@@ -240,11 +241,12 @@ describe('a Buddy through the store', () => {
const web = (await f.execute({ type: 'project.create', name: 'Web', visibility: 'public', brief: '' })).result as { projectId: string; conversationId: string }
const landing = String((await f.execute({ type: 'conversation.create', projectId: web.projectId, title: 'Landing', brief: '', checks: [] })).result.conversationId)
const { agentId } = await buddy(f)
- const leads = (await f.store.read(owner, f.tab)).state.leadsConversationId
- expect(leads).toBeTruthy()
- for (const conversationId of [owners, web.conversationId, landing, leads!]) {
+ // An older Swarm's stored Leads conversation: removed for everyone (model.ts leadsRemoved), its Buddy included.
+ const { id: leads } = await storeOldLeads(db, f.tab, [f.lead], { kind: 'person', id: owner.sub, name: owner.email, membershipGeneration: f.tab })
+ for (const conversationId of [owners, web.conversationId, landing]) {
await expect(f.store.messages(peer, f.tab, conversationId, {}, agentId)).rejects.toThrow('unavailable')
}
+ await expect(f.store.messages(peer, f.tab, leads, {}, agentId)).rejects.toMatchObject({ code: 'LEADS_CONVERSATION_REMOVED' })
const read = await new SwarmReads(f.store).firstLoad(peer, f.tab, agentId)
for (const id of [owners, web.conversationId, landing, leads]) expect(read.groups.map(g => g.key)).not.toContain(id)
})
@@ -858,8 +860,7 @@ describe('a Buddy hears how its person\'s requests go, unasked (Diego, 10-29)',
it('is refused at pickup in the Leads conversation, even with a delivery row there (security review 2 of #2178)', async () => {
const { f, agentId } = await proposed()
- const leads = (await f.store.read(owner, f.tab)).state.leadsConversationId!
- const said = String((await f.execute({ type: 'message.send', conversationId: leads, text: 'Leads only.', replyTo: null, recipientIds: [] }, owner, f.lead)).result.messageId)
+ const { id: leads, messageId: said } = await storeOldLeads(db, f.tab, [f.lead], { kind: 'person', id: owner.sub, name: owner.email, membershipGeneration: f.tab }, 'Leads only.')
const template = await db.superTabDelivery.findFirstOrThrow({ where: { tabId: f.tab, agentId } })
const { id: _id, createdAt: _created, updatedAt: _updated, ...fields } = template
const planted = await db.superTabDelivery.create({ data: { ...fields, id: randomUUID().replaceAll('-', '').slice(0, 24), conversationId: leads, messageId: said,
diff --git a/backend/integration/superTabBuddyProbes.test.ts b/backend/integration/superTabBuddyProbes.test.ts
index f6f973760..02a58a1d4 100644
--- a/backend/integration/superTabBuddyProbes.test.ts
+++ b/backend/integration/superTabBuddyProbes.test.ts
@@ -123,7 +123,7 @@ describe('security review 1 of #2115: a Buddy\'s reads, probed by two people', (
const gen=(await poolRows(f.store,owner,'owner-mac')).find(p=>p.tabId===f.tab)!.machine.generation
await f.store.observeMachine(owner,f.tab,'owner-mac',{generation:gen,resources:{cpuPercent:10,memoryTotalBytes:32e9,memoryUsedBytes:4e9,diskFreeBytes:120e9,diskTotalBytes:500e9,projectDiskFreeBytes:120e9,deviceType:'Laptop',chip:'Fixture',os:'macOS',gpuPercent:null},quotas:[],tools:{},runningHarnessIds:[],stoppedHarnessIds:[]})
const ownerBuddyChat=String((await f.execute({type:'buddy.create',projectId:'lead',machineId:'owner-mac',engine:'claude'})).result.conversationId)
- const leads=(await f.store.read(owner,f.tab)).state.leadsConversationId!
+ const leads=stableId(f.tab,'leads')
const reads=new SwarmReads(f.store)
for(const id of [privateChat,ownerBuddyChat,leads,web.conversationId,other,'invented-group-id']){
await expect(f.store.messages(peer,f.tab,id,{before:Number.MAX_SAFE_INTEGER,messageId:'invented-message-id'},agentId)).rejects.toThrow('unavailable')
diff --git a/backend/integration/superTabGroupPlans.test.ts b/backend/integration/superTabGroupPlans.test.ts
index 66e98cddb..3d73e020e 100644
--- a/backend/integration/superTabGroupPlans.test.ts
+++ b/backend/integration/superTabGroupPlans.test.ts
@@ -89,8 +89,8 @@ async function scene() {
})
const quietLead = bulk('ql', QUIET_LEAD, 'lead', true), quietOther = bulk('qo', QUIET_OTHER, other, true), open = bulk('op', OPEN, 'lead', false)
await db.swarmGroup.createMany({ data: [...quietLead, ...quietOther, ...open] })
- // Every project's Lead conversation and the Leads' one: a host's light load always reads them (parts/light.ts).
- const leadConversations = [...state.projects!.map(p => p.leadConversationId), ...state.leadsConversationId ? [state.leadsConversationId] : []]
+ // Every project's Lead conversation: a host's light load always reads them (parts/light.ts).
+ const leadConversations = state.projects!.map(p => p.leadConversationId)
const active = [...leadConversations, web, done, ...open.map(r => r.key)]
return { tabId, machineId, lead, worker, reviewer, web, done, other, empty, quietLead, quietOther, leadConversations, active }
}
diff --git a/backend/integration/superTabHotReads.test.ts b/backend/integration/superTabHotReads.test.ts
index b54de1329..de77983c4 100644
--- a/backend/integration/superTabHotReads.test.ts
+++ b/backend/integration/superTabHotReads.test.ts
@@ -235,8 +235,8 @@ describe('delivery authority reads', () => {
const groups = entries.filter(e => e.ns.endsWith('.SwarmGroup') && e.op !== 'update')
const returned = groups.reduce((sum, e) => sum + (e.nreturned ?? 0), 0)
console.log(`delivery ${action.type}: groups=${returned}, docs=${entries.reduce((sum, e) => sum + (e.docsExamined ?? 0), 0)}`)
- // The project and Swarm Lead conversations plus the receiver's group; no quiet groups or finished work.
- expect(returned, `${action.type}: ${JSON.stringify(plan(groups))}`).toBe(3)
+ // The project's Lead conversation plus the receiver's group; no quiet groups, finished work or removed Leads conversation.
+ expect(returned, `${action.type}: ${JSON.stringify(plan(groups))}`).toBe(2)
expect(groups.every(e => !!e.command?.hint), 'delivery reads use the installed group indexes').toBe(true)
expect(entries.filter(e => e.ns.endsWith('.SwarmMachine'))).toEqual([])
}
diff --git a/backend/integration/superTabInbox.test.ts b/backend/integration/superTabInbox.test.ts
index 8681f2844..c8dd94c36 100644
--- a/backend/integration/superTabInbox.test.ts
+++ b/backend/integration/superTabInbox.test.ts
@@ -4,6 +4,7 @@ import { promisify } from 'node:util'
import { join } from 'node:path'
import { tmpdir } from 'node:os'
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'
+import { storeOldLeads } from '../src/superTabs/leads.test-support.js'
import { MongoMemoryReplSet } from 'mongodb-memory-server-core'
import { PrismaClient } from '@prisma/client'
import Fastify, { type FastifyInstance } from 'fastify'
@@ -86,6 +87,8 @@ async function scene(extra: (s: ReturnType<typeof swarm>) => void = () => {}) {
Object.assign(chat, { id: buddyId, kind: 'buddy', leadId: null, agentIds: [], audience: { people: [{ id: peer.sub, generation }] } })
})
extra(s)
+ // Stored before its removal: the Swarm-wide Leads conversation, which no inbox lists now (model.ts leadsRemoved).
+ s.edit(state => { storeOldLeads(state) })
const tabId = `tab-${randomUUID()}`
const state = { ...structuredClone(s.state), id: tabId } as SuperTabState
await writeLegacySwarm(db, { state, revision: 3 })
@@ -161,7 +164,7 @@ const latestOf = (data: any) => Object.fromEntries((data.latest as any[]).map(l
* Secret work (owner's private project): owner's root, a worker reply, then "Secret latest".
* Peer's Buddy chat: peer's root, the Buddy's reply, then the Buddy's "Buddy latest".
* Peer's closed Chat with PM: a root, a reply and "Closed latest", read by nobody.
- * Leads: the owner's "Leads note". */
+ * The removed Leads conversation (still stored): the owner's "Leads note", which nobody's inbox shows. */
async function busyScene() {
const s = await scene()
const [webRootId] = await insert(s.tabId, s.web, [{ text: 'Web root', author: personAuthor(owner), mentions: [peer.sub, outsider.sub] }])
@@ -179,7 +182,7 @@ async function busyScene() {
await insert(s.tabId, s.secretGroup, [{ text: 'Secret reply', author: agentAuthor(s.worker), thread: secretRoot }, { text: 'Secret latest', author: personAuthor(owner) }])
await insert(s.tabId, s.buddyId, [{ text: 'Buddy reply', author: agentAuthor('buddy-agent'), thread: buddyRoot }, { text: 'Buddy latest', author: agentAuthor('buddy-agent') }])
await insert(s.tabId, s.closedId, [{ text: 'Closed reply', author: agentAuthor(s.worker), thread: closedRoot }, { text: 'Closed latest', author: personAuthor(peer) }])
- await send(s.tabId, s.leads, 'Leads note')
+ await insert(s.tabId, s.leads, [{ text: 'Leads note', author: personAuthor(owner) }])
return { ...s, webRoot, webLatest }
}
@@ -194,7 +197,7 @@ describe('a person\'s inbox: unread threads and each chat\'s latest message', ()
{ chat: s.buddyId, root: 'Buddy root', unread: 1, last: 'buddy-agent' },
{ chat: s.web, root: 'Web root', unread: 3, last: s.worker },
])
- expect(latestOf(body.data)).toEqual({ [s.web]: 'Web latest', [s.buddyId]: 'Buddy latest', [s.leads]: 'Leads note' })
+ expect(latestOf(body.data)).toEqual({ [s.web]: 'Web latest', [s.buddyId]: 'Buddy latest' })
expect(body.data.more).toBe(false)
expect(JSON.stringify(body.data)).not.toMatch(/Secret|Closed|secret|closed/)
expect(JSON.stringify(body.data)).not.toContain(s.secretGroup)
@@ -210,7 +213,7 @@ describe('a person\'s inbox: unread threads and each chat\'s latest message', ()
{ chat: s.secretGroup, root: 'Secret root', unread: 1, last: s.worker },
{ chat: s.web, root: 'Web root', unread: 1, last: s.worker },
])
- expect(latestOf(body.data)).toEqual({ [s.web]: 'Web latest', [s.secretGroup]: 'Secret latest', [s.leads]: 'Leads note' })
+ expect(latestOf(body.data)).toEqual({ [s.web]: 'Web latest', [s.secretGroup]: 'Secret latest' })
expect(JSON.stringify(body.data)).not.toMatch(/Buddy|Closed/)
expect(JSON.stringify(body.data)).not.toContain(s.buddyId)
})
@@ -220,7 +223,7 @@ describe('a person\'s inbox: unread threads and each chat\'s latest message', ()
const { status, body } = await inbox(s.tabId, outsider)
expect(status).toBe(200)
expect(threadsOf(body.data)).toEqual([{ chat: s.web, root: 'Web root', unread: 3, last: s.worker }])
- expect(latestOf(body.data)).toEqual({ [s.web]: 'Web latest', [s.leads]: 'Leads note' })
+ expect(latestOf(body.data)).toEqual({ [s.web]: 'Web latest' })
expect(JSON.stringify(body.data)).not.toMatch(/Secret|Buddy|Closed/)
})
@@ -405,7 +408,7 @@ describe('thread unread as Desktop marks it (controller.dart threadUnread)', ()
await editChat(s.tabId, s.web, data => { data.archived = true })
const { body } = await inbox(s.tabId, peer)
expect(threadsOf(body.data)).toEqual([{ chat: s.buddyId, root: 'Buddy root', unread: 1, last: 'buddy-agent' }])
- expect(latestOf(body.data)).toEqual({ [s.buddyId]: 'Buddy latest', [s.leads]: 'Leads note' })
+ expect(latestOf(body.data)).toEqual({ [s.buddyId]: 'Buddy latest' })
})
it('gives an older chat whose newest rows are all thread replies its latest top-level message', async () => {
diff --git a/backend/integration/superTabLiveness.test.ts b/backend/integration/superTabLiveness.test.ts
index c2bd2e499..8a21145d7 100644
--- a/backend/integration/superTabLiveness.test.ts
+++ b/backend/integration/superTabLiveness.test.ts
@@ -761,12 +761,10 @@ describe('a machine\'s report', () => {
expect(await db.swarmGroup.findMany({ where: { tabId: f.tab, key: { in: finished } }, orderBy: { key: 'asc' } })).toEqual(before)
})
- it('finds the Leads conversation of a Swarm whose head never stored its id, as a full load does', async () => {
+ it('reports a machine of a Swarm whose head stored no Leads conversation, as every Swarm made now', async () => {
const f = await swarm()
const head = (await db.swarmHead.findFirst({ where: { tabId: f.tab } }))!
- const { leadsConversationId, ...rest } = head.data as { leadsConversationId?: string }
- expect(leadsConversationId).toBe(stableId(f.tab, 'leads'))
- await db.swarmHead.update({ where: { id: head.id }, data: { data: rest as Prisma.InputJsonValue } })
+ expect(head.data).not.toHaveProperty('leadsConversationId')
await f.beat(f.clock.now)
expect((await f.timed.read(owner, f.tab)).state.machines!.map(m => m.observation?.receivedAt)).toEqual([f.clock.now, f.clock.now])
})
diff --git a/backend/integration/superTabRead.test.ts b/backend/integration/superTabRead.test.ts
index e8d7464f3..a9f43c211 100644
--- a/backend/integration/superTabRead.test.ts
+++ b/backend/integration/superTabRead.test.ts
@@ -4,6 +4,7 @@ import { promisify } from 'node:util'
import { join } from 'node:path'
import { tmpdir } from 'node:os'
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
+import { storeOldLeads } from '../src/superTabs/leads.test-support.js'
import { MongoMemoryReplSet } from 'mongodb-memory-server-core'
import { PrismaClient } from '@prisma/client'
import Fastify, { type FastifyInstance } from 'fastify'
@@ -95,6 +96,8 @@ async function scene<T = void>(extra: (s: ReturnType<typeof swarm>, ids: { web:
finished.assignment = { ...state.conversations.find(c => c.id === web)!.assignment!, id: 'old-work', status: 'done' }
})
const more = extra(s, { web, done, lead, secret })
+ // Stored before its removal: the Swarm-wide Leads conversation, with the Lead in it; no read sends it now (model.ts leadsRemoved).
+ s.edit(state => { storeOldLeads(state, [lead]) })
const tabId = `tab-${randomUUID()}`
const state = { ...structuredClone(s.state), id: tabId } as SuperTabState
await writeLegacySwarm(db, { state, revision: R, messages: [{ id: `${tabId}-m1`, conversationId: done, sequence: 5, text: 'Done',
@@ -130,7 +133,7 @@ describe('first load (design 4.3)', () => {
head: { key: 'head', version: R, changedAt: MIGRATED, data: { id: s.tabId, name: 'Pilot' } } })
expect(JSON.parse(Buffer.from(body.data.cursor, 'base64url').toString())).toEqual({ v: 2, t: NOW - 30_000, e: 1 })
expect(keys(body.data.members)).toEqual([owner.sub, peer.sub, outsider.sub])
- expect(keys(body.data.groups)).toEqual(['lead', s.web, s.buddyId, s.leads])
+ expect(keys(body.data.groups)).toEqual(['lead', s.web, s.buddyId])
expect(body.data.derived).toMatchObject({ agents: { [s.lead]: { downSince: null }, [s.worker]: { workDecision: null } }, mentionsWaiting: 0 })
})
@@ -424,7 +427,7 @@ describe('host form (design 4.10)', () => {
expect([...rows.keys()].sort()).toEqual([s.lead, s.worker, s.more.idle, s.more.loner].sort())
// A Lead's readers watch it, view only (Ken, 2026-10-28), as a Builder's do; marked, its host lets nobody else.
const readers = [{ email: peer.email, userId: peer.sub }, { email: outsider.email, userId: outsider.sub }]
- expect(rows.get(s.lead)).toMatchObject({ lead: true, active: true, leadsConversationId: s.leads, lastChangedAt: MIGRATED, observers: readers,
+ expect(rows.get(s.lead)).toMatchObject({ lead: true, active: true, leadsConversationId: null, lastChangedAt: MIGRATED, observers: readers,
confidential: true, membersWatch: true })
expect(rows.get(s.worker)).toMatchObject({ observers: readers, confidential: false, membersWatch: false })
// Its only group is finished and dormant, yet not archived: the host must not hand it to automatic cleanup.
diff --git a/backend/integration/superTabReflection.test.ts b/backend/integration/superTabReflection.test.ts
index b0bbb4fe6..9e66b7ac5 100644
--- a/backend/integration/superTabReflection.test.ts
+++ b/backend/integration/superTabReflection.test.ts
@@ -4,6 +4,7 @@ import { promisify } from 'node:util'
import { join } from 'node:path'
import { tmpdir } from 'node:os'
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
+import { stableId } from '../src/superTabs/model.js'
import { MongoMemoryReplSet } from 'mongodb-memory-server-core'
import { PrismaClient } from '@prisma/client'
import type { AuthUser } from '../src/lib/ssoAuth.js'
@@ -267,7 +268,7 @@ describe('the nightly routing reflection', () => {
week: new Date(Date.UTC(2026, 9, 26)), updatedAt: new Date(f.clock.now) } })
// Attempts in a private chat and in the Leads conversation of this project's Swarm.
const chat = String((await f.execute({ type: 'buddy.chat', projectId: 'lead' }, host)).result.conversationId)
- const leads = (await f.store.read(owner, f.tab)).state.leadsConversationId!
+ const leads = stableId(f.tab, 'leads')
for (const conversationId of [chat, leads, 'lead', hidden.conversationId]) await f.seed(conversationId, { at: f.clock.now - HOUR })
f.clock.now = NIGHT
const pass = await reflectNightly(db, f.store, NIGHT)
diff --git a/backend/integration/superTabs.test.ts b/backend/integration/superTabs.test.ts
index 6842f2439..d234002f5 100644
--- a/backend/integration/superTabs.test.ts
+++ b/backend/integration/superTabs.test.ts
@@ -608,7 +608,7 @@ describe('deleting abandoned swarm projects', () => {
expect(await run(tab, command, owner, undefined, deleteId)).toEqual(response.json().data)
const state = (await store.read(owner, tab)).state
expect(state.projects!.map(p => p.id)).toEqual(['lead'])
- expect(state.conversations.map(c => c.id)).toEqual(['lead', state.leadsConversationId])
+ expect(state.conversations.map(c => c.id)).toEqual(['lead'])
// An invitation is to the Swarm: it moves to the project that is left rather than disappearing.
expect(state.invitations.map(i => [i.email, i.conversationId])).toEqual([['[email protected]', 'lead']])
for (const id of [conversationId, group]) {
@@ -629,8 +629,8 @@ describe('deleting abandoned swarm projects', () => {
await run(tab, { type: 'project.delete', projectId: 'lead' })
const empty = (await store.read(owner, tab)).state
expect(empty.projects).toEqual([])
- // Only the Swarm-wide Leads conversation is left.
- expect(empty.conversations.map(c => c.kind)).toEqual(['leads'])
+ // No conversation is left: a Swarm has no Swarm-wide Leads conversation now (model.ts leadsRemoved).
+ expect(empty.conversations).toEqual([])
expect(empty.agents).toEqual([])
expect(empty.people).toHaveLength(1)
const projectId = String((await run(tab, { type: 'project.create', name: 'Fresh project', visibility: 'public', brief: '' })).result.projectId)
@@ -2431,7 +2431,7 @@ it('allocates workgroup numbers transactionally and replays the same number afte
const results = await Promise.all(operations.map(id => run(tab, command, owner, undefined, id)))
expect(results.map(r => r.result.number).sort()).toEqual([1, 2, 3])
expect((await run(tab, command, owner, undefined, operations[0])).result).toEqual(results[0]!.result)
- expect((await store.read(owner, tab)).state.conversations.map(c => c.number)).toEqual([undefined, 1, 2, 3, undefined])
+ expect((await store.read(owner, tab)).state.conversations.map(c => c.number)).toEqual([undefined, 1, 2, 3])
})
describe('Super Tab chat attachments', () => {
@@ -3094,41 +3094,52 @@ describe('the Lead reads and types in an agent terminal', () => {
})
})
-describe('Leads conversation', () => {
- it('appears in an old Swarm, lets people and Leads post, and delivers only to the other Leads', async () => {
+describe('Product Managers chat, removed (Dee, 2026-10-31)', () => {
+ it('is never made, and an old Swarm\'s stored one reaches nobody, takes no post and keeps its history', async () => {
const { tab, lead } = await fixture()
- // A Swarm stored before the Leads conversation existed.
- const stored = await storedState(tab)
- const leads = stored.leadsConversationId!
- delete stored.leadsConversationId
- stored.conversations = stored.conversations.filter(c => c.kind !== 'leads')
- await saveState(tab, stored)
- // Clients find it without a project: by the tab's id for it and its kind.
- const read = (await store.read(owner, tab)).state
- expect(read.leadsConversationId).toBe(leads)
- const found = read.conversations.find(c => c.id === leads)!
- expect(found.kind).toBe('leads')
- expect(found).not.toHaveProperty('projectId')
- expect((await store.messages(owner, tab, leads, {})).messages).toEqual([])
-
+ expect((await storedState(tab)).conversations.filter(c => c.kind === 'leads')).toEqual([])
const docs = String((await run(tab, { type: 'project.create', name: 'Docs', visibility: 'public', brief: '' })).result.conversationId)
const docsLead = (await run(tab, { type: 'agent.add', conversationId: docs, machineId: 'test-host', harnessId: randomUUID(), name: 'Docs Lead',
configuration: config, lead: true })).result.agentId as string
const worker = (await run(tab, { type: 'agent.add', conversationId: 'lead', machineId: 'test-host', harnessId: randomUUID(), name: 'Worker',
configuration: config, lead: false })).result.agentId as string
- const post = (text: string, user = owner, asAgentId?: string) => store.execute(user, tab, { operationId: randomUUID(),
- command: { type: 'message.send', conversationId: leads, text, replyTo: null, recipientIds: [] } }, asAgentId)
- await post('Who goes first?')
- const waiting = async (agentId: string) => (await store.deliveries(host, tab, agentId)).filter(d => d.conversationId === leads).length
- expect([await waiting(lead), await waiting(docsLead), await waiting(worker)]).toEqual([1, 1, 0])
- await post('Pilot goes first.', host, lead)
- expect([await waiting(lead), await waiting(docsLead)]).toEqual([1, 2])
- await expect(post('Me too', host, worker)).rejects.toMatchObject({ code: 'NOT_FOUND' })
- await expect(store.messages(host, tab, leads, {}, worker)).rejects.toMatchObject({ code: 'NOT_FOUND' })
- expect((await store.messages(owner, tab, leads, {})).messages.map(m => m.text)).toEqual(['Who goes first?', 'Pilot goes first.'])
- })
-
- it('shows Leads the other projects\' work and posts one overlap alert for both Leads', async () => {
+ // A Swarm stored before the removal: its Leads conversation, a message posted there and a delivery still queued for a Lead.
+ const leads = stableId(tab, 'leads')
+ const stored = await storedState(tab)
+ stored.leadsConversationId = leads
+ stored.conversations.push({ id: leads, kind: 'leads', title: 'Leads', leadId: null, agentIds: [lead, docsLead], archived: false, brief: '',
+ checks: [], assignment: null, lastMessageSequence: 1 })
+ await saveState(tab, stored)
+ const said = String((await run(tab, { type: 'message.send', conversationId: 'lead', text: 'Status?', replyTo: null, recipientIds: [] })).result.messageId)
+ const template = await db.superTabMessage.findUniqueOrThrow({ where: { id: said } })
+ const old = await db.superTabMessage.create({ data: { ...template, id: `m-${randomUUID()}`, conversationId: leads, sequence: 1, text: 'Who goes first?',
+ thread: null, author: template.author as never, source: undefined } })
+ const delivery = await db.superTabDelivery.findFirstOrThrow({ where: { tabId: tab, messageId: said } })
+ const { id: _id, createdAt: _created, updatedAt: _updated, ...fields } = delivery
+ const planted = await db.superTabDelivery.create({ data: { ...fields, id: randomUUID().replaceAll('-', '').slice(0, 24), conversationId: leads,
+ messageId: old.id, agentId: docsLead, status: 'queued', claimId: null } })
+
+ for (const [user, asAgentId] of [[owner, undefined], [host, lead], [host, docsLead], [host, worker]] as const) {
+ const state = (await store.read(user, tab, asAgentId)).state
+ expect(state.conversations.filter(c => c.id === leads || c.kind === 'leads')).toEqual([])
+ expect(state).not.toHaveProperty('leadsConversationId')
+ await expect(store.messages(user, tab, leads, {}, asAgentId)).rejects.toMatchObject({ code: 'LEADS_CONVERSATION_REMOVED' })
+ await expect(store.execute(user, tab, { operationId: randomUUID(), command: { type: 'message.send', conversationId: leads, text: 'Who goes first?',
+ replyTo: null, recipientIds: [] } }, asAgentId)).rejects.toMatchObject({ code: 'LEADS_CONVERSATION_REMOVED',
+ message: 'The Product Managers chat was removed. Post in your project\'s chat instead.' })
+ }
+ expect((await store.deliveries(host, tab, docsLead)).map(d => d.id)).not.toContain(planted.id)
+ await expect(store.delivery(host, tab, docsLead, planted.id, { type: 'claim', claimId: randomUUID() })).rejects.toThrow('no longer authorized')
+ // Nothing of it is deleted: its record and its message stay as stored through later writes.
+ await run(tab, { type: 'tab.rename', name: 'Renamed' })
+ expect((await storedState(tab)).conversations.find(c => c.id === leads)).toMatchObject({ kind: 'leads', agentIds: [lead, docsLead] })
+ expect((await storedState(tab)).leadsConversationId).toBe(leads)
+ expect(await db.superTabMessage.findUnique({ where: { id: old.id } })).toMatchObject({ text: 'Who goes first?', conversationId: leads })
+ // Project chats work as before.
+ expect((await store.messages(owner, tab, 'lead', {})).messages.map(m => m.text)).toContain('Status?')
+ })
+
+ it('shows Leads the other projects\' work and tells the other Lead of an overlap in its own project chat alone', async () => {
const { tab, lead } = await fixture()
const docs = String((await run(tab, { type: 'project.create', name: 'Docs', visibility: 'public', brief: '' })).result.projectId)
const docsChat = (await store.read(owner, tab)).state.projects!.find(p => p.id === docs)!.leadConversationId
@@ -3148,14 +3159,14 @@ describe('Leads conversation', () => {
const filter = String((await run(tab, { type: 'conversation.create', title: 'Agents filter', task: task(['desktop/lib/super_tabs/roster.dart']), checks },
host, lead)).result.conversationId)
await run(tab, { type: 'work.define', conversationId: filter, task: task(['desktop/lib/super_tabs']), checks }, host, lead)
- const leads = (await store.read(owner, tab)).state.leadsConversationId!
- const alerts = await db.superTabMessage.findMany({ where: { tabId: tab, conversationId: leads } })
- expect(alerts).toEqual([expect.objectContaining({ source: { kind: 'overlap', conversationIds: [filter, roster] }, recipientIds: [docsLead],
- text: expect.stringContaining('"Agents filter" (Pilot') })])
- expect((await store.deliveries(host, tab, docsLead)).filter(d => d.conversationId === leads)).toHaveLength(1)
- // The two Leads' to settle (Ken, 2026-10-29): the Lead it reaches reads it; people in the Leads chat do not.
- expect((await store.messages(host, tab, leads, {}, docsLead)).messages.map(m => m.id)).toContain(alerts[0]!.id)
- expect((await store.messages(owner, tab, leads, {})).messages.map(m => m.id)).not.toContain(alerts[0]!.id)
+ const alerts = await db.superTabMessage.findMany({ where: { tabId: tab, source: { equals: { kind: 'overlap', conversationIds: [filter, roster] } } } })
+ // The Lead that made the overlap knows it; the other project's Lead hears it in its own project chat, written as itself.
+ expect(alerts).toEqual([expect.objectContaining({ conversationId: docsChat, recipientIds: [docsLead],
+ author: expect.objectContaining({ id: docsLead }), text: expect.stringContaining('"Agents filter" (Pilot') })])
+ expect((await store.deliveries(host, tab, docsLead)).filter(d => d.messageId === alerts[0]!.id)).toHaveLength(1)
+ // The two Leads' to settle (Ken, 2026-10-29): the Lead it reaches reads it; people in the project chat do not.
+ expect((await store.messages(host, tab, docsChat, {}, docsLead)).messages.map(m => m.id)).toContain(alerts[0]!.id)
+ expect((await store.messages(owner, tab, docsChat, {})).messages.map(m => m.id)).not.toContain(alerts[0]!.id)
})
})
@@ -3175,7 +3186,7 @@ describe('a Swarm written by a later release', () => {
stored.conversations.push(later)
await saveState(tab, stored as unknown as SuperTabState)
- expect((await store.read(owner, tab)).state.conversations.map(c => c.id)).toEqual([chat.id, stored.leadsConversationId])
+ expect((await store.read(owner, tab)).state.conversations.map(c => c.id)).toEqual([chat.id])
await run(tab, { type: 'message.send', conversationId: chat.id as string, text: 'Still writable', replyTo: null, recipientIds: [] })
expect((await store.messages(owner, tab, chat.id as string, {})).messages.map(m => m.text)).toEqual(['Still writable'])
await expect(store.messages(owner, tab, 'later', {})).rejects.toMatchObject({ code: 'NOT_FOUND' })
diff --git a/backend/src/superTabs/buddies.test.ts b/backend/src/superTabs/buddies.test.ts
index a4bf843e7..41b16bbfa 100644
--- a/backend/src/superTabs/buddies.test.ts
+++ b/backend/src/superTabs/buddies.test.ts
@@ -1,6 +1,7 @@
import { readFileSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
import { describe, expect, it } from 'vitest'
+import { storeOldLeads } from './leads.test-support.js'
import { CODEX_BUDDY_REFUSAL } from './buddyContract.js'
import { applyCommand, commandSchema, type Command, type CommandContext } from './commands.js'
import { createSuperTab, stableId, visibleState, type Actor, type Conversation } from './model.js'
@@ -82,8 +83,10 @@ describe('what a Buddy reads', () => {
expect(canReadGroup(f.state, buddy, group(f, f.pmChat))).toBe(false)
expect(canReadGroup(f.state, buddy, group(f, f.web.conversationId))).toBe(false)
expect(canReadGroup(f.state, buddy, group(f, web))).toBe(false)
- expect(canReadGroup(f.state, peer, group(f, f.state.leadsConversationId!))).toBe(true)
- expect(canReadGroup(f.state, buddy, group(f, f.state.leadsConversationId!))).toBe(false)
+ // Removed for everyone (model.ts leadsRemoved): an older Swarm's stored one is nobody's, its person's neither.
+ const leads = storeOldLeads(f.state)
+ expect(canReadGroup(f.state, peer, group(f, leads))).toBe(false)
+ expect(canReadGroup(f.state, buddy, group(f, leads))).toBe(false)
expect(visibleState(f.state, buddy).conversations.map(c => c.id).sort()).toEqual([f.app.conversationId, f.chat, f.group].sort())
})
diff --git a/backend/src/superTabs/commands.test.ts b/backend/src/superTabs/commands.test.ts
index 4509a3c99..55aa69905 100644
--- a/backend/src/superTabs/commands.test.ts
+++ b/backend/src/superTabs/commands.test.ts
@@ -1,4 +1,5 @@
import { describe, expect, it } from 'vitest'
+import { storeOldLeads } from './leads.test-support.js'
import { applyCommand, commandSchema, LOOP_NOTICE_AT, PAIR_CHAIN_LIMIT, swarmGridName, withoutCredentials, type Command, type CommandContext } from './commands.js'
import { CREDENTIAL_MARKER, type CredentialKind } from './credentials.js'
import { sweepLiveness } from './liveness.js'
@@ -255,11 +256,11 @@ describe('Super Tab collaboration policy', () => {
const lead = f.add('lead', 'owner', 'lead', true)
const group = f.group()
const worker = f.add('worker', 'owner', group)
- expect(f.state.conversations.map(c => c.title)).toEqual(['Lead', 'Offline editing', 'Leads'])
+ expect(f.state.conversations.map(c => c.title)).toEqual(['Lead', 'Offline editing'])
expect(f.state.conversations[1]).toMatchObject({ leadId: lead, agentIds: [lead, worker], assignment: null })
f.run({ type: 'conversation.agent', conversationId: 'lead', agentId: worker, present: true, lead: false })
expect(f.state.agents).toHaveLength(2)
- expect(f.state.conversations).toHaveLength(3) // Lead, the group and Leads
+ expect(f.state.conversations).toHaveLength(2) // Lead and the group
})
it('routes a human reply to its author, and does not create agent chatter loops', () => {
@@ -376,8 +377,8 @@ describe('Super Tab collaboration policy', () => {
expect(() => send(f, as(engineer), build, [outsider])).toThrow('Choose an agent in this conversation')
expect(f.state.conversations.find(c => c.id === build)!.agentIds).not.toContain(outsider)
expect(() => send(f, as(outsider), build, [])).toThrow()
- const leads = f.state.conversations.find(c => c.title === 'Leads')!.id
- expect(() => send(f, as(engineer), leads, [])).toThrow()
+ const leads = storeOldLeads(f.state)
+ expect(() => send(f, as(engineer), leads, [])).toThrow(expect.objectContaining({ code: 'LEADS_CONVERSATION_REMOVED' }))
const buddy = f.add('buddy', 'owner', build)
f.state.agents.find(a => a.id === buddy)!.buddyOf = { personId: 'owner', projectId: 'lead', generation: 'g' } as never
const elsewhere = f.group()
@@ -768,7 +769,7 @@ it('starts only in the chosen conversation, captures authority, and never assign
const startId = f.run({ type: 'agent.start', request, ...via }, actor, { contribution, ...decisionIn(group) }).result.startId as string
expect(f.state.starts![0]).toMatchObject({ request, hostGrant: 'grant-1', dispatched: false })
expect(f.state.agents).toHaveLength(1)
- expect(f.state.conversations).toHaveLength(3) // Lead, the group and Leads
+ expect(f.state.conversations).toHaveLength(2) // Lead and the group
expect(() => f.run({ type: 'agent.startDispatch', startId }, actor, { contribution: { ...contribution, hostGrant: 'new-grant' } })).toThrow('revoked')
f.run({ type: 'agent.startDispatch', startId }, actor, { contribution })
expect(() => f.run({ type: 'agent.startDispatch', startId }, actor, { contribution })).toThrow('already requested')
@@ -1406,18 +1407,18 @@ describe('the route is advice', () => {
it('assigns stable workgroup numbers through old snapshots, rename, archive and new groups', () => {
const f = fixture(), first = f.group(), second = f.group()
- // The Lead and Leads conversations have no number.
- expect(f.state.conversations.map(c => c.number)).toEqual([undefined, 1, 2, undefined])
+ // The Lead conversation has no number.
+ expect(f.state.conversations.map(c => c.number)).toEqual([undefined, 1, 2])
// An old snapshot has neither the numbers nor the counter the store by parts keeps.
delete f.state.conversations[1]!.number
delete f.state.conversations[2]!.number
delete f.state.groupCounter
- expect(visibleState(f.state, owner).conversations.map(c => c.number)).toEqual([undefined, 1, 2, undefined])
+ expect(visibleState(f.state, owner).conversations.map(c => c.number)).toEqual([undefined, 1, 2])
expect(f.state.conversations[1]!.number).toBeUndefined()
f.run({ type: 'conversation.rename', conversationId: first, title: 'Renamed' })
f.run({ type: 'conversation.archive', conversationId: second, archived: true })
const third = f.group()
- expect(f.state.conversations.map(c => [c.id, c.number])).toEqual([['lead', undefined], [first, 1], [second, 2], [third, 3], [f.state.leadsConversationId, undefined]])
+ expect(f.state.conversations.map(c => [c.id, c.number])).toEqual([['lead', undefined], [first, 1], [second, 2], [third, 3]])
})
it('records the lead project once and accepts only Claude Code and Codex contributions', () => {
const f = fixture(), project = { cwd: '/repo', repositoryUrl: 'https://github.com/example/project' }
@@ -3331,63 +3332,69 @@ describe('Lead protection', () => {
})
})
-describe('Leads conversation', () => {
+describe('Product Managers chat, removed (Dee, 2026-10-31)', () => {
const as = (agentId: string): Actor => ({ kind: 'agent', agentId, machineOwnerId: 'host-owner' })
const send = (conversationId: string, text: string, recipientIds: string[] = []): Command =>
({ type: 'message.send', conversationId, text, replyTo: null, recipientIds })
+ /** A Swarm from before the removal: the Leads conversation and its history are still stored. */
const swarm = () => {
const f = fixture(), lead = f.add('lead', 'owner', 'lead', true), worker = f.add('worker')
const docs = f.run({ type: 'project.create', name: 'Docs', visibility: 'public', brief: 'Docs' }).result as { projectId: string; conversationId: string }
const docsLead = f.add('docs-lead', 'owner', docs.conversationId, true)
- return { f, lead, worker, docs, docsLead, leads: f.state.leadsConversationId! }
+ const leads = 'stored-leads'
+ f.state.leadsConversationId = leads
+ f.state.conversations.push({ id: leads, kind: 'leads', title: 'Leads', leadId: null, agentIds: [lead, docsLead], archived: false,
+ brief: '', checks: [], assignment: null, lastMessageSequence: 7 })
+ return { f, lead, worker, docs, docsLead, leads }
}
+ const REMOVED = expect.objectContaining({ code: 'LEADS_CONVERSATION_REMOVED',
+ message: 'The Product Managers chat was removed. Post in your project\'s chat instead.' })
- it('gives every Swarm one, an old one too, outside every project', () => {
- const f = fixture(), id = f.state.leadsConversationId!
- expect(f.state.conversations.find(c => c.id === id)).toMatchObject({ kind: 'leads', title: 'Leads', archived: false, leadId: null })
- expect(f.state.conversations.find(c => c.id === id)).not.toHaveProperty('number')
-
- const old = fixture()
- delete old.state.leadsConversationId
- old.state.conversations = old.state.conversations.filter(c => c.id !== id)
- expect(visibleState(old.state, owner).leadsConversationId).toBe(id)
- old.run({ type: 'tab.rename', name: 'Renamed' })
- expect(old.state.leadsConversationId).toBe(id)
- expect(old.state.conversations.filter(c => c.kind === 'leads')).toHaveLength(1)
+ it('is not made for a new Swarm', () => {
+ const f = fixture()
+ expect(f.state.conversations.filter(c => c.kind === 'leads')).toEqual([])
+ expect(f.state).not.toHaveProperty('leadsConversationId')
+ f.run({ type: 'tab.rename', name: 'Renamed' })
+ expect(f.state.conversations.filter(c => c.kind === 'leads')).toEqual([])
+ expect(f.state).not.toHaveProperty('leadsConversationId')
})
- it('lets people and Leads post, delivers to every other Lead, and keeps it from other agents', () => {
+ it('reaches no reader of an old Swarm, person or agent, and keeps its stored history', () => {
const { f, lead, worker, docsLead, leads } = swarm()
- expect(f.run(send(leads, 'Who goes first?')).messages[0]!.recipients.sort()).toEqual([lead, docsLead].sort())
- expect(f.run(send(leads, 'Docs waits for Pilot.'), as(docsLead)).messages[0]!.recipients).toEqual([lead])
- // Naming a Lead adds emphasis; every other Lead still hears it.
- expect(f.run(send(leads, 'Pilot, can you go first?', [lead])).messages[0]!.recipients.sort()).toEqual([lead, docsLead].sort())
- expect(() => f.run(send(leads, 'Me too'), as(worker))).toThrow(expect.objectContaining({ code: 'NOT_FOUND' }))
- expect(() => f.run(send(leads, 'Hi', [worker]))).toThrow()
- expect(visibleState(f.state, as(lead)).conversations.map(c => c.id)).toContain(leads)
- const workerView = visibleState(f.state, as(worker))
- expect(workerView.conversations.map(c => c.id)).not.toContain(leads)
- expect(workerView).not.toHaveProperty('leadsConversationId')
-
f.invite('viewer')
- expect(visibleState(f.state, peer).conversations.map(c => c.id)).toContain(leads)
- expect(() => f.run(send(leads, 'Viewer here'), peer)).toThrow(expect.objectContaining({ code: 'READ_ONLY' }))
+ for (const actor of [owner, peer, as(lead), as(docsLead), as(worker)]) {
+ const view = visibleState(f.state, actor)
+ expect(view.conversations.filter(c => c.id === leads || c.kind === 'leads')).toEqual([])
+ expect(view).not.toHaveProperty('leadsConversationId')
+ }
+ f.run({ type: 'tab.rename', name: 'Renamed' })
+ expect(f.state.conversations.find(c => c.id === leads)).toMatchObject({ kind: 'leads', lastMessageSequence: 7, agentIds: [lead, docsLead] })
})
- it('takes no work, members or archiving, and outlives every project', () => {
- const { f, worker, docs, leads } = swarm()
+ it('refuses every post and command on it with one plain message, for people and Leads alike', () => {
+ const { f, lead, worker, docsLead, leads } = swarm()
const checks = [{ description: 'Done', independent: false }]
+ for (const actor of [owner, as(lead), as(docsLead), as(worker)]) {
+ expect(() => f.run(send(leads, 'Who goes first?'), actor)).toThrow(REMOVED)
+ }
+ expect(() => f.run(send(leads, 'Pilot, can you go first?', [lead]))).toThrow(REMOVED)
for (const command of [
{ type: 'conversation.archive', conversationId: leads, archived: true },
{ type: 'conversation.rename', conversationId: leads, title: 'Chat' },
{ type: 'work.define', conversationId: leads, brief: 'Work', checks },
{ type: 'conversation.agent', conversationId: leads, agentId: worker, present: true, lead: false },
- ] as Command[]) expect(() => f.run(command)).toThrow(expect.objectContaining({ code: 'LEADS_CONVERSATION' }))
+ ] as Command[]) expect(() => f.run(command)).toThrow(REMOVED)
// A task links only to a task of its own project: the Leads conversation reads as missing (project instructions, phase 4).
expect(() => f.run({ type: 'conversation.create', title: 'Review', reviewOf: leads, brief: 'Review', checks } as Command))
.toThrow(expect.objectContaining({ code: 'NOT_FOUND' }))
- f.run({ type: 'project.delete', projectId: docs.projectId })
- expect(f.state.conversations.some(c => c.id === leads)).toBe(true)
+ })
+
+ it('leaves project chats, workgroups and their recipients as before', () => {
+ const { f, lead, worker, docs, docsLead } = swarm()
+ expect(f.run(send('lead', 'Status?')).messages[0]!.recipients).toEqual([lead])
+ expect(f.run(send(docs.conversationId, 'Docs status?')).messages[0]!.recipients).toEqual([docsLead])
+ const group = f.group()
+ expect(visibleState(f.state, as(worker)).conversations.map(c => c.id)).toEqual(expect.arrayContaining(['lead', group]))
})
})
@@ -3431,28 +3438,38 @@ describe('other projects\' work for Leads', () => {
expect(visibleState(f.state, owner)).not.toHaveProperty('otherProjectsWork')
})
- it('tells both Leads once when a task\'s owned code overlaps another project\'s active task', () => {
+ it('tells each Lead once, in its own project chat and to it alone, when a task\'s owned code overlaps another project\'s active task', () => {
const { f, lead, project, work } = swarm()
const docs = project('Docs', 'public')
const roster = work(docs.projectId, 'Roster', ['desktop/lib/super_tabs'])
- const alerts = () => f.state.leadsConversationId
const name = (id: string) => f.state.agents.find(a => a.id === id)!.displayName
+ const overlaps = (effects: ReturnType<typeof f.run>) => effects.messages.filter(m => (m.source as { kind?: string } | undefined)?.kind === 'overlap')
const created = f.run({ type: 'conversation.create', title: 'Agents filter', task: task([' ./desktop/lib/super_tabs/roster.dart ', 'cli']), checks }, as(lead))
const group = created.result.conversationId as string
- const alert = created.messages.find(m => m.conversationId === alerts())!
- expect(alert).toMatchObject({ author: { id: lead }, recipients: [docs.lead],
- source: { kind: 'overlap', conversationIds: [group, roster.group] } })
- // The two Leads' to settle (Ken, 2026-10-29): people in the Leads chat do not read it.
- expect(agentOnly(alert.source, alert.recipients)).toBe(true)
- expect(alert.text).toBe(`"Agents filter" (Pilot, ${name(lead)}) and "Roster" (Docs, ${name(docs.lead)}) both change `
- + 'desktop/lib/super_tabs/roster.dart.')
+ const text = `"Agents filter" (Pilot, ${name(lead)}) and "Roster" (Docs, ${name(docs.lead)}) both change desktop/lib/super_tabs/roster.dart.`
+ // The acting Lead created the overlap and is not told again; the other project's Lead hears it in its own project chat.
+ expect(overlaps(created)).toEqual([expect.objectContaining({ conversationId: docs.conversationId, author: expect.objectContaining({ id: docs.lead }),
+ recipients: [docs.lead], text, source: { kind: 'overlap', conversationIds: [group, roster.group] } })])
+ // The two Leads' to settle (Ken, 2026-10-29): people in the project chat do not read it.
+ expect(agentOnly(overlaps(created)[0]!.source, overlaps(created)[0]!.recipients)).toBe(true)
+ expect(f.state.conversations.some(c => c.kind === 'leads')).toBe(false)
// The same pair is not alerted again.
f.run({ type: 'work.define', conversationId: group, task: task(['desktop/lib/super_tabs/roster.dart']), checks }, as(lead))
const worker = f.add('pilot-worker', 'owner', group)
- expect(f.run({ type: 'work.assign', conversationId: group, agentId: worker }).messages.some(m => m.conversationId === alerts())).toBe(false)
+ expect(overlaps(f.run({ type: 'work.assign', conversationId: group, agentId: worker }))).toEqual([])
expect(visibleState(f.state, owner)).not.toHaveProperty('overlapAlerts')
})
+ it('tells both Leads, each in its own project chat, when a person makes the overlap', () => {
+ const { f, lead, project, work } = swarm()
+ const docs = project('Docs', 'public')
+ const roster = work(docs.projectId, 'Roster', ['desktop/lib/super_tabs'])
+ const effects = f.run({ type: 'conversation.create', title: 'Agents filter', task: task(['desktop/lib']), checks })
+ expect(effects.messages.filter(m => (m.source as { kind?: string } | undefined)?.kind === 'overlap')
+ .map(m => [m.conversationId, m.recipients]).sort()).toEqual([['lead', [lead]], [docs.conversationId, [docs.lead]]].sort())
+ expect(roster.group).toBeTruthy()
+ })
+
it('stays silent within one project, for owned code that is not a path, and for private projects', () => {
const { f, project, work } = swarm()
const secret = project('Secret', 'private'), docs = project('Docs', 'public')
@@ -3461,10 +3478,10 @@ describe('other projects\' work for Leads', () => {
work(docs.projectId, 'Phrase', ['The Desktop roster'])
for (const owns of [['desktop/lib/super_tabs'], ['The Desktop roster']]) {
const effects = f.run({ type: 'conversation.create', title: 'More', task: task(owns), checks })
- expect(effects.messages.filter(m => m.conversationId === f.state.leadsConversationId)).toEqual([])
+ expect(effects.messages.filter(m => (m.source as { kind?: string } | undefined)?.kind === 'overlap')).toEqual([])
}
expect(f.run({ type: 'conversation.create', projectId: secret.projectId, title: 'Secret too', task: task(['desktop/lib']), checks })
- .messages.filter(m => m.conversationId === f.state.leadsConversationId)).toEqual([])
+ .messages.filter(m => (m.source as { kind?: string } | undefined)?.kind === 'overlap')).toEqual([])
})
})
@@ -3609,12 +3626,12 @@ describe('Lead mentions', () => {
expect(f.run(send('lead', []), as(lead)).messages[0]).not.toHaveProperty('mentions')
})
- it('lets any agent of the project tag, and refuses another project’s Lead and any tag in the Leads conversation; a person tags (mentions.test.ts)', () => {
+ it('lets any agent of the project tag, and refuses another project’s Lead and the removed Leads conversation; a person tags (mentions.test.ts)', () => {
const { f, lead, secret } = swarm(), group = f.group(), worker = f.add('worker', 'owner', group)
expect(f.run(send(group, ['peer'])).messages[0]!.mentions).toEqual(['peer'])
expect(f.run(send(group, ['peer']), as(worker)).messages[0]!.mentions).toEqual(['peer'])
expect(() => f.run(send(group, ['owner']), as(secret.lead))).toThrow('This project is unavailable.')
- expect(() => f.run(send(f.state.leadsConversationId!, ['owner']), as(lead))).toThrow('Nobody is tagged in the Leads conversation.')
+ expect(() => f.run(send(storeOldLeads(f.state), ['owner']), as(lead))).toThrow(expect.objectContaining({ code: 'LEADS_CONVERSATION_REMOVED' }))
})
it('refuses a person who cannot read the conversation or is not in the Swarm', () => {
@@ -4153,8 +4170,8 @@ describe('linked tasks', () => {
return id
}
const buddy = chat('owner-buddy', { kind: 'buddy', audience: { people } }), secret = chat('private', { leadId: f.lead, agentIds: [f.lead], audience: { people } })
- const before = f.state.conversations.length
- for (const target of [theirs, archived, 'lead', buddy, secret, f.state.leadsConversationId!, 'missing']) {
+ const leads = storeOldLeads(f.state), before = f.state.conversations.length
+ for (const target of [theirs, archived, 'lead', buddy, secret, leads, 'missing']) {
for (const actor of [as(f.worker), owner]) {
expect(() => create('Review', target, actor), target).toThrow(expect.objectContaining({ code: 'NOT_FOUND', message: 'This conversation is unavailable.' }))
}
diff --git a/backend/src/superTabs/commands.ts b/backend/src/superTabs/commands.ts
index fbba905bb..19ed7a2db 100644
--- a/backend/src/superTabs/commands.ts
+++ b/backend/src/superTabs/commands.ts
@@ -1,10 +1,10 @@
import { admitMachineStart, BUDDY_WINDOWS_REFUSAL, cleanupOverdue, dropIdleBuddyMachines, NOT_SWARM_MACHINE, downSince, expireRemoval, expireRemovals, failTeamWork, removalEnded, machineContribution, machineOffline, machineSlots, ownedMachine, productManagerOn, projectFolder, projectsOnMachine, requireTeamWork, teamMachineFor, teamAccountPool, teamPoolsOf, teamStartRequest, teamWorkCheck, type ContributedMachine } from './machines.js'
-import { assignAgentDisplayNames } from './agentNames.js'
+import { agentDisplayName, assignAgentDisplayNames } from './agentNames.js'
import { keepUsernames, setUsername, swarmUsernames } from './usernames.js'
import { z } from 'zod'
import { tokensByModelSchema } from './costs/tokens.js'
import {
- activeWork, actorKey, agent, appendPullRequestUrls, author, conversation, crossProjectActive, fail, isLeads, person, stableId, syncLeads, numberConversations, nextConversationNumber, renderWorkTask,
+ activeWork, actorKey, agent, appendPullRequestUrls, author, conversation, crossProjectActive, fail, isLeads, person, stableId, numberConversations, nextConversationNumber, renderWorkTask,
finishWorker, seenMachineIds, swarmGridName, visibleState, AGENT_ONLY, STATUS_LABELS, forRecipients,
type Actor, type AgentConfiguration, type AgentStart, type AgentStartRequest, type BuddySessionEntry, type WorkTask, type Agent, type Author, type Check, type CommandEffects, type Conversation, type SuperTabState,
} from './model.js'
@@ -532,8 +532,7 @@ export function authorizeCommandAccess(state: SuperTabState, actor: Actor, comma
if (buddy) requireBuddyCommand(buddy, command, state.conversations)
// An invitation's group is only where the person lands, and invite.create replaces a deleted one (inviteLanding).
if ('conversationId' in command && command.type !== 'invite.create') {
- const group = readConversation(state, actor, command.conversationId)
- if (isLeads(group) && command.type !== 'message.send') groupProject(state, group)
+ readConversation(state, actor, command.conversationId)
}
if ('projectId' in command && command.projectId) readProject(state, actor, command.projectId)
if ('agentId' in command) readAgent(state, actor, command.agentId)
@@ -636,7 +635,6 @@ export function applyCommand(original: SuperTabState, actor: Actor, input: Comma
const removed: CredentialKind[] = []
const command = withoutCredentials(commandSchema.parse(input), removed)
const state = cloneData(original)
- syncLeads(state)
numberConversations(state)
placeRules(state)
const ended = expireRemovals(state, context.now)
@@ -770,10 +768,10 @@ export function applyCommand(original: SuperTabState, actor: Actor, input: Comma
/** Any other row the system writes in the actor's name. Without a source, a notice written as the owner read as the owner
* asking, and a Lead could quote it to change rules (review of #1594). Only `message.send` and an initial message stay plain. */
const SYSTEM_ROW = { kind: 'system' }
- /** Agent bookkeeping, a routing line or an agent joined or ready: no one's in the project chat or the Leads chat, which
- * carry only what people read or decide on (the Lead's ruling, 2026-10-29); a task's chat keeps it as its record. */
+ /** Agent bookkeeping, a routing line or an agent joined or ready: no one's in the project chat, which carries only what
+ * people read or decide on (the Lead's ruling, 2026-10-29); a task's chat keeps it as its record. */
const bookkeeping = (conversationId: string, source: Record<string, unknown>) =>
- conversationId === state.leadsConversationId || projectsOf(state).some(p => p.leadConversationId === conversationId) ? forRecipients(source) : source
+ projectsOf(state).some(p => p.leadConversationId === conversationId) ? forRecipients(source) : source
const who = sender.kind === 'person' ? sender.name.split('@')[0]! : sender.name
/** [project], when the actor is its coordinator: the one agent that keeps its notes and names itself (design, PM notes). */
const coordinatorOf = (project: SwarmProject, why = 'Of its agents, only this project\'s coordinator does this.'): SwarmProject => {
@@ -1058,7 +1056,8 @@ export function applyCommand(original: SuperTabState, actor: Actor, input: Comma
}
/** Projects in one Swarm changed the same code without knowing it (2026-10-23). When a task is created, defined or assigned,
- * its Leads hear once per pair of tasks that it owns code another shared project's active task owns too. */
+ * its Leads hear once per pair of tasks that it owns code another shared project's active task owns too: each Lead in its
+ * own project chat, as a notice only it reads (the Leads conversation is removed, model.ts leadsRemoved). */
const alertOverlaps = (group: Conversation) => {
const project = groupProject(state, group)
const mine = (group.task?.owns ?? []).flatMap(entry => ownedPath(entry) ?? [])
@@ -1075,11 +1074,16 @@ export function applyCommand(original: SuperTabState, actor: Actor, input: Comma
if (!shared.length || state.overlapAlerts?.includes(pair)) continue
(state.overlapAlerts ??= []).push(pair)
const ours = leadOf(project), their = leadOf(theirs)
- effects.messages.push({ id: stableId(operationId, 'overlap', pair), conversationId: state.leadsConversationId!, author: sender,
- text: `"${group.title}" (${project.name}, ${named(ours)}) and "${other.title}" (${theirs.name}, ${named(their)}) both change `
- + `${shared.join(', ')}.`,
- replyTo: null, recipients: [ours, their].flatMap(a => a && !(actor.kind === 'agent' && a.id === actor.agentId) ? [a.id] : []),
- source: { kind: 'overlap', conversationIds: [group.id, other.id] } })
+ const text = `"${group.title}" (${project.name}, ${named(ours)}) and "${other.title}" (${theirs.name}, ${named(their)}) both change `
+ + `${shared.join(', ')}.`
+ // Written as that Lead, like its other notices (liveness.ts work-stalled): a sender from another project reads none of it.
+ for (const [chat, lead] of [[project, ours], [theirs, their]] as const) {
+ if (!lead || actor.kind === 'agent' && lead.id === actor.agentId) continue
+ effects.messages.push({ id: stableId(operationId, 'overlap', pair, chat.id), conversationId: chat.leadConversationId,
+ author: { kind: 'agent', id: lead.id, name: lead.name, displayName: agentDisplayName(state.agents, lead.id), membershipGeneration: lead.membershipGeneration },
+ text, replyTo: null,
+ recipients: [lead.id], source: { kind: 'overlap', conversationIds: [group.id, other.id] } })
+ }
}
}
@@ -2263,10 +2267,7 @@ export function applyCommand(original: SuperTabState, actor: Actor, input: Comma
// A Buddy chat has no Lead: its owner talks to its Buddy.
const automatic = actor.kind === 'person' ? (isBuddyChat(group) ? (session?.inSession ? session.to : mainBuddyOf(state, group)?.id ?? null)
: replyAgent && group.agentIds.includes(replyAgent) ? replyAgent : group.leadId) : agentRecipient
- // In the Leads conversation everything posted reaches every other Lead; naming some only adds emphasis.
- const everyLead = isLeads(group) ? group.agentIds.filter(id => actor.kind !== 'agent' || id !== actor.agentId) : []
- const recipients = [...new Set([...addressed, ...everyLead, ...memberToLead,
- ...(addressed.length || everyLead.length || !automatic ? [] : [automatic])])]
+ const recipients = [...new Set([...addressed, ...memberToLead, ...(addressed.length || !automatic ? [] : [automatic])])]
for (const id of recipients) {
const target = agent(state, id)
// In a Buddy chat a session hears its own thread alone, and the main Buddy none of it.
@@ -2658,7 +2659,6 @@ export function applyCommand(original: SuperTabState, actor: Actor, input: Comma
if (!acknowledged && !state.agents.some(a => a.id === target.id)) fail('STOP_REQUESTED', 'Wait for the execution host to finish stopping its workers before withdrawing them.')
}
dropIdleBuddyMachines(state, context.now)
- syncLeads(state)
if (context.registrations) requireSingleRegistration(original, state, context.registrations)
markConfidential(state)
assignAgentDisplayNames(state.agents)
diff --git a/backend/src/superTabs/decisions.test.ts b/backend/src/superTabs/decisions.test.ts
index cddcdd8a5..042a7ab06 100644
--- a/backend/src/superTabs/decisions.test.ts
+++ b/backend/src/superTabs/decisions.test.ts
@@ -1,4 +1,5 @@
import { describe, expect, it } from 'vitest'
+import { storeOldLeads } from './leads.test-support.js'
import type { Prisma } from '@prisma/client'
import { applyCommand, commandSchema, type Command, type CommandContext } from './commands.js'
import { createSuperTab, type Actor, type AgentConfiguration } from './model.js'
@@ -83,7 +84,7 @@ describe('asking a person for decisions', () => {
expect(asked.decisions).toEqual([expect.objectContaining({ askerAgentId: s.worker, conversationId: s.group })])
const other = s.run({ type: 'project.create', name: 'Other', visibility: 'public', brief: '' }).result as { projectId: string }
const elsewhere = s.run({ type: 'conversation.create', projectId: other.projectId, title: 'Elsewhere', brief: '', checks: [] }).result.conversationId as string
- const leads = s.state.conversations.find(c => c.id === s.state.leadsConversationId)!
+ const state = structuredClone(s.state), leadsId = storeOldLeads(state), leads = state.conversations.find(c => c.id === leadsId)!
for (const group of [leads, s.state.conversations.find(c => c.id === elsewhere)!]) {
expect(() => checkAsker(s.state, asAgent(s.worker), group)).toThrow(expect.objectContaining({ code: 'FORBIDDEN' }))
}
diff --git a/backend/src/superTabs/leads.test-support.ts b/backend/src/superTabs/leads.test-support.ts
new file mode 100644
index 000000000..e2e35b470
--- /dev/null
+++ b/backend/src/superTabs/leads.test-support.ts
@@ -0,0 +1,10 @@
+import type { SuperTabState } from './model.js'
+
+/** Stores the Leads conversation an older Swarm still has (model.ts leadsRemoved), as syncLeads made it before the removal:
+ * the one way a test reaches it now. */
+export function storeOldLeads(state: SuperTabState, agentIds: string[] = [], id = 'old-leads'): string {
+ state.leadsConversationId = id
+ state.conversations.push({ id, kind: 'leads', title: 'Leads', leadId: null, agentIds, archived: false, brief: '', checks: [],
+ assignment: null, lastMessageSequence: 0 })
+ return id
+}
diff --git a/backend/src/superTabs/mentions.test.ts b/backend/src/superTabs/mentions.test.ts
index 36708d083..ed2cc2cc0 100644
--- a/backend/src/superTabs/mentions.test.ts
+++ b/backend/src/superTabs/mentions.test.ts
@@ -1,5 +1,6 @@
import { readFileSync } from 'node:fs'
import { describe, expect, it } from 'vitest'
+import { storeOldLeads } from './leads.test-support.js'
import { applyCommand, type Command, type CommandContext } from './commands.js'
import { checkMentions, MAX_MENTIONS, tagTokens } from './mentions.js'
import { createSuperTab, type Actor } from './model.js'
@@ -56,10 +57,10 @@ describe('people tagging people', () => {
expect(() => f.send(f.group, ['stranger'])).toThrow(expect.objectContaining({ code: 'INVALID_MENTION' }))
})
- it('refuses tags in the Leads conversation', () => {
+ it('refuses a post with tags in an older Swarm\'s removed Leads conversation, as every post there', () => {
const f = fixture()
- const leads = f.state.leadsConversationId!
- expect(() => f.send(leads, ['peer'])).toThrow(expect.objectContaining({ code: 'INVALID_MENTION' }))
+ const leads = storeOldLeads(f.state)
+ expect(() => f.send(leads, ['peer'])).toThrow(expect.objectContaining({ code: 'LEADS_CONVERSATION_REMOVED' }))
})
// Who tags a person is workflow (project instructions, phase 4): any agent of the project, in its own project only.
@@ -70,7 +71,7 @@ describe('people tagging people', () => {
expect(checkMentions(f.state, worker, group(f.group), ['peer', 'third', 'peer'])).toEqual(['peer', 'third'])
expect(f.send(f.group, ['peer'], worker).mentions).toEqual(['peer'])
expect(f.say(f.group, '@third please confirm', worker).mentions).toEqual(['third'])
- expect(() => checkMentions(f.state, worker, group(f.state.leadsConversationId!), ['peer']))
+ expect(() => checkMentions(f.state, worker, group(storeOldLeads(f.state)), ['peer']))
.toThrow(expect.objectContaining({ code: 'INVALID_MENTION' }))
})
@@ -135,9 +136,8 @@ describe('tags in the text', () => {
expect(worker.text).toBe('@peer please confirm')
})
- it('tags nobody from the text of a Leads conversation post or an agent-only notice', () => {
+ it('tags nobody from the text of an agent-only notice', () => {
const f = fixture()
- expect(f.say(f.state.leadsConversationId!, '@peer look').mentions ?? []).toEqual([])
const notice = f.run({ type: 'message.send', conversationId: f.app.conversationId, text: '@peer is away', replyTo: null,
recipientIds: [f.lead], agentOnly: true }, { kind: 'agent', agentId: f.lead, machineOwnerId: 'owner' }).messages.at(-1)!
expect(notice.mentions ?? []).toEqual([])
diff --git a/backend/src/superTabs/migration/normalize.test.ts b/backend/src/superTabs/migration/normalize.test.ts
index 9d6be73bd..c1123ee16 100644
--- a/backend/src/superTabs/migration/normalize.test.ts
+++ b/backend/src/superTabs/migration/normalize.test.ts
@@ -1,4 +1,5 @@
import { describe, expect, it } from 'vitest'
+import { storeOldLeads } from '../leads.test-support.js'
import { normalize } from './normalize.js'
import { NOW, richSwarm } from '../read/fixture.test-support.js'
import type { Conversation, SuperTabState } from '../model.js'
@@ -81,13 +82,14 @@ describe('migration normalize (design 6.1.2 step 2)', () => {
expect(group(normalize(legacy, { now: NOW, lastActivity: new Map() }), s.done).dormant).toBe(true)
})
- it('parks conversations of an unknown kind and keeps the Leads conversation in step, as reading the row does', () => {
+ it('parks conversations of an unknown kind, and keeps a stored Leads conversation as it is without making one', () => {
const legacy = structuredClone(richSwarm().state)
legacy.conversations.push({ id: 'later', kind: 'future' as never, title: 'Later', leadId: null, agentIds: [], archived: false, brief: '', checks: [], assignment: null, lastMessageSequence: 0 })
- legacy.conversations = legacy.conversations.filter(c => c.kind !== 'leads')
- const state = normalize(legacy, { now: NOW, lastActivity: new Map() })
- expect(state.parkedConversations!.map(c => c.id)).toEqual(['later'])
- expect(state.conversations.at(-1)!.kind).toBe('leads')
+ const fresh = normalize(legacy, { now: NOW, lastActivity: new Map() })
+ expect(fresh.parkedConversations!.map(c => c.id)).toEqual(['later'])
+ expect(fresh.conversations.some(c => c.kind === 'leads')).toBe(false)
+ storeOldLeads(legacy, ['someone'])
+ expect(normalize(legacy, { now: NOW, lastActivity: new Map() }).conversations.find(c => c.kind === 'leads')).toMatchObject({ id: 'old-leads', agentIds: ['someone'] })
})
it('does not change its input', () => {
diff --git a/backend/src/superTabs/migration/normalize.ts b/backend/src/superTabs/migration/normalize.ts
index 8aaf44720..fcbc975bd 100644
--- a/backend/src/superTabs/migration/normalize.ts
+++ b/backend/src/superTabs/migration/normalize.ts
@@ -3,7 +3,7 @@
* applied, persisted, so behavior after the migration is identical. Link lists are restored from history beforehand
* (store.ts restorePullRequestUrls); removals that expire and the released-harness cap are left to the first write.
*/
-import { activeWork, awaitingWorkers, isLeads, numberConversations, parkLaterConversations, syncLeads, type Conversation, type SuperTabState } from '../model.js'
+import { activeWork, awaitingWorkers, isLeads, numberConversations, parkLaterConversations, type Conversation, type SuperTabState } from '../model.js'
import { assignAgentDisplayNames } from '../agentNames.js'
import { agentProjectId, placeRules, projectsOf } from '../projects.js'
import { DORMANT_AFTER_MS, type ProgressData } from '../parts/index.js'
@@ -25,7 +25,6 @@ function owesReports(state: SuperTabState, group: Conversation): boolean {
export function normalize(original: SuperTabState, { now, lastActivity }: { now: number; lastActivity: ReadonlyMap<string, number> }): SuperTabState {
const state = structuredClone(original)
parkLaterConversations(state)
- syncLeads(state)
numberConversations(state)
placeRules(state)
assignAgentDisplayNames(state.agents)
diff --git a/backend/src/superTabs/model.test.ts b/backend/src/superTabs/model.test.ts
index 150d2e936..13acdcc13 100644
--- a/backend/src/superTabs/model.test.ts
+++ b/backend/src/superTabs/model.test.ts
@@ -1,23 +1,24 @@
import { describe, expect, it } from 'vitest'
-import { createSuperTab, syncLeads, type Agent, type SuperTabState } from './model.js'
+import { createSuperTab, visibleState, type SuperTabState } from './model.js'
const deepFreeze = <T>(value: T): T => {
if (value && typeof value === 'object') { Object.values(value).forEach(deepFreeze); Object.freeze(value) }
return value
}
-describe('syncLeads', () => {
- it('lists the Leads in the Leads conversation without changing the conversation it was given', () => {
+describe('the removed Leads conversation', () => {
+ it('is left out of a read over frozen stored records, which keep it unchanged', () => {
const base = createSuperTab('tab1', 'Pilot', { id: 'u1', email: '[email protected]' }, 'prod')
- syncLeads(base)
- const lead = base.conversations.find(c => !c.kind)!
- lead.leadId = 'a1'
- base.agents.push({ id: 'a1' } as Agent)
+ expect(base.conversations.some(c => c.kind === 'leads')).toBe(false)
+ base.leadsConversationId = 'old-leads'
+ base.conversations.push({ id: 'old-leads', kind: 'leads', title: 'Leads', leadId: null, agentIds: ['a1'], archived: false, brief: '',
+ checks: [], assignment: null, lastMessageSequence: 3 })
const stored = deepFreeze(structuredClone(base))
// A read's state is a new object over frozen stored records (parts/shape.ts reassemble with `share`).
const state: SuperTabState = { ...stored, conversations: [...stored.conversations] }
- syncLeads(state)
- expect(state.conversations.find(c => c.kind === 'leads')!.agentIds).toEqual(['a1'])
- expect(stored.conversations.find(c => c.kind === 'leads')!.agentIds).toEqual([])
+ const view = visibleState(state, { kind: 'person', userId: 'u1', email: '[email protected]' })
+ expect(view.conversations.map(c => c.id)).toEqual(['lead'])
+ expect(view).not.toHaveProperty('leadsConversationId')
+ expect(stored.conversations.find(c => c.kind === 'leads')).toMatchObject({ agentIds: ['a1'], lastMessageSequence: 3 })
})
})
diff --git a/backend/src/superTabs/model.ts b/backend/src/superTabs/model.ts
index 12dae74c5..42a88b315 100644
--- a/backend/src/superTabs/model.ts
+++ b/backend/src/superTabs/model.ts
@@ -256,7 +256,8 @@ export function renderWorkTask(task: WorkTask): string {
export interface Conversation {
id: string
- /** The Swarm-wide Leads conversation (syncLeads), or a person's Buddy chat (buddies.ts); absent on every other conversation. */
+ /** The removed Swarm-wide Leads conversation, still stored in an older Swarm (leadsRemoved), or a person's Buddy chat
+ * (buddies.ts); absent on every other conversation. */
kind?: 'leads' | 'buddy'
projectId?: string
/** Stable, tab-local workgroup reference. Lead has no number. */
@@ -355,7 +356,7 @@ export interface SuperTabState {
name: string
project?: { machineId: string; cwd: string; repositoryUrl: string | null }
projects?: SwarmProject[]
- /** The Leads conversation, outside every project (syncLeads). */
+ /** The removed Leads conversation of an older Swarm, still stored (leadsRemoved); no read sends it. */
leadsConversationId?: string
/** Pairs of tasks ("a:b", sorted ids) whose Leads were told their owned code overlaps, so each pair is told once. */
overlapAlerts?: string[]
@@ -639,17 +640,12 @@ export function otherProjectsWork(state: SuperTabState, own: SwarmProject): Othe
})
}
-/** The Swarm-wide conversation where Leads agree an order across projects and every person reads along. It belongs to no
- * project and stays after the project conversations; an older Swarm gets it on its next read or write. Its members are
- * always the projects' current Leads, so only they receive what is posted there. */
-export function syncLeads(state: SuperTabState): void {
- const id = state.leadsConversationId ??= stableId(state.id, 'leads')
- const group = state.conversations.find(c => c.id === id) ?? { id, kind: 'leads', title: 'Leads', leadId: null, agentIds: [],
- archived: false, brief: '', checks: [], assignment: null, lastMessageSequence: 0 }
- // A new record, not the one found: a read's state shares the stored ones (parts/shape.ts reassemble).
- state.conversations = [...state.conversations.filter(c => c !== group),
- { ...group, agentIds: state.agents.filter(a => ledProject(state, a.id)).map(a => a.id) }]
-}
+/** The Swarm-wide Leads conversation ("Product Managers" in the apps) is removed (Dee, 2026-10-31): only agents posted
+ * there and people did not know what it was for. A new Swarm gets none. An older Swarm keeps its stored record and
+ * history untouched (no data is deleted), but no read sends it, no command or post reaches it (LEADS_REMOVED) and no
+ * delivery from it is handed out. */
+export const LEADS_REMOVED = "The Product Managers chat was removed. Post in your project's chat instead."
+export function leadsRemoved(): never { fail('LEADS_CONVERSATION_REMOVED', LEADS_REMOVED, 410) }
/** Legacy groups keep their append order, including archived groups. Persisted
* numbers are never reassigned; the store serializes concurrent additions. */
@@ -698,7 +694,6 @@ export function createSuperTab(id: string, name: string, owner: { id: string; em
// (CLI `superTabs/swarmGrids.ts`) and reports how it went. Fire and forget: a grid that could not be made leaves the
// Swarm as it is, and the owner's first share or run in Your models sets the models up then.
state.localModels = { grid: swarmGridName(id), enabled: true }
- syncLeads(state)
return state
}
@@ -717,12 +712,9 @@ export function visibleState(state: SuperTabState, actor: Actor, now = Date.now(
if (visible.machines) visible.machines = visible.machines.filter(m => !m.buddyOnly)
// Nor its id, which a Buddy's row carries (machineHiddenFrom).
visible.agents = visible.agents.map(a => machineHiddenFrom(state, actor, a) ? agentWithoutMachine(a) : a)
- syncLeads(visible)
- // People and Leads read the Leads conversation; it is not there for any other agent.
- if (actor.kind === 'agent' && !ledProject(visible, actor.agentId)) {
- visible.conversations = visible.conversations.filter(c => !isLeads(c))
- delete visible.leadsConversationId
- }
+ // The removed Leads conversation reaches nobody (leadsRemoved), its id included.
+ visible.conversations = visible.conversations.filter(c => !isLeads(c))
+ delete visible.leadsConversationId
assignAgentDisplayNames(visible.agents)
const led = actor.kind === 'agent' ? ledProject(visible, actor.agentId) : undefined
if (led) visible.otherProjectsWork = otherProjectsWork(visible, led)
@@ -751,9 +743,8 @@ export function visibleState(state: SuperTabState, actor: Actor, now = Date.now(
if (visible.rules) visible.rules = visible.rules.filter(r => projectsOf(state).some(p => p.id === r.projectId && canReadProject(state, actor, p)))
if (visible.projects) {
visible.projects = visible.projects.filter(p => canReadProject(state, actor, p))
- visible.conversations = visible.conversations.filter(c => isLeads(c) || canReadGroup(state, actor, c))
+ visible.conversations = visible.conversations.filter(c => canReadGroup(state, actor, c))
visible.agents = visible.agents.filter(a => canReadAgent(state, actor, a))
- for (const group of visible.conversations.filter(isLeads)) group.agentIds = group.agentIds.filter(id => visible.agents.some(a => a.id === id))
visible.starts = visible.starts?.filter(s => visible.conversations.some(c => c.id === s.request.conversationId))
if (!visible.projects.some(p => p.id === 'lead')) {
delete visible.project
diff --git a/backend/src/superTabs/native.test.ts b/backend/src/superTabs/native.test.ts
index 41ccb2acc..972b8f96c 100644
--- a/backend/src/superTabs/native.test.ts
+++ b/backend/src/superTabs/native.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest'
import type { Prisma } from '@prisma/client'
-import { isLeads, type Agent, type SuperTabState } from './model.js'
+import type { Agent, SuperTabState } from './model.js'
import { recoveryText, revokeConditions, turnRecipients } from './native.js'
import { canReadAgent, canReadGroup, ownSession, projectsOf, watchClosed } from './projects.js'
import { outsider, owner, peer, richSwarm } from './read/fixture.test-support.js'
@@ -30,7 +30,7 @@ function everyCheck(before: SuperTabState, after: SuperTabState): Prisma.SuperTa
for (const group of before.conversations) {
const current = after.conversations.find(c => c.id === group.id)
if (!current || (current.archived && !group.archived)) conditions.push({ conversationId: group.id })
- else if (!isLeads(current)) {
+ else {
for (const member of after.people) {
const reader = { kind: 'person' as const, userId: member.id, email: member.email }
if (canReadGroup(before, reader, group) && !canReadGroup(after, reader, current)) conditions.push({ conversationId: group.id, userId: member.id })
@@ -99,14 +99,13 @@ describe('which terminals a commit revokes (item 7: only what changed access is
expect(got.conditions).toEqual(expected)
})
- // A conversation's kind alone decides who reads it: every person reads the Leads conversation, but as a project group only
- // that project's readers do. A Buddy chat's kind narrows only what agents read, and no agent reader is checked here.
+ // A conversation's kind alone decides who reads it: nobody reads the removed Leads conversation (model.ts leadsRemoved), but
+ // as a project group that project's readers do. A Buddy chat's kind narrows only what agents read, and no agent reader is
+ // checked here.
it('revokes exactly what every check revokes when only a conversation\'s kind changes', () => {
const ids = swarm()
- const leads = ids.before.conversations.find(isLeads)!
- leads.projectId = ids.s.secret
- const { got, expected } = ids.revokes(after => { delete group(after, leads.id).kind })
- expect(expected).toEqual([{ conversationId: leads.id, userId: outsider.userId }])
+ const { got, expected } = ids.revokes(after => { group(after, ids.s.secretGroup).kind = 'leads' })
+ expect(expected).toEqual([{ conversationId: ids.s.secretGroup, userId: owner.userId }, { conversationId: ids.s.secretGroup, userId: peer.userId }])
expect(got.conditions).toEqual(expected)
})
diff --git a/backend/src/superTabs/native.ts b/backend/src/superTabs/native.ts
index 9cfb2859b..32b2ecda8 100644
--- a/backend/src/superTabs/native.ts
+++ b/backend/src/superTabs/native.ts
@@ -3,7 +3,7 @@ import type { Prisma, SuperTabNativeContext } from '@prisma/client'
import { z } from 'zod'
import type { AuthUser } from '../lib/ssoAuth.js'
import { isTeamSession, TEAM_SESSION_LIMITED, TEAM_SESSION_MESSAGE } from '../lib/teamSession.js'
-import { activeWork, agent, appendPullRequestUrls, author, conversation, fail, isLeads, stableId, SuperTabError,
+import { activeWork, agent, appendPullRequestUrls, author, conversation, fail, stableId, SuperTabError,
type Actor, type Agent, type Author, type Conversation, type SuperTabState } from './model.js'
import { accessInputs, canReadGroup, groupProject, readConversation, watchersLost } from './projects.js'
import { mayDrive } from './terminal.js'
@@ -306,8 +306,8 @@ export function revokeConditions(before: SuperTabState, after: SuperTabState) {
for (const group of before.conversations) {
const current = groups.get(group.id)
if (!current || (current.archived && !group.archived)) conditions.push({ conversationId: group.id })
- // No terminal opens in the Leads conversation (open), so it holds no context to revoke.
- else if (!isLeads(current)) {
+ // The removed Leads conversation is nobody's to read (model.ts leadsRemoved), so whoever read a group that turns into one loses it.
+ else {
for (const member of after.people) {
const reader = { kind: 'person' as const, userId: member.id, email: member.email }
if (canReadGroup(before, reader, group) && !canReadGroup(after, reader, current)) conditions.push({ conversationId: group.id, userId: member.id })
diff --git a/backend/src/superTabs/parts/light.ts b/backend/src/superTabs/parts/light.ts
index 93a24dd37..739e678a2 100644
--- a/backend/src/superTabs/parts/light.ts
+++ b/backend/src/superTabs/parts/light.ts
@@ -80,8 +80,9 @@ const toPart = <T>(kind: PartKind, row: PartRow): Part<T> => ({ kind, key: row.k
export async function loadDeliveryParts(tx: Transaction, tabId: string, groupIds: string[], agentIds: string[], nativeAgentId?: string): Promise<SwarmParts> {
const head = await tx.swarmHead.findUnique({ where: { id: partId(tabId, 'head') } })
if (!head) throw Object.assign(new Error(`Swarm ${tabId} has no parts`), { code: 'PARTS_MISSING' })
- const { projects, leadsConversationId } = head.data as unknown as HeadData
- const keys = [...projects ? projects.map(p => p.leadConversationId) : ['lead'], leadsConversationId ?? '']
+ const { projects } = head.data as unknown as HeadData
+ // The removed Leads conversation is no longer read (model.ts leadsRemoved).
+ const keys = projects ? projects.map(p => p.leadConversationId) : ['lead']
const [members, agents] = await Promise.all([
tx.swarmMember.findMany({ where: { tabId, deleted: false } }),
tx.swarmAgent.findMany({ where: { tabId, deleted: false } }),
@@ -127,10 +128,10 @@ export async function loadLight(tx: Transaction, tabId: string,
if (!head) throw Object.assign(new Error(`Swarm ${tabId} has no parts`), { code: 'PARTS_MISSING' })
const live = { tabId, deleted: false }
const starts = (await delegate(tx, 'start').findMany({ where: opts.includeRecentStarts ? live : { ...live, finishedAt: null } })).map(row => toPart<AgentStart>('start', row))
- const { projects, leadsConversationId, invitations } = head.data as unknown as HeadData
+ const { projects, invitations } = head.data as unknown as HeadData
// Besides the Lead conversations and running work, the conversations a start or an invitation names: a reader sees
// those only alongside their conversation (model.ts visibleState).
- const working = [...projects ? projects.map(p => p.leadConversationId) : ['lead'], leadsConversationId ?? '',
+ const working = [...projects ? projects.map(p => p.leadConversationId) : ['lead'],
...starts.map(s => s.data!.request.conversationId), ...invitations.map(i => i.conversationId)]
// One read per index, never one $or over several: Mongo plans an $or again whenever its plan cache misses (parts/indexed.ts).
const keys = [...opts.groups === 'working' ? working : [], ...opts.groupIds ?? []]
diff --git a/backend/src/superTabs/parts/load.ts b/backend/src/superTabs/parts/load.ts
index df4806954..a63347527 100644
--- a/backend/src/superTabs/parts/load.ts
+++ b/backend/src/superTabs/parts/load.ts
@@ -3,7 +3,7 @@ import { delegate, extracted, partId, type PartRow } from './write.js'
import type { GroupData, HeadData, MachineData, Part, PartKind, SwarmParts } from './types.js'
import { PART_KINDS } from './types.js'
import { noteChange } from '../cache.js'
-import { stableId, type AgentStart } from '../model.js'
+import type { AgentStart } from '../model.js'
import { ms } from './light.js'
import { groupsBy, readBy, type GroupIndex, type NamedCollection } from './indexed.js'
@@ -78,9 +78,9 @@ export function loadActive(tx: Transaction, tabId: string,
export async function loadObserved(tx: Transaction, tabId: string, machineId: string): Promise<SwarmParts> {
const live = { deleted: false }
const loaded = await assemble(tx, tabId, { member: live, agent: live, machine: live, progress: null, start: { ...live, finishedAt: null }, group: [] })
- const { projects, leadsConversationId } = loaded.head.data!
- // A head that never stored the Leads conversation's id finds it where model.ts syncLeads would make it.
- const leads = [...projects ? projects.map(p => p.leadConversationId) : ['lead'], leadsConversationId ?? stableId(tabId, 'leads')]
+ const { projects } = loaded.head.data!
+ // The Lead conversations; the removed Leads conversation is no longer read (model.ts leadsRemoved).
+ const leads = projects ? projects.map(p => p.leadConversationId) : ['lead']
// One read per index (parts/indexed.ts); none of them reads a quiet conversation.
const groups = await liveGroups(tx, tabId, [['running', { executionMachineId: { $ne: null }, dormant: false }],
['key', { key: { $in: [...new Set([...leads, ...loaded.starts.map(s => s.data!.request.conversationId)])] }, dormant: false }]])
diff --git a/backend/src/superTabs/projects.test.ts b/backend/src/superTabs/projects.test.ts
index ef5691eaa..d6fb0c1aa 100644
--- a/backend/src/superTabs/projects.test.ts
+++ b/backend/src/superTabs/projects.test.ts
@@ -33,7 +33,7 @@ describe('projects inside an invite-only swarm', () => {
const original = f.run({ type: 'conversation.create', title: 'First', brief: '', checks: [] })
const p = f.project()
const next = f.run({ type: 'conversation.create', projectId: p.projectId, title: 'Second', brief: '', checks: [] })
- expect(f.state.conversations.map(c => c.number)).toEqual([undefined, 1, undefined, 2, undefined])
+ expect(f.state.conversations.map(c => c.number)).toEqual([undefined, 1, undefined, 2])
expect(f.state.conversations.map(c => c.id)).toContain(original.conversationId)
expect(next.number).toBe(2)
expect(() => f.run({ type: 'conversation.archive', conversationId: p.conversationId, archived: true })).toThrow('stays available')
@@ -44,7 +44,7 @@ describe('projects inside an invite-only swarm', () => {
const id = f.add(p.conversationId, 'private-lead')
const visible = visibleState(f.state, peer)
expect(visible.projects!.map(p => p.id)).toEqual(['lead'])
- expect(visible.conversations.map(c => c.id)).toEqual(['lead', f.state.leadsConversationId])
+ expect(visible.conversations.map(c => c.id)).toEqual(['lead'])
expect(visible.agents).toEqual([])
expect(canReadAgent(f.state, peer, f.state.agents[0]!)).toBe(false)
expect(() => readConversation(f.state, peer, p.conversationId)).toThrow('unavailable')
@@ -97,8 +97,8 @@ describe('projects inside an invite-only swarm', () => {
f.run({ type: 'invite.create', email: '[email protected]', role: 'collaborator', conversationId: 'lead' })
expect(f.run({ type: 'project.delete', projectId: 'lead' })).toEqual({})
expect(projectsOf(f.state)).toEqual([])
- // Only the Swarm-wide Leads conversation is left.
- expect(f.state.conversations.map(c => c.kind)).toEqual(['leads'])
+ // No conversation is left: a new Swarm has no Swarm-wide Leads conversation (model.ts leadsRemoved).
+ expect(f.state.conversations).toEqual([])
expect(f.state.invitations).toEqual([])
expect(f.state.project).toBeUndefined()
expect(f.state.machines?.map(m => m.machineId)).toEqual(['shared'])
diff --git a/backend/src/superTabs/projects.ts b/backend/src/superTabs/projects.ts
index afc8abb99..fa7944af8 100644
--- a/backend/src/superTabs/projects.ts
+++ b/backend/src/superTabs/projects.ts
@@ -1,5 +1,5 @@
import { createHash } from 'node:crypto'
-import { activeWork, agent, agentRole, author, conversation, fail, isLeads, nextConversationNumber, person, type Actor, type Agent, type Conversation, type Person, type SuperTabState } from './model.js'
+import { activeWork, agent, agentRole, author, conversation, fail, isLeads, leadsRemoved, nextConversationNumber, person, type Actor, type Agent, type Conversation, type Person, type SuperTabState } from './model.js'
import type { SwarmRule } from './rules.js'
import { buddyReads, isBuddy, isBuddyChat } from './buddies.js'
@@ -94,7 +94,7 @@ export function projectOf(state: SuperTabState, projectId: string): SwarmProject
}
export function groupProject(state: SuperTabState, group: Conversation): SwarmProject {
- if (isLeads(group)) fail('LEADS_CONVERSATION', 'The Leads conversation is only for messages between Leads and people.')
+ if (isLeads(group)) leadsRemoved()
return projectOf(state, group.projectId ?? 'lead')
}
@@ -107,8 +107,7 @@ export function ledProject(state: SuperTabState, agentId: string): SwarmProject
return projectsOf(state).find(p => state.conversations.some(c => c.id === p.leadConversationId && c.leadId === agentId))
}
-/** Whose active work other projects' Leads see and are alerted about. A private project's work stays with its own people:
- * the Leads conversation is read by the whole Swarm. */
+/** Whose active work other projects' Leads see and are alerted about. A private project's work stays with its own people. */
export const sharedWithLeads = (project: SwarmProject): boolean => project.visibility !== 'private'
export function canReadProject(state: SuperTabState, actor: Actor, project: SwarmProject): boolean {
@@ -130,10 +129,10 @@ export function readProject(state: SuperTabState, actor: Actor, projectId: strin
export function readConversation(state: SuperTabState, actor: Actor, conversationId: string): Conversation {
const group = conversation(state, conversationId)
+ // Removed for everyone alike (model.ts leadsRemoved): a member of the Swarm reads one plain refusal, nothing of it.
if (isLeads(group)) {
author(state, actor)
- if (actor.kind === 'agent' && !ledProject(state, actor.agentId)) fail('NOT_FOUND', 'This conversation is unavailable.', 404)
- return group
+ leadsRemoved()
}
readProject(state, actor, groupProject(state, group).id)
if (!canReadGroup(state, actor, group)) fail('NOT_FOUND', 'This conversation is unavailable.', 404)
@@ -148,7 +147,7 @@ export const PRIVATE_VISIBLE_TO_OWNERS = false
* one any more, and nobody reads one, the PM and its person included; its rows stay in the database. */
export const isClosedPmChat = (group: Pick<Conversation, 'kind' | 'audience'>): boolean => !!group.audience && !isBuddyChat(group)
-/** Who reads a conversation: the Leads conversation's people and Leads; a project conversation's readers; and a Buddy
+/** Who reads a conversation: nobody the removed Leads conversation (model.ts leadsRemoved); a project conversation's readers; and a Buddy
* chat's owner and Buddy (buddies.ts), the PM never. A closed Chat with PM is nobody's. A Buddy reads what its person
* reads of its project, no private conversation but its own chat (buddies.ts). */
export function canReadGroup(state: SuperTabState, actor: Actor, group: Conversation): boolean {
@@ -158,7 +157,7 @@ export function canReadGroup(state: SuperTabState, actor: Actor, group: Conversa
/** Whether [actor] reads what was asked in [group] (decisions.ts): as canReadGroup, and in a closed Chat with PM still its
* person, at the generation they were listed with, and the project's Lead, so a decision asked there before stays theirs. */
export function readsRecordsIn(state: SuperTabState, actor: Actor, group: Conversation): boolean {
- if (isLeads(group)) return actor.kind === 'person' ? state.people.some(p => p.id === actor.userId) : !!ledProject(state, actor.agentId)
+ if (isLeads(group)) return false
const project = groupProject(state, group)
if (!canReadProject(state, actor, project)) return false
const buddy = actor.kind === 'agent' ? state.agents.find(a => a.id === actor.agentId && isBuddy(a)) : undefined
diff --git a/backend/src/superTabs/read/hostRows.ts b/backend/src/superTabs/read/hostRows.ts
index 40aaa8a54..0262e73c6 100644
--- a/backend/src/superTabs/read/hostRows.ts
+++ b/backend/src/superTabs/read/hostRows.ts
@@ -87,7 +87,8 @@ function agentRow(tabId: string, state: SuperTabState, machineId: string, user:
coordinatorName: coordinatorNameOf(home) } : null,
...(custom ? { role: chosen && { ...chosen, projectId: custom.id } } : {}),
lead: !!ledProject(state, target.id),
- leadsConversationId: state.leadsConversationId ?? null,
+ // Removed (model.ts leadsRemoved); an older CLI still reads the field, so it stays, always empty.
+ leadsConversationId: null,
stopRequested: target.workDecision === 'stop' && !state.conversations.some(c => activeWork(c) && c.assignment?.agentId === target.id),
observers: lookups.people.filter(p => p.id !== user.sub && canWatchAgent(state, { kind: 'person', userId: p.id, email: p.email }, target, closed))
.map(p => ({ email: p.email, userId: p.id })),
diff --git a/backend/src/superTabs/read/inbox.ts b/backend/src/superTabs/read/inbox.ts
index e253f5c08..72f54ae0d 100644
--- a/backend/src/superTabs/read/inbox.ts
+++ b/backend/src/superTabs/read/inbox.ts
@@ -104,14 +104,15 @@ async function readable(db: PrismaClient, tabId: string, rows: Row[]): Promise<R
return shown.filter(m => !copies.has(m.id))
}
-/** Whether the messages read lets `actor` read `group`: the same check. Only its "unavailable" answer means this chat is not
- * theirs; any other refusal (no longer a member) refuses the whole read, as it refuses every chat's page. */
+/** Whether the messages read lets `actor` read `group`: the same check. Only its "unavailable" or "removed" answer (an older
+ * Swarm's stored Leads conversation, model.ts leadsRemoved) means this chat is not theirs; any other refusal (no longer a
+ * member) refuses the whole read, as it refuses every chat's page. */
function readsChat(state: SuperTabState, actor: Actor, group: Conversation): boolean {
try {
readConversation(state, actor, group.id)
return true
} catch (error) {
- if (error instanceof SuperTabError && error.code === 'NOT_FOUND') return false
+ if (error instanceof SuperTabError && (error.code === 'NOT_FOUND' || error.code === 'LEADS_CONVERSATION_REMOVED')) return false
throw error
}
}
diff --git a/backend/src/superTabs/read/views.test.ts b/backend/src/superTabs/read/views.test.ts
index a5fdd5951..8ab409b4e 100644
--- a/backend/src/superTabs/read/views.test.ts
+++ b/backend/src/superTabs/read/views.test.ts
@@ -1,4 +1,5 @@
import { describe, expect, it } from 'vitest'
+import { storeOldLeads } from '../leads.test-support.js'
import * as store from '../parts/index.js'
import { readerView } from './views.js'
import { NOW, outsider, owner, peer, richSwarm } from './fixture.test-support.js'
@@ -78,12 +79,15 @@ describe('reader view of the parts (design 4.1, 4.3)', () => {
for (const hidden of ['reportSeq', 'lastActivityAt', 'dormant', 'audience']) expect(web.data).not.toHaveProperty(hidden)
})
- it('shows the Leads conversation to people and Leads, not to another agent', () => {
- const { s, parts } = scene()
- const leads = s.state.leadsConversationId!
- expect(keys(readerView(parts, peer, NOW, { teamMachines: [] }).parts.groups)).toContain(leads)
- expect(keys(readerView(parts, agentActor(s.lead), NOW, { teamMachines: [] }).parts.groups)).toContain(leads)
- expect(keys(readerView(parts, agentActor(s.worker), NOW, { teamMachines: [] }).parts.groups)).not.toContain(leads)
+ it('shows an older Swarm\'s stored Leads conversation to nobody, its id neither (model.ts leadsRemoved)', () => {
+ const s = richSwarm()
+ s.edit(state => { storeOldLeads(state, [s.lead]) })
+ const parts = store.split(s.state, { tabId: 'tab', version: R, now: NOW })
+ for (const actor of [owner, peer, agentActor(s.lead), agentActor(s.worker)]) {
+ const view = readerView(parts, actor, NOW, { teamMachines: [] })
+ expect(keys(view.parts.groups)).not.toContain('old-leads')
+ expect(view.parts.head.data).not.toHaveProperty('leadsConversationId')
+ }
})
it('says to every reader that this server takes New session in a thread reply', () => {
diff --git a/backend/src/superTabs/read/views.ts b/backend/src/superTabs/read/views.ts
index 1c99de516..36d3e6347 100644
--- a/backend/src/superTabs/read/views.ts
+++ b/backend/src/superTabs/read/views.ts
@@ -6,7 +6,7 @@
import { suspendedEngines } from '../engineHealth.js'
import { leadChoices } from '../leadStart.js'
import { isBuddyChat, isBuddyReader } from '../buddies.js'
-import { agentForBuddy, agentWithoutMachine, groupWithoutMachines, isLeads, machineHiddenFrom, seenMachineIds, visibleState, withSeenRequirement, type Actor, type Agent, type Conversation, type SuperTabState } from '../model.js'
+import { agentForBuddy, agentWithoutMachine, groupWithoutMachines, machineHiddenFrom, seenMachineIds, visibleState, withSeenRequirement, type Actor, type Agent, type Conversation, type SuperTabState } from '../model.js'
import { slotCounter, machineTeamWork, teamAccountSwarm, type ContributedMachine } from '../machines.js'
import * as store from '../parts/index.js'
import type { Part, SwarmParts } from '../parts/index.js'
@@ -66,10 +66,9 @@ export function groupView(group: Conversation, seenMachines: ReadonlySet<string>
return { ...rest, messageSeq: messageSeq ?? 0, ...(dormant ? { dormant: true as const } : {}), ...readers }
}
-/** A conversation's whole data as the reader may see it: the Leads conversation lists only the agents the reader can see, and a
- * task's requirement only the machines they see. */
-export function visibleGroupView(group: Conversation, visibleAgents: ReadonlySet<string>, seenMachines: ReadonlySet<string>): GroupView {
- return groupView(isLeads(group) ? { ...group, agentIds: group.agentIds.filter(id => visibleAgents.has(id)) } : group, seenMachines)
+/** A conversation's whole data as the reader may see it: a task's requirement lists only the machines they see. */
+export function visibleGroupView(group: Conversation, _visibleAgents: ReadonlySet<string>, seenMachines: ReadonlySet<string>): GroupView {
+ return groupView(group, seenMachines)
}
/** The machines a reader's view shows them: listed, or running an agent they see (model.ts seenMachineIds). */
diff --git a/backend/src/superTabs/store.ts b/backend/src/superTabs/store.ts
index 6e62e27eb..a893e5643 100644
--- a/backend/src/superTabs/store.ts
+++ b/backend/src/superTabs/store.ts
@@ -55,7 +55,7 @@ import { activeMember, addMember, hasWorkspaceAccess, listWorkspaces, memberId,
import { WORKSPACE_LABEL, type WorkspaceRole } from './workspaces.js'
import {
activeWork, actorKey, agent, agentOnly, appendPullRequestUrls, author, conversation, createSuperTab, fail, person, stableId, visibleState, finishWorker,
- SuperTabError, isLeads, knownKind, parkLaterConversations, syncLeads, type Actor, type Agent, type Assignment, type Author, type CommandEffects, type Conversation, type MessageDraft, type Person, type SuperTabState,
+ SuperTabError, isLeads, knownKind, parkLaterConversations, type Actor, type Agent, type Assignment, type Author, type CommandEffects, type Conversation, type MessageDraft, type Person, type SuperTabState,
} from './model.js'
import { QUIET_CLAIM, type HoldReason } from './holdReason.js'
import { stuck } from './deliverySettle.js'
@@ -176,7 +176,6 @@ function loadedFrom(row: SwarmRow, parts: SwarmParts): Loaded {
freeze(parts)
const state = reassemble(parts, { share: true })
parkLaterConversations(state)
- syncLeads(state)
return { row, parts, state }
}
@@ -724,7 +723,6 @@ export class SuperTabStore {
const parts = await readParts(this.db, view ?? await this.view([tabId]), tabId, named)
const state = reassemble(parts, { share: true })
parkLaterConversations(state)
- syncLeads(state)
return { row, parts, state }
}
@@ -2388,12 +2386,12 @@ export class SuperTabStore {
await check(wide.slice(0, WIDE_WINDOW))
const readable = wide.slice(0, WIDE_WINDOW).filter(id => reads.get(id))
if (readable.length >= LIST_SIZE || wide.length <= WIDE_WINDOW) return readable.length ? recentDecisions(tx, tabId, [...new Set(readable)]) : []
- // Fewer than 100 of the reader's among the newest 500: an agent reads only its project's conversations (and the Leads
+ // Fewer than 100 of the reader's among the newest 500: an agent reads only its project's conversations (and the Lead
// conversations, by key); a person's can be any.
if (target) {
const project = target.projectId!
adopt(await loadLightGroups(tx, tabId, 'project', { projectId: { $in: project === 'lead' ? ['lead', null] : [project] }, dormant: true }))
- const leads = [state.leadsConversationId, ...projectsOf(state).map(p => p.leadConversationId)].filter((id): id is string => !!id && !groups.has(id))
+ const leads = projectsOf(state).map(p => p.leadConversationId).filter((id): id is string => !!id && !groups.has(id))
if (leads.length) adopt(await loadLightGroups(tx, tabId, 'key', { key: { $in: leads } }))
} else {
adopt(await loadLightGroups(tx, tabId, 'dormancy', { dormant: true }))
@@ -2775,17 +2773,18 @@ export class SuperTabStore {
const target = state.agents.find(a => a.id === delivery.agentId)
const group = state.conversations.find(c => c.id === delivery.conversationId)
if (!target || target.membershipGeneration !== delivery.membershipGeneration || !group || group.archived) return false
+ // The removed Leads conversation hands out nothing, a delivery stored before its removal included (model.ts leadsRemoved).
+ if (isLeads(group)) return false
// A Buddy also hears its person's news outside its chat (buddyNews.ts), only where it reads as its person would (below).
- if (!group.agentIds.includes(target.id) && (!isBuddy(target) || isLeads(group))) return false
+ if (!group.agentIds.includes(target.id) && !isBuddy(target)) return false
const sender = delivery.authorKind === 'person' ? state.people.find(p => p.id === delivery.authorId) : state.agents.find(a => a.id === delivery.authorId)
if (!sender) return false
const actor: Actor = delivery.authorKind === 'person'
? { kind: 'person', userId: delivery.authorId, email: '' }
: { kind: 'agent', agentId: delivery.authorId, machineOwnerId: (sender as Agent).machineOwnerId }
- // The Leads conversation belongs to no project: its members are the Leads, and an agent posts there only as a Lead.
// A private conversation's sender and receiver must still be in its audience or be its Lead (projects.ts canReadGroup).
- if (isLeads(group) ? actor.kind === 'agent' && !ledProject(state, actor.agentId) : !canReadGroup(state, actor, group)) return false
- if (!canReadAgent(state, { kind: 'agent', agentId: target.id, machineOwnerId: target.machineOwnerId }, target) || !isLeads(group) &&
+ if (!canReadGroup(state, actor, group)) return false
+ if (!canReadAgent(state, { kind: 'agent', agentId: target.id, machineOwnerId: target.machineOwnerId }, target) ||
!canReadGroup(state, { kind: 'agent', agentId: target.id, machineOwnerId: target.machineOwnerId }, group)) return false
const generation = 'generation' in sender ? sender.generation : sender.membershipGeneration
return generation === delivery.authorGeneration && (!('role' in sender) || sender.role !== 'viewer')
@@ -3015,7 +3014,6 @@ export class SuperTabStore {
[agentId, ...delivery?.authorKind === 'agent' ? [delivery.authorId] : [], ...context ? [context.agentId] : []], context?.agentId)
const state = reassemble(parts, { share: true })
parkLaterConversations(state)
- syncLeads(state)
author(state, await this.actor(tx, user, state, agentId), true)
// The delivery pass ended a hold (it keeps the hold's reason) as its host, its terminal free again, typed it, or a claim
// whose acknowledgement could not get through for 10 minutes (QUIET_CLAIM): the host's own confirmation counts, or the
diff --git a/cli/src/lib/buddyGuard.ts b/cli/src/lib/buddyGuard.ts
index 5e251bb29..82dbd15e2 100644
--- a/cli/src/lib/buddyGuard.ts
+++ b/cli/src/lib/buddyGuard.ts
@@ -53,7 +53,7 @@ export const BUDDY_ENGINE_HOMES: Record<Exclude<AgentEngine, 'terminal'>, readon
/** Places in a home that hold secrets or other people's data (the Lead's list, 10-30): ssh, cloud, GitHub, ArgoCD and
* Harness credentials; keychains; browser profiles and mail; shell and database histories, which keep typed secrets; and
* the Claude Code and Codex folders, where agents on this machine keep transcripts and pasted Swarm messages from chats
- * the Buddy may not read (the Leads conversation, private chats, other projects). */
+ * the Buddy may not read (private chats, other projects, the Leads conversation from before its removal). */
const CLOSED_IN_HOME = ['.ssh', '.aws', '.azure', '.config/gcloud', '.gnupg', '.kube', '.docker', '.config/gh', '.config/hub', '.config/anthropic', '.config/argocd',
'.argocd', '.secrets', '.config/git/credentials', '.password-store', '.config/op', '.zsh_sessions', '.bash_sessions', '.local/share/fish',
'Library/Caches/claude-cli-nodejs', ...Object.values(BUDDY_ENGINE_HOMES).flat(),
diff --git a/cli/src/lib/swarmSkills.spec.ts b/cli/src/lib/swarmSkills.spec.ts
index 36b0202ed..e15d11f5f 100644
--- a/cli/src/lib/swarmSkills.spec.ts
+++ b/cli/src/lib/swarmSkills.spec.ts
@@ -87,8 +87,9 @@ describe('built-in Swarm skills', () => {
const sha = (text: string) => createHash('sha256').update(text).digest('hex')
// The approved terminal line (spec/2026-10-23-lead-sees-agent-terminal.md), the Lead's alone, in both modes.
const terminal = '- When a worker seems stuck, read its terminal; answer prompts within its task; ask the owner before approving anything risky.\n'
- // The approved overlap line (spec/2026-10-23-leads-see-and-talk.md, call 6), the Lead's alone, in both modes.
- const overlap = '- Before assigning, look at other projects\' active work; if your task touches the same code, say so in the Leads conversation and agree an order first.\n'
+ // The approved overlap line (spec/2026-10-23-leads-see-and-talk.md, call 6), the Lead's alone, in both modes; the Leads
+ // conversation it named is removed (Dee, 10-31), so the Lead says so in its own project chat.
+ const overlap = '- Before assigning, look at other projects\' active work; if your task touches the same code, say so in your project chat and let that work land first.\n'
// The Local models line (owner, 2026-10-23: the Lead considers Builders on local models; docs/plans/2026-10-23-swarm-local-models.md).
const local = '- Local models: when the Swarm serves one (a member\'s model, a shared API, a model shared with a member), the route may pick it for low-difficulty, well-specified work; it costs no subscription. Set "local":true in the route only when a person asks for a local model. When a person names a model, set "model" to their words ("deepseek 4.1 flash"): the route then offers that model alone. Start the pick with the gridModel and gridName the route gives, never a model or effort.\n'
const localDefault = '- Local models: the route may pick one for low-difficulty, well-specified work; set "local":true only when a person asks for one, set "model" to a model a person names, and start it with the route\'s gridModel and gridName.\n'
@@ -324,6 +325,15 @@ describe('built-in Swarm skills', () => {
const plain = readFileSync(prepareSwarmSkill(fixture(), { role: 'lead', key: 'session', mode: 'default' }).file, 'utf8')
expect(plain).toContain(`- The brief is all a Builder gets; never rely on chat history.\n${overlap}\n## 4. Keep work moving`)
})
+ // Dee, 10-31: the Leads (Product Managers) conversation is removed; no skill, in any role or mode, sends an agent there.
+ it('points no role at the removed Leads conversation, in either mode', () => {
+ for (const role of ['lead', 'dev', 'review', 'buddy'] as const) {
+ for (const mode of ['orchestration', 'default'] as const) {
+ expect(readFileSync(prepareSwarmSkill(fixture(), { role, key: 'session', mode }, folderOnly).file, 'utf8')).not.toMatch(/Leads conversation/)
+ }
+ }
+ expect(SWARM_TOOLS_SKILL).not.toMatch(/Leads conversation/)
+ })
it('adds the plan line right after each Lead skill\'s first routing rule', () => {
const orchestration = readFileSync(prepareSwarmSkill(fixture(), { role: 'lead', key: 'session' }).file, 'utf8')
expect(orchestration).toContain(`- Route each group before starting or assigning: difficulty, risk, size, why, needs. Use the pick, or override with a reason.\n${plan}`)
diff --git a/cli/src/lib/swarmSkills.ts b/cli/src/lib/swarmSkills.ts
index 3de2d5df9..c3829bf13 100644
--- a/cli/src/lib/swarmSkills.ts
+++ b/cli/src/lib/swarmSkills.ts
@@ -108,7 +108,7 @@ For large work, post the group plan and get the owner's ok before assigning; onc
- Local models: when the Swarm serves one (a member's model, a shared API, a model shared with a member), the route may pick it for low-difficulty, well-specified work; it costs no subscription. Set "local":true in the route only when a person asks for a local model. When a person names a model, set "model" to their words ("deepseek 4.1 flash"): the route then offers that model alone. Start the pick with the gridModel and gridName the route gives, never a model or effort.
- A failed start is retried elsewhere or reported, never left: when one fails, resume it; it starts once on the route's next machine, or tells the group and its requester. A task that requires a machine or device never moves: when its route says it waits, keep it queued and route it again once that machine can take it.
- The brief is all a Builder gets. Never pass your chat history; put everything needed in the brief.
-- Before assigning, look at other projects' active work; if your task touches the same code, say so in the Leads conversation and agree an order first.
+- Before assigning, look at other projects' active work; if your task touches the same code, say so in your project chat and let that work land first.
## 7. Run the work
- When a restart interrupts active work, read the recovery notice and its last recorded checkpoint, then check the agent’s actual session and saved work. Ask it to continue from that checkpoint and report working; either you or the assigned agent can clear the recovery block. Never replay old input or commands: they may already have taken effect. A delayed recording gap after fresh progress is not a new interruption. Keep work already in review in review while you inspect the session. Ordinary typed input, an expired recording view, a missing recorded prompt, or an unclassified gap from an older recorder does not establish that work was interrupted.
@@ -441,7 +441,7 @@ Keep each Builder's list a few tasks deep; do the easy, self-contained parts fir
- Local models: the route may pick one for low-difficulty, well-specified work; set "local":true only when a person asks for one, set "model" to a model a person names, and start it with the route's gridModel and gridName.
- A failed start is retried elsewhere or reported, never left: when one fails, resume it; it starts once on the route's next machine, or tells the group and its requester. A task that requires a machine or device never moves: when its route says it waits, keep it queued and route it again once that machine can take it.
- The brief is all a Builder gets; never rely on chat history.
-- Before assigning, look at other projects' active work; if your task touches the same code, say so in the Leads conversation and agree an order first.
+- Before assigning, look at other projects' active work; if your task touches the same code, say so in your project chat and let that work land first.
## 4. Keep work moving
- Each time you are woken, look at active work.
@@ -625,7 +625,7 @@ You are one person's Buddy for one project. You help them think a request throug
- Your owner may type to you in your terminal too. Answer them once, in your chat, as you would a chat message: to them, as "you", never about them; without repeating what you already sent; and without describing your own workings (commands, watchers, what you will send next).
- The project chat, for context: status names it. Read it; you cannot post there. The Swarm hands you the lines there that are news for your owner (below).
- The PM's private lines to your owner land in your chat too, written by the PM. They are for your owner: never answer them for your owner or take them as your instructions. Your owner answers the PM in the project chat, or through a proposal you send.
-- Nothing else. You read what your owner reads of this project, but no private chats, other people's Buddy chats, the Leads conversation or other projects, and the Swarm refuses every other command.
+- Nothing else. You read what your owner reads of this project, but no private chats, other people's Buddy chats or other projects, and the Swarm refuses every other command.
- The person whose machine runs you can see your terminal. If your owner starts on something they may not want seen there, say so once.
## Read the project's work
diff --git a/cli/src/lib/swarmTools.ts b/cli/src/lib/swarmTools.ts
index dc9977d7d..6e65a243f 100644
--- a/cli/src/lib/swarmTools.ts
+++ b/cli/src/lib/swarmTools.ts
@@ -27,7 +27,7 @@ Every command starts \`harness super-tab --tab TAB\` (your tab id is in your lau
\`post GROUP TEXT OPERATION_ID [--to AGENT]... [--reply-to MESSAGE_ID] [--attach PATH]... [--mention PERSON]...\`
- Answer a message once, inside its thread: \`--reply-to MESSAGE_ID\` puts your reply in that message's thread. Post at the top level only to start a new topic.
- \`--attach PATH\` sends a file (a screenshot, a log; up to 10 files of 10 MB each); TEXT may then be empty.
-- \`--mention PERSON\` tags a person by the id or email shown in status (up to 5), when you need them to act or decide; an @username or @email in TEXT tags too, outside code and links. Nobody is tagged in the Leads conversation, nor a person who cannot read the conversation.
+- \`--mention PERSON\` tags a person by the id or email shown in status (up to 5), when you need them to act or decide; an @username or @email in TEXT tags too, outside code and links. Nobody is tagged who cannot read the conversation.
- Quote TEXT so the shell keeps it one argument.
### Who a post reaches
diff --git a/cli/src/superTabs/fixtures/read/status-lead.json b/cli/src/superTabs/fixtures/read/status-lead.json
index 52832b472..ce1ffea57 100644
--- a/cli/src/superTabs/fixtures/read/status-lead.json
+++ b/cli/src/superTabs/fixtures/read/status-lead.json
@@ -114,21 +114,6 @@
"lastMessageSequence": 214010,
"pullRequestUrls": []
},
- {
- "id": "c00000000000000000000000",
- "kind": "leads",
- "title": "Leads",
- "leadId": null,
- "agentIds": [
- "a00000000000000000000001"
- ],
- "archived": false,
- "brief": "",
- "checks": [],
- "assignment": null,
- "lastMessageSequence": 213950,
- "pullRequestUrls": []
- },
{
"id": "c00000000000000000000002",
"projectId": "5000000000000000000000aa",
@@ -283,7 +268,6 @@
"creationId": "super-e00000000000000000000002"
}
],
- "leadsConversationId": "c00000000000000000000000",
"otherProjectsWork": [
{
"conversationId": "c0000000000000000000000f",
diff --git a/cli/src/superTabs/host.spec.ts b/cli/src/superTabs/host.spec.ts
index edc2e9a08..f8843657c 100644
--- a/cli/src/superTabs/host.spec.ts
+++ b/cli/src/superTabs/host.spec.ts
@@ -40,7 +40,7 @@ function setup(messageFields: Record<string, unknown> = {}, claimFields: Record<
const dir = mkdtempSync(join(tmpdir(), 'super-tab-host-')); roots.push(dir)
const listeners = new Set<(e: TurnDelivery) => void>()
const notices = new Set<(notice: BackendNotice) => void>()
- const row: { tabId: string; agent: { id: string; harnessId: string; machineId: string }; lead?: boolean; leadsConversationId: string } =
+ const row: { tabId: string; agent: { id: string; harnessId: string; machineId: string }; lead?: boolean; leadsConversationId?: string } =
{ tabId: 'tab', agent: { id: 'agent', harnessId: 'harness', machineId: 'machine-1' }, leadsConversationId: 'leads' }
/** The conversation the delivery comes from. */
let from = 'lead'
@@ -289,9 +289,9 @@ describe('Super Tab native delivery handoff', () => {
expect(t.saved().entries.delivery.stage).toBe('uncertain')
expect(t.core.turns.deliver).toHaveBeenCalledTimes(2)
})
- // Leads see each other's work and talk (spec 2026-10-23): the Leads conversation reaches Leads alone. The server
- // delivers it only to them; this host also never types it into an agent that leads nothing.
- it('never types a Leads conversation message into an agent that leads nothing, and says so once', async () => {
+ // Dee, 10-31: the Leads conversation is removed. The server takes no post there; a delivery still queued for it, from
+ // before, is typed into nobody, a Lead included, and said once.
+ it('never types a Leads conversation message into an agent, a Lead included, and says so once', async () => {
const t = setup(), host = t.open()
t.from('leads')
for (let i = 0; i < 3; i++) await host.tick()
@@ -299,22 +299,17 @@ describe('Super Tab native delivery handoff', () => {
expect(t.call).not.toHaveBeenCalledWith('POST', expect.stringContaining('/deliveries/delivery'), expect.anything())
expect(t.log.mock.calls.filter(([line]) => String(line).includes('not in a conversation'))).toHaveLength(1)
t.row.lead = true
- await host.tick()
- expect(t.core.turns.deliver).toHaveBeenCalledTimes(1)
+ for (let i = 0; i < 3; i++) await host.tick()
+ expect(t.core.turns.deliver).not.toHaveBeenCalled()
+ expect(t.log.mock.calls.filter(([line]) => String(line).includes('not in a conversation'))).toHaveLength(1)
})
- // The review of #1657: a Leads message held for a busy Lead must not be typed once that agent no longer leads.
- it('rechecks a held Leads conversation message after its agent stops being a Lead', async () => {
+ // A newer server names no Leads conversation in the roster: every other conversation is delivered as before.
+ it('delivers as before when the roster names no Leads conversation', async () => {
const t = setup(), host = t.open()
- t.row.lead = true
+ delete (t.row as { leadsConversationId?: string }).leadsConversationId
t.from('leads')
await host.tick()
expect(t.core.turns.deliver).toHaveBeenCalledTimes(1)
- t.event('rejected', 'team_waiting_busy')
- expect(t.saved().entries.delivery.stage).toBe('prepared')
- t.row.lead = false
- for (let i = 0; i < 3; i++) await host.tick()
- expect(t.core.turns.deliver).toHaveBeenCalledTimes(1)
- expect(t.saved().entries.delivery.stage).toBe('prepared')
})
// The design of #1726 (section 5.3): the roster names the Leads conversation, so no delivery costs a read of the Swarm.
it('reads no Swarm to judge a delivery, for an agent that leads nothing or a Lead', async () => {
@@ -326,7 +321,6 @@ describe('Super Tab native delivery handoff', () => {
expect(vi.mocked(t.call).mock.calls.some(([, path]) => path.includes('asAgentId='))).toBe(false)
const lead = setup()
lead.row.lead = true
- lead.from('leads')
await lead.open().tick()
expect(lead.core.turns.deliver).toHaveBeenCalledTimes(1)
expect(vi.mocked(lead.call).mock.calls.some(([, path]) => path.includes('asAgentId='))).toBe(false)
diff --git a/cli/src/superTabs/host.ts b/cli/src/superTabs/host.ts
index 1ea67367f..74aa8b39d 100644
--- a/cli/src/superTabs/host.ts
+++ b/cli/src/superTabs/host.ts
@@ -1487,12 +1487,12 @@ export class SuperTabHost {
this.persist()
}
- /** Leads see each other's work and talk (spec 2026-10-23): the Leads conversation reaches Leads alone. The server
- * delivers it only to them; an agent that leads nothing is also never given it here. The roster names the Leads
- * conversation, so this needs no read of the Swarm (design 2026-10-26 section 5.3); the server's delivery rules decide
- * every other conversation, a private one's audience included. */
+ /** The Leads conversation is removed (Dee, 10-31): the server takes no post there, and a delivery still queued for it from
+ * before reaches nobody, a Lead included. The roster names it while a server does, so this needs no read of the Swarm
+ * (design 2026-10-26 section 5.3); the server's delivery rules decide every other conversation, a private one's audience
+ * included. */
private mayRead(target: HostAgent, delivery: Json): boolean {
- if (target.lead === true || delivery.conversationId !== target.leadsConversationId) return true
+ if (typeof target.leadsConversationId !== 'string' || delivery.conversationId !== target.leadsConversationId) return true
if (!this.unreadable.has(delivery.id as string)) {
this.unreadable.add(delivery.id as string)
this.log(`Withheld delivery ${String(delivery.id)}: it is not in a conversation ${target.agent.harnessId} can read.`)
diff --git a/cli/src/superTabs/service.spec.ts b/cli/src/superTabs/service.spec.ts
index dd30e2ab3..9e0285b3a 100644
--- a/cli/src/superTabs/service.spec.ts
+++ b/cli/src/superTabs/service.spec.ts
@@ -364,12 +364,12 @@ it('explains starting an agent in a role of the instructions', async () => {
expect(answer.help.startRequest).toMatchObject({ roleName: 'ROLE' })
expect(JSON.stringify(answer.help)).not.toMatch(/Custom skills|roleId/)
})
-it('explains to the PM other projects\' work and the Leads conversation', async () => {
- const answer = await setup().ask({ action: 'help' }, owner) as { help: { status: string; leads: string } }
+// Dee, 10-31: the Leads (Product Managers) chat is gone; no help points an agent at it.
+it('explains to the PM other projects\' work, and points nobody at the removed Leads conversation', async () => {
+ const answer = await setup().ask({ action: 'help' }, owner) as { help: Record<string, unknown> }
expect(answer.help.status).toContain('The PM\'s status also lists otherProjectsWork: the active work of the Swarm\'s other projects')
- expect(answer.help.leads).toContain('leadsConversationId')
- expect(answer.help.leads).toContain('Only Leads (the projects\' PMs) and people post there, and only Leads among agents receive it.')
- expect(answer.help.leads).not.toContain('agree an order')
+ expect(answer.help).not.toHaveProperty('leads')
+ expect(JSON.stringify(answer.help)).not.toMatch(/Leads conversation|leadsConversationId/)
})
it('resolves a native caller to its exact contribution and rechecks it before every agent command', async () => {
const t = setup()
@@ -386,8 +386,8 @@ it('resolves a native caller to its exact contribution and rechecks it before ev
expect(await t.ask({ action: 'status', tabId: 'tab', agentId: t.agentId }, owner)).toMatchObject({ error: 'AGENT_UNAVAILABLE' })
})
-// Leads see each other's work and talk (spec 2026-10-23): a Lead's status carries other projects' active work, in the
-// backend's own fields and nothing more; an agent that leads nothing never sees it nor the Leads conversation.
+// Leads see each other's work (spec 2026-10-23): a Lead's status carries other projects' active work, in the backend's own
+// fields and nothing more; an agent that leads nothing never sees it. Nobody reads the removed Leads conversation (10-31).
describe('other projects\' work in status', () => {
const work = { conversationId: 'docs-roster', projectName: 'Docs', title: 'Roster', owns: ['desktop/lib/super_tabs'], status: 'review',
agentName: 'Builder', pr: 'https://github.com/example/project/pull/12' }
@@ -406,8 +406,9 @@ describe('other projects\' work in status', () => {
swarm(t, t.agentId)
const state = await status(t)
expect(state.otherProjectsWork).toEqual([work])
- expect(state.leadsConversationId).toBe('leads')
- expect(list(state.conversations).map(c => c.id)).toEqual(['pilot', 'leads'])
+ // Dee, 10-31: the Leads conversation is removed; a Lead no longer reads it either, even from an older server.
+ expect(state).not.toHaveProperty('leadsConversationId')
+ expect(list(state.conversations).map(c => c.id)).toEqual(['pilot'])
})
it('shows the Lead of a Swarm from before projects that work too', async () => {
diff --git a/cli/src/superTabs/service.ts b/cli/src/superTabs/service.ts
index 86c806cf6..21e00730a 100644
--- a/cli/src/superTabs/service.ts
+++ b/cli/src/superTabs/service.ts
@@ -45,7 +45,7 @@ const POST_HELP = `${POST_ABOUT} TEXT is one argument: when it holds quotes, or
* hint was refused and tried again, so its help passes the message in quotes, as the guard's refusal says. */
const BUDDY_POST_HELP = `${POST_ABOUT} TEXT is one argument, the message itself in quotes: 'your message', or "it's done" when it holds an apostrophe. A Buddy never passes - for TEXT: its message is checked for secrets, so one read from stdin is refused and nothing is posted.`
const POST_FLAGS = '[--to AGENT]... [--reply-to MESSAGE_ID] [--attach PATH]... [--mention PERSON]...'
-const MENTION_HELP = ' --mention tags a person, by the id or email shown in status (up to 5), when you need them to act or decide; it shows in their notifications. An @username or @email in TEXT tags that person as well, outside code and links. Nobody is tagged in the Leads conversation, nor a person who cannot read the conversation.'
+const MENTION_HELP = ' --mention tags a person, by the id or email shown in status (up to 5), when you need them to act or decide; it shows in their notifications. An @username or @email in TEXT tags that person as well, outside code and links. Nobody is tagged who cannot read the conversation.'
/** What the command entry says after how its JSON is passed, the same for everyone. A task's review plan (#2382) is said in
* its brief (backend superTabs/model.ts renderWorkTask), for whoever opens its review (project instructions, phase 4). */
const COMMAND_ABOUT = 'send one of the commands below.'
@@ -67,7 +67,6 @@ async function finishingWith(core: CoreApi, command: Record<string, unknown>, ha
* is the project's instructions', never this help's. */
const HELP = {
status: 'Read the shared tab roster and work: people, projects, agents, conversations and their tasks. How the project routes work is in its instructions (instructions). The PM\'s status also lists otherProjectsWork: the active work of the Swarm\'s other projects (group, project, title, owned code, status, agent, PR), read only.',
- leads: 'The Leads conversation (leadsConversationId in the PM\'s status) is one conversation for the whole Swarm, outside every project. Only Leads (the projects\' PMs) and people post there, and only Leads among agents receive it. otherProjectsWork shows what the other projects work on; the Swarm posts there by itself when two projects\' active tasks own the same code.',
messages: 'messages GROUP: read recent messages in a conversation, thread replies included: each names its thread, the root message it answers there. A post with --reply-to lands in that message\'s thread. messages GROUP --thread ROOT reads one thread, its root and replies; a Buddy\'s thread session also gets there, as context, the main-chat messages it started from.',
message: 'message GROUP MESSAGE_ID: read one exact message, including an earlier question or result referenced by a reply.',
instructions: 'instructions [PROJECT]: print your project\'s instructions (its roles, workflow and routing) and the coordinator\'s notes, each with its id. Work by them; ask the coordinator, or a person, to change them.',
@@ -145,16 +144,18 @@ function isLead(state: Record<string, unknown>, agentId: string): boolean {
return list(state.conversations).some(c => leads.includes(c.id) && c.leadId === agentId)
}
-/** Leads see each other's work and talk (spec 2026-10-23): a Lead reads other projects' active work in the backend's
- * fields alone; any other agent reads neither it nor the Leads conversation, even from a server that sent it. */
+/** Leads see each other's work (spec 2026-10-23): a Lead reads other projects' active work in the backend's fields alone;
+ * any other agent reads none of it. Nobody reads the Leads conversation, removed on 10-31, even from an older server
+ * that still sends it. */
function statusView(answer: Record<string, unknown>, agentId: string): Record<string, unknown> {
const { otherProjectsWork, leadsConversationId, ...state } = object(answer.state)
+ const conversations = list(state.conversations).filter(c => c.kind !== 'leads' && (leadsConversationId == null || c.id !== leadsConversationId))
if (isLead(state, agentId)) {
- return { ...answer, state: { ...state, ...(leadsConversationId !== undefined ? { leadsConversationId } : {}),
+ return { ...answer, state: { ...state, conversations,
...(Array.isArray(otherProjectsWork) ? { otherProjectsWork: list(otherProjectsWork).map(work =>
Object.fromEntries(OTHER_WORK_FIELDS.filter(key => key in work).map(key => [key, work[key]]))) } : {}) } }
}
- return { ...answer, state: { ...state, conversations: list(state.conversations).filter(c => c.kind !== 'leads' && c.id !== leadsConversationId) } }
+ return { ...answer, state: { ...state, conversations } }
}
/** A post's mentions name people by id or email; the backend takes person ids. A name that is nobody in the Swarm is refused
diff --git a/desktop/lib/super_tabs/message_receipt.dart b/desktop/lib/super_tabs/message_receipt.dart
index 927c1d6e1..f00cdba3b 100644
--- a/desktop/lib/super_tabs/message_receipt.dart
+++ b/desktop/lib/super_tabs/message_receipt.dart
@@ -194,9 +194,6 @@ class _SuperTabMessageReceiptState extends State<SuperTabMessageReceipt>
}
} else if (delivery == null &&
c.selected?.leadId == null &&
- // Every person reads the Product Managers' conversation; a post there
- // stands even before any Product Manager receives it.
- c.selected?.id != c.snapshot?.leadsConversationId &&
// A Buddy chat has no Lead: its Buddy takes the message.
c.selected?.isBuddyChat != true) {
title = 'Not sent · this chat has no Lead';
diff --git a/desktop/lib/super_tabs/model.dart b/desktop/lib/super_tabs/model.dart
index 942d44baf..683a069a4 100644
--- a/desktop/lib/super_tabs/model.dart
+++ b/desktop/lib/super_tabs/model.dart
@@ -247,10 +247,8 @@ class SuperTabTask {
class SuperTabConversation {
SuperTabConversation.fromJson(Map<String, dynamic> row)
: id = _text(row, 'id'),
- // The Product Managers' conversation belongs to no project; a group from
- // before projects belongs to the first.
- projectId =
- row['projectId'] as String? ?? (row['kind'] == 'leads' ? '' : 'lead'),
+ // A group from before projects belongs to the first.
+ projectId = row['projectId'] as String? ?? 'lead',
kind = row['kind'] as String?,
buddyOwnerId = row['buddyOwnerId'] as String?,
buddyName = row['buddyName'] as String?,
@@ -304,8 +302,8 @@ class SuperTabConversation {
: null;
final String id, projectId, title, brief;
- /// What the backend calls it apart from a workgroup: `leads` for the Product
- /// Managers' conversation, `buddy` for a person's chat with their Buddy.
+ /// What the backend calls it apart from a workgroup: `buddy` for a person's
+ /// chat with their Buddy. A `leads` one is never kept ([SuperTabSnapshot]).
final String? kind;
bool get isBuddyChat => kind == 'buddy';
@@ -420,15 +418,19 @@ class SuperTabSnapshot {
row['machines'] ?? const [],
(m) => Map<String, dynamic>.unmodifiable(m),
),
- conversations = _list(
- row['conversations'],
- SuperTabConversation.fromJson,
+ // The Product Managers chat is gone (Dee, 2026-10-31): an older server
+ // still sends it, by its kind or the id the head names, and no screen
+ // may list or open it.
+ conversations = List.unmodifiable(
+ _list(
+ row['conversations'],
+ SuperTabConversation.fromJson,
+ ).where((g) => g.kind != 'leads' && g.id != row['leadsConversationId']),
),
invitations = _list(
row['invitations'],
(row) => Map<String, dynamic>.unmodifiable(row),
),
- leadsConversationId = row['leadsConversationId'] as String?,
startEfforts = Map.unmodifiable({
for (final start
in row['starts'] is List ? row['starts'] as List : const [])
@@ -511,10 +513,6 @@ class SuperTabSnapshot {
/// kept on this device leaves them out).
final Map<String, String> startEfforts;
- /// Where the projects' Product Managers talk, Swarm-wide; null in a Swarm
- /// from before it (spec 2026-10-23-leads-see-and-talk.md).
- final String? leadsConversationId;
-
/// The Local models add-on, once the owner has turned it on; null before.
final SuperTabLocalModels? localModels;
diff --git a/desktop/lib/super_tabs/project_sidebar.dart b/desktop/lib/super_tabs/project_sidebar.dart
index 2dcac7fd4..93e4d9b8a 100644
--- a/desktop/lib/super_tabs/project_sidebar.dart
+++ b/desktop/lib/super_tabs/project_sidebar.dart
@@ -29,9 +29,6 @@ import 'task_status.dart';
import 'workgroup_name.dart';
import 'project_github.dart';
-/// The Swarm's Product Managers' conversation, listed as a channel among the projects.
-const kProductManagersChannel = 'product-managers';
-
class ProjectSidebar extends StatelessWidget {
const ProjectSidebar({
super.key,
@@ -172,7 +169,6 @@ class ProjectSidebar extends StatelessWidget {
Widget _row(
SuperTabConversation group, {
_ProjectReading? reading,
- String? label,
String? key,
}) {
final project = reading?.project;
@@ -189,7 +185,6 @@ class ProjectSidebar extends StatelessWidget {
return _drawRow(
group,
project: project,
- label: label,
key: key,
selected: selected,
waiting: waiting,
@@ -236,7 +231,6 @@ class ProjectSidebar extends StatelessWidget {
Widget _drawRow(
SuperTabConversation group, {
SuperTabProject? project,
- String? label,
String? key,
required bool selected,
required bool waiting,
@@ -259,7 +253,7 @@ class ProjectSidebar extends StatelessWidget {
// Unread is the name in bold and nothing else, no dot (Dee, 2026-10-29).
final style = DesktopChrome.control(
medium: highlighted,
- color: highlighted || unread || project != null || label != null
+ color: highlighted || unread || project != null
? DesktopChrome.foreground
: DesktopChrome.muted,
).copyWith(fontWeight: unread ? grid.AppFont.semibold : null);
@@ -288,9 +282,7 @@ class ProjectSidebar extends StatelessWidget {
SizedBox(width: SuperTabSectionHeading.indentFor(0)),
SizedBox(
width: _iconColumn,
- child: project != null || label != null
- ? _channelMark()
- : null,
+ child: project != null ? _channelMark() : null,
),
Expanded(
child: Semantics(
@@ -300,10 +292,9 @@ class ProjectSidebar extends StatelessWidget {
selected: selected,
child: _withTaskStatus(
group,
- task: label == null && project == null,
+ task: project == null,
(status) => Tooltip(
message:
- label ??
project?.name ??
[
SuperTabWorkgroupName.plain(group),
@@ -321,7 +312,7 @@ class ProjectSidebar extends StatelessWidget {
child: Row(
children: [
Expanded(
- child: label == null && project == null
+ child: project == null
? Column(
crossAxisAlignment:
CrossAxisAlignment.start,
@@ -347,18 +338,17 @@ class ProjectSidebar extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
Text(
- label ?? project!.name,
+ project.name,
maxLines: 1,
overflow:
TextOverflow.ellipsis,
style: style,
),
// Teammates' agents cannot push to its repository yet (project_github.dart).
- if (project != null)
- ProjectGitHubLine(
- controller: controller,
- project: project,
- ),
+ ProjectGitHubLine(
+ controller: controller,
+ project: project,
+ ),
],
),
),
@@ -399,7 +389,7 @@ class ProjectSidebar extends StatelessWidget {
),
),
)
- : label == null && project == null
+ : project == null
? SuperTabTaskMark(group)
: null,
),
@@ -755,15 +745,11 @@ class ProjectSidebar extends StatelessWidget {
];
}
- /// Every project with its workgroups, and the Product Managers'
- /// conversation, which every person in the Swarm reads, by name from A to Z.
+ /// Every project with its workgroups, by name from A to Z.
List<(String, Widget)> _channels(
SuperTabSnapshot? snapshot,
_SidebarReading reading,
) => [
- if (snapshot?.conversation(snapshot.leadsConversationId ?? '')
- case final leads?)
- (kProductManagersChannel, _row(leads, label: kProductManagersChannel)),
for (final project in snapshot?.projects ?? const <SuperTabProject>[])
if (reading.of(project) case final read when read.lead != null)
(
diff --git a/desktop/lib/super_tabs/pull_requests.dart b/desktop/lib/super_tabs/pull_requests.dart
index bcf3ab29e..dd5c585ef 100644
--- a/desktop/lib/super_tabs/pull_requests.dart
+++ b/desktop/lib/super_tabs/pull_requests.dart
@@ -87,11 +87,8 @@ class _SuperTabPullRequestsState extends State<SuperTabPullRequests> {
SuperTabController get c => widget.controller;
bool get _active =>
widget.visible && _tickers && (widget.app?.foreground.value ?? true);
- // The Product Managers' conversation belongs to no project, whatever was
- // chosen in a workgroup before.
bool get _projectScope =>
- c.selectedId != c.snapshot?.leadsConversationId &&
- (_all || c.snapshot?.isProjectLead(c.selectedId) == true);
+ _all || c.snapshot?.isProjectLead(c.selectedId) == true;
List<SuperTabConversation> get _groups =>
c.snapshot?.conversations
.where(
@@ -486,8 +483,7 @@ class _SuperTabPullRequestsState extends State<SuperTabPullRequests> {
const SizedBox(width: 8),
if (c.snapshot?.isProjectLead(c.selectedId) == true)
Text('This project', style: DesktopChrome.metadata())
- // The Product Managers' conversation belongs to no project.
- else if (c.selectedId != c.snapshot?.leadsConversationId)
+ else
DropdownButton<bool>(
value: _all,
underline: const SizedBox.shrink(),
diff --git a/desktop/lib/super_tabs/quick_switcher.dart b/desktop/lib/super_tabs/quick_switcher.dart
index efbff497d..c8710e876 100644
--- a/desktop/lib/super_tabs/quick_switcher.dart
+++ b/desktop/lib/super_tabs/quick_switcher.dart
@@ -17,7 +17,6 @@ import 'dialog_scope.dart';
import 'identity.dart';
import 'model.dart';
import 'profile_sheet.dart';
-import 'project_sidebar.dart' show kProductManagersChannel;
const _gap = grid.AppDesktop.controlGap;
@@ -219,8 +218,6 @@ bool _readable(SuperTabController c, SuperTabConversation? g) {
if (c.accessRevoked || g == null) return false;
if (c.hiddenByBuddies(g)) return false;
if (g.isBuddyChat) return g.buddyOwnerId == c.accountId;
- // Match the sidebar: the server returned this channel for this reader.
- if (g.id == c.snapshot?.leadsConversationId) return true;
if (g.audience != null && !g.audience!.contains(c.accountId)) return false;
return c.snapshot?.projects.any((p) => p.id == g.projectId) == true;
}
@@ -251,14 +248,8 @@ List<_Destination> _destinations(SuperTabController c) {
if (_readable(c, g))
_Destination(
'conversation:${g.id}',
- g.id == s.leadsConversationId
- ? kProductManagersChannel
- : s.isProjectLead(g.id)
- ? projects[g.projectId]!.name
- : g.label,
- g.id == s.leadsConversationId
- ? 'Swarm chat'
- : g.isBuddyChat
+ s.isProjectLead(g.id) ? projects[g.projectId]!.name : g.label,
+ g.isBuddyChat
? 'Your Buddy'
: s.isProjectLead(g.id)
? 'Project chat'
diff --git a/desktop/lib/super_tabs/roster.dart b/desktop/lib/super_tabs/roster.dart
index b66b7181a..4f6bd6c75 100644
--- a/desktop/lib/super_tabs/roster.dart
+++ b/desktop/lib/super_tabs/roster.dart
@@ -572,13 +572,8 @@ class _SuperTabRosterState extends State<SuperTabRoster> {
const SizedBox(height: DesktopChrome.groupGap),
SuperTabSectionHeading(
'Agents',
- // An agent joins the Product Managers' conversation by leading a project,
- // and a private conversation holds only the project's Lead.
- onAdd:
- c.canWrite &&
- c.selected != null &&
- c.selected!.id != c.snapshot?.leadsConversationId &&
- audience == null
+ // A private conversation holds only the project's Lead.
+ onAdd: c.canWrite && c.selected != null && audience == null
? () => widget.onAddAgent(c.selected!)
: null,
addTooltip: 'Add agent',
diff --git a/desktop/lib/super_tabs/thread_panel.dart b/desktop/lib/super_tabs/thread_panel.dart
index 2aa13b395..049d4c910 100644
--- a/desktop/lib/super_tabs/thread_panel.dart
+++ b/desktop/lib/super_tabs/thread_panel.dart
@@ -19,7 +19,6 @@ import 'controller.dart';
import 'jump_to_latest.dart';
import 'model.dart';
import 'thread_scroll.dart';
-import 'project_sidebar.dart' show kProductManagersChannel;
/// One thread beside the chat (Dee, 2026-10-29): its root, a "N replies"
/// divider, the replies, and a composer whose reply goes to the root.
@@ -149,12 +148,8 @@ class _SuperTabThreadPanelState extends State<SuperTabThreadPanel> {
List<String> get _alsoSendLabels {
final group = c.selected, snapshot = c.snapshot;
String? channel;
- if (group != null && snapshot != null) {
- if (snapshot.isProjectLead(group.id)) {
- channel = snapshot.projectFor(group.id)?.name;
- } else if (group.id == snapshot.leadsConversationId) {
- channel = kProductManagersChannel;
- }
+ if (group != null && snapshot != null && snapshot.isProjectLead(group.id)) {
+ channel = snapshot.projectFor(group.id)?.name;
}
return channel == null
? const ['Also post to the main chat', 'Also to chat']
diff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dart
index 2bba0366a..e07bd0633 100644
--- a/desktop/lib/super_tabs/view.dart
+++ b/desktop/lib/super_tabs/view.dart
@@ -1048,15 +1048,13 @@ class _SuperTabViewState extends State<SuperTabView>
}
/// Who `@` offers: the people who read this conversation, then its agents,
- /// filtered by what follows the `@`. Never the reader; nobody is tagged in
- /// the Leads conversation, so it offers agents alone.
+ /// filtered by what follows the `@`. Never the reader.
List<_ComposerChoice> get _mentionChoices {
final mention = _mentionAtCursor;
final snapshot = c.snapshot, group = c.selected;
if (mention == null || snapshot == null || group == null) return const [];
final project = snapshot.projectFor(group.id);
bool reads(SuperTabPerson person) => switch (group) {
- _ when group.kind == 'leads' => false,
SuperTabConversation(:final audience?) => audience.contains(person.id),
_ when group.buddyOwnerId != null => person.id == group.buddyOwnerId,
_ =>
@@ -1968,8 +1966,6 @@ class _SuperTabViewState extends State<SuperTabView>
: 'Choose a project'
: c.snapshot!.isProjectLead(group.id)
? '# ${c.snapshot!.projectFor(group.id)!.name}'
- : group.id == c.snapshot!.leadsConversationId
- ? '# $kProductManagersChannel'
: _buddyName(group) == null
? null
: c.buddy(group.projectId) == null && group.buddyName == null
@@ -1985,15 +1981,12 @@ class _SuperTabViewState extends State<SuperTabView>
}
/// The composer's hint, naming the open conversation as its sidebar row
- /// does: "Message #openharness", "Message #product-managers", "Message Wren".
+ /// does: "Message #openharness", "Message Wren".
String _messageHint(SuperTabConversation group) {
final snapshot = c.snapshot!;
if (snapshot.isProjectLead(group.id)) {
return 'Message #${snapshot.projectFor(group.id)!.name}';
}
- if (group.id == snapshot.leadsConversationId) {
- return 'Message #$kProductManagersChannel';
- }
if (_buddyName(group) case final buddy?) return 'Message $buddy';
return 'Message ${group.title}';
}
@@ -2068,138 +2061,134 @@ class _SuperTabViewState extends State<SuperTabView>
);
}
- Widget _header(
- SuperTabConversation? group,
- bool narrow,
- bool showRoster,
- ) => Container(
- constraints: const BoxConstraints(minHeight: 52),
- padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 6),
- decoration: BoxDecoration(
- border: Border(bottom: BorderSide(color: DesktopChrome.rim)),
- ),
- child: Row(
- children: [
- if (narrow)
- fingerTarget(
- enabled: _phone,
- AppIconButton(
- icon: AppIcons.columns2,
- tooltip: 'Conversations',
- onPressed: () => setState(() => _sidebarOpen = !_sidebarOpen),
- ),
- ),
- Expanded(
- child: Padding(
- padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 8),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisSize: MainAxisSize.min,
- children: [
- // A view saved on this device, until the first read
- // replaces it ([SuperTabReading.drawsSaved]).
- if (c.showingSaved)
- Row(
- children: [
- Flexible(child: _title(group)),
- const SizedBox(width: 8),
- // Where the copy is; how long it stays and where
- // it is cleared, a hover or a long press away.
- Flexible(
- child: Tooltip(
- message:
- 'This browser keeps a copy of the Super '
- 'Tabs you open until you sign out. '
- 'Settings ▸ Account clears it now.',
- child: Text(
- 'Saved in this browser · Updating…',
- key: const ValueKey('super-updating'),
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: DesktopChrome.metadata(),
- ),
- ),
- ),
- ],
- )
- else
- _title(group),
- if (!_devicesVisible && !_notificationsVisible)
- ?_subtitle(group),
- ],
- ),
- ),
+ Widget _header(SuperTabConversation? group, bool narrow, bool showRoster) =>
+ Container(
+ constraints: const BoxConstraints(minHeight: 52),
+ padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 6),
+ decoration: BoxDecoration(
+ border: Border(bottom: BorderSide(color: DesktopChrome.rim)),
),
- if (group != null && !_devicesVisible && !_notificationsVisible) ...[
- fingerTarget(
- enabled: _phone,
- AppIconButton(
- key: const ValueKey('super-chat'),
- icon: AppIcons.messageSquare,
- size: AppIcons.inlineSize,
- tooltip: 'Chat',
- selected: !_terminalsVisible && !_showPullRequests,
- color: !_terminalsVisible && !_showPullRequests
- ? DesktopChrome.foreground
- : DesktopChrome.muted,
- onPressed: () {
- setState(() => _showPullRequests = false);
- widget.onCloseTerminal?.call();
- _readVisibleTailAfterFrame();
- WidgetsBinding.instance.addPostFrameCallback((_) {
- if (mounted) _focus.requestFocus();
- });
- },
- ),
- ),
- if (!_menuNamesViews) ...[
- const SizedBox(width: 4),
- AppIconButton(
- key: const ValueKey('super-terminals'),
- icon: AppIcons.terminal,
- size: AppIcons.inlineSize,
- tooltip: 'Group terminals (${group.agentIds.length})',
- selected: _terminalsVisible,
- color: _terminalsVisible
- ? DesktopChrome.foreground
- : DesktopChrome.muted,
- onPressed: _openTerminals(group),
- ),
- const SizedBox(width: 4),
- AppIconButton(
- key: const ValueKey('super-pull-requests'),
- focusNode: _pullRequestsFocus,
- icon: AppIcons.gitPullRequest,
- size: AppIcons.inlineSize,
- tooltip: 'Pull requests',
- selected: !_terminalsVisible && _showPullRequests,
- color: !_terminalsVisible && _showPullRequests
- ? DesktopChrome.foreground
- : DesktopChrome.muted,
- onPressed: _openPullRequests,
+ child: Row(
+ children: [
+ if (narrow)
+ fingerTarget(
+ enabled: _phone,
+ AppIconButton(
+ icon: AppIcons.columns2,
+ tooltip: 'Conversations',
+ onPressed: () => setState(() => _sidebarOpen = !_sidebarOpen),
+ ),
+ ),
+ Expanded(
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 8),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ // A view saved on this device, until the first read
+ // replaces it ([SuperTabReading.drawsSaved]).
+ if (c.showingSaved)
+ Row(
+ children: [
+ Flexible(child: _title(group)),
+ const SizedBox(width: 8),
+ // Where the copy is; how long it stays and where
+ // it is cleared, a hover or a long press away.
+ Flexible(
+ child: Tooltip(
+ message:
+ 'This browser keeps a copy of the Super '
+ 'Tabs you open until you sign out. '
+ 'Settings ▸ Account clears it now.',
+ child: Text(
+ 'Saved in this browser · Updating…',
+ key: const ValueKey('super-updating'),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: DesktopChrome.metadata(),
+ ),
+ ),
+ ),
+ ],
+ )
+ else
+ _title(group),
+ if (!_devicesVisible && !_notificationsVisible)
+ ?_subtitle(group),
+ ],
+ ),
+ ),
),
+ if (group != null &&
+ !_devicesVisible &&
+ !_notificationsVisible) ...[
+ fingerTarget(
+ enabled: _phone,
+ AppIconButton(
+ key: const ValueKey('super-chat'),
+ icon: AppIcons.messageSquare,
+ size: AppIcons.inlineSize,
+ tooltip: 'Chat',
+ selected: !_terminalsVisible && !_showPullRequests,
+ color: !_terminalsVisible && !_showPullRequests
+ ? DesktopChrome.foreground
+ : DesktopChrome.muted,
+ onPressed: () {
+ setState(() => _showPullRequests = false);
+ widget.onCloseTerminal?.call();
+ _readVisibleTailAfterFrame();
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ if (mounted) _focus.requestFocus();
+ });
+ },
+ ),
+ ),
+ if (!_menuNamesViews) ...[
+ const SizedBox(width: 4),
+ AppIconButton(
+ key: const ValueKey('super-terminals'),
+ icon: AppIcons.terminal,
+ size: AppIcons.inlineSize,
+ tooltip: 'Group terminals (${group.agentIds.length})',
+ selected: _terminalsVisible,
+ color: _terminalsVisible
+ ? DesktopChrome.foreground
+ : DesktopChrome.muted,
+ onPressed: _openTerminals(group),
+ ),
+ const SizedBox(width: 4),
+ AppIconButton(
+ key: const ValueKey('super-pull-requests'),
+ focusNode: _pullRequestsFocus,
+ icon: AppIcons.gitPullRequest,
+ size: AppIcons.inlineSize,
+ tooltip: 'Pull requests',
+ selected: !_terminalsVisible && _showPullRequests,
+ color: !_terminalsVisible && _showPullRequests
+ ? DesktopChrome.foreground
+ : DesktopChrome.muted,
+ onPressed: _openPullRequests,
+ ),
+ ],
+ fingerTarget(
+ enabled: _phone,
+ _options(group, views: _menuNamesViews),
+ ),
+ ],
+ if (!showRoster)
+ fingerTarget(
+ enabled: _phone,
+ AppIconButton(
+ icon: AppIcons.users,
+ tooltip: 'Members and machines',
+ selected: _rosterOpen,
+ onPressed: _toggleRoster,
+ ),
+ ),
],
- // Not a workgroup: nothing to rename, archive or detail — but
- // on a phone ⋮ still carries the views the bar leaves out.
- if (_menuNamesViews || group.id != c.snapshot!.leadsConversationId)
- fingerTarget(
- enabled: _phone,
- _options(group, views: _menuNamesViews),
- ),
- ],
- if (!showRoster)
- fingerTarget(
- enabled: _phone,
- AppIconButton(
- icon: AppIcons.users,
- tooltip: 'Members and machines',
- selected: _rosterOpen,
- onPressed: _toggleRoster,
- ),
- ),
- ],
- ),
- );
+ ),
+ );
/// The group's ⋮ menu. With [views] (a phone) it opens on the views the
/// header has no room for — the group's terminals and its pull requests —
@@ -2207,7 +2196,6 @@ class _SuperTabViewState extends State<SuperTabView>
Widget _options(SuperTabConversation group, {bool views = false}) {
final project = c.snapshot?.projectFor(group.id);
final isProject = c.snapshot?.isProjectLead(group.id) == true;
- final isLeads = group.id == c.snapshot?.leadsConversationId;
final editable = c.canWrite && !c.saving && !c.hasPendingAction;
Widget item(String label, VoidCallback? action) => MenuItemButton(
style: ButtonStyle(
@@ -2234,13 +2222,9 @@ class _SuperTabViewState extends State<SuperTabView>
_openTerminals(group),
),
item('Pull requests', _openPullRequests),
- if (!isLeads) const Divider(height: 9),
+ const Divider(height: 9),
],
- // The leads' conversation is no workgroup: nothing to rename, archive
- // or detail.
- if (isLeads)
- ...const <Widget>[]
- else if (isProject) ...[
+ if (isProject) ...[
if (editable && project?.ownerId == c.accountId)
item('Rename project', () => _groupAction('rename', group)),
item('Project details', () => _groupAction('details', group)),
diff --git a/desktop/test/super_tab_leads_test.dart b/desktop/test/super_tab_leads_test.dart
index 118025806..27def746a 100644
--- a/desktop/test/super_tab_leads_test.dart
+++ b/desktop/test/super_tab_leads_test.dart
@@ -1,28 +1,24 @@
-import 'dart:io';
-
import 'package:flutter/material.dart';
-import 'package:flutter/rendering.dart';
-import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
-import 'package:harness/shared/theme/app_icons.dart';
import 'package:harness/shared/theme/app_theme.dart' as grid;
-import 'package:harness/shared/widgets/app_icon_button.dart';
import 'package:harness/super_tabs/controller.dart';
-import 'package:harness/super_tabs/terminal_row.dart';
+import 'package:harness/super_tabs/model.dart';
import 'package:harness/super_tabs/view.dart';
-import 'support/capture.dart';
+import 'support/buddy_fixture.dart';
import 'support/super_tab_fixture.dart';
-/// The Swarm-wide conversation where the projects' Product Managers talk
-/// (spec 2026-10-23-leads-see-and-talk.md): not part of any project, found by
-/// the tab's `leadsConversationId`, shown above Projects for every person.
+/// The Product Managers ("product-managers") chat is gone (Dee, 2026-10-31):
+/// it was the Leads' cross-project room, not a project, and people did not
+/// know what it was for. The server no longer sends it; while an older server
+/// still does, Desktop drops it when it reads the Swarm, so no list shows it
+/// and nothing opens it.
void main() {
- final captureDir = Platform.environment['HARNESS_SUPER_TAB_CAPTURE'];
- setUpAll(() => loadCaptureFonts(captureDir));
-
- ConversationServer swarm({bool leads = true}) {
+ /// Two projects, the owner's Buddy chat and, as an older server still sends
+ /// it, the Leads conversation with messages in it.
+ ConversationServer swarm() {
final server = ConversationServer();
+ server.state['buddies'] = true;
server.state['projects'] = [
projectFixture('lead', 'openharness', 'lead'),
projectFixture('os', 'autonomous-os', 'os-lead'),
@@ -50,49 +46,47 @@ void main() {
'projectId': 'os',
'leadId': 'pm-2',
});
- if (leads) {
- // As the backend sends it: no project, kind `leads`.
- conversations.add({
- ...conversationFixture('leads', 'Leads'),
- 'kind': 'leads',
- 'agentIds': ['pm-1', 'pm-2'],
- });
- server.state['leadsConversationId'] = 'leads';
- }
+ conversations.add({
+ ...conversationFixture('leads', 'Leads'),
+ 'kind': 'leads',
+ 'agentIds': ['pm-1', 'pm-2'],
+ });
+ server.state['leadsConversationId'] = 'leads';
+ giveBuddy(
+ server,
+ person: 'owner',
+ id: 'sol',
+ name: 'Sol',
+ machineOwnerId: 'owner',
+ );
+ server.append(
+ 'I will take the roster file after #12 lands.',
+ conversationId: 'leads',
+ );
return server;
}
Future<SuperTabController> show(
WidgetTester tester,
ConversationServer server, {
- Brightness brightness = Brightness.dark,
- String account = 'owner',
+ String selected = 'lead',
}) async {
await tester.binding.setSurfaceSize(const Size(1100, 640));
- final previous = grid.AppTheme.brightness.value;
- grid.AppTheme.brightness.value = brightness;
- addTearDown(() => grid.AppTheme.brightness.value = previous);
addTearDown(() => tester.binding.setSurfaceSize(null));
final controller = server.controller(
- account: account,
- initial: {'tabId': 'tab', 'accountId': account, 'selectedId': 'lead'},
+ initial: {'tabId': 'tab', 'accountId': 'owner', 'selectedId': selected},
);
await controller.refresh();
await tester.pumpWidget(
- // The whole app, so the picture has the Scaffold's background too.
- RepaintBoundary(
- key: const ValueKey('leads-capture'),
- child: MaterialApp(
- debugShowCheckedModeBanner: false,
- theme: grid.buildAppTheme(brightness: brightness),
- home: Scaffold(
- body: SuperTabView(
- controller: controller,
- onInvite: () {},
- onAddAgent: (_) {},
- onOpenTerminal: (_) {},
- machineName: (_) => 'Team Mac',
- ),
+ MaterialApp(
+ theme: grid.buildAppTheme(brightness: Brightness.dark),
+ home: Scaffold(
+ body: SuperTabView(
+ controller: controller,
+ onInvite: () {},
+ onAddAgent: (_) {},
+ onOpenTerminal: (_) {},
+ machineName: (_) => 'Team Mac',
),
),
),
@@ -107,167 +101,72 @@ void main() {
controller.dispose();
}
- final leadsRow = find.byKey(const ValueKey('super-group-leads'));
- final projects = find.text('Projects');
+ test('reading a Swarm drops the Leads conversation, whatever its id', () {
+ final snapshot = SuperTabSnapshot.fromJson({
+ ...swarm().state,
+ 'conversations': [
+ ...swarm().state['conversations'] as List,
+ // A Leads conversation the head names, even one sent without its kind.
+ conversationFixture('named', 'Product Managers'),
+ ],
+ 'leadsConversationId': 'named',
+ });
+ expect(snapshot.conversation('leads'), isNull);
+ expect(snapshot.conversation('named'), isNull);
+ expect(snapshot.conversations.map((g) => g.id), [
+ 'lead',
+ 'offline',
+ 'os-lead',
+ 'buddy-owner-lead',
+ ]);
+ });
testWidgets(
- 'lists the Product Managers conversation as # product-managers among Projects, and opens and posts in it',
+ 'an older server still sends it: listed nowhere, never opened, and project and Buddy chats stay',
(tester) async {
final server = swarm();
- server.append(
- 'I will take the roster file after #12 lands.',
- conversationId: 'leads',
- );
- server.messages.last['author'] = {
- 'kind': 'agent',
- 'id': 'pm-1',
- 'name': 'Lead',
- 'displayName': 'Wren',
- };
- server.append(
- 'Overlap: #12 Roster polish (openharness, Wren) and #3 Agents filter (autonomous-os, Nova) both own desktop/lib/super_tabs/roster.dart.',
- conversationId: 'leads',
- );
- server.messages.last['author'] = {
- 'kind': 'agent',
- 'id': 'pm-1',
- 'name': 'Lead',
- };
- server.messages.last['source'] = {'kind': 'overlap'};
+ final reads = <String>[];
+ server.onRead = reads.add;
final controller = await show(tester, server);
- // An open project's heading and composer read as its row too.
- expect(find.text('# openharness'), findsOneWidget);
- expect(find.text('Message #openharness'), findsOneWidget);
- expect(leadsRow, findsOneWidget);
- expect(
- find.descendant(of: leadsRow, matching: find.text('product-managers')),
- findsOneWidget,
- );
- expect(
- tester.getTopLeft(projects).dy,
- lessThan(tester.getTopLeft(leadsRow).dy),
- );
- // It belongs to no project: never listed again as a workgroup of the first one.
- await tester.tap(find.byKey(const ValueKey('super-group-lead')));
- await tester.pumpAndSettle();
- expect(find.text('Leads'), findsNothing);
- expect(leadsRow, findsOneWidget);
-
- await tester.tap(leadsRow);
- await tester.pumpAndSettle();
- // Its heading reads as its row, and it has no rename or archive.
- expect(find.text('# product-managers'), findsOneWidget);
- expect(find.byKey(const ValueKey('super-group-options')), findsNothing);
+ expect(find.byKey(const ValueKey('super-group-leads')), findsNothing);
+ expect(find.text('product-managers'), findsNothing);
+ expect(find.text('# product-managers'), findsNothing);
expect(
find.text('I will take the roster file after #12 lands.'),
- findsOneWidget,
- );
-
- // The overlap alert is a system note, not chat from a Product Manager.
- final note = find.byType(SuperTabTerminalRow);
- expect(note, findsOneWidget);
- expect(
- find.descendant(
- of: note,
- matching: find.textContaining(
- 'both own desktop/lib/super_tabs/roster.dart',
- findRichText: true,
- ),
- ),
- findsOneWidget,
- );
- expect(
- find.descendant(
- of: note,
- matching: find.byIcon(AppIcons.triangleAlert),
- ),
- findsOneWidget,
- );
-
- await captureBoundary(
- tester,
- tester.renderObject<RenderRepaintBoundary>(
- find.byKey(const ValueKey('leads-capture')),
- ),
- captureDir,
- 'leads-conversation',
+ findsNothing,
);
- // The roster is the whole Swarm's: both Product Managers, whatever their project.
- for (final id in ['pm-1', 'pm-2']) {
- expect(find.byKey(ValueKey('super-member-$id')), findsOneWidget);
+ // Project chats and the Buddy chat are listed as before.
+ for (final key in [
+ 'super-group-lead',
+ 'super-group-os-lead',
+ 'super-buddy-lead',
+ ]) {
+ expect(find.byKey(ValueKey(key)), findsOneWidget, reason: key);
}
- // Agents join it by leading a project, never by being added.
- expect(find.byTooltip('Add agent'), findsNothing);
- final composer = find.byKey(const ValueKey('super-message-composer'));
- expect(
- find.descendant(
- of: composer,
- matching: find.text('Message #product-managers'),
- ),
- findsOneWidget,
- );
- await tester.enterText(composer, 'Nova, please go first.');
- await tester.sendKeyEvent(LogicalKeyboardKey.enter);
- await tester.pumpAndSettle();
- expect((server.posts.last['command'] as Map)['conversationId'], 'leads');
- // Posted for every person to read, even before any Product Manager
- // receives it: never "this chat has no Lead".
- expect(find.textContaining('has no Lead'), findsNothing);
- expect(find.text('Add a Lead'), findsNothing);
- expect(
- (server.posts.last['command'] as Map)['text'],
- 'Nova, please go first.',
- );
-
- await close(tester, controller);
- },
- );
+ expect(find.text('# openharness'), findsOneWidget);
- testWidgets(
- 'a viewer reads it, without the terminals they may not open, and its pull requests have no project scope',
- (tester) async {
- final server = swarm();
- (server.state['people'] as List).add({
- 'id': 'viewer',
- 'email': '[email protected]',
- 'role': 'viewer',
- });
- final controller = await show(tester, server, account: 'viewer');
- // "This project" chosen in a workgroup does not follow into it.
- await tester.tap(find.byKey(const ValueKey('super-project-toggle-lead')));
- await tester.pumpAndSettle();
- await tester.tap(find.byKey(const ValueKey('super-group-offline')));
+ // Nothing opens it, a link or a notification included.
+ expect(await controller.select('leads'), isFalse);
await tester.pumpAndSettle();
- await tester.tap(find.byKey(const ValueKey('super-pull-requests')));
+ expect(controller.selectedId, 'lead');
+ expect(reads.where((path) => path.contains('/leads/')), isEmpty);
+ // The other chats still open.
+ expect(await controller.select('os-lead'), isTrue);
+ expect(await controller.select('buddy-owner-lead'), isTrue);
await tester.pumpAndSettle();
- await tester.tap(find.byType(DropdownButton<bool>));
- await tester.pumpAndSettle();
- await tester.tap(find.text('This project').last);
- await tester.pumpAndSettle();
- await tester.tap(leadsRow);
- await tester.pumpAndSettle();
- final terminals = find.byKey(const ValueKey('super-terminals'));
- expect(terminals, findsOneWidget);
- // A read-only viewer's terminal reads are refused, so the button is off.
- expect(tester.widget<AppIconButton>(terminals).onPressed, isNull);
- // It belongs to no project: no "This project" scope beside "This group".
- await tester.tap(find.byKey(const ValueKey('super-pull-requests')));
- await tester.pumpAndSettle();
- expect(find.text('This project'), findsNothing);
- expect(find.byType(DropdownButton<bool>), findsNothing);
- expect(find.textContaining('any chat of this project'), findsNothing);
+ expect(controller.selectedId, 'buddy-owner-lead');
await close(tester, controller);
},
);
testWidgets(
- 'is not shown in a Swarm that has no Product Managers conversation',
+ 'a view saved while it was open lands on the first project chat',
(tester) async {
- final controller = await show(tester, swarm(leads: false));
- expect(leadsRow, findsNothing);
- expect(find.text('product-managers'), findsNothing);
- expect(projects, findsOneWidget);
+ final controller = await show(tester, swarm(), selected: 'leads');
+ expect(controller.selectedId, 'lead');
+ expect(find.text('# openharness'), findsOneWidget);
+ expect(find.text('# product-managers'), findsNothing);
await close(tester, controller);
},
);
diff --git a/desktop/test/super_tab_parts_test.dart b/desktop/test/super_tab_parts_test.dart
index 21e8c462a..34679f13a 100644
--- a/desktop/test/super_tab_parts_test.dart
+++ b/desktop/test/super_tab_parts_test.dart
@@ -26,14 +26,11 @@ void main() {
expect(parts.lastChangedAt, 1793010101002);
expect(snapshot.id, 'c51479bd73b59e58176ad9e4');
expect(snapshot.name, 'openharness');
- expect(snapshot.leadsConversationId, 'leads');
expect(snapshot.people.single.email, '[email protected]');
expect(snapshot.projects.single.leadConversationId, 'lead5701');
- expect(snapshot.conversations.map((g) => g.id), [
- 'leads',
- 'lead5701',
- 'aeef',
- ]);
+ // The Product Managers chat an older server still sends is gone from
+ // what the screens read (Dee, 2026-10-31).
+ expect(snapshot.conversations.map((g) => g.id), ['lead5701', 'aeef']);
expect(snapshot.conversation('aeef')!.lastMessageSequence, 219804);
expect(snapshot.agents.map((a) => a.displayName), ['River', 'Hugo']);
expect(snapshot.localModels!.grid, 'swarm-c514');
diff --git a/desktop/test/super_tab_quick_switcher_test.dart b/desktop/test/super_tab_quick_switcher_test.dart
index 5eaa22005..82fb6224d 100644
--- a/desktop/test/super_tab_quick_switcher_test.dart
+++ b/desktop/test/super_tab_quick_switcher_test.dart
@@ -477,57 +477,39 @@ void main() {
variant: TargetPlatformVariant.only(TargetPlatform.macOS),
);
- for (final held in [true, false]) {
- testWidgets(
- 'Product Managers channel follows sidebar visibility (held=$held)',
- (tester) async {
- final (f, c) = await setup(tester);
- f.connection.server.state['leadsConversationId'] = 'managers';
- if (held) {
- (f.connection.server.state['conversations'] as List).add({
- ...conversationFixture('managers', 'Internal coordination title'),
- 'kind': 'leads',
- 'projectId': '',
- });
- }
- f.connection.server.revision++;
- await c.refresh();
- await tester.pump();
- expect(
- find.text('product-managers'),
- held ? findsOneWidget : findsNothing,
- );
- await open(tester);
+ testWidgets(
+ 'finds no Product Managers chat, even from an older server that sends it',
+ (tester) async {
+ final (f, c) = await setup(tester);
+ f.connection.server.state['leadsConversationId'] = 'managers';
+ (f.connection.server.state['conversations'] as List).add({
+ ...conversationFixture('managers', 'Internal coordination title'),
+ 'kind': 'leads',
+ 'projectId': '',
+ });
+ f.connection.server.revision++;
+ await c.refresh();
+ await tester.pump();
+ expect(find.text('product-managers'), findsNothing);
+ await open(tester);
+ for (final query in ['product-managers', 'Internal coordination']) {
await tester.enterText(
find.byKey(const ValueKey('swarm-quick-query')),
- 'product-managers',
+ query,
);
await tester.pump();
expect(
find.byKey(const ValueKey('swarm-quick-conversation:managers')),
- held ? findsOneWidget : findsNothing,
+ findsNothing,
+ reason: query,
);
- if (held) {
- expect(
- find.descendant(
- of: find.byKey(
- const ValueKey('swarm-quick-conversation:managers'),
- ),
- matching: find.text('product-managers'),
- ),
- findsOneWidget,
- );
- await key(tester, LogicalKeyboardKey.enter);
- await tester.pumpAndSettle();
- expect(c.selectedId, 'managers');
- } else {
- await key(tester, LogicalKeyboardKey.escape);
- }
- await close(tester, f, c);
- },
- variant: TargetPlatformVariant.only(TargetPlatform.macOS),
- );
- }
+ }
+ await key(tester, LogicalKeyboardKey.escape);
+ expect(c.selectedId, isNot('managers'));
+ await close(tester, f, c);
+ },
+ variant: TargetPlatformVariant.only(TargetPlatform.macOS),
+ );
testWidgets(
'old private chat stays out even when the reader is in its audience',
diff --git a/desktop/test/super_tab_roster_test.dart b/desktop/test/super_tab_roster_test.dart
index 1f51a72bb..53e91b45b 100644
--- a/desktop/test/super_tab_roster_test.dart
+++ b/desktop/test/super_tab_roster_test.dart
@@ -1092,7 +1092,8 @@ void main() {
...conversationFixture('ask', 'Pick a sign-in page'),
'assignment': {'agentId': 'agent-3', 'status': 'needs_human'},
},
- // As the backend sends it: no project, kind `leads`.
+ // As an older backend still sends it: no project, kind `leads`.
+ // It is gone (Dee, 2026-10-31), and no chat lists anyone from it.
{
...conversationFixture('leads', 'Leads'),
'kind': 'leads',
@@ -1106,10 +1107,11 @@ void main() {
await f.controller.refresh();
// Needs input first; then idle in today's order, the Leads first.
const order = [3, 0, 2, 1];
+ expect(f.controller.snapshot!.conversation('leads'), isNull);
final saved = grid.AppTheme.brightness.value;
addTearDown(() => grid.AppTheme.brightness.value = saved);
for (final brightness in Brightness.values) {
- for (final chat in ['lead', 'os-lead', 'buddy-owner-lead', 'leads']) {
+ for (final chat in ['lead', 'os-lead', 'buddy-owner-lead']) {
f.controller.select(chat);
// The app's tokens follow their own brightness, not the theme's.
grid.AppTheme.brightness.value = brightness;
@@ -1144,7 +1146,6 @@ void main() {
('lead', true),
('os-lead', true),
('buddy-owner-lead', false),
- ('leads', false),
]) {
f.controller.select(chat);
await tester.pumpAndSettle();
diff --git a/desktop/test/super_tab_sidebar_test.dart b/desktop/test/super_tab_sidebar_test.dart
index 5d6d5ec5e..02a47494a 100644
--- a/desktop/test/super_tab_sidebar_test.dart
+++ b/desktop/test/super_tab_sidebar_test.dart
@@ -254,13 +254,15 @@ void main() {
}
testWidgets('reads like a chat app: utilities, Projects A to Z with their '
- 'workgroups and # product-managers, Buddies, then Machines', (
+ 'workgroups, Buddies, then Machines; no # product-managers', (
tester,
) async {
addTearDown(() => tester.binding.setSurfaceSize(null));
final app = createApp(connected: true);
addTearDown(app.dispose);
final server = ConversationServer();
+ // An older server still sends the Leads conversation; it is gone
+ // (Dee, 2026-10-31).
(server.state['conversations'] as List).add({
...conversationFixture('leads', 'Leads'),
'kind': 'leads',
@@ -277,7 +279,6 @@ void main() {
find.byKey(const ValueKey('super-your-devices')),
find.byKey(const ValueKey('super-local-models')),
find.text('Projects'),
- find.byKey(const ValueKey('super-group-leads')),
find.byKey(const ValueKey('super-group-empty-lead')),
find.text('No workgroups yet'),
find.byKey(const ValueKey('super-group-lead')),
@@ -295,18 +296,14 @@ void main() {
);
}
for (final (key, name) in [
- ('leads', 'product-managers'),
('empty-lead', 'sample-project'),
('lead', 'web-project'),
]) {
expect(inRow('super-group-$key', find.text('#')), findsOneWidget);
expect(inRow('super-group-$key', find.text(name)), findsOneWidget);
}
- // The product managers' channel has no workgroups to disclose.
- expect(
- inRow('super-group-leads', find.byIcon(AppIcons.chevronRight)),
- findsNothing,
- );
+ expect(find.byKey(const ValueKey('super-group-leads')), findsNothing);
+ expect(find.text('product-managers'), findsNothing);
expect(
inRow('super-buddy-lead', find.text('(web-project)')),
findsOneWidget,
diff --git a/docs/naming-system.md b/docs/naming-system.md
index 58e87eb99..40a604de3 100644
--- a/docs/naming-system.md
+++ b/docs/naming-system.md
@@ -109,8 +109,8 @@ the person is in the menu bar's Harness menu and on the Dock's badge), then thre
order: **Projects**,
**Buddies** and **Machines**. Projects and Machines have section headings with disclosure
after the label and an add action at the right. Project rows read as channels, from A to Z:
-**#** at the left, then their name and status, with no chevron. The Product Managers'
-conversation is one of them, **# product-managers**, with no workgroups. A click on a project row
+**#** at the left, then their name and status, with no chevron. (The Swarm-wide
+**# product-managers** row was removed on 2026-10-31: it was not a project.) A click on a project row
opens its product manager chat and reveals its workgroups; a second click on the open project
hides them. Workgroups are shown by their number in grey with no **#**
and then their title (`12 Offline editing`), aligned with the project name. An expanded project
diff --git a/docs/swarms.md b/docs/swarms.md
index 3a668a973..6a23b299d 100644
--- a/docs/swarms.md
+++ b/docs/swarms.md
@@ -742,7 +742,7 @@ Agents talk to each other directly, not through the product manager
no person or other agent between, its next unnamed post reaches nobody until
it names the agent.
- Agents of another project, Buddies, Buddy chats, private chats, the project
- chat and the Leads conversation keep their own members; naming an agent there
+ chat keep their own members; naming an agent there
is refused with `INVALID_RECIPIENT`. Only the coordinator or a person adds an
agent to the project chat or takes one out (`conversation.agent`); another
agent is refused with `COORDINATOR_REQUIRED`.
@@ -764,7 +764,7 @@ Design:
backend is refused only when it names an agent outside the conversation.
- Migration and rollback: none; a rollback restores the copies.
- Audience: the server checks the recipient belongs to the same project and the
- conversation is not a Buddy chat, the project chat, the Leads conversation or
+ conversation is not a Buddy chat, the project chat or
private, and checks the team access of every agent that joins. The sender
needs no role.
- Identity: messages stay the agent's own.
diff --git a/mobile/lib/swarm/model.dart b/mobile/lib/swarm/model.dart
index 76becce41..28e0fe44a 100644
--- a/mobile/lib/swarm/model.dart
+++ b/mobile/lib/swarm/model.dart
@@ -253,10 +253,8 @@ class SuperTabTask {
class SuperTabConversation {
SuperTabConversation.fromJson(Map<String, dynamic> row)
: id = _text(row, 'id'),
- // The Product Managers' conversation belongs to no project; a group from
- // before projects belongs to the first.
- projectId =
- row['projectId'] as String? ?? (row['kind'] == 'leads' ? '' : 'lead'),
+ // A group from before projects belongs to the first.
+ projectId = row['projectId'] as String? ?? 'lead',
kind = row['kind'] as String?,
buddyOwnerId = row['buddyOwnerId'] as String?,
buddyName = row['buddyName'] as String?,
@@ -317,8 +315,9 @@ class SuperTabConversation {
: null;
final String id, projectId, title, brief;
- /// What the backend calls it apart from a workgroup: `leads` for the Product
- /// Managers' conversation, `buddy` for a person's chat with their Buddy.
+ /// What the backend calls it apart from a workgroup: `buddy` for a person's
+ /// chat with their Buddy. A `leads` one, the removed Product Managers'
+ /// conversation, is in no read ([SuperTabSnapshot.fromJson]).
final String? kind;
bool get isBuddyChat => kind == 'buddy';
@@ -460,15 +459,19 @@ class SuperTabSnapshot {
row['machines'] ?? const [],
(m) => Map<String, dynamic>.unmodifiable(m),
),
- conversations = _list(
- row['conversations'],
- SuperTabConversation.fromJson,
+ // The Product Managers' (Leads) conversation is removed (Dee, 10-31): a
+ // server from before that still sends it has it listed and opened
+ // nowhere here.
+ conversations = List.unmodifiable(
+ _list(
+ row['conversations'],
+ SuperTabConversation.fromJson,
+ ).where((c) => c.kind != 'leads' && c.id != row['leadsConversationId']),
),
invitations = _list(
row['invitations'],
(row) => Map<String, dynamic>.unmodifiable(row),
),
- leadsConversationId = row['leadsConversationId'] as String?,
startEfforts = Map.unmodifiable({
for (final start
in row['starts'] is List ? row['starts'] as List : const [])
@@ -479,6 +482,8 @@ class SuperTabSnapshot {
harness: effort,
}),
localModels = SuperTabLocalModels.read(row['localModels']),
+ threadSessions = row['threadSessions'] == true,
+ sessionsFromChat = row['sessionsFromChat'] == true,
mentionsWaiting = (row['mentionsWaiting'] as num?)?.toInt() ?? 0,
mentionsDigest = row['mentionsDigest'] as String?,
decisionsWaiting = (row['decisionsWaiting'] as num?)?.toInt() ?? 0,
@@ -547,13 +552,19 @@ class SuperTabSnapshot {
/// kept on this device leaves them out).
final Map<String, String> startEfforts;
- /// Where the projects' Product Managers talk, Swarm-wide; null in a Swarm
- /// from before it (spec 2026-10-23-leads-see-and-talk.md).
- final String? leadsConversationId;
-
/// The Local models add-on, once the owner has turned it on; null before.
final SuperTabLocalModels? localModels;
+ /// Whether this Swarm's server takes a thread reply's New session: true only
+ /// where it says so (backend read/contract.ts `threadSessions`). Read as the
+ /// desktop reads it (desktop_parity_test.dart); the phone offers no New
+ /// session yet.
+ final bool threadSessions;
+
+ /// Whether that server also takes New session on a top-level message in a
+ /// Buddy chat (read/contract.ts `sessionsFromChat`); false from an older one.
+ final bool sessionsFromChat;
+
/// The reader's tags still waiting for them, Swarm-wide; 0 from a backend
/// before tags (spec 2026-10-24-lead-mentions.md).
final int mentionsWaiting;
diff --git a/mobile/lib/swarm/parts.dart b/mobile/lib/swarm/parts.dart
index 16b46af98..3a6744991 100644
--- a/mobile/lib/swarm/parts.dart
+++ b/mobile/lib/swarm/parts.dart
@@ -346,6 +346,10 @@ class SuperTabParts {
}
// Sent only where the server does not try Harness Team accounts yet.
if (_derived['teamAccounts'] == false) state['teamAccounts'] = false;
+ // Sent by a server that takes a thread reply's New session.
+ if (_derived['threadSessions'] == true) state['threadSessions'] = true;
+ // And one that also takes it on a top-level message in a Buddy chat.
+ if (_derived['sessionsFromChat'] == true) state['sessionsFromChat'] = true;
if (_readMarks.isNotEmpty) state['readMarks'] = Map.of(_readMarks);
if (_threadMarks.isNotEmpty) {
state['threadMarks'] = {
diff --git a/mobile/lib/swarm/swarm_conversation.dart b/mobile/lib/swarm/swarm_conversation.dart
index 9ec0eb3b2..bdda25d48 100644
--- a/mobile/lib/swarm/swarm_conversation.dart
+++ b/mobile/lib/swarm/swarm_conversation.dart
@@ -351,12 +351,12 @@ class SwarmConversation extends ChangeNotifier implements SwarmFilesBox {
}
/// The people a post can tag, as Desktop offers them: those who read this
- /// conversation, never the reader. Nobody in the Leads conversation; in a
- /// Buddy chat only its owner reads it. The backend checks each tag again.
+ /// conversation, never the reader. In a Buddy chat only its owner reads it.
+ /// The backend checks each tag again.
List<SuperTabPerson> get mentionablePeople {
final snapshot = reader.snapshot;
final group = conversation;
- if (snapshot == null || group == null || group.kind == 'leads') {
+ if (snapshot == null || group == null) {
return const [];
}
final project = snapshot.projectFor(group.id);
diff --git a/mobile/lib/swarm/swarm_home_view.dart b/mobile/lib/swarm/swarm_home_view.dart
index c965eb91c..0a0085289 100644
--- a/mobile/lib/swarm/swarm_home_view.dart
+++ b/mobile/lib/swarm/swarm_home_view.dart
@@ -29,7 +29,6 @@ SwarmHomeSwarm swarmHomeSwarm(
'name': snapshot.name,
'ownerId': snapshot.ownerId,
'paused': snapshot.paused,
- 'leadsConversationId': ?snapshot.leadsConversationId,
'projects': [for (final p in snapshot.projects) _project(p)],
'people': [
for (final p in snapshot.people)
diff --git a/mobile/test/swarm/swarm_chat_test.dart b/mobile/test/swarm/swarm_chat_test.dart
index 29c057395..6cc0f9fcf 100644
--- a/mobile/test/swarm/swarm_chat_test.dart
+++ b/mobile/test/swarm/swarm_chat_test.dart
@@ -927,12 +927,11 @@ void main() {
expect(find.text('new-dee'), findsNothing);
});
- testWidgets('a Buddy chat and the Leads conversation offer no people', (
- tester,
- ) async {
+ // The Leads conversation is removed (Dee, 10-31) and in no read, so it
+ // opens nowhere (swarm_model_lookups_test.dart).
+ testWidgets('a Buddy chat offers no people', (tester) async {
for (final kind in [
{'kind': 'buddy', 'buddyOwnerId': me},
- {'kind': 'leads'},
]) {
await pump(
tester,
diff --git a/mobile/test/swarm/swarm_live_card_test.dart b/mobile/test/swarm/swarm_live_card_test.dart
index ea2ef9ddb..4d02aa22a 100644
--- a/mobile/test/swarm/swarm_live_card_test.dart
+++ b/mobile/test/swarm/swarm_live_card_test.dart
@@ -410,6 +410,7 @@ void main() {
expect(find.textContaining('deadbeef1'), findsNothing);
});
+ // A Leads chat from an older server is in no read at all (Dee, 10-31).
testWidgets('a Buddy chat or the Leads chat is never a linked task', (
tester,
) async {
diff --git a/mobile/test/swarm/swarm_model_lookups_test.dart b/mobile/test/swarm/swarm_model_lookups_test.dart
index f65b41453..3dc661c41 100644
--- a/mobile/test/swarm/swarm_model_lookups_test.dart
+++ b/mobile/test/swarm/swarm_model_lookups_test.dart
@@ -80,6 +80,35 @@ void main() {
expect(snapshot.projectFor('nope'), isNull);
});
+ // Dee, 10-31: the Product Managers' (Leads) conversation is removed. A
+ // server from before still sends it: the phone lists and opens it nowhere,
+ // and every other chat reads as before.
+ test('the removed Product Managers conversation is in no read, even from an '
+ 'older server that still sends it', () {
+ final older = SuperTabSnapshot.fromJson(
+ SuperTabParts.firstLoad(
+ firstLoad(
+ head: {...headData(), 'leadsConversationId': 'leads'},
+ groups: [
+ groupData('g1', title: 'Fix login', agentIds: ['agent-builder']),
+ {
+ ...groupData('leads', title: 'Leads', agentIds: ['agent-lead']),
+ 'kind': 'leads',
+ 'projectId': null,
+ },
+ {...groupData('g2', title: 'Unmarked'), 'kind': 'leads'},
+ {...groupData('buddy-me', title: 'Buddy'), 'kind': 'buddy'},
+ ],
+ ),
+ ).state,
+ );
+ expect(older.conversation('leads'), isNull);
+ expect(older.conversation('g2'), isNull);
+ expect(older.conversations.map((c) => c.id), [leadChat, 'g1', 'buddy-me']);
+ expect(older.conversation('buddy-me')?.isBuddyChat, isTrue);
+ expect(older.projectFor('g1')?.id, isNotNull);
+ });
+
test("each project's Product Manager, and no project for anyone else", () {
expect(snapshot.leadProjectForAgent('agent-lead')?.id, project);
expect(snapshot.leadProjectForAgent('agent-cleo')?.id, web);