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
Harness Team account in every Swarm: the owner allowlist is gone (#2505)
scholes-autonomousa3f8a307e25c
diff --git a/backend/integration/superTabGithub.test.ts b/backend/integration/superTabGithub.test.tsindex 4c167cc2c..269409e1f 100644--- a/backend/integration/superTabGithub.test.ts+++ b/backend/integration/superTabGithub.test.ts@@ -103,10 +103,9 @@ async function ownerWithoutEmail() {await db.user.update({ where: { id: owner.sub }, data: { email: '' } })onTestFinished(async () => { await db.user.update({ where: { id: owner.sub }, data: { email: owner.email } }) })}-/** The team account switched on for this test, in the Swarms of [owners] or everyone's. */-function teamAccounts(owners = '') {+/** The team account switched on for this test, in every Swarm. */+function teamAccounts() {vi.stubEnv('SWARM_TEAM_ACCOUNT_REQUIRED', '1')- vi.stubEnv('SWARM_TEAM_ACCOUNT_OWNERS', owners)onTestFinished(() => { vi.unstubAllEnvs() })}/** A tab whose project is on [repositoryUrl], with a Builder on the host's machine working on a task. */@@ -344,13 +343,16 @@ describe('a queued start\'s preparation token', () => {})// Rolled out with the team account (machines.ts teamAccountRequired), so a bug in it cannot stop anyone else's Swarm.- it('asks no approval in a Swarm the team account is not tried in, or with the switch off', async () => {- teamAccounts('[email protected]')+ // Every Swarm alike (2026-11-02): an owner list left in a deployment (SWARM_TEAM_ACCOUNT_OWNERS, read 10-27 to 11-02) no+ // longer exempts a Swarm from approving its repositories.+ it('asks approval in any Swarm with the switch on, whatever SWARM_TEAM_ACCOUNT_OWNERS says, and none with it off', async () => {+ teamAccounts()+ vi.stubEnv('SWARM_TEAM_ACCOUNT_OWNERS', '[email protected]')const env = await fresh({ approveAll: false })const { tab, startId } = await queued(env)const status = await env.app.inject({ method: 'GET', url: `/api/super-tabs/${tab}/projects/lead/github`, headers: { authorization: `Bearer ${owner.sub}` } })- expect(status.json().data).toMatchObject({ state: 'covered', repository: 'example/app' })- expect((await prepare(env, tab, startId)).json().data).toMatchObject({ github: true, token: 'ghs_fixture_1' })+ expect(status.json().data).toMatchObject({ state: 'not-approved', repository: 'example/app' })+ expect((await prepare(env, tab, startId)).statusCode).toBe(403)vi.unstubAllEnvs()const off = await queued(env)expect((await prepare(env, off.tab, off.startId)).json().data).toMatchObject({ github: true })diff --git a/backend/integration/superTabTeam.test.ts b/backend/integration/superTabTeam.test.tsindex 543b9a8ab..18b5b1b61 100644--- a/backend/integration/superTabTeam.test.ts+++ b/backend/integration/superTabTeam.test.ts@@ -544,9 +544,9 @@ describe('one machine: a Mac and its Harness Team account', () => {}})- // Tried in listed owners' Swarms only (machines.ts teamAccountSwarm, 2026-10-28): anyone else's Swarm never gets a team- // account, and says so, so neither the Mac's daemon nor Desktop offers to set one up for it.- it('joins only a Swarm the team account is tried in, and tells the others they use none', async () => {+ // Every Swarm alike (2026-11-02): it was tried in listed owners' Swarms only (SWARM_TEAM_ACCOUNT_OWNERS, 10-28 to 11-02),+ // and a list left in a deployment must neither keep a team account out of a Swarm nor tell a Swarm it uses none.+ it('joins every Swarm its Mac was added to, whatever SWARM_TEAM_ACCOUNT_OWNERS says, and tells none it uses none', async () => {await db.machine.update({ where: { machineId: 'team-mac' }, data: { hostMachineId: 'personal-mac' } })onTestFinished(async () => {vi.unstubAllEnvs()@@ -559,9 +559,6 @@ describe('one machine: a Mac and its Harness Team account', () => {const joins = async () => (await rosterRows(store, person, 'personal-mac')).some(r => r.tabId === tab && 'joinTeam' in r)const derived = async () => (await new SwarmReads(store).firstLoad(person, tab)).derivedvi.stubEnv('SWARM_TEAM_ACCOUNT_OWNERS', '[email protected]')- expect(await joins()).toBe(false)- expect(await derived()).toMatchObject({ teamAccounts: false })- vi.stubEnv('SWARM_TEAM_ACCOUNT_OWNERS', `[email protected],${owner.email.toUpperCase()}`)expect(await joins()).toBe(true)expect(await derived()).not.toHaveProperty('teamAccounts')})diff --git a/backend/src/superTabs/buddies.test.ts b/backend/src/superTabs/buddies.test.tsindex c4a365e03..992bae5fd 100644--- a/backend/src/superTabs/buddies.test.ts+++ b/backend/src/superTabs/buddies.test.ts@@ -1043,9 +1043,8 @@ describe('where a Buddy runs (Ken\'s ruling, 10-28)', () => {it('stays in its owner\'s own account for a teammate\'s project, even where teammates\' work needs a Team account', () => {const f = fresh()- const saved = { required: process.env.SWARM_TEAM_ACCOUNT_REQUIRED, owners: process.env.SWARM_TEAM_ACCOUNT_OWNERS }+ const saved = { required: process.env.SWARM_TEAM_ACCOUNT_REQUIRED }process.env.SWARM_TEAM_ACCOUNT_REQUIRED = '1'- delete process.env.SWARM_TEAM_ACCOUNT_OWNERStry {machine(f, 'peer-team', 'peer')Object.assign(f.state.machines!.find(m => m.machineId === 'peer-team')!, { hostMachineId: 'peer-mac' })@@ -1054,7 +1053,6 @@ describe('where a Buddy runs (Ken\'s ruling, 10-28)', () => {expect(f.state.starts!.find(s => s.id === start)!.request.machineId).toBe('peer-mac')} finally {if (saved.required === undefined) delete process.env.SWARM_TEAM_ACCOUNT_REQUIRED; else process.env.SWARM_TEAM_ACCOUNT_REQUIRED = saved.required- if (saved.owners !== undefined) process.env.SWARM_TEAM_ACCOUNT_OWNERS = saved.owners}})})diff --git a/backend/src/superTabs/leadStart.ts b/backend/src/superTabs/leadStart.tsindex bf773a92f..f130d9548 100644--- a/backend/src/superTabs/leadStart.ts+++ b/backend/src/superTabs/leadStart.ts@@ -4,7 +4,7 @@* Mac itself, as its owner, whatever the Swarm's switch (machines.ts teamAccountRequired) says for workers. Its person always* names the machine: only they know which one stays on (Ken, 10-29). Desktop's own-machine flow (project.create, a local* start, agent.add) is unchanged. */-import { admitMachineStart, contributedEngines, failTeamWork, machineContribution, projectFolder, projectsOnMachine, teamAccountPool, teamAccountSwarm, teamPoolOf,+import { admitMachineStart, contributedEngines, failTeamWork, machineContribution, projectFolder, projectsOnMachine, teamAccountPool, teamPoolOf,slotCounter, teamWorkRefusal, type ContributedMachine } from './machines.js'import { actorKey, fail, person, SuperTabError, type AgentStart, type AgentStartRequest, type Conversation, type Person, type SuperTabState } from './model.js'import { projectsOf, type SwarmProject } from './projects.js'@@ -74,9 +74,8 @@ export function leadHost(state: SuperTabState, project: SwarmProject, machineId:engine: request.engine, ...(request.model ? { model: request.model } : {}), ...(request.effort ? { effort: request.effort } : {}), name: coordinatorNameOf(project),cwd: projectFolder(pool, project), worktree: true, ...(request.branchRef ? { branchRef: request.branchRef } : {}), requirements: LEAD_REQUIREMENTS, leadFor })const teamMachines = context.teamMachines ?? []- // With no GitHub App, or outside the Swarms Team accounts are tried in, a Team account takes no work (machines.ts- // teamMachineFor).- const teamsWork = !context.teamAccountsIdle && teamAccountSwarm(state)+ // With no GitHub App a Team account takes no work (machines.ts teamMachineFor).+ const teamsWork = !context.teamAccountsIdleconst refusal = (pool: ContributedMachine) => teamWorkRefusal(pool, context.now, teamMachines.includes(pool.machineId), true,(context.otherWorkspaceMachines ?? []).includes(pool.machineId))let candidates: ContributedMachine[]diff --git a/backend/src/superTabs/machines.ts b/backend/src/superTabs/machines.tsindex f2b3c12f7..440b009e3 100644--- a/backend/src/superTabs/machines.ts+++ b/backend/src/superTabs/machines.ts@@ -261,29 +261,15 @@ const PRIVACY_ITEMS: Record<string, string> = {const ONLY_OWN = 'so it runs only its owner\'s projects'/**- * Whether a teammate's work needs a Harness Team account on every machine of [state]'s Swarm- * (`SWARM_TEAM_ACCOUNT_REQUIRED=1`). Until the CLI that makes team accounts is released, it does not: a machine without- * one takes a teammate's work as it did before team accounts, while a machine with one already follows the rule.+ * Whether a teammate's work needs a Harness Team account on every machine of a Swarm (`SWARM_TEAM_ACCOUNT_REQUIRED=1`).+ * Without it, a machine without one takes a teammate's work as it did before team accounts, while a machine with one+ * already follows the rule. Read on every call, so a test can set it.*- * `SWARM_TEAM_ACCOUNT_OWNERS`, comma-separated emails, holds the switch to the Swarms those people own, so it can be tried- * on production with one's own Swarm first and no other Swarm changes (2026-10-27). Empty, it is every Swarm's. Both are- * read on every call, so a test can set them.+ * Every Swarm alike (2026-11-02). It was held to the Swarms of the owners `SWARM_TEAM_ACCOUNT_OWNERS` listed while the+ * feature was tried on production (2026-10-27 to 11-02); that variable is no longer read.*/-export function teamAccountRequired(state?: Pick<SuperTabState, 'ownerId' | 'people'>): boolean {- return process.env.SWARM_TEAM_ACCOUNT_REQUIRED === '1' && teamAccountSwarm(state)-}--/**- * Whether Harness Team accounts take part in [state]'s Swarm at all: they join it where their Mac was added (hostRows.ts)- * and teammates' work goes to them (teamMachineFor). With `SWARM_TEAM_ACCOUNT_OWNERS` set, only the Swarms those people- * own, so a bug in the team account cannot reach anyone else's Swarm while it is tried out (2026-10-28): elsewhere a Mac- * runs teammates' work itself, as before team accounts. Empty, every Swarm.- */-export function teamAccountSwarm(state?: Pick<SuperTabState, 'ownerId' | 'people'>): boolean {- const owners = (process.env.SWARM_TEAM_ACCOUNT_OWNERS ?? '').split(',').map(email => email.trim().toLowerCase()).filter(Boolean)- if (!owners.length) return true- const owner = state?.people.find(person => person.id === state.ownerId)?.email.toLowerCase()- return !!owner && owners.includes(owner)+export function teamAccountRequired(): boolean {+ return process.env.SWARM_TEAM_ACCOUNT_REQUIRED === '1'}/** Why this contributed machine may not run a teammate's project now, or null when it may. `teamRow`: its account row@@ -336,10 +322,10 @@ export function teamWorkCheck(state: SuperTabState, machineId: string, contributif (project.ownerId === contributorId) return nullif (!pool) {// Off the Machines list nothing reports a team account (store.ts teamMachines), so this is the switch alone.- if (!teamAccountRequired(state)) return null+ if (!teamAccountRequired()) return nullreturn { code: 'TEAM_ACCOUNT_REQUIRED', reason: `This machine is not a Team machine of this Swarm, ${ONLY_OWN}.` }}- return teamWorkRefusal(pool, now, teamMachines.includes(machineId), teamAccountRequired(state), otherWorkspaceMachines.includes(machineId))+ return teamWorkRefusal(pool, now, teamMachines.includes(machineId), teamAccountRequired(), otherWorkspaceMachines.includes(machineId))}// ── One machine: a Mac and its Harness Team account ─────────────────────────────────────────────────────────────────@@ -369,9 +355,9 @@ export function teamPoolOf(state: SuperTabState, pool: ContributedMachine, live?*/export function machineTeamWork(state: SuperTabState, pool: ContributedMachine, now: number, teamMachines: readonly string[],otherWorkspaceMachines: readonly string[] = []): TeamWorkRefusal | null {- const team = !pool.hostMachineId && teamAccountSwarm(state) ? teamPoolOf(state, pool, teamMachines) : undefined+ const team = !pool.hostMachineId ? teamPoolOf(state, pool, teamMachines) : undefinedconst subject = team ?? pool- return teamWorkRefusal(subject, now, teamMachines.includes(subject.machineId), teamAccountRequired(state), otherWorkspaceMachines.includes(subject.machineId))+ return teamWorkRefusal(subject, now, teamMachines.includes(subject.machineId), teamAccountRequired(), otherWorkspaceMachines.includes(subject.machineId))}/** The projects with work on [machineId]: its agents' and its pending starts'. */@@ -398,7 +384,7 @@ export function productManagerOn(state: SuperTabState, machineId: string): strin* its contributor's own and the Mac has one in this Swarm, else the machine named. */export function teamMachineFor(state: SuperTabState, machineId: string, project: SwarmProject, idle = false, live?: readonly string[]): string {// With no GitHub App on this server a team account cannot fetch or push, so the work stays on the Mac, as before.- if (idle || !teamAccountSwarm(state)) return machineId+ if (idle) return machineIdconst pool = state.machines?.find(m => m.machineId === machineId)if (!pool || project.ownerId === pool.contributorId) return machineIdreturn teamPoolOf(state, pool, live)?.machineId ?? machineIddiff --git a/backend/src/superTabs/read/contract.ts b/backend/src/superTabs/read/contract.tsindex 205951eb1..838c08828 100644--- a/backend/src/superTabs/read/contract.ts+++ b/backend/src/superTabs/read/contract.ts@@ -94,8 +94,8 @@ export interface Derived {* `readMarks`: a first load has every one of the conversations it holds (a chat with none is at `mentions`), a changes read* those moved since its cursor. Absent when there are none, and from an older backend. Never another person's. */chatSettings?: Record<string, 'all' | 'mentions' | 'muted'>- /** Present, and false, only in a Swarm Harness Team accounts are not tried in yet (machines.ts teamAccountSwarm): this- * Mac's daemon and Desktop then offer no team account for it. Absent is every older backend's "yes". */+ /** Present, and false, only from a backend that held Harness Team accounts to listed owners' Swarms (2026-10-27 to 11-02):+ * this Mac's daemon and Desktop then offered no team account for it. No longer sent: every Swarm takes part. */teamAccounts?: false/** This server takes a thread reply's `newSession` (buddySessions.ts): Desktop offers New session only where it is* true and the Buddy's machine reports it can run sessions. Absent from an older backend, whose strict schema refusesdiff --git a/backend/src/superTabs/read/hostRows.ts b/backend/src/superTabs/read/hostRows.tsindex 2df2a5576..690081d54 100644--- a/backend/src/superTabs/read/hostRows.ts+++ b/backend/src/superTabs/read/hostRows.ts@@ -6,7 +6,7 @@import type { AuthUser } from '../../lib/ssoAuth.js'import { activeWork, agent, isLeads, SuperTabError, conversation, type Agent, type SuperTabState } from '../model.js'import { isSwarmBuddyChat } from '../buddies.js'-import { hostLocalGrid, machineContribution, teamAccountSwarm, type MachineCleanup } from '../machines.js'+import { hostLocalGrid, machineContribution, type MachineCleanup } from '../machines.js'import { agentProjectId, agentSetRole, canWatchAgent, isConfidential, groupProject, ledProject, projectsOf, skillModeOf, startProject, skillSetOf, watchClosed } from '../projects.js'import type { HostAgentRow, HostPool, HostRosterRow, HostTabRows } from './contract.js'import { hostEtag } from './hostEtag.js'@@ -37,10 +37,8 @@ export async function hostTab(tabId: string, state: SuperTabState, machineId: stasync function roster(tabId: string, state: SuperTabState, machineId: string, user: AuthUser, lastChangedAt: number | null, lookups: HostLookups): Promise<HostRosterRow[]> {const rows: HostRosterRow[] = []- // Where its owner added this Mac and its team account is missing, this host adds that account (cli/src/superTabs/host.ts),- // in a Swarm the team account is tried in (teamAccountSwarm).- const mac = !teamAccountSwarm(state) ? undefined- : state.machines?.find(m => m.machineId === machineId && m.contributorId === user.sub && m.scope === 'swarm' && !m.removal && !m.buddyOnly)+ // Where its owner added this Mac and its team account is missing, this host adds that account (cli/src/superTabs/host.ts).+ const mac = state.machines?.find(m => m.machineId === machineId && m.contributorId === user.sub && m.scope === 'swarm' && !m.removal && !m.buddyOnly)for (const team of mac ? lookups.teams : []) {if (state.machines?.some(m => m.machineId === team.machineId) || state.machineCleanups?.some(c => c.machineId === team.machineId)) continuerows.push({ tabId, joinTeam: { machineId: team.machineId, name: mac!.name, maxAgents: mac!.maxAgents } })diff --git a/backend/src/superTabs/read/views.ts b/backend/src/superTabs/read/views.tsindex b4f815116..a7a4530b3 100644--- a/backend/src/superTabs/read/views.ts+++ b/backend/src/superTabs/read/views.ts@@ -7,7 +7,7 @@ import { suspendedEngines } from '../engineHealth.js'import { leadChoices } from '../leadStart.js'import { isBuddyChat, isBuddyReader } from '../buddies.js'import { agentForBuddy, agentWithoutMachine, groupForBuddy, machineHiddenFrom, seenMachineIds, visibleState, withSeenRequirement, type Actor, type Agent, type Conversation, type SuperTabState } from '../model.js'-import { slotCounter, machineTeamWork, teamAccountSwarm, type ContributedMachine } from '../machines.js'+import { slotCounter, machineTeamWork, type ContributedMachine } from '../machines.js'import * as store from '../parts/index.js'import type { Part, SwarmParts } from '../parts/index.js'import { canReadGroup } from '../projects.js'@@ -150,7 +150,6 @@ function derive(state: SuperTabState, visible: SuperTabState, actor: Actor, now:...(actor.kind === 'person' && extras.decisionsWaiting !== undefined ? { decisionsWaiting: extras.decisionsWaiting } : {}),...(actor.kind === 'person' && extras.decisionsDigest !== undefined ? { decisionsDigest: extras.decisionsDigest } : {}),...(actor.kind === 'person' && extras.activityDigest !== undefined ? { activityDigest: extras.activityDigest } : {}),- ...(teamAccountSwarm(state) ? {} : { teamAccounts: false as const }),threadSessions: true as const,sessionsFromChat: true as const,// One Buddy per person per Swarm (Dee, 10-31): an app shows # buddy and New session in a project only when the server says so.diff --git a/backend/src/superTabs/store.ts b/backend/src/superTabs/store.tsindex 6b3ce3fd5..caf7165e5 100644--- a/backend/src/superTabs/store.ts+++ b/backend/src/superTabs/store.ts@@ -1745,7 +1745,7 @@ export class SuperTabStore {const contributed = state.machines?.find(m => m.machineId === target.machineId)?.nameconst machineName = contributed ?? await tx.machine.findFirst({ where: { machineId: target.machineId, userId: target.machineOwnerId },select: { name: true, hostname: true } }).then(m => m?.name ?? m?.hostname ?? null)- return { tabId, projectId: project.id, approvalRequired: teamAccountRequired(state), agentId: target.id, assignmentId: group.assignment!.id,+ return { tabId, projectId: project.id, approvalRequired: teamAccountRequired(), agentId: target.id, assignmentId: group.assignment!.id,repositoryUrl: project.repository?.repositoryUrl ?? null,requester: { name: requester.name?.trim() || null, email: requester.email },agentName: agentDisplayName(state.agents, target.id) ?? target.displayName ?? target.name, machineName: machineName?.trim() || null }@@ -1775,7 +1775,7 @@ export class SuperTabStore {const project = startProject(state, start.request) ?? fail('NOT_FOUND', 'This start has no project folder to prepare.', 404)const owner = await tx.user.findUnique({ where: { id: project.ownerId }, select: { name: true, email: true } })const email = owner?.email ?? state.people.find(p => p.id === project.ownerId)?.email ?? ''- return { tabId, projectId: project.id, repositoryUrl: project.repository?.repositoryUrl ?? null, approvalRequired: teamAccountRequired(state),+ return { tabId, projectId: project.id, repositoryUrl: project.repository?.repositoryUrl ?? null, approvalRequired: teamAccountRequired(),startId, own: project.ownerId === start.machineOwnerId,requester: { name: owner?.name?.trim() || null, email } }})@@ -2674,7 +2674,7 @@ export class SuperTabStore {const actor = await this.actor(tx, user, state)const projects = visibleState(state, actor, this.now()).projects ?? []const project = projects.find(p => p.id === projectId) ?? fail('NOT_FOUND', 'This project is unavailable.', 404)- return { repositoryUrl: project.repository?.repositoryUrl ?? null, approvalRequired: teamAccountRequired(state), name: project.name,+ return { repositoryUrl: project.repository?.repositoryUrl ?? null, approvalRequired: teamAccountRequired(), name: project.name,others: projects.filter(p => p.id !== projectId).map(p => ({ id: p.id, name: p.name })) }})}diff --git a/backend/src/superTabs/teamRouting.test.ts b/backend/src/superTabs/teamRouting.test.tsindex c46ad0286..6ca8bceec 100644--- a/backend/src/superTabs/teamRouting.test.ts+++ b/backend/src/superTabs/teamRouting.test.ts@@ -1,6 +1,6 @@import { afterEach, beforeEach, describe, expect, it } from 'vitest'import { applyCommand, commandSchema, type Command, type CommandContext } from './commands.js'-import { admitMachineStart, machineObservationSchema, machineTeamWork, machineSlots, observedPrivacy, PRIVACY_FRESH_MS, removalPreview, teamAccountRequired, teamAccountSwarm, teamWorkRefusal, type ContributedMachine, type MachinePrivacy } from './machines.js'+import { admitMachineStart, machineObservationSchema, machineTeamWork, machineSlots, observedPrivacy, PRIVACY_FRESH_MS, removalPreview, teamAccountRequired, teamWorkRefusal, type ContributedMachine, type MachinePrivacy } from './machines.js'import { createSuperTab, SuperTabError, visibleState, type Actor, type AgentConfiguration, type AgentStart, type SuperTabState } from './model.js'import type { RouteDecision } from './routeRecord.js'@@ -380,49 +380,30 @@ describe('until a team account is required everywhere', () => {})})-// Tried on production with one person's Swarms first (2026-10-27): SWARM_TEAM_ACCOUNT_OWNERS holds the switch to the-// Swarms those people own, and every other Swarm stays as it is with the switch off.-describe('the switch held to the Swarms of listed owners', () => {+// Every Swarm alike (2026-11-02). The switch was held to listed owners' Swarms while it was tried on production+// (SWARM_TEAM_ACCOUNT_OWNERS, 2026-10-27 to 11-02); a value left in a deployment must not hold it back any more.+describe('the switch, in every Swarm', () => {afterEach(() => { delete process.env.SWARM_TEAM_ACCOUNT_OWNERS })- it('requires a team account in a listed owner\'s Swarm, and in no other', () => {+ it('requires a team account in any Swarm, whatever SWARM_TEAM_ACCOUNT_OWNERS says, and in none with the switch off', () => {const f = swarm(), group = f.group()- process.env.SWARM_TEAM_ACCOUNT_OWNERS = ' [email protected], [email protected] '- expect(teamAccountRequired(f.state)).toBe(true)+ process.env.SWARM_TEAM_ACCOUNT_OWNERS = '[email protected]'+ expect(teamAccountRequired()).toBe(true)expect(refusal(() => f.run({ type: 'agent.start', request: f.request(group, 'mate-mac') }, owner, f.pooled('mate-mac')))?.code).toBe('TEAM_ACCOUNT_REQUIRED')- process.env.SWARM_TEAM_ACCOUNT_OWNERS = '[email protected]'- expect(teamAccountRequired(f.state)).toBe(false)+ delete process.env.SWARM_TEAM_ACCOUNT_REQUIRED+ expect(teamAccountRequired()).toBe(false)f.run({ type: 'agent.start', request: f.request(group, 'mate-mac') }, owner, f.pooled('mate-mac'))expect(f.state.starts).toHaveLength(1)- // A Team machine follows the rule in every Swarm, as it does with the switch off.- f.machine('mate-team').observation = reading('team', FAILED)- expect(refusal(() => f.run({ type: 'agent.start', request: f.request(group, 'mate-team') }, owner, f.pooled('mate-team')))?.code).toBe('PRIVACY_CHECK_FAILED')})- it('leaves a teammate\'s work on the Mac, not its team account, in a Swarm the team account is not tried in', () => {+ it('sends a teammate\'s work on a Mac to its team account in any Swarm, whatever SWARM_TEAM_ACCOUNT_OWNERS says', () => {const f = swarm(), group = f.group()Object.assign(f.machine('mate-team'), { hostMachineId: 'mate-mac', name: 'MacBook Pro', cwd: '/team-swarm' })delete process.env.SWARM_TEAM_ACCOUNT_REQUIREDprocess.env.SWARM_TEAM_ACCOUNT_OWNERS = '[email protected]'- expect(teamAccountSwarm(f.state)).toBe(false)- f.run({ type: 'agent.start', request: f.request(group, 'mate-mac') }, owner, f.pooled('mate-mac'))- expect(f.state.starts![0]!.request).toMatchObject({ machineId: 'mate-mac', cwd: '/swarm/lead' })- process.env.SWARM_TEAM_ACCOUNT_OWNERS = '[email protected]'- expect(teamAccountSwarm(f.state)).toBe(true)f.run({ type: 'agent.start', request: f.request(group, 'mate-mac') }, owner, f.pooled('mate-mac'))- expect(f.state.starts![1]!.request).toMatchObject({ machineId: 'mate-team', cwd: '/team-swarm/lead' })- })-- it('is every Swarm\'s with no list, and none with the switch off, list or not', () => {- const f = swarm()- process.env.SWARM_TEAM_ACCOUNT_OWNERS = ' , '- expect(teamAccountRequired(f.state)).toBe(true)- expect(teamAccountRequired()).toBe(true)- process.env.SWARM_TEAM_ACCOUNT_OWNERS = '[email protected]'- expect(teamAccountRequired()).toBe(false)- delete process.env.SWARM_TEAM_ACCOUNT_REQUIRED- expect(teamAccountRequired(f.state)).toBe(false)+ expect(f.state.starts![0]!.request).toMatchObject({ machineId: 'mate-team', cwd: '/team-swarm/lead' })})})@@ -456,12 +437,9 @@ describe('one machine: a Mac and its Harness Team account', () => {f.machine('mate-team').observation = reading('team', FAILED)expect(machineTeamWork(f.state, f.machine('mate-mac'), NOW, ['mate-team'])?.code).toBe('PRIVACY_CHECK_FAILED')expect(machineTeamWork(f.state, f.machine('mate-mac'), NOW, ['mate-team'], ['mate-team'])?.code).toBe('MACHINE_IN_OTHER_WORKSPACE')- // The account itself reads as itself; a Mac whose account is no longer signed in, or outside the Swarms it is tried in,- // reads as a Mac without one.+ // The account itself reads as itself; a Mac whose account is no longer signed in reads as a Mac without one.expect(machineTeamWork(f.state, f.machine('mate-team'), NOW, ['mate-team'])?.code).toBe('PRIVACY_CHECK_FAILED')expect(machineTeamWork(f.state, f.machine('mate-mac'), NOW, [])?.code).toBe('TEAM_ACCOUNT_REQUIRED')- process.env.SWARM_TEAM_ACCOUNT_OWNERS = '[email protected]'- try { expect(machineTeamWork(f.state, f.machine('mate-mac'), NOW, ['mate-team'])).toBeNull() } finally { delete process.env.SWARM_TEAM_ACCOUNT_OWNERS }})it('once the team account is removed, its pool left behind takes nothing: the Mac is a Mac without one again', () => {diff --git a/docs/plans/2026-10-24-swarm-team-account.md b/docs/plans/2026-10-24-swarm-team-account.mdindex b7cb29a6e..9b7b941b7 100644--- a/docs/plans/2026-10-24-swarm-team-account.md+++ b/docs/plans/2026-10-24-swarm-team-account.md@@ -84,9 +84,9 @@ How it works (`backend/src/superTabs/machines.ts`, `teamWorkCheck`):- **Routing.** The tab read gives each machine `teamWork`: `{ allowed: true }`, or `{ allowed: false, code, reason }`. The CLI's route leaves those machines out for a teammate's project and lists the reason in `excluded[]`. The backend does the same with any candidate an older CLI still sends, and refuses a pick there ("… Route again.").- **Migration.** Nothing is stopped. Agents already running on personal machines keep their current task, its reports, messages and their sessions. New starts, new assignments and new Reviewer groups for another person's project follow the rule. A personal machine contributed with scope "swarm" now serves only its owner's projects. So does a machine contributed before projects (no scope) by someone other than the Swarm's owner: the Swarm's first project is the owner's.- **Switch.** The backend shipped (1.3.28) before the CLI that makes team accounts. So the rule is held to every machine only with `SWARM_TEAM_ACCOUNT_REQUIRED=1` (`machines.ts` `teamAccountRequired`). Until then, a machine without a team account takes a teammate's work as it did before, and a machine with one already follows the rule. Turn it on with the CLI and Desktop release that makes team accounts.-- **One person's Swarms first.** `SWARM_TEAM_ACCOUNT_OWNERS`, comma-separated emails, holds the switch to the Swarms- those people own (2026-10-27), so it can be tried on production without changing anyone else's: every other Swarm- behaves as with the switch off. Empty, the switch is every Swarm's.+- **One person's Swarms first, then every Swarm.** From 2026-10-27 `SWARM_TEAM_ACCOUNT_OWNERS`, comma-separated emails,+ held the switch to the Swarms those people own, so it could be tried on production without changing anyone else's.+ Since 2026-11-02 every Swarm takes part and the variable is no longer read.- **GitHub App first.** A team account has no git login, so it can fetch and push only with the Harness GitHub App. Until the server has the app (`docs/swarm-github-app.md`), a team account joins no Swarm and takes no teammates' work, and starts on its Mac stay with the Mac (`teamAccountsIdle`). Configure the app before turning `SWARM_TEAM_ACCOUNT_REQUIRED` on, or teammates' work has nowhere to run.## Task 4: Harness GitHub App (backend, CLI)diff --git a/docs/plans/2026-10-28-swarm-project-github-access.md b/docs/plans/2026-10-28-swarm-project-github-access.mdindex af52f9f9c..ad0a6c610 100644--- a/docs/plans/2026-10-28-swarm-project-github-access.md+++ b/docs/plans/2026-10-28-swarm-project-github-access.md@@ -43,11 +43,10 @@ can push to it approved it, for that project or for every project of the Swarm:`GITHUB_REPOSITORY_NOT_APPROVED`. The status says `not-approved`, with the buttons, until then.- The signed state names the person, Swarm, project, repository and scope, lasts ten minutes, and is signed with a keyderived from the app's private key. The callback trusts nothing else.-- **Rollout:** approvals are rolled out with the team account (`SWARM_TEAM_ACCOUNT_REQUIRED=1`, held to the Swarms of- `SWARM_TEAM_ACCOUNT_OWNERS`). Every other Swarm gets tokens as before and reads `covered`, so a bug here cannot stop- anyone else's Swarm. The same owner list keeps Harness Team accounts out of other Swarms altogether: they do not join- them, teammates' work there stays on the Mac, and their reads say `teamAccounts: false`, so neither the Mac's daemon nor- Desktop offers the team account (and macOS's administrator prompt) on joining or adding a Mac to one.+- **Rollout:** approvals are rolled out with the team account (`SWARM_TEAM_ACCOUNT_REQUIRED=1`). From 2026-10-28 to 11-02+ both were held to the Swarms of `SWARM_TEAM_ACCOUNT_OWNERS`: every other Swarm got tokens as before, read `covered`, kept+ Harness Team accounts out, and its reads said `teamAccounts: false`. Since 2026-11-02 every Swarm takes part: the owner+ list is no longer read, and `teamAccounts: false` is no longer sent.## Build