The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Combined merge 10-31 C: quiet project chats, server and Desktop (#2448 #2446) (#2449)
0xken153f5d44d642ba
diff --git a/backend/integration/superTabBuddies.test.ts b/backend/integration/superTabBuddies.test.tsindex af63a527a..4bc720848 100644--- a/backend/integration/superTabBuddies.test.ts+++ b/backend/integration/superTabBuddies.test.ts@@ -326,7 +326,8 @@ describe('a Buddy through the store', () => {const f = await swarm()const { agentId } = await buddy(f)const group = String((await f.execute({ type: 'conversation.create', projectId: 'lead', title: 'Old task', brief: '', checks: [] })).result.conversationId)- await f.execute({ type: 'message.send', conversationId: group, text: 'Done here.', replyTo: null, recipientIds: [] })+ // A work change the PM has not reported yet (a plain message no longer is one: Dee, 2026-10-31).+ await f.execute({ type: 'conversation.merged', conversationId: group, pullRequestUrl: 'https://github.com/example/app/pull/7' })await f.execute({ type: 'conversation.archive', conversationId: group, archived: true } as Command)const read = await new SwarmReads(f.store).firstLoad(peer, f.tab, agentId)expect(read.groups.find(g => g.key === group)?.data).toMatchObject({ archived: true })diff --git a/backend/integration/superTabBuddyProbes.test.ts b/backend/integration/superTabBuddyProbes.test.tsindex 02a58a1d4..c056ec51f 100644--- a/backend/integration/superTabBuddyProbes.test.ts+++ b/backend/integration/superTabBuddyProbes.test.ts@@ -101,7 +101,8 @@ describe('security review 1 of #2115: a Buddy\'s reads, probed by two people', (it('still hands a Buddy an archived task awaiting the PM\'s report, in the active set its summary shows', async () => {const f=await swarm(), {agentId}=await buddy(f)const group=String((await f.execute({type:'conversation.create',projectId:'lead',title:'Archived but unsummarized',brief:'',checks:[]})).result.conversationId)- await f.execute({type:'message.send',conversationId:group,text:'Completed task report',replyTo:null,recipientIds:[]})+ // A work change the PM has not reported yet (a plain message no longer is one: Dee, 2026-10-31).+ await f.execute({type:'conversation.merged',conversationId:group,pullRequestUrl:'https://github.com/example/app/pull/7'})await f.execute({type:'conversation.archive',conversationId:group,archived:true})const reads=new SwarmReads(f.store), active=await reads.firstLoad(peer,f.tab,agentId)const held=active.groups.find(g=>g.key===group)!diff --git a/backend/integration/superTabLiveness.test.ts b/backend/integration/superTabLiveness.test.tsindex 8a21145d7..f72c35656 100644--- a/backend/integration/superTabLiveness.test.ts+++ b/backend/integration/superTabLiveness.test.ts@@ -1308,9 +1308,9 @@ describe('the delivery poll of an agent with nothing waiting', () => {// Typed into the Lead's terminal, never answered.await f.timed.delivery(host, f.tab, f.lead, first!.id, { type: 'claim', claimId: 'claim' })await f.timed.delivery(host, f.tab, f.lead, first!.id, { type: 'ack', claimId: 'claim', receipt: 'typed', uncertain: false })- // New reports keep coming.+ // New work changes keep coming (an ordinary progress note would wake nobody: Dee, 2026-10-31).f.clock.now += MINUTE- await f.execute({ type: 'work.status', conversationId: f.group, assignmentId: f.assignmentId, status: 'working', result: 'Halfway' }, host, f.worker)+ await f.execute({ type: 'work.status', conversationId: f.group, assignmentId: f.assignmentId, status: 'review', result: 'Halfway' }, host, f.worker)f.clock.now += 59 * MINUTEexpect(await requests()).toEqual([])f.clock.now += 61 * MINUTEdiff --git a/backend/integration/superTabs.test.ts b/backend/integration/superTabs.test.tsindex 6050ded1e..2e0c40852 100644--- a/backend/integration/superTabs.test.ts+++ b/backend/integration/superTabs.test.ts@@ -800,8 +800,11 @@ describe('private swarm projects on the real control API', () => {name: 'Moved lead', configuration: config, lead: false })).rejects.toMatchObject({ code: 'PROJECT_SESSION' })})- it('requests one consolidation after five minutes and remains quiet without new reports', async () => {- let now = 10_000+ // Quiet project chats (Dee, 2026-10-31): a work group's change of state wakes the coordinator at most once every 15 minutes,+ // an ordinary message never; its report sets the project's status card and posts nothing; the digest is on by default.+ it('wakes the coordinator only on work changes, at most every 15 minutes, and keeps its report in the status card', async () => {+ // 14:00 in Vietnam: the default digest starts tomorrow at 08:00.+ let now = Date.UTC(2026, 9, 31, 7, 0)const timed = new SuperTabStore(db, () => now)const tab = (await timed.create(owner, randomUUID(), 'Updates', 'public')).idconst execute = (command: Command, asAgentId?: string) => timed.execute(asAgentId ? host : owner, tab,@@ -809,38 +812,50 @@ describe('private swarm projects on the real control API', () => {const lead = String((await execute({ type: 'agent.add', conversationId: 'lead', machineId: 'test-host',harnessId: randomUUID(), name: 'Lead', configuration: config, lead: true })).result.agentId)const updates = async () => (await timed.deliveries(host, tab, lead)).filter(d => d.conversationId === 'lead')+ const chat = async () => db.superTabMessage.findMany({ where: { tabId: tab, conversationId: 'lead' } })+ expect(await updates()).toEqual([])const group = String((await execute({ type: 'conversation.create', title: 'Work', brief: 'Implement it',checks: [{ description: 'Verified', independent: true }] })).result.conversationId)- expect(await updates()).toEqual([])+ // Five minutes on, so a burst of changes is one wake-up (the quiet poll's 30 s fit within that).now += 299_999expect(await updates()).toEqual([])- // The quiet poll skips the time checks for 30 s after a full one (store.deliveries), so the request lands within that.- now += 30_000+ now += 30_001const polls = await Promise.all(Array.from({ length: 3 }, () => updates()))const ids = new Set(polls.flat().map(d => d.id))expect(ids.size).toBe(1)- const requests = await db.superTabMessage.findMany({ where: { tabId: tab, conversationId: 'lead' } })- expect(requests).toHaveLength(1)- expect(requests[0]!.source).toMatchObject({ kind: 'update-request' })+ expect((await chat()).map(m => (m.source as Record<string, unknown>)?.kind)).toEqual(['update-request'])await execute({ ...message('New evidence'), conversationId: group } as Command)- now += 300_000+ now += 900_000expect((await updates()).map(d => d.id)).toEqual([...ids])- // The Lead reports through what it read of each workgroup: here the new evidence, the group's latest message.+ // The Lead reports through what it read of each workgroup: the card, and nothing in the chat.const read = (await timed.read(owner, tab)).state.conversations.find(c => c.id === group)!- await execute({ type: 'project.report', projectId: 'lead', through: { [group]: read.lastMessageSequence },- text: 'The implementation is ready. Verification is next.' }, lead)+ const card = 'Work: implementation ready, verification next.'+ await execute({ type: 'project.report', projectId: 'lead', through: { [group]: read.lastMessageSequence }, text: card }, lead)expect(await updates()).toEqual([])+ expect((await chat()).filter(m => m.text === card || (m.source as Record<string, unknown>)?.kind === 'project-report')).toEqual([])+ expect((await timed.read(owner, tab)).state.projects!.find(p => p.id === 'lead')!.status).toEqual({ text: card, at: new Date(now).toISOString(), by: lead })+ // An ordinary message, here an hour of them, wakes nobody.+ await execute({ ...message('Tests passed'), conversationId: group } as Command)now += 3_600_000expect(await updates()).toEqual([])- expect((await db.superTabMessage.findMany({ where: { tabId: tab, conversationId: 'lead' } })).filter(m =>- (m.source as Record<string, unknown>)?.kind === 'project-report')).toHaveLength(1)- await execute({ type: 'project.cadence', projectId: 'lead', minutes: 15 })- await execute({ ...message('Tests passed'), conversationId: group } as Command)- now += 899_999+ // Two changes within 15 minutes: one wake-up now, the second waits for the next window.+ await execute({ type: 'conversation.create', title: 'Docs', brief: 'Write them', checks: [{ description: 'Read', independent: false }] })+ now += 300_000+ expect(await updates()).toHaveLength(1)+ const answered = (await timed.read(owner, tab)).state.conversations.filter(c => c.title === 'Docs' || c.id === group)+ await execute({ type: 'project.report', projectId: 'lead', through: Object.fromEntries(answered.map(c => [c.id, c.lastMessageSequence])), text: null }, lead)expect(await updates()).toEqual([])- // As above: the Lead's open deliveries are answered from its last full poll for 30 s, so the request lands within that.- now += 30_000+ await execute({ type: 'conversation.merged', conversationId: group, pullRequestUrl: 'https://github.com/example/app/pull/7' })+ now += 600_000+ expect(await updates()).toEqual([])+ now += 300_000expect(await updates()).toHaveLength(1)+ // The card stayed through the acknowledgement, and the morning digest comes by default at 08:00 the next day.+ expect((await timed.read(owner, tab)).state.projects!.find(p => p.id === 'lead')!.status!.text).toBe(card)+ expect((await chat()).some(m => (m.source as Record<string, unknown>)?.kind === 'digest-request')).toBe(false)+ now = Date.UTC(2026, 10, 1, 1, 0) + 30_000+ await updates()+ expect((await chat()).filter(m => (m.source as Record<string, unknown>)?.kind === 'digest-request')).toHaveLength(1)})})diff --git a/backend/src/superTabs/commands.ts b/backend/src/superTabs/commands.tsindex 19ed7a2db..ab7fedf05 100644--- a/backend/src/superTabs/commands.ts+++ b/backend/src/superTabs/commands.ts@@ -33,7 +33,7 @@ import { shipNotice, shippedAt } from './ship.js'import { assignedNotice, tellBuddies } from './buddyNews.js'import { bindPullRequestCards, bindTaskCard, pullRequestCard, recordCardMerged } from './cards.js'import { avatarChoice, setAgentAvatar, setMemberAvatar, setStatus, statusSchema, type AvatarUpload } from './profile.js'-import { BUILT_IN_ROLE_DEFAULTS, agentProjectId, audienceOf, canReadProject, deleteProject, isConfidential, markConfidential, onTeamAccount, requireSingleRegistration, groupProject, inviteLanding, ledProject, manageProject, MAX_ROLES, mutableProjects, placeRules, projectAgent, projectMembers, projectOf, projectsOf, readAgent, readConversation, readProject, sameProject, sharedWithLeads, withRoleDefaults, type SwarmProject } from './projects.js'+import { BUILT_IN_ROLE_DEFAULTS, PROJECT_STATUS_MAX, agentProjectId, audienceOf, canReadProject, deleteProject, isConfidential, markConfidential, onTeamAccount, requireSingleRegistration, groupProject, inviteLanding, ledProject, manageProject, MAX_ROLES, mutableProjects, placeRules, projectAgent, projectMembers, projectOf, projectsOf, readAgent, readConversation, readProject, sameProject, sharedWithLeads, withRoleDefaults, type SwarmProject } from './projects.js'import { BUDDY_SESSION_CAPABILITY, chatOwner, endSessionEntry, liveSessions, mainBuddyOf, MAX_BUDDY_SESSIONS, MAX_SESSION_WAITING, requireChatOwner, SESSION_ENDED_KIND, sessionAgentsOf, sessionOf, setSessions, type SessionEndReason } from './buddySessions.js'import { BUDDY_REQUIREMENTS, buddyChatId, buddyReady, chosenBuddyName, isBuddy, isBuddyChat, MAX_PROPOSAL_ASKS, MAX_PROPOSAL_ATTACHMENTS, openBuddyChat, PROPOSAL_ASK_MS, proposalText, renameBuddy, requireBuddyCommand } from './buddies.js'import { BUDDY_OWN_MACHINE_REFUSAL, CODEX_BUDDY_REFUSAL } from './buddyContract.js'@@ -143,7 +143,8 @@ export const commandSchema = z.discriminatedUnion('type', [// `through`: each conversation's sequence the Lead read, as its wake-up names them. `throughRevision` is the tab revision a// wake-up from before the store by parts named; it is accepted only up to that split (projectUpdates.ts).z.object({ type: z.literal('project.report'), projectId: id, through: z.record(id, z.number().int().nonnegative().safe()).optional(),- throughRevision: z.number().int().nonnegative().safe().optional(), text: text.nullable() }).strict()+ throughRevision: z.number().int().nonnegative().safe().optional(),+ text: z.string().trim().min(1).max(PROJECT_STATUS_MAX, `Keep the status card under ${PROJECT_STATUS_MAX.toLocaleString('en-US')} characters: one short line per active task.`).nullable() }).strict().refine(c => (c.through === undefined) !== (c.throughRevision === undefined), 'Acknowledge with through, the map your wake-up names.'),z.object({ type: z.literal('project.repository'), projectId: id, repositoryUrl }).strict(),// The project's instructions, saved on the revision the writer read (instructions.ts). `askedBy`: the member whose words it@@ -1126,12 +1127,16 @@ export function applyCommand(original: SuperTabState, actor: Actor, input: Comma}case 'project.report': {const project = coordinatorOf(readProject(state, actor, command.projectId), 'The project\'s coordinator writes its progress updates.')- const group = conversation(state, project.leadConversationId)if (command.throughRevision !== undefined && command.throughRevision > (state.sequenceBase ?? 0)) {fail('THROUGH_REQUIRED', 'Acknowledge with through, the map of workgroups your latest wake-up names.', 400)}summarize(state, project, command.through ?? Object.fromEntries(reportGroups(state, project).map(g => [g.id, command.throughRevision!])))- if (command.text) message(group.id, command.text, [], null, { kind: 'project-report' })+ // The text is the project's status card, replacing the one before; it posts nothing to the chat (Dee, 2026-10-31).+ // Without text the report only acknowledges, and the card stays.+ if (command.text) {+ mutableProjects(state)+ projectOf(state, project.id).status = { text: command.text, at: new Date(context.now).toISOString(), by: (actor as Extract<Actor, { kind: 'agent' }>).agentId }+ }break}case 'project.repository': {@@ -1297,8 +1302,12 @@ export function applyCommand(original: SuperTabState, actor: Actor, input: Commaif (!knownTimeZone(command.timeZone)) fail('TIME_ZONE', 'Name a time zone such as Asia/Ho_Chi_Minh.', 400)mutableProjects(state)const stored = projectOf(state, project.id)- if (command.time === null) delete stored.digest- else {+ // Off stays off: the default (digest.ts defaultDigest) is not filled in again.+ if (command.time === null) {+ delete stored.digest+ stored.digestOff = true+ } else {+ delete stored.digestOff// Set after today's time, the first digest comes tomorrow rather than at once; moved later on a day its digest went// out, it stays sent for today.const lastOn = digestStartsAfter(command.time, command.timeZone, context.now, stored.digest?.lastOn)diff --git a/backend/src/superTabs/digest.test.ts b/backend/src/superTabs/digest.test.tsindex 01dd4ee60..d90177b60 100644--- a/backend/src/superTabs/digest.test.ts+++ b/backend/src/superTabs/digest.test.ts@@ -109,13 +109,16 @@ describe('a project\'s morning digest', () => {expect(digestRequest(state, lead, EIGHT + 24 * HOUR)).not.toBeNull()})- it('wakes nobody for a project with no digest time, in a paused Swarm, or for an agent that is not the Lead', () => {+ it('wakes nobody for a project whose digest a person turned off, in a paused Swarm, or for an agent that is not the Lead', () => {const state = fixture()expect(digestRequest(state, state.agents.find(a => a.id === 'nico')!, EIGHT)).toBeNull()state.paused = trueexpect(digestRequest(state, state.agents.find(a => a.id === 'lead')!, EIGHT)).toBeNull()state.paused = false+ // Never set, it is on by default at 08:00 Vietnam time (Dee, 2026-10-31); turned off, it stays off.delete lampOS(state).digest+ expect(digestRequest(state, state.agents.find(a => a.id === 'lead')!, EIGHT)?.text).toContain('(08:00, Asia/Ho_Chi_Minh)')+ lampOS(state).digestOff = trueexpect(digestRequest(state, state.agents.find(a => a.id === 'lead')!, EIGHT)).toBeNull()})})diff --git a/backend/src/superTabs/digest.ts b/backend/src/superTabs/digest.tsindex eb59aca31..62ddc7ffd 100644--- a/backend/src/superTabs/digest.ts+++ b/backend/src/superTabs/digest.ts@@ -2,6 +2,7 @@ import { activeWork, author, stableId, type Agent, type Conversation, type Messaimport { agentDisplayName } from './agentNames.js'import { canReadGroup, ledProject, type SwarmProject } from './projects.js'import { reportGroups } from './projectUpdates.js'+import { DEFAULT_TIME_ZONE } from './costs/reflection.js'// Night shift (v2 B): people wake to one message per project saying what the Swarm did overnight. At the project's local// digest time its Lead's poll wakes the Lead with the lists below, built from state; the Lead checks each pull request is@@ -24,11 +25,24 @@ export function knownTimeZone(timeZone: string): boolean {try { localNow(timeZone, 0); return true } catch { return false }}+/** Every project's digest unless a person turns it off (Dee, 2026-10-31): 08:00 in the project owner's zone. No owner's+ * zone is known to the Swarm yet, so it is Vietnam's, where the team works; a person moves it with project.digest. */+export const DEFAULT_DIGEST = { time: '08:00', timeZone: DEFAULT_TIME_ZONE } as const+/** A project that never stored a digest gets its first default one in the hour from 08:00, Vietnam time: no release goes+ * out then (releases run 09:00 to 18:00), so a release never sends every project's digest at once, and no poll writes+ * anything for it until that send stores it like any other digest. */+const DEFAULT_UNTIL = '09:00'++/** The digest a project keeps: its own, else the default unless a person turned it off. */+export const digestOf = (project: SwarmProject): NonNullable<SwarmProject['digest']> | undefined =>+ project.digest ?? (project.digestOff ? undefined : DEFAULT_DIGEST)+/** The local date of a digest due at `now`, or null: none set, not yet its time today, or today's already sent. */export function digestDue(project: SwarmProject, now: number): string | null {- const digest = project.digest+ const digest = digestOf(project)if (!digest) return nullconst local = localNow(digest.timeZone, now)+ if (!project.digest) return local.time >= digest.time && local.time < DEFAULT_UNTIL ? local.date : nullreturn local.time >= digest.time && digest.lastOn !== local.date ? local.date : null}@@ -97,7 +111,7 @@ export function digestRequest(state: SuperTabState, target: Agent, now: number,const project = ledProject(state, target.id)const on = project && digestDue(project, now)if (!project || !on) return null- const digest = project.digest!+ const digest = digestOf(project)!const text = `Morning digest for project ${JSON.stringify(project.name)} (${digest.time}, ${digest.timeZone}). This is a scheduled request, not a new task. `+ 'Check that each pull request under Shipped is merged, and move one that is not to In progress. Then post one message to the people in this chat '+ 'with these parts, in plain words, without commands or internal IDs.\n\n'diff --git a/backend/src/superTabs/model.ts b/backend/src/superTabs/model.tsindex 42a88b315..23ab88954 100644--- a/backend/src/superTabs/model.ts+++ b/backend/src/superTabs/model.ts@@ -744,6 +744,15 @@ export function visibleState(state: SuperTabState, actor: Actor, now = Date.now(if (visible.projects) {visible.projects = visible.projects.filter(p => canReadProject(state, actor, p))visible.conversations = visible.conversations.filter(c => canReadGroup(state, actor, c))+ // The status card is read exactly by those who read the project chat (projects.ts SwarmProject.status); without the chat+ // loaded, by nobody.+ visible.projects = visible.projects.map(p => {+ if (p.status === undefined) return p+ const chat = state.conversations.find(c => c.id === p.leadConversationId)+ if (chat && canReadGroup(state, actor, chat)) return p+ const { status: _status, ...rest } = p+ return rest+ })visible.agents = visible.agents.filter(a => canReadAgent(state, actor, a))visible.starts = visible.starts?.filter(s => visible.conversations.some(c => c.id === s.request.conversationId))if (!visible.projects.some(p => p.id === 'lead')) {diff --git a/backend/src/superTabs/native.ts b/backend/src/superTabs/native.tsindex 32b2ecda8..99ea415ba 100644--- a/backend/src/superTabs/native.ts+++ b/backend/src/superTabs/native.ts@@ -7,7 +7,6 @@ import { activeWork, agent, appendPullRequestUrls, author, conversation, fail, stype 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'-import { noteProjectReports } from './projectUpdates.js'import { cloneData } from './cloneData.js'import { numberMessages, type Touch } from './parts/commit.js'import { redactCredentials } from './credentials.js'@@ -234,8 +233,8 @@ export class SuperTabNativeStore {// A required recovery reaches the coordinator; a typed prompt, its answer or any other gap names no one (phase 1).const recipients = turnRecipients(group, target, !!recovery?.source.required)const draft = { id: eventId, conversationId: group.id, author: observedBy, text, replyTo: null, recipients }+ // A terminal turn is an ordinary message: it never wakes the coordinator (projectUpdates.ts noteWorkChanges).const now = Date.now(), sequences = numberMessages(state, [draft], now), sequence = sequences.get(eventId)!- noteProjectReports(state, [draft], sequences, now)// The turn touches its agent (spec ruling 2). The person who opened the terminal is guarded by this context's row,// which the turn writes: removing that person, or taking away their access, revokes the context (rule b,// revokeNativeContexts). Touching the person instead would make one person's terminals in different groups conflict.diff --git a/backend/src/superTabs/notices.test.ts b/backend/src/superTabs/notices.test.tsindex 3838ec638..9060c788f 100644--- a/backend/src/superTabs/notices.test.ts+++ b/backend/src/superTabs/notices.test.ts@@ -83,8 +83,8 @@ describe('the notices the Swarm writes into a chat', () => {const unclassified = [...written].filter(([kind]) => !Object.hasOwn(NOTICE_READERS, kind)).map(([kind, files]) => `${kind} (${files.join(', ')})`)expect(unclassified, 'add each to NOTICE_READERS in model.ts: who reads it?').toEqual([])// A kind no longer written keeps its readers for the rows stored before: the server's idle stop (project instructions,- // phase 4) told only the Lead.- const retired = ['idle-stop']+ // phase 4) told only the Lead; the coordinator's progress post, now the project's status card (Dee, 2026-10-31), people.+ const retired = ['idle-stop', 'project-report']expect(Object.keys(NOTICE_READERS).filter(kind => !written.has(kind) && !retired.includes(kind))).toEqual([])expect(retired.filter(kind => written.has(kind))).toEqual([])})diff --git a/backend/src/superTabs/projectStatus.test.ts b/backend/src/superTabs/projectStatus.test.tsnew file mode 100644index 000000000..960e4e90e--- /dev/null+++ b/backend/src/superTabs/projectStatus.test.ts@@ -0,0 +1,222 @@+import { describe, expect, it } from 'vitest'+import { applyCommand, commandSchema, type Command, type CommandContext } from './commands.js'+import { createSuperTab, visibleState, type Actor, type AgentConfiguration, type SuperTabState } from './model.js'+import { BATCH_MS, noteWorkChanges, projectUpdateRequest, WAKE_GAP_MS } from './projectUpdates.js'+import { DEFAULT_DIGEST, digestDue, digestOf } from './digest.js'+import { projectOf } from './projects.js'+import { numberMessages } from './parts/commit.js'++// Quiet project chats (Dee, 2026-10-31): a report sets the project's status card and posts nothing, only a work group's+// state wakes the coordinator, at most once every 15 minutes, and every project gets the morning digest by default.++const owner: Extract<Actor, { kind: 'person' }> = { kind: 'person', userId: 'owner', email: '[email protected]' }+const peer: Extract<Actor, { kind: 'person' }> = { kind: 'person', userId: 'peer', email: '[email protected]' }+const config: AgentConfiguration = { engine: 'codex', model: 'test-model', effort: 'high', contextWindow: 200000, engineVersion: 'fixture' }+const MINUTE = 60_000++function fixture() {+ let state = createSuperTab('tab', 'Pilot', { id: 'owner', email: owner.email }, 'prod')+ let sequence = 0, now = 1_000_000+ /** A command as the store runs it: numbered messages, then the work changes it made (store.ts execute). */+ const run = (command: Command, actor: Actor = owner, context: Partial<CommandContext> = {}) => {+ const before = state+ const effects = applyCommand(state, actor, command, { now, operationId: `op-${++sequence}`, ...context })+ numberMessages(effects.state, effects.messages, now)+ noteWorkChanges(before, effects.state, now)+ state = effects.state+ return effects+ }+ const add = (harnessId: string, group = 'lead', lead = false) => run({ type: 'agent.add', conversationId: group, machineId: 'host', harnessId,+ name: harnessId, configuration: config, lead }, owner, { contribution: { machineOwnerId: 'host-owner', contributorId: 'owner' } }).result.agentId as string+ // A stored project, as every Swarm made since projects has.+ run({ type: 'project.cadence', projectId: 'lead', minutes: 5 })+ const lead = add('lead-harness', 'lead', true)+ const leadActor: Actor = { kind: 'agent', agentId: lead, machineOwnerId: 'host-owner' }+ const group = () => run({ type: 'conversation.create', title: 'Offline editing', brief: 'Save edits while offline.',+ checks: [{ description: 'Reconnect preserves the edits.', independent: true }] }).result.conversationId as string+ return {+ run, add, group, lead, leadActor,+ get state(): SuperTabState { return state },+ get now() { return now },+ tick(ms: number) { now += ms },+ }+}++const report = (text: string | null, through: Record<string, number> = {}): Command =>+ commandSchema.parse({ type: 'project.report', projectId: 'lead', through, text })++describe('the project status card', () => {+ it('is set by a report, replacing the one before, and posts nothing to the chat', () => {+ const f = fixture()+ const first = f.run(report('Offline editing: PR #12 waiting on CI'), f.leadActor)+ expect(first.messages).toEqual([])+ expect(projectOf(f.state, 'lead').status).toEqual({ text: 'Offline editing: PR #12 waiting on CI', at: new Date(f.now).toISOString(), by: f.lead })+ f.tick(MINUTE)+ expect(f.run(report('Offline editing: merged'), f.leadActor).messages).toEqual([])+ expect(projectOf(f.state, 'lead').status).toEqual({ text: 'Offline editing: merged', at: new Date(f.now).toISOString(), by: f.lead })+ // No text only acknowledges: the card stays.+ expect(f.run(report(null), f.leadActor).messages).toEqual([])+ expect(projectOf(f.state, 'lead').status!.text).toBe('Offline editing: merged')+ })++ it('holds up to 2,000 characters and refuses a longer card', () => {+ expect(() => report('x'.repeat(2_000))).not.toThrow()+ expect(() => report('x'.repeat(2_001))).toThrow(/under 2,000 characters/)+ })++ it('is written only by the coordinator: never another agent of the project, nor a person', () => {+ const f = fixture(), engineer = f.add('engineer')+ const as: Actor = { kind: 'agent', agentId: engineer, machineOwnerId: 'host-owner' }+ expect(() => f.run(report('Mine now'), as)).toThrow(expect.objectContaining({ code: 'COORDINATOR_REQUIRED' }))+ expect(() => f.run(report('Mine now'), owner)).toThrow(expect.objectContaining({ code: 'COORDINATOR_REQUIRED' }))+ expect(projectOf(f.state, 'lead').status).toBeUndefined()+ })++ it('is refused alike to another project\'s coordinator, which writes only its own card', () => {+ const f = fixture()+ const created = f.run({ type: 'project.create', name: 'Firmware', visibility: 'public', brief: 'Build the firmware.' } as Command)+ const other = f.add('other-lead', created.result.conversationId as string, true)+ const as: Actor = { kind: 'agent', agentId: other, machineOwnerId: 'host-owner' }+ expect(() => f.run(report('Firmware took over'), as)).toThrow(expect.objectContaining({ code: 'NOT_FOUND', message: 'This project is unavailable.' }))+ expect(() => f.run(commandSchema.parse({ type: 'project.report', projectId: 'no-such-project', through: {}, text: 'x' }), as))+ .toThrow(expect.objectContaining({ code: 'NOT_FOUND', message: 'This project is unavailable.' }))+ f.run(commandSchema.parse({ type: 'project.report', projectId: created.result.projectId, through: {}, text: 'Firmware: flashing' }), as)+ expect(projectOf(f.state, created.result.projectId as string).status!.text).toBe('Firmware: flashing')+ expect(projectOf(f.state, 'lead').status).toBeUndefined()+ })++ it('is read exactly by those who read the project chat', () => {+ const f = fixture()+ const invited = f.run({ type: 'invite.create', email: peer.email, role: 'collaborator', conversationId: 'lead' })+ f.run({ type: 'invite.accept', inviteId: invited.result.inviteId as string }, peer)+ f.run(report('Offline editing: building'), f.leadActor)+ const card = (actor: Actor, state = f.state) => visibleState(state, actor).projects?.find(p => p.id === 'lead')?.status+ expect(card(owner)!.text).toBe('Offline editing: building')+ expect(card(peer)!.text).toBe('Offline editing: building')+ // Made private without them, the project and its card leave their reads together.+ f.run({ type: 'project.sharing', projectId: 'lead', visibility: 'private', memberIds: [] })+ expect(visibleState(f.state, peer).projects?.some(p => p.id === 'lead')).toBe(false)+ expect(JSON.stringify(visibleState(f.state, peer))).not.toContain('Offline editing: building')+ expect(card(owner)!.text).toBe('Offline editing: building')+ // A read whose state lacks the chat shows no card rather than guess.+ const withoutChat = { ...f.state, conversations: f.state.conversations.filter(c => c.id !== 'lead') }+ expect(visibleState(withoutChat, owner).projects?.find(p => p.id === 'lead')).not.toHaveProperty('status')+ })+})++describe('the coordinator\'s scheduled wake-up', () => {+ const lead = (f: ReturnType<typeof fixture>) => f.state.agents.find(a => a.id === f.lead)!+ /** The coordinator answers the request it got: everything summarized through what it read. */+ const answer = (f: ReturnType<typeof fixture>, request: NonNullable<ReturnType<typeof projectUpdateRequest>>) => {+ const progress = projectOf(f.state, 'lead').progress!+ progress.requested = { ...progress.requested, ...request.source!.through as Record<string, number> }+ progress.requestedAt = f.now+ f.run(report('Card', request.source!.through as Record<string, number>), f.leadActor)+ }++ it('is never asked for by an ordinary message or a progress note', () => {+ const f = fixture(), group = f.group()+ const engineer = f.add('engineer', group)+ const as: Actor = { kind: 'agent', agentId: engineer, machineOwnerId: 'host-owner' }+ const assignmentId = f.run({ type: 'work.assign', conversationId: group, agentId: engineer }).result.assignmentId as string+ f.tick(BATCH_MS)+ answer(f, projectUpdateRequest(f.state, lead(f), f.now)!)+ f.tick(WAKE_GAP_MS)+ f.run({ type: 'message.send', conversationId: group, text: 'Halfway there.', replyTo: null, recipientIds: [] }, as)+ f.run({ type: 'message.send', conversationId: group, text: 'How is it going?', replyTo: null, recipientIds: [engineer] }, owner)+ // Still working: a progress note changes no state.+ f.run({ type: 'work.status', conversationId: group, assignmentId, status: 'working', result: 'Tests written' }, as)+ f.tick(WAKE_GAP_MS)+ expect(projectUpdateRequest(f.state, lead(f), f.now)).toBeNull()+ // Ready for review is a change: it wakes the coordinator five minutes on.+ f.run({ type: 'work.status', conversationId: group, assignmentId, status: 'review', result: 'PR #7' }, as)+ f.tick(BATCH_MS - 1)+ expect(projectUpdateRequest(f.state, lead(f), f.now)).toBeNull()+ f.tick(1)+ expect(projectUpdateRequest(f.state, lead(f), f.now)?.source).toMatchObject({ kind: 'update-request', through: { [group]: expect.any(Number) } })+ })++ it('is asked for by a work group\'s change of state, at most once every 15 minutes', () => {+ const f = fixture()+ // A new group is a change: the wake-up comes five minutes on, so a burst of changes is one.+ const a = f.group()+ f.tick(BATCH_MS - 1)+ expect(projectUpdateRequest(f.state, lead(f), f.now)).toBeNull()+ f.tick(1)+ const first = projectUpdateRequest(f.state, lead(f), f.now)+ expect(first?.source).toMatchObject({ kind: 'update-request' })+ answer(f, first!)+ // Two changes within 15 minutes wake it once.+ f.tick(MINUTE)+ const b = f.group()+ expect(projectUpdateRequest(f.state, lead(f), f.now)).toBeNull()+ f.tick(5 * MINUTE)+ f.run({ type: 'conversation.merged', conversationId: a, pullRequestUrl: 'https://github.com/example/app/pull/7' })+ expect(projectUpdateRequest(f.state, lead(f), f.now)).toBeNull()+ f.tick(WAKE_GAP_MS - 6 * MINUTE - 1)+ expect(projectUpdateRequest(f.state, lead(f), f.now)).toBeNull()+ f.tick(1)+ const second = projectUpdateRequest(f.state, lead(f), f.now)!+ expect(Object.keys(second.source!.through as object).sort()).toEqual([a, b].sort())+ expect(second.text).toContain('status card')+ answer(f, second)+ f.tick(WAKE_GAP_MS)+ expect(projectUpdateRequest(f.state, lead(f), f.now)).toBeNull()+ })++ it('keeps its 15 minutes whatever cadence an older client set', () => {+ const f = fixture()+ f.run({ type: 'project.cadence', projectId: 'lead', minutes: 1 })+ f.group()+ f.tick(BATCH_MS)+ answer(f, projectUpdateRequest(f.state, lead(f), f.now)!)+ f.tick(MINUTE)+ f.group()+ expect(projectUpdateRequest(f.state, lead(f), f.now)).toBeNull()+ f.tick(WAKE_GAP_MS - MINUTE)+ expect(projectUpdateRequest(f.state, lead(f), f.now)).not.toBeNull()+ })+})++describe('the morning digest by default', () => {+ /** 14:00 on 31 October in Vietnam (UTC+7). */+ const AFTERNOON = Date.UTC(2026, 9, 31, 7, 0)+ const NEXT_EIGHT = Date.UTC(2026, 10, 1, 1, 0)++ it('is 08:00 Vietnam time for a project that never set one, first sent in the hour from 08:00', () => {+ const f = fixture(), project = projectOf(f.state, 'lead')+ expect(project.digest).toBeUndefined()+ expect(DEFAULT_DIGEST).toEqual({ time: '08:00', timeZone: 'Asia/Ho_Chi_Minh' })+ expect(digestOf(project)).toEqual(DEFAULT_DIGEST)+ // A release in the afternoon sends nothing at once; the first comes the next morning.+ expect(digestDue(project, AFTERNOON)).toBeNull()+ expect(digestDue(project, NEXT_EIGHT - 1)).toBeNull()+ expect(digestDue(project, NEXT_EIGHT)).toBe('2026-11-01')+ expect(digestDue(project, NEXT_EIGHT + 59 * MINUTE)).toBe('2026-11-01')+ expect(digestDue(project, NEXT_EIGHT + 60 * MINUTE)).toBeNull()+ // Once sent it is stored like any digest, and the next day's comes whenever the coordinator polls after 08:00.+ project.digest = { ...digestOf(project)!, lastOn: '2026-11-01', lastAt: NEXT_EIGHT }+ expect(digestDue(project, NEXT_EIGHT + 24 * 60 * MINUTE + 5 * 60 * MINUTE)).toBe('2026-11-02')+ })++ it('stays off once a person turns it off, and comes back when they set a time', () => {+ const f = fixture()+ f.run({ type: 'project.digest', projectId: 'lead', time: null, timeZone: 'Asia/Ho_Chi_Minh' })+ const project = () => projectOf(f.state, 'lead')+ expect(project().digest).toBeUndefined()+ expect(project().digestOff).toBe(true)+ expect(digestOf(project())).toBeUndefined()+ expect(digestDue(project(), NEXT_EIGHT)).toBeNull()+ f.run({ type: 'project.digest', projectId: 'lead', time: '09:00', timeZone: 'Europe/Paris' })+ expect(project().digestOff).toBeUndefined()+ expect(project().digest).toMatchObject({ time: '09:00', timeZone: 'Europe/Paris' })+ })++ it('is on for a new project from its creation', () => {+ const f = fixture()+ const created = f.run({ type: 'project.create', name: 'Firmware', visibility: 'public', brief: 'Build the firmware.' } as Command)+ const project = projectOf(f.state, created.result.projectId as string)+ expect(digestOf(project)).toEqual(DEFAULT_DIGEST)+ expect(digestDue(project, NEXT_EIGHT)).toBe('2026-11-01')+ })+})diff --git a/backend/src/superTabs/projectUpdates.ts b/backend/src/superTabs/projectUpdates.tsindex f7fa016bf..f824c6869 100644--- a/backend/src/superTabs/projectUpdates.ts+++ b/backend/src/superTabs/projectUpdates.ts@@ -18,18 +18,34 @@ export function dirtyGroups(state: SuperTabState, project: SwarmProject): Converreturn reportGroups(state, project).filter(g => (g.reportSeq ?? 0) > (progress.summarized[g.id] ?? progress.summarizedFloor))}-/** Workgroup reports mark their conversation, and the project's progress changes only when the project goes from clean to- * dirty, so posts in different conversations of one project never write the same part (spec ruling 1). */-export function noteProjectReports(state: SuperTabState, messages: MessageDraft[], sequences: ReadonlyMap<string, number>, now: number) {- if (!state.projects) return- for (const message of messages) {- const group = conversation(state, message.conversationId)+/** The least time between two of a project's scheduled wake-ups (Dee, 2026-10-31: "even at 30 min that's 48 updates a day").+ * A question, a blocker or completion reaches the coordinator at once anyway, as the status line's recipients. */+export const WAKE_GAP_MS = 15 * 60_000+/** How long after a project's first change since its last report the wake-up waits, so a burst (a task created, assigned+ * and started) is one wake-up. */+export const BATCH_MS = 5 * 60_000++/** What of a work group's state wakes its coordinator: its task (assigned, a new one), the task's status (review, done,+ * blocked, needs_human, cancelled; a review group's verdict is its own task's status), a review's findings, its merges and+ * pull requests. Ordinary messages, progress notes, terminal turns and archiving change none of it. */+const workState = (group: Conversation): string => JSON.stringify([group.assignment?.id ?? null, group.assignment?.status ?? null,+ group.assignment?.reviewFoundAt ?? null, group.ledger?.mergedAt ?? null, group.pullRequestUrls?.length ?? 0])++/** Marks each work group whose state this write changed, or that it created, through its latest message, so the wake-up+ * asks the coordinator to read it; the project's progress changes only when the project goes from clean to dirty, so+ * changes in different conversations of one project never write the same part (spec ruling 1). */+export function noteWorkChanges(before: SuperTabState, after: SuperTabState, now: number) {+ if (!after.projects) return+ const prior = new Map(before.conversations.map(g => [g.id, g]))+ for (const group of after.conversations) {if (isLeads(group) || group.audience) continue- const project = groupProject(state, group)+ const was = prior.get(group.id)+ if (was && workState(was) === workState(group)) continue+ const project = groupProject(after, group)if (group.id === project.leadConversationId) continue- const clean = !project.progress || !dirtyGroups(state, project).length+ const clean = !project.progress || !dirtyGroups(after, project).lengthproject.progress ??= freshProgress(now)- group.reportSeq = sequences.get(message.id) ?? group.messageSeq ?? 0+ group.reportSeq = Math.max(group.reportSeq ?? 0, group.messageSeq ?? 0)if (clean) project.progress.since = now}}@@ -43,27 +59,29 @@ const throughOf = (groups: Conversation[]) => Object.fromEntries(groups.map(g =>export const UNANSWERED_REQUEST_MS = 2 * 60 * 60_000export function projectUpdateRequest(state: SuperTabState, target: Agent, now: number): MessageDraft | null {- // An older Swarm without stored projects is one synthesized project. It keeps no report progress (noteProjectReports),+ // An older Swarm without stored projects is one synthesized project. It keeps no report progress (noteWorkChanges),// so its Lead is woken only for lost work (liveness.ts), which replaced the wake-up for workers down two hours.if (state.paused) return nullconst project = projectOf(state, agentProjectId(state, target))const group = conversation(state, project.leadConversationId), progress = project.progressif (group.leadId !== target.id || group.archived) return nullconst dirty = dirtyGroups(state, project)+ // Five minutes after the first change, and at most once every 15 minutes, whatever cadence an older client set+ // (updateMinutes is still read, never used here).const reports = !!progress && dirty.some(g => (g.reportSeq ?? 0) > (progress.requested[g.id] ?? progress.requestedFloor)) &&- now >= Math.max(progress.requestedAt ?? 0, progress.since) + project.updateMinutes * 60_000+ now >= Math.max(progress.since + BATCH_MS, progress.requestedAt === undefined ? 0 : progress.requestedAt + WAKE_GAP_MS)if (!reports) return nullconst through = throughOf(dirty)const id = stableId('project-update', state.id, project.id, JSON.stringify(through))const after = (g: Conversation) => `${g.number !== undefined ? `#${g.number}` : JSON.stringify(g.title)} after ${progress!.summarized[g.id] ?? progress!.summarizedFloor}`- const text = `Consolidate new reports for project ${JSON.stringify(project.name)}. ` ++ const text = `Work changed in project ${JSON.stringify(project.name)}. ` +`Read the new messages of these workgroups: ${dirty.map(after).join(', ')}; inspect their current work. ` +- 'At your next natural checkpoint, tell the people what changed, what is blocked, and what comes next. Include useful workgroup references and result links. ' +- 'Do not copy the terminal log or repeat unchanged status. This is a scheduled request, not a new task. ' ++ 'Then keep the project\'s status card current: one short line per active task saying where it is, what changed, and what it waits on; ' ++ 'nothing repeated from the cards in the chat. The card updates in place and posts nothing to the chat. This is a scheduled request, not a new task. ' +`Use harness super-tab --tab ${state.id} command UNIQUE_OPERATION_ID ` +- `JSON with {"type":"project.report","projectId":"${project.id}","through":${JSON.stringify(through)},"text":"your update"}. ` +- 'Use text:null to acknowledge if nothing merits an update. Reuse the same operation ID after a lost reply. ' +- 'Keep reporting human questions, serious blockers, and completion immediately; do not wait for this cadence.'+ `JSON with {"type":"project.report","projectId":"${project.id}","through":${JSON.stringify(through)},"text":"the whole card"}. ` ++ 'Use text:null to acknowledge when the card is still right. Reuse the same operation ID after a lost reply. ' ++ 'Post in the project chat only when work merges or ships, a person must decide something new, or work is badly stuck, in one or two lines with the link.'return { id, conversationId: group.id,author: author(state, { kind: 'agent', agentId: target.id, machineOwnerId: target.machineOwnerId }),text, replyTo: null, recipients: [target.id],diff --git a/backend/src/superTabs/projects.ts b/backend/src/superTabs/projects.tsindex fa7944af8..298ba720d 100644--- a/backend/src/superTabs/projects.ts+++ b/backend/src/superTabs/projects.ts@@ -38,8 +38,14 @@ export interface SwarmProject {visibility: ProjectVisibilitymembers: Array<{ id: string; generation: string }>updateMinutes: 1 | 5 | 15 | 30- /** The morning digest (digest.ts): its local time ("08:00") and zone, and the local date and time of the last one sent. */+ /** The morning digest (digest.ts): its local time ("08:00") and zone, and the local date and time of the last one sent.+ * On by default: a project without one gets the default on its coordinator's next poll, unless a person turned it off. */digest?: { time: string; timeZone: string; lastOn?: string; lastAt?: number }+ /** A person turned the digest off (project.digest with time null), so the default is not filled in again. */+ digestOff?: true+ /** The status card at the top of the project chat (Dee, 2026-10-31): the coordinator's last project.report text, which+ * replaces the one before and posts nothing. Read exactly by those who read the project chat (model.ts visibleState). */+ status?: ProjectStatus | null/** Report watermark per conversation (projectUpdates.ts); kept in its own part (store by parts). */progress?: import('./parts/types.js').ProgressDatarepository?: { machineId: string; cwd: string; repositoryUrl: string | null }@@ -64,6 +70,10 @@ export interface SwarmProject {coordinatorName?: string}+/** A project's status card: its text, when (ISO time) and by which agent it was written. */+export interface ProjectStatus { text: string; at: string; by: string }+export const PROJECT_STATUS_MAX = 2_000+export const skillModeOf = (project: SwarmProject): SkillMode => project.skillMode ?? 'orchestration'/** Custom only while the stored mode is still Default: a release from before custom sets switches a project by skillMode* alone during a rolling deploy, and that switch must hold here too. */diff --git a/backend/src/superTabs/store.ts b/backend/src/superTabs/store.tsindex a893e5643..4806f6325 100644--- a/backend/src/superTabs/store.ts+++ b/backend/src/superTabs/store.ts@@ -34,9 +34,9 @@ import { deleteInstructions, instructionsId, readNotes, revisionId, writeInstrucimport { coordinatorNameOf, FIRST_INSTRUCTIONS, FIRST_SUMMARY, liveNotes, MAX_REVISIONS } from './instructions.js'import { INSTRUCTIONS_TEMPLATE } from './instructionsTemplate.js'import { confidentialSessions, otherRegistrations, recordConfidential } from './confidential.js'-import { answersRequest, dirtyGroups, noteProjectReports, projectUpdateRequest, UNANSWERED_REQUEST_MS } from './projectUpdates.js'+import { answersRequest, dirtyGroups, noteWorkChanges, projectUpdateRequest, UNANSWERED_REQUEST_MS } from './projectUpdates.js'import { cloneData } from './cloneData.js'-import { digestDue, digestMessageId, digestRequest, digestSince } from './digest.js'+import { digestDue, digestMessageId, digestOf, digestRequest, digestSince } from './digest.js'import { judgedMachines, loseTasks, nextLossAt, sweepForLead, sweepLiveness, SWEEP_EVERY_MS, unpurgedNotice } from './liveness.js'import { archivable, archiveLine, idleNotices, reviewClosable, reviewCloseLine, reviewPullRequests } from './tidy.js'import { clock, insertParts, loadActive, loadLightGroups, loadMachineParts, loadObserved, reassemble, split, type GroupData, type HeadData, type MachineData, type Part, type SwarmParts } from './parts/index.js'@@ -1451,9 +1451,10 @@ export class SuperTabStore {await tx.superTabDelivery.updateMany({ where: { tabId, conversationId: { in: removedGroups.map(c => c.id) },status: { in: ['queued', 'claimed', 'uncertain'] } }, data: { status: 'cancelled', holdReason: null, holdSince: null } })}- // Each conversation numbers its own messages; a shown one is its latest and counts toward its project's reports.+ // Each conversation numbers its own messages. Only a change of a work group's state wakes its coordinator, read through+ // its latest message; an ordinary message never does (Dee, 2026-10-31).const sequences = numberMessages(effects.state, effects.messages, context.now)- noteProjectReports(effects.state, shown, sequences, context.now)+ noteWorkChanges(original, effects.state, context.now)if (command.type === 'work.assign' || command.type === 'work.status' || command.type === 'message.send') {const group = conversation(effects.state, command.conversationId)const assignment = group.assignment@@ -2881,7 +2882,7 @@ export class SuperTabStore {const state = cloneData(loaded.state)if (sentAlready) {const project = projectOf(state, led!.id)- project.digest = { ...project.digest!, lastOn: due! }+ project.digest = { ...digestOf(project)!, lastOn: due! }}author(state, await this.actor(tx, user, state, agentId), true)const target = agent(state, agentId)@@ -2912,7 +2913,8 @@ export class SuperTabStore {const digest = digestRequest(state, target, this.now(), asked)if (digest) {const project = projectOf(state, digest.source!.projectId as string)- project.digest = { ...project.digest!, lastOn: digest.source!.on as string, lastAt: this.now() }+ // A default digest is stored with its first send (digest.ts digestOf).+ project.digest = { ...digestOf(project)!, lastOn: digest.source!.on as string, lastAt: this.now() }written.push(digest)}// The poll also frees agents whose task the checks just lost, and any an older server left marked running (each poll; adiff --git a/cli/src/lib/swarmSkills.spec.ts b/cli/src/lib/swarmSkills.spec.tsindex e15d11f5f..9f1c0cb6d 100644--- a/cli/src/lib/swarmSkills.spec.ts+++ b/cli/src/lib/swarmSkills.spec.ts@@ -104,7 +104,8 @@ describe('built-in Swarm skills', () => {// alone, in both modes, right after its write-like-a-colleague line.const thread = '- Answer a message inside its thread: post with --reply-to that message, and your reply joins its thread. Many people talk to you at once; answers in the main chat bury each other. Post at the top level only to start a new topic.\n'const limit = '- A task lost to a usage limit resumes by itself in the same session when the limit resets (its wake-up says when). Hand it on at once only to another account or engine with allowance now, with its pushed branch and last progress note.\n'- const digest = '- Morning digest: when a person asks for one, set the project\'s digest to their local time and time zone ("project.digest" with time "08:00" and timeZone "Asia/Ho_Chi_Minh"). When it wakes you, check that each pull request under Shipped is merged, then post one message to the people in the project chat.\n'+ // On by default since quiet project chats (Dee, 2026-10-31); a person moves it or turns it off.+ const digest = '- Morning digest: every project has one by default, at 08:00 Vietnam time. When a person asks, move it to their local time and time zone ("project.digest" with time "08:00" and timeZone "Asia/Ho_Chi_Minh"), or turn it off with time null. When it wakes you, check that each pull request under Shipped is merged, then post one message to the people in the project chat.\n'const checkpoint = '- Push your work branch at least every 30 minutes, and set your work status to working with a one-line note of what is done and what is next, so another agent can continue if you stop.\n'// The plan line (Lead's brief for v2 M, 2026-10-27; docs/plans/2026-10-27-swarm-scheduler.md): the Lead's alone, in both modes.const plan = '- With 3 or more groups waiting, run plan first: it places them all at once on the best machines and models. Then route each group in the plan\'s order and start the plan\'s pick, with overrideReason "scheduler plan" when the route picks otherwise. If plan cannot run here, route as usual.\n'@@ -125,8 +126,19 @@ describe('built-in Swarm skills', () => {+ '- Never remove a worktree that a live process still uses. A fresh worktree on the default branch may belong to an agent that is just starting.\n'+ '- Install nothing system-wide on a shared machine; put the tools you need in your session folder.\n\n'const sharedLast = `\n${shared.trimEnd()}\n`- // The update-request line (Ken, 2026-10-28): the Lead's alone, in both modes, right after its cadence rule.- const report = '- Answer each scheduled project update request as soon as it arrives: project.report through the revisions it names, with text null when nothing changed. An unanswered request blocks the later ones and keeps finished groups from archiving.\n'+ // The update-request line (Ken, 2026-10-28): the Lead's alone, in both modes, right after its status-card rule. Quiet project+ // chats (Dee, 2026-10-31): the report writes the status card, and the chat gets a post only when work ships, a person must+ // decide or work is badly stuck, right after it.+ const report = '- Answer each scheduled update request as soon as it arrives: project.report through the conversations it names, with the whole card as text, or text null when the card is still right. An unanswered request blocks the later ones and keeps finished groups from archiving.\n'+ const quiet = '- Post in the project chat only when work merges or ships, a person must decide something new, or work is badly stuck: one or two lines with the link. Ask a person a question once, as a decision; it shows in the card until answered, and no later post repeats it.\n'+ // The status card replaces each Lead's cadence post, and the card's lines the scored table (Dee, 2026-10-31).+ const card = '- Keep the project\'s status card current: it sits at the top of the project chat and updates in place. Write it with project.report, the whole card as text: one short line per active task saying where it is and what it waits on, nothing repeated. It posts nothing to the chat.\n'+ const quietChat: Array<['orchestration' | 'default', 'lead', string, string]> = [+ ['orchestration', 'lead', card, '- At project cadence, post progress, blockers and next steps in the project chat; if nothing changed, post nothing.\n'],+ ['orchestration', 'lead', '- The card names each active task in a few words, then where it is and what it waits on; a task leaves it once it is done and verified.\n',+ '- Progress is a scored table: one row per group with a score from 0 to 1, its owner, and what it waits on. Only done and verified scores 1.0. Every row below 1.0 has an owner or says what it waits on.\n'],+ ['default', 'lead', card, '- At the project\'s cadence, post a scored table: one row per group, 0 to 1, its owner and what it waits on. Only merged and tried scores 1.0. If nothing changed, post nothing.\n'],+ ]// The live-card lines (Dee's Slack parity, 2026-10-29; backend superTabs/cards.ts): a task and each linked pull request are one// card that updates itself, so no role posts a line that only repeats it. Each role's own line, in both modes: the Lead's after// its update-request line, the Builder's after its checkpoint line, the Reviewer's after its independent check.@@ -219,7 +231,7 @@ describe('built-in Swarm skills', () => {})// By role too: the Builder's and the Reviewer's tool-check line is the same, and only the Builder's replaced an approved one.const approved = (text: string, mode: 'orchestration' | 'default', role: 'lead' | 'dev' | 'review') =>- [...autoReview, ...failFast, ...stallWake, ...reactionTake].filter(([m, r]) => m === mode && r === role).reduce((t, [, , line, before]) => t.replace(line, before), role === 'lead' ? text.replace(reviewPlan, '') : text)+ [...autoReview, ...failFast, ...stallWake, ...reactionTake, ...quietChat].filter(([m, r]) => m === mode && r === role).reduce((t, [, , line, before]) => t.replace(line, before), role === 'lead' ? text.replace(reviewPlan, '') : text)it('tells each Lead to act within minutes on the Swarm\'s stall wake-up, in place of the 6-hour rule, and no other role', () => {for (const [mode, , line, before] of stallWake) {expect(readFileSync(prepareSwarmSkill(fixture(), { role: 'lead', key: 'session', mode }).file, 'utf8').split(line), mode).toHaveLength(2)@@ -285,7 +297,7 @@ describe('built-in Swarm skills', () => {expect(text.split(thread)).toHaveLength(role === 'lead' ? 2 : 1)expect([cardLead, cardDev, cardReview].map(line => text.split(line).length)).toEqual([role === 'lead' ? 2 : 1, role === 'dev' ? 2 : 1, role === 'review' ? 2 : 1])expect(sha(approved(text, 'orchestration', role).replace(whoReaches(role), '').replace(reactions(role), '').replace(twoHours, '').replace(terminal, '').replace(update, '').replace(overlap, '').replace(local, '').replace(failedStart, '').replace(mention, '').replace(lost, '').replace(checkpoint, '')- .replace(limit, '').replace(digest, '').replace(decision, '').replace(ask, '').replace(requests, '').replace(shared, '').replace(report, '')+ .replace(limit, '').replace(digest, '').replace(decision, '').replace(ask, '').replace(requests, '').replace(shared, '').replace(report, '').replace(quiet, '').replace(missingStop, '').replace(reviewCheck, '').replace(moveMissing, '').replace(thread, '').replace(cardLead, '').replace(cardDev, '').replace(cardReview, ''))).toBe(sha256)}@@ -294,7 +306,7 @@ describe('built-in Swarm skills', () => {const read = (role: 'lead' | 'dev' | 'review', mode: 'orchestration' | 'default') =>readFileSync(prepareSwarmSkill(fixture(), { role, key: 'session', mode }).file, 'utf8')for (const mode of ['orchestration', 'default'] as const) {- expect(read('lead', mode)).toContain(`${report}${cardLead}`)+ expect(read('lead', mode)).toContain(`${report}${quiet}${cardLead}`)expect(read('dev', mode)).toContain(`${checkpoint}${cardDev}`)}expect(read('review', 'orchestration')).toContain(`- Pass or fail the independent check, with the revision and verdict as evidence.\n${cardReview}`)@@ -368,11 +380,15 @@ describe('built-in Swarm skills', () => {expect(plain.endsWith(`${lastBefore[role]}\n${whoReaches(role)}${reactionsBefore(role).slice(1)}${sharedLast}`), role).toBe(true)}})- it('adds the update-request line right after each Lead skill\'s cadence rule', () => {- const orchestration = readFileSync(prepareSwarmSkill(fixture(), { role: 'lead', key: 'session' }).file, 'utf8')- expect(orchestration).toContain(`- At project cadence, post progress, blockers and next steps in the project chat; if nothing changed, post nothing.\n${report}`)- const plain = readFileSync(prepareSwarmSkill(fixture(), { role: 'lead', key: 'session', mode: 'default' }).file, 'utf8')- expect(plain).toContain(`Only merged and tried scores 1.0. If nothing changed, post nothing.\n${report}`)+ it('keeps each Lead\'s progress in the status card and its chat quiet, right after the card rule, and no other role', () => {+ for (const mode of ['orchestration', 'default'] as const) {+ for (const role of ['lead', 'dev', 'review'] as const) {+ const text = readFileSync(prepareSwarmSkill(fixture(), { role, key: 'session', mode }).file, 'utf8')+ expect(text.split(quiet), `${mode} ${role}`).toHaveLength(role === 'lead' ? 2 : 1)+ expect(text, `${mode} ${role}`).not.toMatch(/project cadence|project's cadence|scored table/)+ if (role === 'lead') expect(text, mode).toContain(`${card}${report}${quiet}${cardLead}`)+ }+ }})it('adds the lost-work line right after each Lead skill\'s 2-hour rule', () => {const orchestration = readFileSync(prepareSwarmSkill(fixture(), { role: 'lead', key: 'session' }).file, 'utf8')@@ -457,7 +473,7 @@ describe('built-in Swarm skills', () => {expect(text.split(thread)).toHaveLength(role === 'lead' ? 2 : 1)expect([cardLead, cardDev, cardReview].map(line => text.split(line).length)).toEqual([role === 'lead' ? 2 : 1, role === 'dev' ? 2 : 1, role === 'review' ? 2 : 1])expect(sha(approved(text, 'default', role).replace(whoReaches(role), '').replace(reactions(role), '').replace(terminal, '').replace(update, '').replace(overlap, '').replace(localDefault, '').replace(failedStart, '').replace(mention, '').replace(lost, '').replace(checkpoint, '')- .replace(limit, '').replace(digest, '').replace(decision, '').replace(ask, '').replace(requestsLast, '').replace(sharedLast, '').replace(report, '')+ .replace(limit, '').replace(digest, '').replace(decision, '').replace(ask, '').replace(requestsLast, '').replace(sharedLast, '').replace(report, '').replace(quiet, '').replace(missingStop, '').replace(reviewCheck, '').replace(moveMissing, '').replace(thread, '').replace(cardLead, '').replace(cardDev, '').replace(cardReview, ''))).toBe(sha256)expect(prepared.instructions).toMatch(/^Use the built-in swarm-tools skill /)diff --git a/cli/src/lib/swarmSkills.ts b/cli/src/lib/swarmSkills.tsindex c3829bf13..2b96efe47 100644--- a/cli/src/lib/swarmSkills.ts+++ b/cli/src/lib/swarmSkills.ts@@ -122,7 +122,7 @@ For large work, post the group plan and get the owner's ok before assigning; onc- A Builder or Reviewer that has been down for 2 hours (machine offline, session gone or stopped): cancel its task with the reason, route it, and assign it to another agent with what the first one left (branch, last revision, last report).- When you are told a task is lost, hand it on at once: route it and assign it to another agent, avoiding what failed (another machine if its machine died, another account or engine if it hit a usage limit). The new brief tells the successor to continue from the lost attempt's pushed branch and last result, not to start over.- A task lost to a usage limit resumes by itself in the same session when the limit resets (its wake-up says when). Hand it on at once only to another account or engine with allowance now, with its pushed branch and last progress note.-- Morning digest: when a person asks for one, set the project's digest to their local time and time zone ("project.digest" with time "08:00" and timeZone "Asia/Ho_Chi_Minh"). When it wakes you, check that each pull request under Shipped is merged, then post one message to the people in the project chat.+- Morning digest: every project has one by default, at 08:00 Vietnam time. When a person asks, move it to their local time and time zone ("project.digest" with time "08:00" and timeZone "Asia/Ho_Chi_Minh"), or turn it off with time null. When it wakes you, check that each pull request under Shipped is merged, then post one message to the people in the project chat.- When a worker seems stuck, read its terminal; answer prompts within its task; ask the owner before approving anything risky.- Codex's "Update available" screen on a worker is dismissed with Esc alone, never a number and Enter (on a misread row that runs the update) and never as a question for the owner. The host does it for Swarm agents when the screen is exactly that prompt; if one still waits on it, press Esc yourself.- Keep each worker supplied: have its next group ready before it finishes, so nobody waits for you.@@ -152,10 +152,11 @@ For large work, post the group plan and get the owner's ok before assigning; onc- Then give the owner the choice: merge, open a PR, or keep the branch. Never merge, push, release or discard on your own.## 10. Keep people informed-- At project cadence, post progress, blockers and next steps in the project chat; if nothing changed, post nothing.-- Answer each scheduled project update request as soon as it arrives: project.report through the revisions it names, with text null when nothing changed. An unanswered request blocks the later ones and keeps finished groups from archiving.+- Keep the project's status card current: it sits at the top of the project chat and updates in place. Write it with project.report, the whole card as text: one short line per active task saying where it is and what it waits on, nothing repeated. It posts nothing to the chat.+- Answer each scheduled update request as soon as it arrives: project.report through the conversations it names, with the whole card as text, or text null when the card is still right. An unanswered request blocks the later ones and keeps finished groups from archiving.+- Post in the project chat only when work merges or ships, a person must decide something new, or work is badly stuck: one or two lines with the link. Ask a person a question once, as a decision; it shows in the card until answered, and no later post repeats it.- Each task and each pull request linked in its chat is one card there that updates itself: status, checks passed, CI, review verdict and merge. Post a pull request's link once, and never a line that only repeats what a card shows (opened, CI running or green, reviewed, merged); people and agents read the card and the Swarm's status instead.-- Progress is a scored table: one row per group with a score from 0 to 1, its owner, and what it waits on. Only done and verified scores 1.0. Every row below 1.0 has an owner or says what it waits on.+- The card names each active task in a few words, then where it is and what it waits on; a task leaves it once it is done and verified.- Answer questions, blockers and completions immediately.- Summarize long threads once; record important decisions once.- When your own session grows long, post a checkpoint in the project chat: the approved description, groups and their state, open rulings, and next steps. It must be enough for a fresh Lead session to continue.@@ -451,7 +452,7 @@ Keep each Builder's list a few tasks deep; do the easy, self-contained parts fir- A Builder or Reviewer that has been down for 2 hours (its machine offline, its session gone, or stopped): cancel its task with the reason, route it, and assign it to another agent with what the first one left (branch, last revision, last report).- When you are told a task is lost, hand it on at once: route it and assign it to another agent, avoiding what failed (another machine if its machine died, another account or engine if it hit a usage limit). The new brief tells the successor to continue from the lost attempt's pushed branch and last result, not to start over.- A task lost to a usage limit resumes by itself in the same session when the limit resets (its wake-up says when). Hand it on at once only to another account or engine with allowance now, with its pushed branch and last progress note.-- Morning digest: when a person asks for one, set the project's digest to their local time and time zone ("project.digest" with time "08:00" and timeZone "Asia/Ho_Chi_Minh"). When it wakes you, check that each pull request under Shipped is merged, then post one message to the people in the project chat.+- Morning digest: every project has one by default, at 08:00 Vietnam time. When a person asks, move it to their local time and time zone ("project.digest" with time "08:00" and timeZone "Asia/Ho_Chi_Minh"), or turn it off with time null. When it wakes you, check that each pull request under Shipped is merged, then post one message to the people in the project chat.- When the Swarm tells you a task stalled (quiet or orphaned), act on it within minutes: nudge its agent, reassign it, or post in its chat why it waits.- Needs a person: get the decision now. Blocked: change something (context, model, size or plan); never resend the same thing.- When you need a person to act or decide, tag them in the message.@@ -471,8 +472,9 @@ Keep each Builder's list a few tasks deep; do the easy, self-contained parts firWhen the project owner asks in chat to switch this project's skills (Default or Harness orchestration), change it with the project skills command, quoting their message. Only the project owner's own chat message counts.## 7. Keep people informed-- At the project's cadence, post a scored table: one row per group, 0 to 1, its owner and what it waits on. Only merged and tried scores 1.0. If nothing changed, post nothing.-- Answer each scheduled project update request as soon as it arrives: project.report through the revisions it names, with text null when nothing changed. An unanswered request blocks the later ones and keeps finished groups from archiving.+- Keep the project's status card current: it sits at the top of the project chat and updates in place. Write it with project.report, the whole card as text: one short line per active task saying where it is and what it waits on, nothing repeated. It posts nothing to the chat.+- Answer each scheduled update request as soon as it arrives: project.report through the conversations it names, with the whole card as text, or text null when the card is still right. An unanswered request blocks the later ones and keeps finished groups from archiving.+- Post in the project chat only when work merges or ships, a person must decide something new, or work is badly stuck: one or two lines with the link. Ask a person a question once, as a decision; it shows in the card until answered, and no later post repeats it.- Each task and each pull request linked in its chat is one card there that updates itself: status, checks passed, CI, review verdict and merge. Post a pull request's link once, and never a line that only repeats what a card shows (opened, CI running or green, reviewed, merged); people and agents read the card and the Swarm's status instead.- Answer questions, blockers and completions at once.- Every post carries a result, a decision asked for with your recommendation, a question, or a fault; never an acknowledgement alone.diff --git a/cli/src/superTabs/service.ts b/cli/src/superTabs/service.tsindex 21e00730a..90f452b40 100644--- a/cli/src/superTabs/service.ts+++ b/cli/src/superTabs/service.ts@@ -93,7 +93,7 @@ const HELP = {model: 'opus', effort: 'high', routeDecisionId: 'DECISION' },command: `command OPERATION_ID JSON: ${COMMAND_ABOUT} The JSON is one argument: when it holds quotes, put - in its place and send it on stdin (command OPERATION_ID - <<'JSON' … JSON). ${COMMAND_RULES}`,commands: [- { type: 'project.report', projectId: 'PROJECT', through: { GROUP: 214031 }, text: 'What changed, what is blocked, and what comes next. Use null when nothing merits repeating.' },+ { type: 'project.report', projectId: 'PROJECT', through: { GROUP: 214031 }, text: 'The whole status card, one short line per active task; it replaces the last one and posts nothing. Use null when the card is still right.' },{ type: 'project.repository', projectId: 'PROJECT', repositoryUrl: 'https://github.com/OWNER/REPOSITORY' },// The morning digest, at a person's local time; time null turns it off.{ type: 'project.digest', projectId: 'PROJECT', time: '08:00', timeZone: 'Asia/Ho_Chi_Minh' },diff --git a/cli/src/superTabs/serviceReads.spec.ts b/cli/src/superTabs/serviceReads.spec.tsindex 05ad8d9a8..8a59abc00 100644--- a/cli/src/superTabs/serviceReads.spec.ts+++ b/cli/src/superTabs/serviceReads.spec.ts@@ -114,7 +114,7 @@ describe('the project report a Lead is shown how to send', () => {const { help } = await swarm().ask({ action: 'help' }, owner) as { help: { commands: Json[] } }const report = help.commands.find(c => c.type === 'project.report')expect(report).toEqual({ type: 'project.report', projectId: 'PROJECT', through: { GROUP: 214031 },- text: 'What changed, what is blocked, and what comes next. Use null when nothing merits repeating.' })+ text: 'The whole status card, one short line per active task; it replaces the last one and posts nothing. Use null when the card is still right.' })expect(JSON.stringify(help)).not.toContain('throughRevision')})})diff --git a/desktop/lib/super_tabs/controller.dart b/desktop/lib/super_tabs/controller.dartindex 2e14134eb..d2ac2e9c9 100644--- a/desktop/lib/super_tabs/controller.dart+++ b/desktop/lib/super_tabs/controller.dart@@ -187,6 +187,9 @@ class SuperTabController extends ChangeNotifier {_decisionsAside.addAll((initial['decisionsAside'] as List? ?? const []).whereType<String>(),);+ _statusFolded.addAll(+ (initial['statusFolded'] as List? ?? const []).whereType<String>(),+ );devicesSelected = initial['devicesSelected'] == true;projectsGroupOpen = initial['projectsGroupOpen'] as bool? ?? true;machinesGroupOpen = initial['machinesGroupOpen'] as bool? ?? true;@@ -850,6 +853,26 @@ class SuperTabController extends ChangeNotifier {if (_decisionsAside.length != before) _saveSoon();}+ /// The projects whose status card the reader folded to its heading line:+ /// saved on this computer for this reader. Only the newest+ /// [statusFoldedKept] are kept, so the set cannot grow without end.+ final _statusFolded = <String>{};+ static const statusFoldedKept = 200;+ bool statusFolded(String projectId) => _statusFolded.contains(projectId);++ void setStatusFolded(String projectId, {required bool folded}) {+ // Folded again moves it to the newest end.+ _statusFolded.remove(projectId);+ if (folded) {+ _statusFolded.add(projectId);+ while (_statusFolded.length > statusFoldedKept) {+ _statusFolded.remove(_statusFolded.first);+ }+ }+ _saveSoon();+ _changed();+ }+void toggleProjectsGroup() {projectsGroupOpen = !projectsGroupOpen;_saveSoon();@@ -2210,6 +2233,7 @@ class SuperTabController extends ChangeNotifier {'expandedProjects': expandedProjects.toList(),'expandedMachines': expandedMachines.toList(),'decisionsAside': _decisionsAside.toList(),+ 'statusFolded': _statusFolded.toList(),'devicesSelected': devicesSelected,'projectsGroupOpen': projectsGroupOpen,'machinesGroupOpen': machinesGroupOpen,diff --git a/desktop/lib/super_tabs/launch_prompt.dart b/desktop/lib/super_tabs/launch_prompt.dartindex dc6c0f244..3859abb51 100644--- a/desktop/lib/super_tabs/launch_prompt.dart+++ b/desktop/lib/super_tabs/launch_prompt.dart@@ -16,4 +16,15 @@ String superTabLaunchPrompt({'Terminal output is not shared chat. If sandbox blocks commands, request permission. '"Read your role in the project's instructions: `harness super-tab --tab $tabId instructions`. "'Be a helpful colleague: answer first, in their language, under 150 words unless asked. Hide commands, internal IDs and field names. Give results with revision/links. '- '${lead ? 'Update Lead chat: plan, progress, blockers, next steps. At project cadence, read new reports and consolidate them. No per-turn summarizer. Answer questions, blockers and completion immediately. On scheduled requests use project.report for updates or text:null when nothing changed. Scope workgroups and sessions to this project.' : ''}';+ // Quiet project chats (Dee, 2026-10-31): progress lives in the project's+ // status card, never in posts at a cadence (cli swarmSkills.ts, Lead text).+ '${lead ? kLeadQuietChat : ''}';++/// How a Lead keeps people informed, the same as the Lead skill text: the+/// status card holds progress, and the chat hears only what needs people.+const kLeadQuietChat =+ "Keep the project's status card current with project.report, the whole card as text: one short line per active task, where it is and what it waits on; it posts nothing. "+ 'Post in the Lead chat only when work merges or ships, a person must decide something new, or work is badly stuck: one or two lines with the link. '+ 'Ask a person a question once, as a decision; never repeat it. Answer questions, blockers and completion at once. '+ 'On scheduled requests read new reports, then use project.report with the whole card, or text:null when nothing changed. No per-turn summarizer. '+ 'Scope workgroups and sessions to this project.';diff --git a/desktop/lib/super_tabs/model.dart b/desktop/lib/super_tabs/model.dartindex 683a069a4..f122bfbad 100644--- a/desktop/lib/super_tabs/model.dart+++ b/desktop/lib/super_tabs/model.dart@@ -383,6 +383,7 @@ class SuperTabProject {superTabMap(member)['id'] as String,],updateMinutes = (row['updateMinutes'] as num?)?.toInt() ?? 5,+ status = SuperTabProjectStatus.read(row['status']),repository = row['repository'] is Map? Map.unmodifiable(superTabMap(row['repository'])): null;@@ -400,9 +401,46 @@ class SuperTabProject {final bool isPrivate;final List<String> memberIds;final int updateMinutes;++ /// What the coordinator last said of the project's progress, shown in the+ /// status card at the top of its chat; null from an older backend and+ /// before the first report.+ final SuperTabProjectStatus? status;final Map<String, dynamic>? repository;}+/// A project's status card text: one per project, replaced by each report+/// (`project.report` with text), never posted to its chat.+class SuperTabProjectStatus {+ const SuperTabProjectStatus({required this.text, this.at, this.by});++ /// The longest text the backend keeps; a longer one is cut here too.+ static const maxText = 2000;++ /// Null for anything but a status with text: a missing or malformed field,+ /// or an empty report, shows no card.+ static SuperTabProjectStatus? read(Object? value) {+ if (value is! Map) return null;+ final text = value['text'];+ if (text is! String || text.trim().isEmpty) return null;+ final at = value['at'];+ final by = value['by'];+ return SuperTabProjectStatus(+ text: text.length > maxText ? text.substring(0, maxText) : text,+ at: at is String ? DateTime.tryParse(at) : null,+ by: by is String ? by : null,+ );+ }++ final String text;++ /// When it was written; null when the backend sent no readable time.+ final DateTime? at;++ /// The agent that wrote it.+ final String? by;+}+class SuperTabSnapshot {SuperTabSnapshot.fromJson(Map<String, dynamic> row): id = _text(row, 'id'),diff --git a/desktop/lib/super_tabs/project_options.dart b/desktop/lib/super_tabs/project_options.dartindex eec5a02f5..929346443 100644--- a/desktop/lib/super_tabs/project_options.dart+++ b/desktop/lib/super_tabs/project_options.dart@@ -96,7 +96,6 @@ Future<void> showProjectAction(var name = project.name;var visibility = project.isPrivate ? 'private' : 'public';final members = project.memberIds.toSet();- var minutes = project.updateMinutes;var busy = false;await showAppDialog<void>(context: context,@@ -113,11 +112,7 @@ Future<void> showProjectAction(.firstOrNull;final canManage = current?.ownerId == c.accountId;return AlertDialog(- title: Text(switch (action) {- 'rename' => 'Rename project',- 'sharing' => 'Sharing',- _ => 'Project updates',- }),+ title: Text(action == 'rename' ? 'Rename project' : 'Sharing'),content: SizedBox(width: 400,child: SingleChildScrollView(@@ -174,33 +169,6 @@ Future<void> showProjectAction(),),],- if (action == 'cadence') ...[- Text(- '${c.snapshot?.coordinatorNameOf(project.id) ?? kDefaultCoordinatorName} gathers new task reports while work is active.',- style: DesktopChrome.text(),- ),- const SizedBox(height: 12),- DropdownButton<int>(- value: minutes,- items: [- for (final value in const [1, 5, 15, 30])- DropdownMenuItem(- value: value,- child: Text(- 'Every $value ${value == 1 ? 'minute' : 'minutes'}',- ),- ),- ],- onChanged: busy- ? null- : (value) => update(() => minutes = value!),- ),- const SizedBox(height: 8),- Text(- 'Questions, blockers and completion are reported immediately. No new progress means no update.',- style: DesktopChrome.metadata(),- ),- ],if (c.operationError != null) ...[const SizedBox(height: 12),Text(c.operationError!),@@ -225,24 +193,20 @@ Future<void> showProjectAction(c.saving ||c.hasPendingAction ||name.trim().isEmpty ||- (action != 'cadence' && !canManage)+ !canManage? null: () async {update(() => busy = true);final result = await c.command({- 'type':- 'project.${action == 'rename'- ? 'rename'- : action == 'sharing'- ? 'sharing'- : 'cadence'}',+ 'type': action == 'rename'+ ? 'project.rename'+ : 'project.sharing','projectId': project.id,if (action == 'rename') 'name': name.trim(),if (action == 'sharing') ...{'visibility': visibility,'memberIds': members.toList(),},- if (action == 'cadence') 'minutes': minutes,});if (!context.mounted) return;if (result != null) {diff --git a/desktop/lib/super_tabs/project_status_card.dart b/desktop/lib/super_tabs/project_status_card.dartnew file mode 100644index 000000000..d18414da6--- /dev/null+++ b/desktop/lib/super_tabs/project_status_card.dart@@ -0,0 +1,342 @@+import 'package:flutter/gestures.dart';+import 'package:flutter/material.dart';++import '../core/open_in_browser.dart';+import '../shared/theme/app_icons.dart';+import '../shared/theme/app_theme.dart' as grid;+import '../shared/widgets/app_icon_button.dart';+import '../widgets/desktop_chrome.dart';+import 'controller.dart';+import 'decisions.dart';+import 'message_text.dart';+import 'model.dart';++/// The status card at the top of a project's chat (Dee, 2026-10-31): what the+/// coordinator last reported, replaced in place by each report instead of a+/// post, and the decisions in this project waiting on the reader, each with+/// Answer. Hidden while there is neither; folded to its heading line by the+/// reader, remembered on this computer ([SuperTabController.statusFolded]).+///+/// It reads nothing of its own: the text comes with the Swarm read, the+/// decisions are the reader's own list ([SuperTabDecisions]).+class SuperTabProjectStatusCard extends StatelessWidget {+ const SuperTabProjectStatusCard({+ super.key,+ required this.controller,+ required this.projectId,+ this.now = DateTime.now,+ });++ final SuperTabController controller;+ final String projectId;+ final DateTime Function() now;++ /// The decisions [decisions] holds that wait on the reader in [projectId]:+ /// each asked in a conversation of that project the reader still reads, so+ /// one from another project, or whose conversation they lost, never shows.+ static List<SuperTabDecision> needsYou(+ SuperTabController c,+ SuperTabDecisions decisions,+ String projectId,+ ) {+ final snapshot = c.snapshot;+ if (snapshot == null || c.accessRevoked) return const [];+ return [+ for (final d in decisions.open)+ if (d.projectId == projectId &&+ snapshot.conversation(d.conversationId)?.projectId == projectId)+ d,+ ];+ }++ /// "16:52" today, "Oct 30, 16:52" before, in this computer's time.+ static String updatedAt(DateTime at, DateTime now) {+ final local = at.toLocal(), today = now.toLocal();+ String two(int n) => n.toString().padLeft(2, '0');+ final clock = '${two(local.hour)}:${two(local.minute)}';+ if (local.year == today.year &&+ local.month == today.month &&+ local.day == today.day) {+ return clock;+ }+ const months = [+ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', //+ 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec',+ ];+ final year = local.year == today.year ? '' : ' ${local.year}';+ return '${months[local.month - 1]} ${local.day}$year, $clock';+ }++ @override+ Widget build(BuildContext context) {+ final decisions = SuperTabDecisions.of(controller);+ return ListenableBuilder(+ listenable: Listenable.merge([controller, decisions]),+ builder: (context, _) {+ grid.AppTheme.watch(context);+ final c = controller;+ final project = c.accessRevoked+ ? null+ : c.snapshot?.projectById(projectId);+ if (project == null) return const SizedBox.shrink();+ final status = project.status;+ final waiting = needsYou(c, decisions, projectId);+ if (status == null && waiting.isEmpty) return const SizedBox.shrink();+ final folded = c.statusFolded(projectId);+ return Padding(+ padding: const EdgeInsets.fromLTRB(+ grid.AppDesktop.panelPadding,+ grid.AppDesktop.controlGap,+ grid.AppDesktop.panelPadding,+ grid.AppDesktop.controlGap,+ ),+ child: Semantics(+ container: true,+ label: 'Project status',+ child: DecoratedBox(+ key: ValueKey('super-project-status-$projectId'),+ decoration: BoxDecoration(+ color: DesktopChrome.surface,+ border: Border.all(color: DesktopChrome.rim),+ borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),+ ),+ child: Padding(+ padding: EdgeInsets.fromLTRB(+ grid.AppDesktop.groupGap,+ grid.AppDesktop.listRowGap,+ grid.AppDesktop.controlGap,+ folded+ ? grid.AppDesktop.listRowGap+ : grid.AppDesktop.groupGap,+ ),+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.stretch,+ children: [+ _heading(status, waiting.length, folded),+ if (!folded)+ // A long report scrolls inside the card, so the chat+ // keeps its room.+ ConstrainedBox(+ constraints: const BoxConstraints(maxHeight: 240),+ child: SingleChildScrollView(+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.stretch,+ children: [+ if (status != null) _StatusText(status.text),+ for (final (i, d) in waiting.indexed)+ _NeedsYouRow(+ decision: d,+ first: i == 0,+ reader: c.snapshot?.people+ .where((p) => p.id == c.accountId)+ .firstOrNull+ ?.username,+ onAnswer: () =>+ c.openNotice('decision', d.id),+ ),+ ],+ ),+ ),+ ),+ ],+ ),+ ),+ ),+ ),+ );+ },+ );+ }++ Widget _heading(SuperTabProjectStatus? status, int waiting, bool folded) {+ final at = status?.at;+ return Row(+ children: [+ Expanded(+ child: Text.rich(+ TextSpan(+ children: [+ TextSpan(+ text: 'Status',+ style: DesktopChrome.control(medium: true),+ ),+ if (at != null)+ TextSpan(+ text: ' · updated ${updatedAt(at, now())}',+ style: DesktopChrome.metadata(),+ ),+ // Folded, the heading still says something waits.+ if (folded && waiting > 0)+ TextSpan(+ text: ' · $waiting ${waiting == 1 ? 'needs' : 'need'} you',+ style: DesktopChrome.metadata(color: DesktopChrome.accent),+ ),+ ],+ ),+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ ),+ ),+ AppIconButton(+ key: ValueKey('super-project-status-fold-$projectId'),+ tooltip: folded ? 'Show status' : 'Fold status',+ icon: folded ? AppIcons.chevronDown : AppIcons.chevronUp,+ onPressed: () =>+ controller.setStatusFolded(projectId, folded: !folded),+ ),+ ],+ );+ }+}++/// The report as the coordinator wrote it, line for line, with its web links+/// clickable. Not Markdown: the card is a glance, not a message.+class _StatusText extends StatefulWidget {+ const _StatusText(this.text);+ final String text;++ @override+ State<_StatusText> createState() => _StatusTextState();+}++class _StatusTextState extends State<_StatusText> {+ static final _link = RegExp(r'https?://[^\s<>()\[\]]+');++ /// The text cut into plain pieces and links, with one tap per link: made+ /// again only when the text changes, so a rebuild (a theme flip, a Swarm+ /// read) never drops a tap under the pointer.+ var _pieces = <(String, TapGestureRecognizer?)>[];++ @override+ void initState() {+ super.initState();+ _cut();+ }++ @override+ void didUpdateWidget(_StatusText old) {+ super.didUpdateWidget(old);+ if (old.text != widget.text) _cut();+ }++ @override+ void dispose() {+ _release();+ super.dispose();+ }++ void _release() {+ for (final (_, tap) in _pieces) {+ tap?.dispose();+ }+ }++ void _cut() {+ _release();+ final text = widget.text.trimRight();+ final pieces = <(String, TapGestureRecognizer?)>[];+ var at = 0;+ for (final match in _link.allMatches(text)) {+ // A sentence's closing punctuation is not part of its link.+ var url = match[0]!;+ while (url.isNotEmpty && '.,;:!?\'"'.contains(url[url.length - 1])) {+ url = url.substring(0, url.length - 1);+ }+ final uri = SuperTabMessageText.webLink(url);+ if (uri == null) continue;+ if (match.start > at) pieces.add((text.substring(at, match.start), null));+ pieces.add((+ url,+ TapGestureRecognizer()..onTap = () => openInBrowser(uri),+ ));+ at = match.start + url.length;+ }+ if (at < text.length) pieces.add((text.substring(at), null));+ _pieces = pieces;+ }++ @override+ Widget build(BuildContext context) {+ final link = TextStyle(+ color: DesktopChrome.accent,+ decoration: TextDecoration.underline,+ decorationColor: DesktopChrome.accent,+ );+ return Padding(+ padding: const EdgeInsets.only(top: grid.AppDesktop.listRowGap),+ child: Text.rich(+ key: const ValueKey('super-project-status-text'),+ TextSpan(+ style: DesktopChrome.text(),+ children: [+ for (final (text, tap) in _pieces)+ tap == null+ ? TextSpan(text: text)+ : TextSpan(+ text: text,+ style: link,+ recognizer: tap,+ mouseCursor: SystemMouseCursors.click,+ ),+ ],+ ),+ ),+ );+ }+}++/// One decision waiting on the reader: who it waits on, the question, and+/// Answer, which opens it where Notifications answers it.+class _NeedsYouRow extends StatelessWidget {+ const _NeedsYouRow({+ required this.decision,+ required this.first,+ required this.reader,+ required this.onAnswer,+ });++ final SuperTabDecision decision;++ /// The first row carries the "Needs you" label; the rest line up under it.+ final bool first;+ final String? reader;+ final VoidCallback onAnswer;++ static const _labelWidth = 88.0;++ @override+ Widget build(BuildContext context) => Padding(+ padding: const EdgeInsets.only(top: grid.AppDesktop.controlGap),+ child: Row(+ key: ValueKey('super-project-status-needs-${decision.id}'),+ children: [+ SizedBox(+ width: _labelWidth,+ child: first+ ? Text(+ 'Needs you',+ style: DesktopChrome.metadata(color: DesktopChrome.accent)+ .copyWith(fontWeight: grid.AppFont.semibold),+ )+ : null,+ ),+ Expanded(+ child: Text(+ reader == null+ ? decision.question+ : '$reader: ${decision.question}',+ style: DesktopChrome.text(),+ maxLines: 2,+ overflow: TextOverflow.ellipsis,+ ),+ ),+ const SizedBox(width: grid.AppDesktop.controlGap),+ OutlinedButton(+ key: ValueKey('super-project-status-answer-${decision.id}'),+ onPressed: onAnswer,+ child: const Text('Answer'),+ ),+ ],+ ),+ );+}diff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dartindex edcb4272a..04857fc48 100644--- a/desktop/lib/super_tabs/view.dart+++ b/desktop/lib/super_tabs/view.dart@@ -61,6 +61,7 @@ import 'project_sidebar.dart';import 'buddy_sessions.dart';import 'swarm_switcher.dart' show fallBackToPersonal;import 'project_options.dart';+import 'project_status_card.dart';import 'pane_layout.dart';import '../widgets/dial_list_scroll.dart';@@ -2231,8 +2232,6 @@ class _SuperTabViewState extends State<SuperTabView>// them sends no coordinatorName.if (project?.hasInstructions == true)item('Instructions', () => _groupAction('instructions', group)),- if (editable)- item('Update cadence', () => _groupAction('cadence', group)),if (editable && project?.ownerId == c.accountId)item('Delete Project', () => _groupAction('delete', group)),] else if (_isBuddyChat(group)) ...[@@ -3019,6 +3018,16 @@ class _SuperTabViewState extends State<SuperTabView>decisions: SuperTabDecisions.of(c),projectId: group.projectId,),+ // A project's chat opens with its status card: the coordinator's+ // progress, replaced in place, and what waits on the reader there.+ if (group != null && c.snapshot?.isProjectLead(group.id) == true)+ for (final project in c.snapshot!.projects)+ if (project.leadConversationId == group.id)+ SuperTabProjectStatusCard(+ key: ValueKey('super-project-status-card-${project.id}'),+ controller: c,+ projectId: project.id,+ ),Expanded(child: c.loading? const Center(child: CircularProgressIndicator())diff --git a/desktop/test/super_tab_project_status_test.dart b/desktop/test/super_tab_project_status_test.dartnew file mode 100644index 000000000..13470761f--- /dev/null+++ b/desktop/test/super_tab_project_status_test.dart@@ -0,0 +1,567 @@+import 'dart:async';+import 'dart:io';+import 'dart:ui' as ui;++import 'package:flutter/gestures.dart';+import 'package:flutter/material.dart';+import 'package:flutter/rendering.dart';+import 'package:flutter_test/flutter_test.dart';+import 'package:harness/shared/theme/app_theme.dart' as grid;+import 'package:harness/super_tabs/controller.dart';+import 'package:harness/super_tabs/model.dart';+import 'package:harness/super_tabs/project_status_card.dart';+import 'package:harness/super_tabs/view.dart';++import 'box_render_preview_test.dart' show loadPreviewFonts;+import 'support/super_tab_fixture.dart';++/// Set to a folder to write the PR's screenshots there.+final shots = Platform.environment['SUPER_TAB_STATUS_SHOTS'];+final _picture = GlobalKey();++/// Today, 16:52 on this computer's clock, as the backend sends it.+final _at = () {+ final now = DateTime.now();+ return DateTime(now.year, now.month, now.day, 16, 52);+}();++const _report =+ 'Memory engine first PR #4750, waiting on build checks\n'+ 'Test bench docs PR #4752 open, building the month\n'+ 'Details: https://github.com/autonomous-ai/openharness/pull/4750.';++Map<String, dynamic> _status(String text, {DateTime? at}) => {+ 'text': text,+ 'at': (at ?? _at).toUtc().toIso8601String(),+ 'by': 'lead-agent',+};++/// The reader is the peer, in a Swarm of two projects: web-project (its chat+/// `lead`, with a report) and Design (its chat `design-lead`).+ConversationServer swarm({Map<String, dynamic>? status}) {+ final server = ConversationServer();+ server.state['projects'] = [+ {+ ...projectFixture('lead', 'web-project', 'lead'),+ 'status': status ?? _status(_report),+ },+ projectFixture('design', 'Design', 'design-lead'),+ ];+ server.state['people'] = [+ {'id': 'owner', 'email': '[email protected]', 'role': 'owner'},+ {'id': 'peer', 'email': '[email protected]', 'role': 'collaborator'},+ ];+ server.state['conversations'] = [+ conversationFixture('lead', 'Lead'),+ {...conversationFixture('design-lead', 'Lead'), 'projectId': 'design'},+ ];+ return server;+}++Future<SuperTabController> showView(+ WidgetTester tester,+ ConversationServer server, {+ Map<String, dynamic>? initial,+ Brightness brightness = Brightness.dark,+}) async {+ await tester.binding.setSurfaceSize(const Size(1200, 800));+ addTearDown(() => tester.binding.setSurfaceSize(null));+ final c = server.controller(account: 'peer', initial: initial);+ addTearDown(c.dispose);+ final before = grid.AppTheme.brightness.value;+ grid.AppTheme.brightness.value = brightness;+ addTearDown(() => grid.AppTheme.brightness.value = before);+ await c.refresh();+ await tester.pumpWidget(+ MaterialApp(+ key: UniqueKey(),+ theme: grid.buildAppTheme(brightness: brightness),+ builder: (context, child) => RepaintBoundary(key: _picture, child: child),+ home: Scaffold(+ body: SuperTabView(+ controller: c,+ onInvite: () {},+ onAddAgent: (_) {},+ onOpenTerminal: (_) {},+ machineName: (_) => 'Team Mac',+ ),+ ),+ ),+ );+ await tester.pumpAndSettle();+ return c;+}++Future<void> shot(WidgetTester tester, String name) async {+ if (shots == null) return;+ await tester.runAsync(() async {+ final boundary =+ _picture.currentContext!.findRenderObject()! as RenderRepaintBoundary;+ final image = await boundary.toImage();+ final bytes = await image.toByteData(format: ui.ImageByteFormat.png);+ await Directory(shots!).create(recursive: true);+ await File('$shots/$name.png').writeAsBytes(bytes!.buffer.asUint8List());+ image.dispose();+ });+}++Finder card(String projectId) =>+ find.byKey(ValueKey('super-project-status-$projectId'));+Finder statusText() => find.byKey(const ValueKey('super-project-status-text'));+Finder needs(String id) =>+ find.byKey(ValueKey('super-project-status-needs-$id'));+Finder answer(String id) =>+ find.byKey(ValueKey('super-project-status-answer-$id'));+Finder fold(String projectId) =>+ find.byKey(ValueKey('super-project-status-fold-$projectId'));++String plain(WidgetTester tester, Finder text) =>+ tester.widget<Text>(text).textSpan!.toPlainText();++String heading(WidgetTester tester, String projectId) => plain(+ tester,+ find.descendant(of: card(projectId), matching: find.byType(Text)).first,+);++Future<void> change(+ WidgetTester tester,+ ConversationServer server,+ SuperTabController c,+ void Function() edit,+) async {+ edit();+ server.revision++;+ await c.refresh();+ await tester.pumpAndSettle();+}++void main() {+ setUpAll(() async {+ if (shots != null) await loadPreviewFonts();+ });++ group('the project row\'s status', () {+ test('reads text, time and writer; anything else reads as none', () {+ final status = SuperTabProject.fromJson({+ ...projectFixture('lead', 'web-project', 'lead'),+ 'status': _status('Building'),+ }).status!;+ expect(status.text, 'Building');+ expect(status.at, _at.toUtc());+ expect(status.by, 'lead-agent');+ for (final value in <Object?>[+ null,+ 'Building',+ {'text': ''},+ {'text': ' \n'},+ {'text': 7},+ {'at': '2026-10-31T09:00:00Z'},+ ]) {+ expect(+ SuperTabProject.fromJson({+ ...projectFixture('lead', 'web-project', 'lead'),+ 'status': value,+ }).status,+ isNull,+ reason: '$value',+ );+ }+ // An older backend sends no status at all.+ expect(+ SuperTabProject.fromJson(projectFixture('lead', 'x', 'lead')).status,+ isNull,+ );+ });++ test('text at the limit is kept whole; longer is cut to it', () {+ final at = 'a' * SuperTabProjectStatus.maxText;+ expect(SuperTabProjectStatus.read({'text': at})!.text, at);+ expect(+ SuperTabProjectStatus.read({'text': '${at}bc'})!.text,+ hasLength(SuperTabProjectStatus.maxText),+ );+ // A bad time keeps the text and drops only the time.+ final odd = SuperTabProjectStatus.read({'text': 'x', 'at': 'soon'})!;+ expect(odd.text, 'x');+ expect(odd.at, isNull);+ });++ test('the time reads as a clock today and with its date before', () {+ final now = DateTime(2026, 10, 31, 18);+ expect(+ SuperTabProjectStatusCard.updatedAt(+ DateTime(2026, 10, 31, 16, 52),+ now,+ ),+ '16:52',+ );+ expect(+ SuperTabProjectStatusCard.updatedAt(DateTime(2026, 10, 30, 9, 5), now),+ 'Oct 30, 09:05',+ );+ expect(+ SuperTabProjectStatusCard.updatedAt(DateTime(2025, 12, 1, 9, 5), now),+ 'Dec 1 2025, 09:05',+ );+ });+ });++ group('the status card', () {+ testWidgets(+ 'shows the coordinator\'s text and when it was updated, links clickable',+ (tester) async {+ await showView(tester, swarm());+ expect(card('lead'), findsOneWidget);+ expect(heading(tester, 'lead'), 'Status · updated 16:52');+ expect(plain(tester, statusText()), _report);+ // The link is its own span, without the sentence's full stop.+ final spans = <TextSpan>[];+ tester.widget<Text>(statusText()).textSpan!.visitChildren((span) {+ if (span is TextSpan && span.recognizer != null) spans.add(span);+ return true;+ });+ expect(+ spans.single.text,+ 'https://github.com/autonomous-ai/openharness/pull/4750',+ );+ expect(spans.single.recognizer, isA<TapGestureRecognizer>());+ // It sits above the chat, not in it.+ expect(find.byType(SuperTabProjectStatusCard), findsOneWidget);+ },+ );++ testWidgets(+ 'a Swarm read that leaves the text keeps the same link tap, so a click in progress is not lost',+ (tester) async {+ final server = swarm();+ final c = await showView(tester, server);+ GestureRecognizer? tap() {+ GestureRecognizer? found;+ tester.widget<Text>(statusText()).textSpan!.visitChildren((span) {+ if (span is TextSpan && span.recognizer != null) {+ found = span.recognizer;+ }+ return true;+ });+ return found;+ }++ final before = tap();+ expect(before, isNotNull);+ await change(tester, server, c, () => server.ask(['Ship how?']));+ expect(needs('decision-1'), findsOneWidget);+ expect(identical(tap(), before), isTrue);+ },+ );++ testWidgets(+ 'Needs you lists only the reader\'s open decisions in this project, and Answer opens it where Notifications answers it',+ (tester) async {+ final server = swarm()+ // decision-1: asked here, open.+ ..ask(['Model keys for live runs?'])+ // decision-2: asked in the other project.+ ..ask(['Logo?'], projectId: 'design', conversationId: 'design-lead')+ // decision-3: says this project, but its conversation is Design's.+ ..ask(['Mismatch?'], conversationId: 'design-lead')+ // decision-4: in a conversation the reader cannot read.+ ..ask(['Hidden?'], conversationId: 'private-elsewhere')+ // decision-5: asked here, already answered.+ ..ask(['Done already?']);+ server.answerDecision('decision-5', 0);+ await showView(tester, server);++ expect(needs('decision-1'), findsOneWidget);+ for (final id in [+ 'decision-2',+ 'decision-3',+ 'decision-4',+ 'decision-5',+ ]) {+ expect(needs(id), findsNothing, reason: id);+ }+ expect(find.text('Logo?'), findsNothing);+ expect(find.text('Hidden?'), findsNothing);+ expect(+ find.descendant(+ of: needs('decision-1'),+ matching: find.text('dee: Model keys for live runs?'),+ ),+ findsOneWidget,+ );+ expect(+ find.descendant(+ of: needs('decision-1'),+ matching: find.text('Needs you'),+ ),+ findsOneWidget,+ );++ await tester.tap(answer('decision-1'));+ await tester.pumpAndSettle();+ // The Notifications page, with the decision's own option buttons.+ expect(find.text('Decisions'), findsOneWidget);+ expect(+ find.byKey(const ValueKey('super-decision-decision-1-0')),+ findsOneWidget,+ );+ expect(server.posts, isEmpty);+ },+ );++ testWidgets(+ 'hidden while there is no report and nothing waits; a decision alone shows it',+ (tester) async {+ final server = swarm(status: {});+ final c = await showView(tester, server);+ expect(card('lead'), findsNothing);++ // A decision in the other project changes nothing here.+ await change(tester, server, c, () {+ server.ask(+ ['Logo?'],+ projectId: 'design',+ conversationId: 'design-lead',+ );+ });+ expect(card('lead'), findsNothing);++ await change(tester, server, c, () => server.ask(['Ship how?']));+ expect(card('lead'), findsOneWidget);+ expect(heading(tester, 'lead'), 'Status');+ expect(statusText(), findsNothing);+ expect(needs('decision-2'), findsOneWidget);++ await change(+ tester,+ server,+ c,+ () => server.answerDecision('decision-2', 0),+ );+ expect(card('lead'), findsNothing);+ },+ );++ testWidgets(+ 'folding is remembered per project on this computer, and the heading still says what waits',+ (tester) async {+ final server = swarm()..ask(['Ship how?']);+ (server.state['projects'] as List)[1]['status'] = _status(+ 'Logo drafts',+ );+ final c = await showView(tester, server);++ await tester.tap(fold('lead'));+ await tester.pumpAndSettle();+ expect(statusText(), findsNothing);+ expect(needs('decision-1'), findsNothing);+ expect(heading(tester, 'lead'), 'Status · updated 16:52 · 1 needs you');+ expect(c.statusFolded('lead'), isTrue);++ await c.flush();+ final saved = server.saved!;+ expect(saved['statusFolded'], ['lead']);++ // Restarted: still folded here; the other project's card is not.+ await tester.pumpWidget(const SizedBox());+ final again = await showView(tester, server, initial: saved);+ expect(statusText(), findsNothing);+ expect(heading(tester, 'lead'), 'Status · updated 16:52 · 1 needs you');+ again.select('design-lead');+ await tester.pumpAndSettle();+ expect(plain(tester, statusText()), 'Logo drafts');++ // Shown again, and that is remembered too.+ again.select('lead');+ await tester.pumpAndSettle();+ await tester.tap(fold('lead'));+ await tester.pumpAndSettle();+ expect(plain(tester, statusText()), _report);+ await again.flush();+ expect(server.saved!['statusFolded'], isEmpty);+ },+ );++ test('the folded set keeps only the newest projects', () async {+ final server = swarm();+ final c = server.controller(account: 'peer');+ addTearDown(c.dispose);+ for (var i = 0; i <= SuperTabController.statusFoldedKept; i++) {+ c.setStatusFolded('p$i', folded: true);+ }+ expect(c.statusFolded('p0'), isFalse);+ expect(c.statusFolded('p1'), isTrue);+ expect(c.statusFolded('p${SuperTabController.statusFoldedKept}'), isTrue);+ // Another account's saved view on this computer is not read.+ await c.flush();+ final other = SuperTabController(+ tabId: 'tab',+ accountId: 'someone-else',+ request: (_, _, {body}) async => const {},+ save: (_) async {},+ initial: server.saved!,+ );+ addTearDown(other.dispose);+ expect(other.statusFolded('p1'), isFalse);+ });++ testWidgets(+ 'a new report replaces the card in place and adds nothing to the chat',+ (tester) async {+ final server = swarm();+ final c = await showView(tester, server);+ final messages = c.messages('lead').length;+ await change(tester, server, c, () {+ (server.state['projects'] as List)[0]['status'] = _status(+ 'Memory engine merged #4750',+ at: _at.add(const Duration(minutes: 30)),+ );+ });+ expect(plain(tester, statusText()), 'Memory engine merged #4750');+ expect(heading(tester, 'lead'), 'Status · updated 17:22');+ expect(find.byType(SuperTabProjectStatusCard), findsOneWidget);+ expect(c.messages('lead').length, messages);+ },+ );++ testWidgets(+ 'each project\'s chat shows its own card, never the one opened before',+ (tester) async {+ final server = swarm();+ (server.state['projects'] as List)[1]['status'] = _status(+ 'Logo drafts',+ );+ final c = await showView(tester, server);+ c.select('design-lead');+ await tester.pumpAndSettle();+ expect(card('design'), findsOneWidget);+ expect(card('lead'), findsNothing);+ expect(plain(tester, statusText()), 'Logo drafts');+ },+ );++ testWidgets('access lost while the card is open hides it at once', (+ tester,+ ) async {+ final server = swarm()..ask(['Ship how?']);+ final c = await showView(tester, server);+ expect(needs('decision-1'), findsOneWidget);+ c.revokeAccess('You no longer have access to this Swarm.');+ await tester.pump();+ expect(card('lead'), findsNothing);+ expect(find.textContaining('Ship how?'), findsNothing);+ expect(find.textContaining('Memory engine'), findsNothing);+ });++ testWidgets(+ 'the card on its own forgets the project once access is lost, never showing what it read before',+ (tester) async {+ final server = swarm()..ask(['Ship how?']);+ final c = server.controller(account: 'peer');+ addTearDown(c.dispose);+ await c.refresh();+ await tester.pumpWidget(+ MaterialApp(+ home: Scaffold(+ body: SuperTabProjectStatusCard(controller: c, projectId: 'lead'),+ ),+ ),+ );+ await tester.pumpAndSettle();+ expect(card('lead'), findsOneWidget);+ expect(needs('decision-1'), findsOneWidget);++ c.revokeAccess('You no longer have access to this Swarm.');+ await tester.pump();+ expect(card('lead'), findsNothing);+ expect(find.textContaining('Memory engine'), findsNothing);+ expect(find.textContaining('Ship how?'), findsNothing);+ },+ );++ testWidgets(+ 'losing the project drops its card, and a changed audience drops Needs you rows before the new list arrives',+ (tester) async {+ final server = swarm();+ (server.state['conversations'] as List).add({+ ...conversationFixture('plans', 'Plans'),+ 'projectId': 'lead',+ });+ server.ask(['Ship how?'], conversationId: 'plans');+ final c = await showView(tester, server);+ expect(needs('decision-1'), findsOneWidget);++ // The reader loses the workgroup; the new list is slow to come.+ final slow = server.holdDecisions = Completer<void>();+ await change(tester, server, c, () {+ (server.state['conversations'] as List).removeWhere(+ (g) => (g as Map)['id'] == 'plans',+ );+ server.hideDecision('decision-1');+ server.parts.epoch++;+ });+ expect(needs('decision-1'), findsNothing);+ expect(find.textContaining('Ship how?'), findsNothing);+ server.holdDecisions = null;+ slow.complete();+ await tester.pumpAndSettle();+ expect(needs('decision-1'), findsNothing);++ // The project itself goes: no card, no text left behind.+ await change(tester, server, c, () {+ (server.state['projects'] as List).removeAt(0);+ });+ expect(card('lead'), findsNothing);+ expect(find.textContaining('Memory engine'), findsNothing);+ },+ );++ testWidgets(+ 'a failed first decisions read shows the report alone, and the rows once a read succeeds',+ (tester) async {+ final server = swarm()..ask(['Ship how?']);+ server.failDecisions = true;+ final c = await showView(tester, server);+ expect(card('lead'), findsOneWidget);+ expect(needs('decision-1'), findsNothing);+ expect(find.byType(CircularProgressIndicator), findsNothing);++ server.failDecisions = false;+ await change(tester, server, c, () {+ (server.state['projects'] as List)[0]['status'] = _status('Later');+ });+ expect(needs('decision-1'), findsOneWidget);+ },+ );++ testWidgets('a report at the limit scrolls inside the card', (+ tester,+ ) async {+ final long = List.filled(40, 'Line of progress ' * 3).join('\n');+ final text = long.substring(0, SuperTabProjectStatus.maxText);+ await showView(tester, swarm(status: _status(text)));+ expect(tester.getSize(card('lead')).height, lessThan(320));+ expect(+ find.descendant(+ of: card('lead'),+ matching: find.byType(SingleChildScrollView),+ ),+ findsOneWidget,+ );+ expect(tester.takeException(), isNull);+ });++ for (final brightness in Brightness.values) {+ testWidgets('screenshot, ${brightness.name}', (tester) async {+ final server = swarm()..ask(['Model keys for live runs?']);+ final c = await showView(tester, server, brightness: brightness);+ expect(card('lead'), findsOneWidget);+ await shot(tester, 'project-status-${brightness.name}');+ await tester.tap(fold('lead'));+ await tester.pumpAndSettle();+ await shot(tester, 'project-status-folded-${brightness.name}');+ await c.flush();+ });+ }+ });+}diff --git a/desktop/test/super_tab_startup_recovery_test.dart b/desktop/test/super_tab_startup_recovery_test.dartindex 488e7a8f5..f8072e304 100644--- a/desktop/test/super_tab_startup_recovery_test.dart+++ b/desktop/test/super_tab_startup_recovery_test.dart@@ -81,7 +81,12 @@ void main() {);expect(prompt, contains('read new reports'));expect(prompt, contains('No per-turn summarizer'));- expect(prompt, contains('On scheduled requests use project.report'));+ expect(+ prompt,+ contains(+ 'On scheduled requests read new reports, then use project.report with the whole card',+ ),+ );expect(prompt, contains('text:null when nothing changed'));});diff --git a/desktop/test/super_tab_work_details_test.dart b/desktop/test/super_tab_work_details_test.dartindex 7b9725b0c..462f578b5 100644--- a/desktop/test/super_tab_work_details_test.dart+++ b/desktop/test/super_tab_work_details_test.dart@@ -47,6 +47,44 @@ void main() {},);+ // Quiet project chats (Dee, 2026-10-31): a Lead started from Desktop keeps+ // progress in the status card and posts only what needs people.+ test('launch prompt keeps a Lead\'s progress in the status card, never cadence posts', () {+ final lead = superTabLaunchPrompt(+ tabId: 'tab',+ conversationId: 'lead',+ lead: true,+ );+ expect(+ lead,+ contains("Keep the project's status card current with project.report"),+ );+ expect(+ lead,+ contains(+ 'Post in the Lead chat only when work merges or ships, a person must decide something new, or work is badly stuck',+ ),+ );+ expect(+ lead,+ contains('Ask a person a question once, as a decision; never repeat it.'),+ );+ for (final gone in [+ 'cadence',+ 'consolidate',+ 'Update Lead chat',+ 'progress, blockers, next steps',+ ]) {+ expect(lead, isNot(contains(gone)), reason: gone);+ }+ final builder = superTabLaunchPrompt(+ tabId: 'tab',+ conversationId: 'group',+ lead: false,+ );+ expect(builder, isNot(contains('status card')));+ });+for (final structured in [true, false]) {testWidgets('work details show the brief as written${structured ? ', never a task\'s five parts' : ''}',diff --git a/desktop/test/swarm_projects_test.dart b/desktop/test/swarm_projects_test.dartindex c72faa0ab..0069f3d5f 100644--- a/desktop/test/swarm_projects_test.dart+++ b/desktop/test/swarm_projects_test.dart@@ -227,32 +227,22 @@ void main() {await unmount(tester, c);});- testWidgets('compact project menu changes cadence for only that project', (- tester,- ) async {- final server = projectsServer(), c = server.controller();- await mount(tester, c);- await tester.tap(find.byTooltip('Project options'));- await tester.pumpAndSettle();- expect(find.byIcon(AppIcons.ellipsisVertical), findsOneWidget);- await tester.tap(find.text('Update cadence'));- await tester.pumpAndSettle();- expect(find.text('Every 5 minutes'), findsOneWidget);- await tester.tap(find.byType(DropdownButton<int>));- await tester.pumpAndSettle();- await tester.tap(find.text('Every 15 minutes').last);- await tester.pumpAndSettle();- await tester.tap(find.text('Save'));- await tester.pumpAndSettle();- expect(server.posts.single['command'], {- 'type': 'project.cadence',- 'projectId': 'lead',- 'minutes': 15,- });- expect(c.snapshot!.projectFor('lead')!.updateMinutes, 15);- expect(c.snapshot!.projectFor('design-lead')!.updateMinutes, 5);- await unmount(tester, c);- });+ testWidgets(+ 'the project menu has no update cadence: progress lives in the status card',+ (tester) async {+ final server = projectsServer(), c = server.controller();+ await mount(tester, c);+ await tester.tap(find.byTooltip('Project options'));+ await tester.pumpAndSettle();+ expect(find.byIcon(AppIcons.ellipsisVertical), findsOneWidget);+ expect(find.text('Project details'), findsOneWidget);+ expect(find.text('Update cadence'), findsNothing);+ expect(find.textContaining('Every 5 minutes'), findsNothing);+ expect(find.textContaining('task reports'), findsNothing);+ expect(server.posts, isEmpty);+ await unmount(tester, c);+ },+ );testWidgets('public means swarm members and private is an explicit project choice',diff --git a/mobile/lib/swarm/model.dart b/mobile/lib/swarm/model.dartindex 28e0fe44a..8fa036f78 100644--- a/mobile/lib/swarm/model.dart+++ b/mobile/lib/swarm/model.dart@@ -414,6 +414,7 @@ class SuperTabProject {superTabMap(member)['generation'] as String?,},updateMinutes = (row['updateMinutes'] as num?)?.toInt() ?? 5,+ status = SuperTabProjectStatus.read(row['status']),repository = row['repository'] is Map? Map.unmodifiable(superTabMap(row['repository'])): null;@@ -441,9 +442,38 @@ class SuperTabProject {_memberGenerations.containsKey(person.id) &&_memberGenerations[person.id] == person.generation;final int updateMinutes;++ /// The project's status card text, read as the desktop's model reads it;+ /// the phone shows no card yet.+ final SuperTabProjectStatus? status;final Map<String, dynamic>? repository;}+/// A project's status card text, as the desktop's model reads it+/// (`../desktop/lib/super_tabs/model.dart`).+class SuperTabProjectStatus {+ const SuperTabProjectStatus({required this.text, this.at, this.by});++ static const maxText = 2000;++ static SuperTabProjectStatus? read(Object? value) {+ if (value is! Map) return null;+ final text = value['text'];+ if (text is! String || text.trim().isEmpty) return null;+ final at = value['at'];+ final by = value['by'];+ return SuperTabProjectStatus(+ text: text.length > maxText ? text.substring(0, maxText) : text,+ at: at is String ? DateTime.tryParse(at) : null,+ by: by is String ? by : null,+ );+ }++ final String text;+ final DateTime? at;+ final String? by;+}+class SuperTabSnapshot {SuperTabSnapshot.fromJson(Map<String, dynamic> row): id = _text(row, 'id'),diff --git a/mobile/test/swarm/swarm_project_status_model_test.dart b/mobile/test/swarm/swarm_project_status_model_test.dartnew file mode 100644index 000000000..9ddcf7b6d--- /dev/null+++ b/mobile/test/swarm/swarm_project_status_model_test.dart@@ -0,0 +1,42 @@+import 'package:flutter_test/flutter_test.dart';+import 'package:harness_mobile/swarm/model.dart';++/// A project carries its status card text as the desktop's model reads it+/// (desktop_parity_test): the phone shows no card yet, but drops nothing.+void main() {+ Map<String, dynamic> project(Object? status) => {+ 'id': 'p',+ 'name': 'Mobile',+ 'ownerId': 'me',+ 'leadConversationId': 'lead',+ 'visibility': 'public',+ 'members': <Object>[],+ 'updateMinutes': 5,+ 'status': status,+ };++ test('reads the text, time and writer, as the desktop does', () {+ final status = SuperTabProject.fromJson(+ project({'text': 'Building', 'at': '2026-10-31T09:52:00Z', 'by': 'pm'}),+ ).status!;+ expect(status.text, 'Building');+ expect(status.at, DateTime.utc(2026, 10, 31, 9, 52));+ expect(status.by, 'pm');+ });++ test('none, empty or malformed reads as no status; long text is cut', () {+ for (final value in <Object?>[+ null,+ 'x',+ {'text': ' '},+ {'text': 1},+ ]) {+ expect(SuperTabProject.fromJson(project(value)).status, isNull);+ }+ final long = 'a' * (SuperTabProjectStatus.maxText + 5);+ expect(+ SuperTabProject.fromJson(project({'text': long})).status!.text,+ hasLength(2000),+ );+ });+}