Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

A Linux test step only goes to a Tester on a Linux machine (#3926) (#3429)

harness-for-autonomous[bot]27356f78f11c
diff --git a/backend/src/superTabs/commands.ts b/backend/src/superTabs/commands.ts
index 5cd3a71d3..085cf5c08 100644
--- a/backend/src/superTabs/commands.ts
+++ b/backend/src/superTabs/commands.ts
@@ -27,7 +27,7 @@ import { jobKindOf } from './evidence/jobKind.js'
import { endSteps, listStep, stepEndedRows, isStep, stepName, stepsOf, taskOwner } from './steps.js'
import { closeMerged } from './mergedTasks.js'
import { noteWriter } from './stuck.js'
-import { reviewPlan, refreshStepBrief, type PlannedStep, type StepKind } from './reviewTable.js'
+import { reviewPlan, refreshStepBrief, stepOsRefusal, type PlannedStep, type StepKind } from './reviewTable.js'
import { openReviewStep, type StepPull } from './stepOpen.js'
import { LINUX_WAIT_LINE, testsOnLinux, waitForLinux } from './linuxSteps.js'
import { builtBy, reviewerCandidates, STRENGTH_RULE } from './reviewerPick.js'
@@ -1492,6 +1492,9 @@ function applyCommandOnce(original: SuperTabState, actor: Actor, input: Command,
return { code: 'TEAM_WRITTEN_WORK' as const, reason: TEAM_WRITTEN_REASON }
}
const contributor = member?.contributorId ?? pool?.contributorId ?? starter
+ // A step named for an OS on a machine of another OS (reviewTable.ts, task #3926).
+ const wrongOs = stepOsRefusal(state, group, machineId, member?.contributorId)
+ if (wrongOs) return { code: 'STEP_OS' as const, reason: wrongOs }
// Then what the task needs to reach, in the account it would run in (machineAccess.ts, task #3047).
return teamWorkCheck(state, machineId, contributor, project)
?? accessRefusal(state, machineId, project, needed)
@@ -1901,6 +1904,9 @@ function applyCommandOnce(original: SuperTabState, actor: Actor, input: Command,
// And what the task needs to reach, where it runs (machineAccess.ts): an assignment is held to it as a start is.
const unreached = accessRefusal(state, worker.machineId, home, taskAccess(group))
if (unreached) failTeamWork(unreached)
+ // A step named for an OS runs on a machine of that OS (reviewTable.ts, task #3926).
+ const wrongOs = stepOsRefusal(state, group, worker.machineId, worker.contributorId)
+ if (wrongOs) fail('STEP_OS', wrongOs)
requireRepositoryReach(state, onTeamAccount(state, worker), worker.machineOwnerId, home, context.repositoryReach)
// Team-written code: only the project owner's own agent (teamWritten.ts, task #4120; audit H2).
pushedRefusal(group, worker)
@@ -3318,6 +3324,9 @@ function applyCommandOnce(original: SuperTabState, actor: Actor, input: Command,
else if (context.pushOrigin === 'unknown' && !ownersOwnMachine(state, startGroup, named.machineId)) failPushUnknown(unknownPushReason(context.repositoryReach))
const request: AgentStartRequest = noRepositoryStart(state.machines?.find(m => m.machineId === named.machineId), home,
written ? { ...named, projectSettings: 'off' } : named)
+ // A step named for an OS starts its agent only on a machine of that OS (reviewTable.ts, task #3926).
+ const wrongOs = stepOsRefusal(state, startGroup, request.machineId)
+ if (wrongOs) fail('STEP_OS', wrongOs)
// Before it is queued: a machine that cannot get the app's token for it would fail it, and count that against its engine.
requireRepositoryReach(state, false, grant.machineOwnerId, home, context.repositoryReach)
// The project's machine rules (machineRules.ts).
diff --git a/backend/src/superTabs/dispatch.ts b/backend/src/superTabs/dispatch.ts
index ea18c2859..96af3c459 100644
--- a/backend/src/superTabs/dispatch.ts
+++ b/backend/src/superTabs/dispatch.ts
@@ -18,8 +18,7 @@ import { unavailableReason } from './liveness.js'
import { FAILED, type PullRequestWatch } from './pullRequestEvents.js'
import { modelMatches } from './rules.js'
import { roleNameOf } from './instructions.js'
-import { reviewerCandidates } from './reviewerPick.js'
-import { stepName } from './steps.js'
+import { stepCandidates } from './reviewerPick.js'
import { ownMerge } from './mergedTasks.js'
const HOUR_MS = 3_600_000
@@ -178,13 +177,8 @@ export function candidatesFor(state: SuperTabState, member: Agent, rules: Dispat
// The project's machine rules (machineRules.ts): what its machine refuses now, it is not handed, pinned or not.
const refused = (review: boolean) => !!machineRuleRefusal(rules.machines, { machineId: member.machineId, engine: member.configuration.engine, review }, now)
const refusesWork = refused(false), refusesReview = refused(true)
- const steps = open.filter(g => g.reviewOf && !lostByIt(g) && !(refusesReview && isReview(g))).filter(step => {
- const task = state.conversations.find(g => g.id === step.reviewOf)!
- const kind = /test/i.test(stepName(step)) ? 'test' : /security/i.test(stepName(step)) ? 'security' : 'review'
- const latest = task.pullRequestUrls?.at(-1)
- const head = latest ? task.pullRequestHeads?.[latest]?.head ?? null : null
- return reviewerCandidates(state, task, kind, head, now).some(a => a.id === member.id)
- })
+ // A step named for an OS goes to an agent of that OS only (task #3926), as it went when first opened.
+ const steps = open.filter(g => g.reviewOf && !lostByIt(g) && !(refusesReview && isReview(g))).filter(step => stepCandidates(state, step, now).some(a => a.id === member.id))
const lane = open.filter(g => (!g.lane || !!laneNamed(rules.lanes, g.lane)) && !g.reviewOf && !pinned.includes(g) && !(pinOf(g) && members.has(pinOf(g)!.agentId)) && !lostByIt(g)
// Ordinary workers recover work; new tasks still need the PM's route or a standing crew lane.
&& (member.crew || (g.assignment?.status === 'lost' && g.lostAttempt))
diff --git a/backend/src/superTabs/liveness.ts b/backend/src/superTabs/liveness.ts
index 33c63d4bd..9f36e195d 100644
--- a/backend/src/superTabs/liveness.ts
+++ b/backend/src/superTabs/liveness.ts
@@ -20,6 +20,8 @@ import { crewClock, DISPATCH_RULES, laneOf, nudgeLine, returnReason, type Dispat
import { handed, pickUp, unclaimedAt, unclaimedReason } from './handed.js'
import { isBuddy } from './buddies.js'
import { closeMergedLost } from './mergedTasks.js'
+import { stepCandidates } from './reviewerPick.js'
+import { noTesterFree, stepOs } from './reviewTable.js'
// Work never sits with a dead owner (design: "A Swarm that never stops", 2026-10-26). A worker's active assignment is held
// by a lease that its progress renews. A dead, stalled or limited worker loses it within minutes: the assignment becomes
@@ -372,16 +374,23 @@ function loseTask(state: SuperTabState, group: Conversation, worker: Agent, reas
const result = assignment.result?.replace(/[.\s]+$/, '')
const pr = group.pullRequestUrls?.at(-1)
const source = { kind: 'work-lost', agentId: worker.id, assignmentId: assignment.id, reason }
+ // A step named for an OS that no free agent of that OS can take waits for one, and says so (task #3926): the dispatch never
+ // hands it to another OS, so without these words it would only sit there.
+ const os = stepOs(group)
+ const waits = os && !stepCandidates(state, group, now).length ? noTesterFree(os) : null
// What happened, never the next step (project instructions, phase 4): the instructions say what the coordinator does.
const wake = `${worker.displayName ?? worker.name} lost its task "${group.title}": ${reason}. Last progress ${since}. `
+ `Last result: ${result || 'none'}.${pr && !result?.includes(pr) ? ` Pull request: ${pr}.` : ''}`
+ (resumeAt ? ` It resumes by itself when its limit resets at ${resumeAt.slice(11, 16)} UTC.` : '')
+ + (waits ? ` ${waits}: the step waits for one.` : '')
// Named by the loss, not the task: a task resumed after a usage limit keeps its id and can be lost again (2026-10-28).
const loss = String(now)
return [...leadNoticeRows(toLead(state, worker, { id: stableId('work-lost', assignment.id, loss), conversationId: group.id, author: sender, replyTo: null,
recipients: [], text: wake, source }).map(row => reachable(state, row))),
reachable(state, { id: stableId('work-lost', assignment.id, loss, 'agent'), conversationId: group.id, author: sender, replyTo: null, recipients: [worker.id], source,
text: `Your task "${group.title}" moved: ${reason}. Stop working on it; your status and results for it are no longer accepted.` }),
+ ...(waits ? [{ id: stableId('work-lost', assignment.id, loss, 'waits'), conversationId: group.id, author: sender, replyTo: null, recipients: [],
+ text: `${waits}: this step waits until one is.`, source: { kind: 'system' } }] : []),
// And its project chat's thread says Stuck, as no command saw the loss (task #2693).
...endedReply(state, group, stableId('task-line-lost', assignment.id, loss), sender)]
}
diff --git a/backend/src/superTabs/machines.ts b/backend/src/superTabs/machines.ts
index b73f2af4a..a0260c70a 100644
--- a/backend/src/superTabs/machines.ts
+++ b/backend/src/superTabs/machines.ts
@@ -314,7 +314,7 @@ export function observedPrivacy(previous: StoredPrivacy | undefined, reported: M
}
export type TeamWorkCode = 'TEAM_WRITTEN_WORK' | 'MACHINE_OFFLINE' | 'TEAM_ACCOUNT_REQUIRED' | 'PRIVACY_UNCHECKED' | 'PRIVACY_CHECK_FAILED' | 'PRIVACY_CHECK_STALE'
- | 'MACHINE_IN_OTHER_WORKSPACE' | 'NOT_SWARM_MACHINE' | 'MACHINE_PROJECTS' | 'ACCESS_MISSING' | 'TEAM_ACCOUNT_JOINING' | 'TEAM_ACCOUNTS_REMOVED' | 'NOT_YOUR_COMPUTER' | 'READ_ONLY'
+ | 'MACHINE_IN_OTHER_WORKSPACE' | 'NOT_SWARM_MACHINE' | 'MACHINE_PROJECTS' | 'ACCESS_MISSING' | 'TEAM_ACCOUNT_JOINING' | 'TEAM_ACCOUNTS_REMOVED' | 'NOT_YOUR_COMPUTER' | 'READ_ONLY' | 'STEP_OS'
export interface TeamWorkRefusal { code: TeamWorkCode; reason: string }
/** Refusals that hold until a person acts on the machine; a stale check or an offline machine may pass again by itself. */
export const LASTING_TEAM_REFUSALS: readonly string[] = ['TEAM_ACCOUNT_REQUIRED', 'PRIVACY_UNCHECKED', 'PRIVACY_CHECK_FAILED', 'MACHINE_IN_OTHER_WORKSPACE']
diff --git a/backend/src/superTabs/reviewTable.ts b/backend/src/superTabs/reviewTable.ts
index d8f3770cb..fea3bbff6 100644
--- a/backend/src/superTabs/reviewTable.ts
+++ b/backend/src/superTabs/reviewTable.ts
@@ -4,8 +4,10 @@
* (project instructions, Rules for every agent: Ken, 2026-10-29); a test step where the change runs (Workflow 2). The table is
* the project's rules record (policy.ts, #3393): its review rows, test rows and untested paths, read through its own matcher.
*/
+import type { Conversation, SuperTabState } from './model.js'
import { unknownHistory, type HistoryReport } from './prHistory.js'
import { requiredReads, SEED_RULES, testsFor, touchedRows, type ProjectRules } from './policy.js'
+import { stepName } from './steps.js'
export type StepKind = 'review' | 'security' | 'test'
/** A step a pull request needs: its name in the task, its kind, the sensitive areas it touched, where a test runs, and
@@ -20,6 +22,31 @@ const OS_WORDS: Record<StepOs, RegExp> = { mac: /\bmac(?:os|book)?\b/i, linux: /
export const osesIn = (where: readonly string[]): StepOs[] => (['mac', 'linux', 'windows'] as const).filter(os => where.some(line => OS_WORDS[os].test(line)))
/** Whether a machine's reported OS (machines.ts resources.os: "macOS", "Linux", "Windows") is [os]. */
export const reportsOs = (reported: string | null | undefined, os: StepOs): boolean => !!reported && OS_WORDS[os].test(reported)
+const OS_NAME: Record<StepOs, string> = { mac: 'Mac', linux: 'Linux', windows: 'Windows' }
+
+/** The OS a step's name names, when it names exactly one (task #3926): "Test on a Linux machine" is Linux's; a plain "Test",
+ * or anything that is not a step, names none and is matched to no OS. */
+export function stepOs(group: Pick<Conversation, 'reviewOf' | 'step' | 'title'>): StepOs | undefined {
+ const oses = group.reviewOf ? osesIn([stepName(group)]) : []
+ return oses.length === 1 ? oses[0] : undefined
+}
+
+/** The words for a step of [os] nobody of that OS can take: "No Linux Tester free". */
+export const noTesterFree = (os: StepOs): string => `No ${OS_NAME[os]} Tester free`
+
+/**
+ * Why [group], a step named for an OS, cannot run on [machineId], or null (task #3926: with the Linux Testers down, two Linux
+ * steps went to a Windows and a Mac Tester, and stalled). The machine's own reading says its OS, as reviewerPick.ts reads it;
+ * one the Swarm does not list, or with no reading, reports none and takes no OS step. [contributorId] picks an agent's own pool.
+ */
+export function stepOsRefusal(state: SuperTabState, group: Pick<Conversation, 'reviewOf' | 'step' | 'title'>, machineId: string, contributorId?: string): string | null {
+ const os = stepOs(group)
+ if (!os) return null
+ const pool = state.machines?.find(m => m.machineId === machineId && (!contributorId || m.contributorId === contributorId))
+ const reported = pool?.observation?.resources?.os
+ if (reportsOs(reported, os)) return null
+ return `${stepName(group)} runs only on a ${OS_NAME[os]} machine, and ${pool?.name ?? 'this machine'} reports ${reported ? reported : 'no OS'}.`
+}
/**
* The steps a change to [files] needs by the project's [rules], reads first: as many reads as requiredReads asks, each a
diff --git a/backend/src/superTabs/reviewerPick.ts b/backend/src/superTabs/reviewerPick.ts
index e8559ad55..6abd76b89 100644
--- a/backend/src/superTabs/reviewerPick.ts
+++ b/backend/src/superTabs/reviewerPick.ts
@@ -12,8 +12,8 @@ import { activeWork, workerIndex, type Agent, type CheckVerdict, type Conversati
import { agentProjectId, groupProject, onTeamAccount } from './projects.js'
import { agentTarget, modelMatches } from './rules.js'
import { canStart, standing } from './reviewSeats.js'
-import { stepsOf } from './steps.js'
-import { reportsOs, type StepKind, type StepOs } from './reviewTable.js'
+import { stepName, stepsOf } from './steps.js'
+import { reportsOs, stepOs, type StepKind, type StepOs } from './reviewTable.js'
/** The agents that built [task]: its assignee and every agent its ledger says ran it. */
export function builtBy(task: Conversation): Set<string> {
@@ -101,3 +101,15 @@ export function reviewerCandidates(state: SuperTabState, task: Conversation, kin
})
return ranked.sort((a, b) => a.rank - b.rank || a.cost - b.cost || a.agent.id.localeCompare(b.agent.id)).map(entry => entry.agent)
}
+
+/** The agents that may take [step] now, as reviewerCandidates ranks them: its kind by its name, at its task's newest pull
+ * request head, and on the OS its name names (task #3926). None when its task is not loaded. */
+export function stepCandidates(state: SuperTabState, step: Conversation, now: number): Agent[] {
+ const task = state.conversations.find(g => g.id === step.reviewOf)
+ if (!task) return []
+ const name = stepName(step)
+ const kind: StepKind = /test/i.test(name) ? 'test' : /security/i.test(name) ? 'security' : 'review'
+ const latest = task.pullRequestUrls?.at(-1)
+ const head = latest ? task.pullRequestHeads?.[latest]?.head ?? null : null
+ return reviewerCandidates(state, task, kind, head, now, stepOs(step))
+}
diff --git a/backend/src/superTabs/stepOs.test.ts b/backend/src/superTabs/stepOs.test.ts
new file mode 100644
index 000000000..d51a74189
--- /dev/null
+++ b/backend/src/superTabs/stepOs.test.ts
@@ -0,0 +1,153 @@
+/**
+ * A step named for an OS goes only to an agent on that OS (task #3926: with daniel-pc's Linux Testers down, #3872's "Test on a
+ * Linux machine" went to a Windows Tester and #3861's to a Mac one, and both stalled).
+ */
+import { describe, expect, it } from 'vitest'
+import { applyCommand, type Command, type CommandContext } from './commands.js'
+import { candidatesFor, DISPATCH_RULES } from './dispatch.js'
+import { sweepLiveness } from './liveness.js'
+import { createSuperTab, type Actor, type AgentConfiguration } from './model.js'
+import { stepsOf } from './steps.js'
+
+const owner: Extract<Actor, { kind: 'person' }> = { kind: 'person', userId: 'owner', email: '[email protected]' }
+const opus: AgentConfiguration = { engine: 'claude', model: 'opus', effort: 'high', contextWindow: 200000, engineVersion: 'fixture' }
+const PR = 'https://github.com/acme/app/pull/7'
+const NOW = 1_000_000
+const contribution = { contribution: { machineOwnerId: 'host-owner', contributorId: 'owner' } }
+/** A new agent starts only on its starter's own computer, as them (Swarm v3, task #4120). */
+const ownComputer = { contribution: { machineOwnerId: 'owner', contributorId: 'owner' } }
+
+const machine = (machineId: string, os: string) => ({ machineId, name: machineId, contributorId: 'owner', membershipGeneration: 'g', generation: 'g1',
+ cwd: '/swarm', scope: 'swarm', engines: ['claude'], maxAgents: 4, paused: false,
+ observation: { generation: 'g1', receivedAt: NOW - 1000, sessionKind: 'computer', resources: { os }, tools: {}, runningHarnessIds: [], stoppedHarnessIds: [],
+ readiness: { engines: [{ engine: 'claude', installed: true, signedIn: true }] },
+ quotas: [{ engine: 'claude', known: true, windows: [{ name: 'weekly', usedPercent: 10, resetsAt: null }] }] } })
+
+/** A task in review whose CLI change opened "Test on a Mac" and "Test on a Linux machine", each with its Tester, and a second
+ * Mac Tester and a Windows Tester left free. */
+function fixture() {
+ let state = createSuperTab('tab', 'Pilot', { id: 'owner', email: owner.email }, 'prod')
+ let sequence = 0
+ const run = (command: Command, actor: Actor = owner, context: Partial<CommandContext> = {}) => {
+ const effects = applyCommand(state, actor, command, { now: NOW, operationId: `op-${++sequence}`, ...context })
+ state = effects.state
+ return effects
+ }
+ const as = (agentId: string): Actor => ({ kind: 'agent', agentId, machineOwnerId: 'host-owner' })
+ const add = (name: string, group: string, roleName: string, machineId = 'mac0') => run({ type: 'agent.add', conversationId: group, machineId,
+ harnessId: name, name, configuration: opus, lead: false, roleName } as Command, owner, contribution).result.agentId as string
+ const lead = run({ type: 'agent.add', conversationId: 'lead', machineId: 'mac0', harnessId: 'pm', name: 'pm', configuration: opus, lead: true }, owner,
+ contribution).result.agentId as string
+ const task = run({ type: 'conversation.create', title: 'Fix the host', brief: 'The host restarts.', checks: [{ description: 'Restarts', independent: true }],
+ priority: 'P2', requesterId: 'owner' }, as(lead)).result.conversationId as string
+ const dev = add('dev', task, 'Engineer')
+ run({ type: 'work.assign', conversationId: task, agentId: dev }, as(lead))
+ add('rev', task, 'Reviewer')
+ const linux = add('linux-tst', task, 'Tester', 'linux1')
+ const mac = add('mac-tst', task, 'Tester', 'mac1')
+ // A second Linux Tester, a second Mac Tester and a Windows Tester, out of reach until the Ready has opened the steps.
+ const linux2 = add('linux-tst2', task, 'Tester', 'linux1'), mac2 = add('mac-tst2', task, 'Tester', 'mac1'), win = add('win-tst', task, 'Tester', 'win1')
+ const agent = (id: string) => state.agents.find(a => a.id === id)!
+ const busy = [linux2, mac2, win].map(id => { const a = agent(id); const was = a.workDecision; a.workDecision = 'stop'; return () => { agent(id).workDecision = was } })
+ const generation = state.people.find(p => p.id === 'owner')!.generation
+ state.machines = [machine('mac0', 'macOS'), machine('mac1', 'macOS'), machine('linux1', 'Linux'), machine('win1', 'Windows')]
+ .map(m => ({ ...m, membershipGeneration: generation })) as never
+ run({ type: 'work.status', conversationId: task, assignmentId: state.conversations.find(c => c.id === task)!.assignment!.id, status: 'review',
+ result: `Ready: ${PR}` } as Command, as(dev), { pullRequestFiles: { urls: [PR], head: 'abc1234', files: ['cli/src/superTabs/host.ts'] } })
+ const step = (name: string) => stepsOf(state, task).find(s => s.step === name)!
+ const linuxStep = step('Test on a Linux machine')
+ expect(linuxStep.assignment!.agentId).toBe(linux)
+ expect(step('Test on a Mac').assignment!.agentId).toBe(mac)
+ busy.forEach(free => free())
+ const lose = () => {
+ const held = linuxStep.assignment!
+ held.status = 'lost'
+ held.lost = { reason: 'its machine went offline', at: NOW }
+ linuxStep.lostAttempt = { id: held.id, agentId: linux, machineId: 'linux1', engine: 'claude' }
+ }
+ const offered = (agentId: string) => candidatesFor(state, agent(agentId), DISPATCH_RULES, NOW).map(c => c.group.id)
+ return { run, as, lead, task, dev, linux, linux2, mac, mac2, win, linuxStep, step, lose, offered, get state() { return state } }
+}
+
+describe('a step named for an OS', () => {
+ it('lost, is never handed on to a Mac or Windows Tester, and a free Linux Tester takes it', () => {
+ const f = fixture()
+ f.lose()
+ expect(f.offered(f.mac2)).not.toContain(f.linuxStep.id)
+ expect(f.offered(f.win)).not.toContain(f.linuxStep.id)
+ expect(f.offered(f.linux2)).toContain(f.linuxStep.id)
+ })
+
+ it('is refused to an agent on another OS when assigned', () => {
+ const f = fixture()
+ f.lose()
+ for (const agentId of [f.mac2, f.win]) {
+ expect(() => f.run({ type: 'work.assign', conversationId: f.linuxStep.id, agentId }, f.as(f.lead)))
+ .toThrow(expect.objectContaining({ code: 'STEP_OS' }))
+ }
+ expect(() => f.run({ type: 'work.assign', conversationId: f.linuxStep.id, agentId: f.linux2 }, f.as(f.lead))).not.toThrow()
+ })
+
+ it('without an OS in its name, still goes to any free Tester', () => {
+ const f = fixture()
+ const plain = f.run({ type: 'conversation.create', title: 'Test', brief: 'Test it.', reviewOf: f.task, step: 'Test',
+ checks: [{ description: 'Runs.', independent: true }] }, f.as(f.lead)).result.conversationId as string
+ expect(() => f.run({ type: 'work.assign', conversationId: plain, agentId: f.win }, f.as(f.lead))).not.toThrow()
+ })
+
+ const candidate = (id: string, machineId: string) => ({ id, kind: 'new', machineId, engine: 'claude', model: 'opus', effort: 'high',
+ quality: 3, cost: 2, title: `${id} on ${machineId}`, label: `Label ${id}` })
+ const record = (candidates: unknown[]) => ({ assessment: { difficulty: 'low', risk: 'low', why: 'A Linux test.' }, candidates, excluded: [],
+ floor: 2, notes: false, via: 'instructions', p: null, belowFloor: false, why: 'Instructions.' })
+ const requirements = { memoryBytes: 0, diskBytes: 0, maxCpuPercent: 100, tools: [], devices: [], quotaRequired: false }
+
+ it('is routed only to its OS: a Mac or Windows candidate moves to the exclusions with why, and a route with no Linux one is refused', () => {
+ const f = fixture()
+ f.lose()
+ const routed = f.run({ type: 'route.record', conversationId: f.linuxStep.id,
+ decision: record([candidate('c0', 'mac1'), candidate('c1', 'linux1'), candidate('c2', 'win1')]) } as Command)
+ expect(routed.routeDecisions[0]).toMatchObject({ op: 'create', record: { candidates: [{ id: 'c1' }],
+ excluded: [{ title: 'c0 on mac1', reason: expect.stringContaining('runs only on a Linux machine, and mac1 reports macOS') },
+ { title: 'c2 on win1', reason: expect.stringContaining('win1 reports Windows') }] } })
+ expect(() => f.run({ type: 'route.record', conversationId: f.linuxStep.id, decision: record([candidate('c0', 'mac1')]) } as Command))
+ .toThrow(expect.objectContaining({ code: 'STEP_OS' }))
+ })
+
+ it('is refused a new agent started on a machine of another OS', () => {
+ const f = fixture()
+ f.lose()
+ const start = (machineId: string) => () => f.run({ type: 'agent.start', request: { conversationId: f.linuxStep.id, machineId, engine: 'claude',
+ name: 'Tester', cwd: '/swarm/lead', worktree: true, requirements } } as Command, owner, ownComputer)
+ expect(start('mac1')).toThrow(expect.objectContaining({ code: 'STEP_OS' }))
+ expect(start('linux1')).not.toThrow()
+ })
+
+ it('with no Linux Tester free, waits and says so in the step, and the PM is told once', () => {
+ const f = fixture()
+ // daniel-pc goes down: its Linux Testers with it, while the Mac and Windows Testers stay free.
+ const linux1 = f.state.machines!.find(m => m.machineId === 'linux1')!
+ linux1.observation!.receivedAt = NOW - 60 * 60_000
+ const rows = sweepLiveness(f.state, NOW)
+ const step = f.step('Test on a Linux machine')
+ expect(step.assignment!.status).toBe('lost')
+ const toPm = rows.filter(r => r.recipients.includes(f.lead))
+ expect(toPm).toHaveLength(1)
+ expect(toPm[0]!.text).toContain('No Linux Tester free')
+ const said = rows.filter(r => r.conversationId === step.id && r.recipients.length === 0 && /No Linux Tester free/.test(r.text))
+ expect(said).toHaveLength(1)
+ expect(f.offered(f.mac2)).not.toContain(step.id)
+ // The next sweeps say nothing again.
+ expect(sweepLiveness(f.state, NOW + 30_000).filter(r => /No Linux Tester free/.test(r.text))).toEqual([])
+ })
+
+ it('lost with a Linux Tester free, says nothing of waiting', () => {
+ const f = fixture()
+ // Only the Tester's own session ends: its machine and the other Linux Tester are up.
+ f.state.machines!.find(m => m.machineId === 'linux1')!.observation!.stoppedHarnessIds = ['linux-tst']
+ const rows = sweepLiveness(f.state, NOW)
+ expect(f.step('Test on a Linux machine').assignment!.status).toBe('lost')
+ expect(rows.filter(r => /No Linux Tester free/.test(r.text))).toEqual([])
+ expect(f.offered(f.linux2)).toContain(f.step('Test on a Linux machine').id)
+ })
+})
+
diff --git a/docs/plans/2026-11-06-os-steps-plan.md b/docs/plans/2026-11-06-os-steps-plan.md
new file mode 100644
index 000000000..6318a4a59
--- /dev/null
+++ b/docs/plans/2026-11-06-os-steps-plan.md
@@ -0,0 +1,89 @@
+# A step named for an OS goes only to an agent on that OS: implementation plan
+
+> Written by the project's Engineer way of working (project instructions, Engineer): plan first, then each task test first,
+> the failing test committed before its code. No Execution Handoff.
+
+**Goal:** A step named for an OS ("Test on a Linux machine", "Test on a Mac", "Test on a Windows machine") is handed on,
+assigned and routed only to an agent on a machine reporting that OS. With none free, the step waits, says so in its own
+conversation ("No Linux Tester free"), and the PM is told once (task #3926, found by the PM 11-06: with daniel-pc's Linux
+Testers down, #3872's Linux step went to WinTest3348 on Windows and #3861's to Wintest2 on macOS, and both stalled).
+
+**Architecture:** The OS is read from the step's name only (`stepOs`, reviewTable.ts, beside `osesIn` and `reportsOs`): a
+step whose name names exactly one OS. A step without one changes in nothing (the brief's constraint), including a plain
+"Test" whose plan carried an OS: that one is matched where it is first opened, as today.
+
+- Handed on (the bug): dispatch.ts `candidatesFor` asks `reviewerCandidates` for a lost step's agents without its OS, so any
+ free Tester matched. It passes `stepOs(step)`.
+- Assigned: commands.ts `assignRefusal` (work.assign, the server's own review-step and dispatch picks) refuses an agent whose
+ machine does not report the step's OS: `STEP_OS`, naming the step's OS and the machine's.
+- Routed: route.record's `candidateRefusal` gives the same refusal, so a wrong-OS candidate moves to the decision's exclusions
+ with its reason, as a Team-work refusal does; and agent.start for such a step refuses a machine of another OS.
+- Waits and says so: when a lost OS step has no free agent of its OS (`reviewerCandidates` with the OS is empty), the loss
+ row the PM already gets once (liveness.ts `loseTask`) adds "No Linux Tester is free: the step waits for one", and the step's
+ own conversation gets the row "No Linux Tester free: this step waits until one is.", by the loss's stable id, so a later
+ sweep writes nothing again.
+
+One function says what a machine reports: `machineOs(state, machineId, contributorId?)`, the pool's own reading (a Team
+account's pool reports its own), as reviewerPick.ts reads it today.
+
+**Tech Stack:** TypeScript backend (vitest).
+
+**Spec:** task #3926 brief.
+
+## Global Constraints
+
+- No change to steps without an OS in their name.
+- A machine the Swarm does not list, or one with no reading, reports no OS: it never takes an OS step (as reviewerPick.ts).
+- Owns backend/src/superTabs/. No client change: the step's row carries the words.
+
+## Design
+
+- growth: N/A because nothing new is stored: one system row per lost OS step with nobody free, by the loss's id.
+- concurrency: N/A because every check runs inside the existing command or sweep write.
+- read cost: N/A because it reads only the loaded state (the machine list and agents already loaded).
+- scale: one more candidate filter per step per dispatch pass; the pass is already bounded by DISPATCH_TRIES.
+- compatibility: a new refusal code `STEP_OS` on work.assign and agent.start, which clients show as any refusal's message.
+- migration and rollback: none; revert the commit.
+- audience: the server enforces it; the rows go to the step's conversation and the PM as the loss row does.
+- identity: N/A because no work runs under anyone new.
+- failure: the refusal names the step's OS and the machine's; a waiting step says why.
+- platforms: backend only (Linux CI).
+
+## Review Focus
+
+- Every path that gives a step an agent goes through `assignRefusal` (work.assign, `openReviewSteps`, dispatch's work.assign).
+- `stepOs` reads only the name, so no existing step without an OS changes.
+
+## Task 1: a lost OS step is never handed to an agent of another OS
+
+**Files:** backend/src/superTabs/reviewTable.ts, dispatch.ts, commands.ts, stepOs.test.ts (new).
+
+**Interfaces:** `stepOs(step: Pick<Conversation, 'step' | 'title' | 'reviewOf'>): StepOs | undefined`;
+`machineOs(state, machineId, contributorId?): string | undefined`.
+
+- [ ] Test: a Linux step whose Linux Tester was lost, with a Mac Tester and a Windows Tester free, is in neither one's
+ dispatch candidates; work.assign of either is refused STEP_OS; a free Linux Tester gets it. A plain "Test" step
+ still goes to any free Tester.
+- [ ] Watch it fail.
+- [ ] Code: `stepOs`, `machineOs`; `candidatesFor` passes the OS; `assignRefusal` refuses.
+- [ ] Watch it pass; commit.
+
+## Task 2: routing and starts keep to the step's OS
+
+**Files:** backend/src/superTabs/commands.ts, stepOs.test.ts.
+
+- [ ] Test: route.record for a Linux step moves a Mac candidate to its exclusions with the reason, and refuses when every
+ candidate is of another OS; agent.start for it on a Mac is refused STEP_OS.
+- [ ] Watch it fail.
+- [ ] Code: `candidateRefusal` and agent.start call the same OS refusal.
+- [ ] Watch it pass; commit.
+
+## Task 3: with no Tester of its OS free, the step waits and says so; the PM is told once
+
+**Files:** backend/src/superTabs/liveness.ts, stepOs.test.ts.
+
+- [ ] Test: the Linux Tester's machine goes offline with no other Linux Tester: the PM's loss row says no Linux Tester is
+ free, the step's conversation has "No Linux Tester free", and a second sweep writes neither again.
+- [ ] Watch it fail.
+- [ ] Code: `loseTask` adds both for an OS step with no candidate of its OS.
+- [ ] Watch it pass; commit.