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.

Review and test steps are never doubled, and only Reviewers and Testers get them (#3602) (#3312)

harness-for-autonomous[bot]5e268c223a57
diff --git a/backend/src/superTabs/commands.ts b/backend/src/superTabs/commands.ts
index 698cb9ce2..30a2201f3 100644
--- a/backend/src/superTabs/commands.ts
+++ b/backend/src/superTabs/commands.ts
@@ -21,7 +21,7 @@ import {
import { jobKindOf } from './evidence/jobKind.js'
import { endSteps, stepEndedRows, isStep, stepName, stepsOf, taskOwner } from './steps.js'
import { reviewPlan, stepBrief, stepCheck, type PlannedStep, type StepKind } from './reviewTable.js'
-import { reviewerCandidates } from './reviewerPick.js'
+import { builtBy, reviewerCandidates } from './reviewerPick.js'
import { recordCheckVerdict } from './checkVerdicts.js'
import { routeRecordSchema, routeTitle, startedAs, type KeptCandidate, type RouteDecision, type RouteFinal, type RouteOverride } from './routeRecord.js'
import { routingOverrideSaveSchema } from './routingPolicy.js'
@@ -1775,7 +1775,7 @@ function applyCommandOnce(original: SuperTabState, actor: Actor, input: Command,
state.conversations.push({ id, ...(state.projects ? { projectId: project.id } : {}), number, title: planned.name, leadId,
agentIds: leadId ? [leadId] : [], archived: false, brief, reviewOf: task.id,
// A step keeps its task's mark, as conversation.create's does (teamWritten.ts stepMark).
- ...stepMark(state, task), step: planned.name,
+ ...stepMark(state, task), step: planned.name, openedBy: 'server',
assignment: null, lastMessageSequence: 0, codePullRequestUrls: [], checks: storedChecks([{ description: stepCheck(planned), independent: true }], id) })
const step = state.conversations.at(-1)!
listStep(task, id)
@@ -1803,7 +1803,7 @@ function applyCommandOnce(original: SuperTabState, actor: Actor, input: Command,
&& (check.verdicts ?? []).some(verdict => verdict.passed && (verdict as { head?: string }).head === read.head))) continue
step ??= openStep(task, planned, read)
const previous = step.assignment?.agentId
- const ranked = reviewerCandidates(state, task, planned.kind, read.head, context.now)
+ const ranked = reviewerCandidates(state, task, planned.kind, read.head, context.now, planned.os)
const ordered = [...ranked.filter(a => a.id === previous), ...ranked.filter(a => a.id !== previous)]
const target = step
const worker = ordered.find(candidate => {
@@ -2560,6 +2560,20 @@ function applyCommandOnce(original: SuperTabState, actor: Actor, input: Command,
open(state, reviewed.id)
// One level: a step's own work is a task's step, never a task with steps of its own (task steps design).
if (command.step && isStep(reviewed)) fail('STEP_OF_STEP', 'A step belongs to a task, not to another step.', 400)
+ // Never doubled (task #3602: #3561 got its server's Security reviews and Test, then its Engineer's review, review and
+ // test): the task's own Engineer is refused a step when one of the same name is open, or the server opened one of that
+ // kind, while its work is open. Its own second step of a kind under another name ("Security review 2") still opens. The
+ // PM, the Integrator and people open their later checks (a main merge check, a combination read) as before, and a done
+ // step blocks nobody (review of #3312).
+ const engineer = actor.kind === 'agent' && (reviewed!.assignment?.agentId === actor.agentId || builtBy(reviewed!).has(actor.agentId))
+ if (command.step && engineer) {
+ const name = (text: string) => text.trim().replace(/\s+/g, ' ').toLowerCase()
+ const kind = (text: string) => /security/i.test(text) ? 'security' : /test/i.test(text) ? 'test' : /review|read/i.test(text) ? 'review' : null
+ const wanted = kind(command.step)
+ const same = stepsOf(state, reviewed!.id).find(step => !step.archived && (!step.assignment || activeWork(step)) && (name(stepName(step)) === name(command.step!)
+ || (step.openedBy === 'server' && wanted !== null && kind(stepName(step)) === wanted)))
+ if (same) fail('STEP_OPEN', `"${stepName(same)}"${same.number ? ` (#${same.number})` : ''} is already open on this task: use it rather than opening another.`, 409)
+ }
}
// Who asked: the person named, else the one a Buddy's proposal was sent for, else a person opening it themselves.
const proposal = command.proposalMessageId ? proposalOf(state, project, proposalNamed(context.proposal)) : undefined
diff --git a/backend/src/superTabs/model.ts b/backend/src/superTabs/model.ts
index 5793d203b..b24fb4727 100644
--- a/backend/src/superTabs/model.ts
+++ b/backend/src/superTabs/model.ts
@@ -427,6 +427,9 @@ export interface Conversation {
* #3554): those its brief, title, assignment's result, checks' evidence and merge record name, never links in posts. [] from
* its creation; absent on a conversation from before, which reads what it recorded instead (codePullRequests). */
codePullRequestUrls?: string[]
+ /** 'server' on a step the server opened for a handed task (commands.ts openReviewSteps, task #3602): an agent's step of its
+ * kind is then refused as a double. Absent on a step an agent or a person opened, and on older ones. */
+ openedBy?: 'server'
/** When its brief was last set (conversation.create, work.define): a person's rule moved into this task leaves the
* instructions only for a pull request GitHub says merged after it (ruleGuard.ts rulePlaces, #3463). No command writes
* it otherwise. Absent on a task from before. */
diff --git a/backend/src/superTabs/parts/light.test.ts b/backend/src/superTabs/parts/light.test.ts
index 71f3749b8..42c175b64 100644
--- a/backend/src/superTabs/parts/light.test.ts
+++ b/backend/src/superTabs/parts/light.test.ts
@@ -61,6 +61,7 @@ const conversation: Required<Conversation> = {
messageSeq: 0,
notBefore: '2026-12-04',
number: 1,
+ openedBy: 'server',
owed: [],
pin: { agentId: 'a', why: 'ci', at: 1 },
priority: 'P0',
diff --git a/backend/src/superTabs/parts/light.ts b/backend/src/superTabs/parts/light.ts
index 9537d2794..fe14cfca4 100644
--- a/backend/src/superTabs/parts/light.ts
+++ b/backend/src/superTabs/parts/light.ts
@@ -86,6 +86,7 @@ export const GROUP_FIELDS = {
'messageSeq',
'notBefore',
'number',
+ 'openedBy',
'owed',
'pin',
'priority',
diff --git a/backend/src/superTabs/reviewSteps.test.ts b/backend/src/superTabs/reviewSteps.test.ts
index 0d7dcd605..9bdc0360b 100644
--- a/backend/src/superTabs/reviewSteps.test.ts
+++ b/backend/src/superTabs/reviewSteps.test.ts
@@ -63,6 +63,11 @@ describe('a handed task opens its review steps', () => {
const f = fixture()
f.add('rev', f.task, 'Reviewer')
const tester = f.add('tst', f.task, 'Tester')
+ // A Desktop test runs on a Mac: its Tester's machine says it is one (task #3602; an unlisted machine takes no OS step).
+ f.state.machines = [{ machineId: 'host', name: 'host', contributorId: 'owner', membershipGeneration: 'g', generation: 'g1', cwd: '/swarm', scope: 'swarm',
+ engines: ['claude'], maxAgents: 8, paused: false, observation: { generation: 'g1', receivedAt: 1_000_000 - 1000, sessionKind: 'computer', resources: { os: 'macOS' },
+ tools: {}, runningHarnessIds: [], stoppedHarnessIds: [], readiness: { engines: [{ engine: 'claude', installed: true, signedIn: true }] },
+ quotas: [{ engine: 'claude', known: true, windows: [{ name: 'weekly', usedPercent: 10, resetsAt: null }] }] } }] as never
f.ready(['desktop/lib/super_tabs/view.dart'])
expect(f.steps().map(s => s.name)).toEqual(['Review', 'Test'])
expect(f.steps()[1]!.agent).toBe(tester)
@@ -120,6 +125,67 @@ describe('a handed task opens its review steps', () => {
expect(f.group(own).assignment?.status).toBe('working')
})
+ // Task #3602: #3561 got Security review 1, 2 and Test from the server, then review, review and test from its Engineer.
+ it('refuses an agent\'s step of a kind the server already opened, or of a name already open, naming the open one', () => {
+ const f = fixture()
+ f.add('rev-a', f.task, 'Reviewer'); f.add('rev-b', f.task, 'Reviewer'); f.add('tst', f.task, 'Tester')
+ f.ready(['backend/src/routes/auth.ts', 'desktop/lib/a.dart'])
+ expect(f.steps().map(s => s.name)).toEqual(['Security review 1', 'Security review 2', 'Test'])
+ const open = (step: string) => () => f.run({ type: 'conversation.create', title: step, reviewOf: f.task, step, brief: 'Read it.', checks: [] } as Command, f.as(f.dev))
+ for (const step of ['Security review', 'Test']) {
+ expect(open(step), step).toThrow(expect.objectContaining({ code: 'STEP_OPEN' }))
+ }
+ expect(open('Test')).toThrow(/Test/)
+ expect(f.steps()).toHaveLength(3)
+ })
+
+ it('refuses an agent\'s step of a name it already has open, and opens its own second step of a kind under another name', () => {
+ const f = fixture()
+ const open = (step: string) => f.run({ type: 'conversation.create', title: step, reviewOf: f.task, step, brief: 'Read it.', checks: [] } as Command, f.as(f.dev))
+ open('Review')
+ expect(() => open('Review')).toThrow(expect.objectContaining({ code: 'STEP_OPEN' }))
+ open('Security review 1')
+ expect(() => open('Security review 2')).not.toThrow()
+ expect(f.steps().map(s => s.name)).toEqual(['Review', 'Security review 1', 'Security review 2'])
+ })
+
+ // ReviewLinnea's review of #3312: the PM and the Integrator open merge, combination and row checks after a main merge, once
+ // the server's review is done. Only the task's own Engineer is refused, and only for a step whose work is still open.
+ it('lets the PM or another agent open a later check after a done server step, and refuses only the Engineer while it is open', () => {
+ const f = fixture()
+ const rev = f.add('rev', f.task, 'Reviewer')
+ f.ready(['docs/a.md'])
+ const open = (step: string, by: string) => () => f.run({ type: 'conversation.create', title: step, reviewOf: f.task, step, brief: 'Read it.', checks: [] } as Command, f.as(by))
+ // While the server's Review is working, a PM's own check still opens; the Engineer's double does not.
+ expect(open('Review: main merge check', f.lead)).not.toThrow()
+ expect(open('Review', f.dev)).toThrow(expect.objectContaining({ code: 'STEP_OPEN' }))
+ // Done, it blocks nobody: the Engineer may open another review step of its own.
+ const review = stepsOf(f.state, f.task).find(s => s.step === 'Review')!
+ f.run({ type: 'work.status', conversationId: review.id, assignmentId: review.assignment!.id, status: 'done', result: 'Ready to merge: Yes' } as Command, f.as(rev))
+ expect(open('Review: combination read', f.dev)).not.toThrow()
+ })
+
+ // #3576's Test went to a Mac only when its check needed a Mac and a Linux machine.
+ it('opens one test step per machine its check names, each to a Tester on that OS', () => {
+ const f = fixture()
+ f.add('rev', f.task, 'Reviewer')
+ const tester = (name: string, machineId: string) => f.run({ type: 'agent.add', conversationId: f.task, machineId, harnessId: name, name, configuration: opus,
+ lead: false, roleName: 'Tester' } as Command, owner, { contribution: { machineOwnerId: 'host-owner', contributorId: 'owner' } }).result.agentId as string
+ const mac = tester('mac-tst', 'mac1'), linux = tester('linux-tst', 'linux1')
+ 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: 1_000_000 - 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 }] }] } })
+ f.state.machines = [machine('mac1', 'macOS'), machine('linux1', 'Linux')] as never
+ // A Tester on a machine the Swarm does not list says no OS, so it takes neither (review of #3312, Minor 1).
+ tester('unlisted-tst', 'unlisted')
+ f.ready(['cli/src/superTabs/host.ts'])
+ expect(f.steps()).toEqual([{ name: 'Review', agent: expect.any(String), status: 'working' },
+ { name: 'Test on a Mac', agent: mac, status: 'working' }, { name: 'Test on a Linux machine', agent: linux, status: 'working' }])
+ expect(stepsOf(f.state, f.task).find(s => s.step === 'Test on a Linux machine')!.brief).toContain('a Linux machine')
+ })
+
it('with nobody free, the step stays open and the PM is told once; the Ready itself goes through', () => {
const f = fixture()
const effects = f.ready(['backend/src/routes/auth.ts'])
diff --git a/backend/src/superTabs/reviewTable.test.ts b/backend/src/superTabs/reviewTable.test.ts
index cd600879b..bd5ab69de 100644
--- a/backend/src/superTabs/reviewTable.test.ts
+++ b/backend/src/superTabs/reviewTable.test.ts
@@ -23,9 +23,12 @@ describe('reviewPlan', () => {
})
it('adds a test step where the change runs, and none for docs or tests alone', () => {
+ // Task #3602: a test that runs on a Mac and a Linux machine is one step per OS; one OS is that step's.
const plan = reviewPlan(['desktop/lib/super_tabs/view.dart', 'cli/src/superTabs/route.ts'])
- expect(plan.map(step => step.name)).toEqual(['Review', 'Test'])
+ expect(plan.map(step => [step.name, step.os ?? null])).toEqual([['Review', null], ['Test on a Mac', 'mac'], ['Test on a Linux machine', 'linux']])
expect(plan.find(step => step.kind === 'test')?.where).toEqual(['Desktop on a Mac', 'The CLI on a Mac and on a Linux machine'])
+ expect(reviewPlan(['desktop/lib/a.dart']).map(step => [step.name, step.os ?? null])).toEqual([['Review', null], ['Test', 'mac']])
+ expect(reviewPlan(['mobile/lib/a.dart']).map(step => [step.name, step.os ?? null])).toEqual([['Review', null], ['Test', null]])
expect(names(['desktop/test/super_tabs/view_test.dart', 'backend/src/superTabs/steps.test.ts', 'docs/a.md'])).toEqual(['Review'])
expect(names(['backend/src/superTabs/steps.ts'])).toEqual(['Review'])
})
diff --git a/backend/src/superTabs/reviewTable.ts b/backend/src/superTabs/reviewTable.ts
index f3f475ee3..9b60e2357 100644
--- a/backend/src/superTabs/reviewTable.ts
+++ b/backend/src/superTabs/reviewTable.ts
@@ -9,7 +9,16 @@ import { requiredReads, SEED_RULES, testsFor, touchedRows, type ProjectRules } f
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
* `unread` when its files could not be read, so it was planned as strictly as the table goes. */
-export interface PlannedStep { name: string; kind: StepKind; areas: string[]; where?: string[]; unread?: true }
+export interface PlannedStep { name: string; kind: StepKind; areas: string[]; where?: string[]; unread?: true; os?: StepOs }
+
+/** An OS a test step runs on, as the rules record's `where` names it (task #3602): "on a Mac", "on a Linux machine". */
+export type StepOs = 'mac' | 'linux' | 'windows'
+const OS_PLACE: Record<StepOs, string> = { mac: 'a Mac', linux: 'a Linux machine', windows: 'a Windows machine' }
+const OS_WORDS: Record<StepOs, RegExp> = { mac: /\bmac(?:os|book)?\b/i, linux: /\blinux\b/i, windows: /\bwindows\b/i }
+/** The OSes [where] names, in a fixed order. */
+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)
/**
* The steps a change to [files] needs by the project's [rules], reads first: as many reads as requiredReads asks, each a
@@ -27,7 +36,11 @@ export function reviewPlan(files: readonly string[] | null, rules: ProjectRules
...(files === null ? { unread: true as const } : {}),
}))
const where = testsFor(rules, files)
- if (where.length) steps.push({ name: 'Test', kind: 'test', areas: [], where })
+ // A test that must run on more than one OS is one step per OS, each for a Tester on that OS (task #3602: #3576's went to a
+ // Mac only when its check needed a Mac and a Linux machine); one OS named is that step's.
+ const oses = osesIn(where)
+ if (where.length && oses.length > 1) for (const os of oses) steps.push({ name: `Test on ${OS_PLACE[os]}`, kind: 'test', areas: [], where, os })
+ else if (where.length) steps.push({ name: 'Test', kind: 'test', areas: [], where, ...oses.length ? { os: oses[0]! } : {} })
return steps
}
@@ -53,6 +66,7 @@ export function stepBrief(step: PlannedStep, task: { number: number; title: stri
: 'its pull request'
const what = step.kind === 'test'
? `Test ${pulls} for task #${task.number} "${task.title}" as a user would, where it changes: ${step.where!.join('; ')}.`
+ + (step.os && step.name !== 'Test' ? ` This step runs it on ${OS_PLACE[step.os]}.` : '')
: `${step.kind === 'security' ? 'Security-review' : 'Review'} ${pulls} for task #${task.number} "${task.title}".`
const why = step.unread ? ' Its changed files could not be read, so it is reviewed as strictly as the review table goes.'
: step.kind === 'security' ? ` It changes ${step.areas.join(', ')}: two independent security reviews before merge.` : ''
diff --git a/backend/src/superTabs/reviewerPick.test.ts b/backend/src/superTabs/reviewerPick.test.ts
index 1aaa88642..9c49ec77d 100644
--- a/backend/src/superTabs/reviewerPick.test.ts
+++ b/backend/src/superTabs/reviewerPick.test.ts
@@ -117,21 +117,31 @@ describe('reviewerCandidates', () => {
expect(f.pick('security')).toEqual(['free'])
})
- it('takes the step\'s role first, then any other free agent; never a Guide or an Integrator', () => {
+ // Task #3602: only the step's own role, with no other free agent standing in.
+ it('takes only the step\'s role; never an Engineer, a Guide or an Integrator', () => {
const f = fixture()
f.add('eng', f.task, opus, { roleName: 'Engineer' })
f.add('guide', f.task, opus, { roleName: 'Guide' })
f.add('integrator', f.task, opus, { roleName: 'Integrator' })
f.add('tst', f.task, opus, { roleName: 'Tester' })
f.add('rev', f.task, opus, { roleName: 'Reviewer' })
- const review = f.pick('review'), test = f.pick('test')
- expect(review[0]).toBe('rev')
- expect(review.slice(1).sort()).toEqual(['eng', 'tst'])
- expect(test[0]).toBe('tst')
- expect(test.slice(1).sort()).toEqual(['eng', 'rev'])
+ expect(f.pick('review')).toEqual(['rev'])
+ expect(f.pick('test')).toEqual(['tst'])
})
// Review of #3227 (Digest): on the live Swarm the Guides carry the role Reviewer and the Integrator none (an Engineer).
+ // Task #3602: #3576's Test step went to an Engineer. A server-opened step goes only to its own role, with no stand-in.
+ it('is only the step\'s own role: never an Engineer, nor an agent of no role', () => {
+ const f = fixture()
+ f.add('eng', f.task, opus, { roleName: 'Engineer' }); f.add('plain', f.task, opus)
+ expect(f.pick('review')).toEqual([])
+ expect(f.pick('test')).toEqual([])
+ f.add('rev', f.task, opus, { roleName: 'Reviewer' }); f.add('tst', f.task, opus, { roleName: 'Tester' })
+ expect(f.pick('review')).toEqual(['rev'])
+ expect(f.pick('security')).toEqual(['rev'])
+ expect(f.pick('test')).toEqual(['tst'])
+ })
+
it('is never the Guide or the Integrator, whatever role name they carry', () => {
const f = fixture()
f.add('Guide', f.task, opus, { roleName: 'Reviewer' })
diff --git a/backend/src/superTabs/reviewerPick.ts b/backend/src/superTabs/reviewerPick.ts
index 6da759a8d..53dd5e08c 100644
--- a/backend/src/superTabs/reviewerPick.ts
+++ b/backend/src/superTabs/reviewerPick.ts
@@ -13,7 +13,7 @@ import { agentProjectId, groupProject } from './projects.js'
import { agentTarget, modelMatches } from './rules.js'
import { canStart, standing } from './reviewSeats.js'
import { stepsOf } from './steps.js'
-import type { StepKind } from './reviewTable.js'
+import { reportsOs, 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> {
@@ -58,7 +58,7 @@ const atHead = (verdict: CheckVerdict & { head?: string }, head: string | null)
* unknown model or one weaker than the engineer; anyone busy, coordinating a conversation, a Buddy, stopping, or of another
* project; anyone holding another open step of this task; anyone with a verdict at this head on the task or its steps.
*/
-export function reviewerCandidates(state: SuperTabState, task: Conversation, kind: StepKind, head: string | null, now: number): Agent[] {
+export function reviewerCandidates(state: SuperTabState, task: Conversation, kind: StepKind, head: string | null, now: number, os?: StepOs): Agent[] {
const projectId = groupProject(state, task).id
const index = workerIndex(state)
const built = builtBy(task)
@@ -74,13 +74,17 @@ export function reviewerCandidates(state: SuperTabState, task: Conversation, kin
if (judged.has(`agent:${agent.id}`)) return []
const role = roleNameOf(state, agent)
if (NEVER.test(role) || NEVER_NAMED.test(agent.name) || NEVER_NAMED.test(agent.displayName ?? '')) return []
+ // Only the step's own role, Reviewer or Tester, with no other agent standing in (task #3602: #3576's Test went to an Engineer).
+ if (!ROLE[kind].test(role)) return []
// Its machine can start work within the review's wait (reviewSeats.ts): not offline, paused, signed out, suspended or
// out of quota. A machine the state does not list is not judged here; work.assign's checks still hold it.
const pool = state.machines?.find(m => m.machineId === agent.machineId && m.contributorId === agent.contributorId)
if (pool && !canStart(standing(state, pool, agent.configuration.engine, now))) return []
+ // A test step for an OS goes to a machine that reports that OS: one reporting another, none, or not listed is never it.
+ if (os && !reportsOs(pool?.observation?.resources?.os, os)) return []
const row = catalogRow(state, agent)
if (!row || row.strength < bar) return []
- return [{ agent, rank: ROLE[kind].test(role) ? 0 : 1, cost: row.cost }]
+ return [{ agent, rank: 0, cost: row.cost }]
})
return ranked.sort((a, b) => a.rank - b.rank || a.cost - b.cost || a.agent.id.localeCompare(b.agent.id)).map(entry => entry.agent)
}
diff --git a/docs/plans/2026-11-06-steps-never-doubled-plan.md b/docs/plans/2026-11-06-steps-never-doubled-plan.md
new file mode 100644
index 000000000..7b0f4b53a
--- /dev/null
+++ b/docs/plans/2026-11-06-steps-never-doubled-plan.md
@@ -0,0 +1,66 @@
+# Review and test steps are never doubled, and only Reviewers and Testers get them (task #3602)
+
+> Implemented by its Engineer test first, by superpowers:test-driven-development, as the project's instructions say
+> (Engineer role). No subagent-driven-development and no execution handoff.
+
+**Goal:** On 11-06 #3561 got Security review 1, Security review 2 and Test from the server and then review, review and test from
+its Engineer (two duplicates cancelled by the PM). #3576's Test step went to an Engineer whose own task was in review, on a Mac
+only, when its check needed a Mac and a Linux machine.
+
+**Architecture:**
+1. Doubling: the server's openReviewSteps already reuses an open step of the same name or kind, whoever opened it. The other
+ order was open: an agent's `conversation.create` with `reviewOf` and `step` is refused (STEP_OPEN, naming the open step) when
+ the task already has an open step of the same name, or the server already opened an open step of that kind. Server steps are
+ marked when opened (`openedBy: 'server'`). An agent's own second step of a kind under another name ("Security review 2")
+ still opens.
+2. Who gets a step: the server's pick (reviewerPick.ts reviewerCandidates) takes only the step's role, Reviewer for a review or
+ security step and Tester for a test step; no other free agent stands in. A test step needs the machines its check names:
+ "a Mac", "a Linux machine". When it names more than one, one test step opens per machine ("Test on a Mac", "Test on a Linux
+ machine"), each given only to a Tester on that OS (the machine's reported `os`). One nobody can take stays open, and the PM
+ hears it once, as today.
+3. Not a refusal on `work.assign`: the server refuses only facts and access (removedRefusals.test.ts pins ROLE_* and
+ REVIEWER_NOT_ASSIGNABLE as removed); a person or the PM may still hand a step to anyone.
+
+**Tech Stack:** TypeScript, vitest.
+
+**Spec:** task #3602's brief (River, 11-06).
+
+## Global Constraints
+
+- removedRefusals.test.ts stays green.
+- The step names and checks stay readable for the Engineer and the reviewer.
+
+## Design
+
+- growth: one marker on a server-opened step; per-OS test steps replace one, never more than the OSes named.
+- concurrency: inside the command's transaction, as steps open today.
+- read cost: none added; the pick already reads agents and machines.
+- scale: candidates filtered by role and OS before ranking; linear in agents, as today.
+- compatibility: an older step has no marker and counts as the Engineer's; an older client sees ordinary steps.
+- migration + rollback: none.
+- audience: n/a, no new data exposed.
+- identity: agents by id and role; machines by their own report.
+- failure: a refused step names the open one to use; a step nobody may take stays open and the PM hears it.
+- platforms: picks by the OS each machine reports (macOS, Linux, Windows).
+
+## Review Focus
+
+- No path still doubles a step; a legitimate second step of a kind still opens.
+- No Engineer, Guide or other role is picked for a step; a test step's OS is right.
+
+## Task 1: steps are never doubled
+
+**Files:** backend/src/superTabs/commands.ts (conversation.create with reviewOf, openStep), tests in reviewSteps.test.ts.
+
+- [ ] Failing test: an agent's step after the server's of the same kind, or of the same name, is refused, naming the open one;
+ an agent's own second step under another name opens; the server reuses an agent's open step.
+- [ ] Code.
+
+## Task 2: only Reviewers and Testers, on the OS a test needs
+
+**Files:** reviewerPick.ts, reviewTable.ts (OS needs from `where`), commands.ts openReviewSteps; tests in reviewerPick.test.ts and
+reviewSteps.test.ts.
+
+- [ ] Failing test: an Engineer (or another role) is never picked for a step; a test step whose check names a Mac and a Linux
+ machine opens one step per OS, each given only to a Tester on that OS.
+- [ ] Code.