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.

Windows test steps open only where a Windows machine can take them (#4410) (#3511)

0xken155f445bf169f1
diff --git a/backend/src/superTabs/commands.ts b/backend/src/superTabs/commands.ts
index add38900b..60e6b3fb0 100644
--- a/backend/src/superTabs/commands.ts
+++ b/backend/src/superTabs/commands.ts
@@ -29,7 +29,7 @@ import { closeMerged } from './mergedTasks.js'
import { noteWriter } from './stuck.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 { stopWaiting, testsOn, WAIT_LINE, waitFor, waits } from './osSteps.js'
import { builtBy, reviewerCandidates, STRENGTH_RULE } from './reviewerPick.js'
import { checkedPullRequest, deriveCheck, recordCheckVerdict } from './checkVerdicts.js'
import { routeRecordSchema, routeTitle, startedAs, type KeptCandidate, type RouteDecision, type RouteFinal, type RouteOverride } from './routeRecord.js'
@@ -2014,14 +2014,16 @@ function applyCommandOnce(original: SuperTabState, actor: Actor, input: Command,
taken.add(step.id)
step.brief = refreshStepBrief(step.brief ?? '', planned, { number: task.number!, title: task.title, pulls })
}
- // A new Linux step opens only where the project can test on Linux (linuxSteps.ts, task #4278): else it waits, and the
- // task says once that CI's Linux runs stand in. A step the PM closed is not open, so a later head never brings it back.
- if (!step && planned.os === 'linux') {
- if (!testsOnLinux(state, groupProject(state, task), context.now)) {
- if (waitForLinux(task, planned, pulls)) message(task.id, LINUX_WAIT_LINE, [], null, SYSTEM_ROW, undefined, undefined, undefined, stableId(operationId, 'linux-wait'))
+ // A new Linux or Windows step opens only where the project can test on that OS (osSteps.ts, tasks #4278, #4410): else it
+ // waits, and the task says once why (for Linux CI's runs stand in; for Windows a person's check is owed). A step the PM
+ // closed is not open, so a later head never brings it back.
+ const os = planned.os
+ if (!step && waits(os)) {
+ if (!testsOn(state, groupProject(state, task), context.now, os)) {
+ if (waitFor(task, { ...planned, os }, pulls)) message(task.id, WAIT_LINE[os], [], null, SYSTEM_ROW, undefined, undefined, undefined, stableId(operationId, `${os}-wait`))
continue
}
- delete task.waitingLinuxStep
+ stopWaiting(task, os)
}
if (step && activeWork(step)) continue
// A step whose every check passed at this very head keeps its verdict: a repeated Ready (a CI rerun) asks nothing again.
diff --git a/backend/src/superTabs/linuxSteps.test.ts b/backend/src/superTabs/linuxSteps.test.ts
deleted file mode 100644
index 01185d6e9..000000000
--- a/backend/src/superTabs/linuxSteps.test.ts
+++ /dev/null
@@ -1,150 +0,0 @@
-import { describe, expect, it } from 'vitest'
-import { applyCommand, type Command, type CommandContext } from './commands.js'
-import { createSuperTab, type Actor, type AgentConfiguration } from './model.js'
-import { stepsOf } from './steps.js'
-import { openWaitingSteps } from './linuxSteps.js'
-
-// Task #4278: since v3 (#4120) a Tester starts only on its own person's computer, and no own-account Linux machine could take
-// harness's Linux test steps, yet every new head opened one and the PM closed it by hand (#4204, #4215, #4216, #4217, #4252,
-// #4259 on 11-07).
-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 LINE = 'No Linux machine: CI\'s Linux runs stand in.'
-const NOW = 1_000_000
-
-/** A machine as its reading lists it: online, signed in, with quota. */
-const machine = (machineId: string, os: string, contributorId = 'owner', extra: Record<string, unknown> = {}) => ({ machineId, name: machineId, contributorId,
- 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 }] }] }, ...extra })
-
-/** The PM's person is `owner`: its PM, Engineer and Mac Tester run on owner's Mac. */
-function fixture() {
- let state = createSuperTab('tab', 'Pilot', { id: 'owner', email: owner.email }, 'prod')
- let sequence = 0
- const rows: Array<{ conversationId: string; text: string; recipients: string[] }> = []
- 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
- rows.push(...effects.messages)
- return effects
- }
- const as = (agentId: string): Actor => ({ kind: 'agent', agentId, machineOwnerId: 'host-owner' })
- const add = (harnessId: string, group: string, machineId: string, roleName?: string, lead = false) => run({ type: 'agent.add', conversationId: group, machineId,
- harnessId, name: harnessId, configuration: opus, lead, ...roleName ? { roleName } : {} } as Command, owner,
- { contribution: { machineOwnerId: 'host-owner', contributorId: 'owner' } }).result.agentId as string
- const lead = add('pm', 'lead', 'mac1', undefined, true)
- const task = run({ type: 'conversation.create', title: 'Fix the host', brief: 'The host restarts cleanly.', checks: [{ description: 'Restarts', independent: true }],
- priority: 'P2', requesterId: 'owner' }, as(lead)).result.conversationId as string
- const dev = add('dev', task, 'mac1', 'Engineer')
- run({ type: 'work.assign', conversationId: task, agentId: dev }, as(lead))
- add('rev', task, 'mac1', 'Reviewer')
- add('mac-tst', task, 'mac1', 'Tester')
- const group = (id: string) => state.conversations.find(c => c.id === id)!
- const ready = (head: string) => run({ type: 'work.status', conversationId: task, assignmentId: group(task).assignment!.id, status: 'review',
- result: `Ready: ${PR}` } as Command, as(dev), { pullRequestFiles: { urls: [PR], head, files: ['cli/src/superTabs/host.ts'] } })
- const steps = () => stepsOf(state, task).filter(step => !step.archived).map(step => step.step)
- const lines = () => rows.filter(row => row.conversationId === task && row.text === LINE)
- const machines = (...list: unknown[]) => { state.machines = [machine('mac1', 'macOS'), ...list] as never }
- return { run, as, add, lead, task, dev, group, ready, steps, lines, machines, get state() { return state } }
-}
-
-describe('a Ready opens a Linux test step only where the project can test on Linux', () => {
- it('with only a Mac, opens the Mac test and no Linux one, and the task says why once', () => {
- const f = fixture()
- f.machines()
- f.ready('a'.repeat(40))
- expect(f.steps()).toEqual(['Review', 'Test on a Mac'])
- expect(f.lines()).toHaveLength(1)
- // A second head opens no Linux step and says it no second time.
- f.ready('b'.repeat(40))
- expect(f.steps()).toEqual(['Review', 'Test on a Mac'])
- expect(f.lines()).toHaveLength(1)
- })
-
- it('counts no Linux machine that no Tester of the project can reach', () => {
- const cases = {
- 'another person\'s, with no agent of the project': machine('linux1', 'Linux', 'dan'),
- 'a Team account\'s': machine('linux1', 'Linux', 'owner', { hostMachineId: 'mac1' }),
- 'offline': machine('linux1', 'Linux', 'owner', { observation: { ...machine('linux1', 'Linux').observation, receivedAt: NOW - 10 * 60_000 } }),
- 'paused': machine('linux1', 'Linux', 'owner', { paused: true }),
- 'kept for other projects': machine('linux1', 'Linux', 'owner', { projects: ['other'] }),
- }
- for (const [why, linux] of Object.entries(cases)) {
- const f = fixture()
- f.machines(linux)
- f.ready('a'.repeat(40))
- expect(f.steps(), why).toEqual(['Review', 'Test on a Mac'])
- expect(f.lines(), why).toHaveLength(1)
- }
- })
-
- it('opens it on the PM\'s person\'s own Linux computer, where the PM may start a Tester', () => {
- const f = fixture()
- f.machines(machine('linux1', 'Linux'))
- f.ready('a'.repeat(40))
- expect(f.steps()).toEqual(['Review', 'Test on a Mac', 'Test on a Linux machine'])
- expect(f.lines()).toHaveLength(0)
- })
-
- it('opens it on another person\'s Linux machine where their own agent of this project runs', () => {
- const f = fixture()
- const theirs = f.add('dan-tst', f.task, 'linux1', 'Tester')
- const agent = f.state.agents.find(a => a.id === theirs)!
- agent.contributorId = 'dan'
- f.machines(machine('linux1', 'Linux', 'dan'))
- f.ready('a'.repeat(40))
- expect(f.steps()).toEqual(['Review', 'Test on a Mac', 'Test on a Linux machine'])
- expect(f.lines()).toHaveLength(0)
- })
-
- it('never reopens at a later head a Linux step the PM closed while no Linux machine was there', () => {
- const f = fixture()
- f.machines(machine('linux1', 'Linux'))
- f.ready('a'.repeat(40))
- const linux = stepsOf(f.state, f.task).find(step => step.step === 'Test on a Linux machine')!
- // The machine leaves; nobody can take the step, and the PM closes it.
- f.machines()
- f.run({ type: 'conversation.archive', conversationId: linux.id, archived: true } as Command, f.as(f.lead))
- f.ready('b'.repeat(40))
- expect(f.steps()).toEqual(['Review', 'Test on a Mac'])
- expect(f.lines()).toHaveLength(1)
- })
-})
-
-describe('a waiting Linux step opens once a Linux machine is there', () => {
- it('opens nothing while none is, then opens it at the recorded head and tells the PM, once', () => {
- const f = fixture()
- f.machines()
- const head = 'a'.repeat(40)
- f.ready(head)
- const state = f.state
- expect(openWaitingSteps(state, NOW)).toEqual([])
- expect(f.steps()).toEqual(['Review', 'Test on a Mac'])
- // The PM's person's Linux computer reports.
- state.machines = [machine('mac1', 'macOS'), machine('linux1', 'Linux')] as never
- const rows = openWaitingSteps(state, NOW)
- const linux = stepsOf(state, f.task).filter(step => step.step === 'Test on a Linux machine')
- expect(linux).toHaveLength(1)
- expect(linux[0]!.brief).toContain(head)
- expect(rows.find(row => row.conversationId === linux[0]!.id)!.text).toBe(linux[0]!.brief)
- expect(rows.find(row => row.conversationId === f.task)!.recipients).toEqual([f.lead])
- expect(state.conversations.find(c => c.id === f.task)!.waitingLinuxStep).toBeUndefined()
- // A second pass opens nothing more.
- expect(openWaitingSteps(state, NOW)).toEqual([])
- expect(stepsOf(state, f.task).filter(step => step.step === 'Test on a Linux machine')).toHaveLength(1)
- })
-
- it('keeps waiting on a task that is no longer open', () => {
- const f = fixture()
- f.machines()
- f.ready('a'.repeat(40))
- const state = f.state
- state.conversations.find(c => c.id === f.task)!.assignment!.status = 'done'
- state.machines = [machine('mac1', 'macOS'), machine('linux1', 'Linux')] as never
- expect(openWaitingSteps(state, NOW)).toEqual([])
- expect(stepsOf(state, f.task).some(step => step.step === 'Test on a Linux machine')).toBe(false)
- })
-})
diff --git a/backend/src/superTabs/linuxSteps.ts b/backend/src/superTabs/linuxSteps.ts
deleted file mode 100644
index 6fa78f9ed..000000000
--- a/backend/src/superTabs/linuxSteps.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * A Linux test step waits for a Linux machine (task #4278). Since v3 (#4120) a Tester starts only on its own person's
- * computer and a Team account takes no work, so harness's Linux steps had nobody who could take them, yet every new head
- * opened one and the PM closed it by hand (#4204, #4215, #4216, #4217, #4252, #4259 on 11-07). A Ready now opens one only
- * where the project can test on Linux; otherwise CI's Linux unit checks stand in, the task says so once, and the time checks
- * open the step once such a machine is there. Mac and Windows steps open as before (the task's constraint).
- */
-import { agentDisplayName } from './agentNames.js'
-import { isBuddy } from './buddies.js'
-import { machineOffline, machineProjectRefusal, swarmMachines } from './machines.js'
-import { activeWork, stableId, type Author, type Conversation, type MessageDraft, type SuperTabState } from './model.js'
-import { agentProjectId, groupProject, onTeamAccount, teamAccountPool, type SwarmProject } from './projects.js'
-import { reportsOs, type PlannedStep } from './reviewTable.js'
-import { openReviewStep, type StepPull } from './stepOpen.js'
-import { stepName, stepsOf } from './steps.js'
-
-/** What the task says while its Linux step waits. */
-export const LINUX_WAIT_LINE = 'No Linux machine: CI\'s Linux runs stand in.'
-
-/** A task's Linux test step that waits for a Linux machine, with the pull requests its brief names (no history: the brief
- * says it is unknown). One per task, replaced at each Ready, gone once the step opens. */
-export interface WaitingStep { step: PlannedStep; pulls: StepPull[] }
-
-const coordinatorOf = (state: SuperTabState, project: SwarmProject) =>
- state.agents.find(a => a.id === state.conversations.find(c => c.id === project.leadConversationId)?.leadId)
-
-/**
- * Whether [project] can test on Linux at [now]: an own-account machine reports Linux, online, not paused or being removed,
- * open to the project, and a Tester can get there: it is the PM's own person's computer, where the PM may start one, or an
- * own-account agent of the project runs there as that machine's person.
- */
-export function testsOnLinux(state: SuperTabState, project: SwarmProject, now: number): boolean {
- const pm = coordinatorOf(state, project)
- return swarmMachines(state).some(pool => reportsOs(pool.observation?.resources?.os, 'linux') && !machineOffline(pool, now) && !pool.paused
- && !pool.removal && !teamAccountPool(pool) && !machineProjectRefusal(state, pool.machineId, project)
- && (pool.contributorId === pm?.contributorId || state.agents.some(a => a.machineId === pool.machineId && a.contributorId === pool.contributorId
- && !isBuddy(a) && a.workDecision !== 'stop' && !onTeamAccount(state, a) && agentProjectId(state, a) === project.id)))
-}
-
-/** Records [step] of [task] as waiting for a Linux machine, briefed on [pulls]; true when it was not waiting yet, so the
- * task is told once. */
-export function waitForLinux(task: Conversation, step: PlannedStep, pulls: readonly StepPull[]): boolean {
- const first = !task.waitingLinuxStep
- task.waitingLinuxStep = { step, pulls: pulls.map(({ url, head, base }) => ({ url, head, ...base ? { base } : {} })) }
- return first
-}
-
-/**
- * The time checks' pass (store.ts runTimeChecks): each open task's waiting Linux step opens once its project can test on
- * Linux, and the PM hears it in the task, to give it a Tester there. Written as the PM; a project with none keeps waiting.
- */
-export function openWaitingSteps(state: SuperTabState, now: number): MessageDraft[] {
- const waiting = state.conversations.filter(task => task.waitingLinuxStep && !task.archived && activeWork(task))
- const can = new Map<string, boolean>()
- const linux = (project: SwarmProject) => can.get(project.id) ?? can.set(project.id, testsOnLinux(state, project, now)).get(project.id)!
- return waiting.flatMap(task => {
- const project = groupProject(state, task), pm = coordinatorOf(state, project)
- if (!pm || !linux(project)) return []
- const { step, pulls } = task.waitingLinuxStep!
- delete task.waitingLinuxStep
- // One its PM opened by hand meanwhile is that step.
- if (stepsOf(state, task.id).some(s => !s.archived && stepName(s) === step.name)) return []
- const author: Author = { kind: 'agent', id: pm.id, name: pm.name, displayName: agentDisplayName(state.agents, pm.id), membershipGeneration: pm.membershipGeneration }
- const id = stableId(task.id, 'linux-step', ...pulls.map(pull => pull.head ?? ''))
- const { brief } = openReviewStep(state, task, step, pulls, id, author)
- return [brief, { id: stableId(id, 'told'), conversationId: task.id, author, replyTo: null, recipients: [pm.id], source: { kind: 'system' },
- text: `${step.name} of #${task.number} is open: a Linux machine is here now. Give it a Tester there.` }]
- })
-}
diff --git a/backend/src/superTabs/model.ts b/backend/src/superTabs/model.ts
index 9a304f7e5..d82f23f44 100644
--- a/backend/src/superTabs/model.ts
+++ b/backend/src/superTabs/model.ts
@@ -480,9 +480,11 @@ export interface Conversation {
* pull request head re-derives the checks of, dormant ones included (#3394). Empty from a task's start; absent on a task
* from before, whose PR watch looks them up once (pullRequestEvents.ts listedSteps). */
stepIds?: string[]
- /** Its Linux test step, waiting for a Linux machine the project can test on (linuxSteps.ts, task #4278): set by a Ready that
+ /** Its Linux test step, waiting for a Linux machine the project can test on (osSteps.ts, task #4278): set by a Ready that
* found none, gone once the step opens. */
- waitingLinuxStep?: import('./linuxSteps.js').WaitingStep
+ waitingLinuxStep?: import('./osSteps.js').WaitingStep
+ /** Its Windows test step, waiting likewise for a Windows machine (osSteps.ts, task #4410). */
+ waitingWindowsStep?: import('./osSteps.js').WaitingStep
/** Its messages drawn as live cards: its task and each linked pull request (cards.ts). Absent until its first card. */
cards?: import('./cards.js').GroupCards
/** The last sequence given to a message here. Each conversation numbers its own messages (store by parts). */
diff --git a/backend/src/superTabs/osSteps.test.ts b/backend/src/superTabs/osSteps.test.ts
new file mode 100644
index 000000000..5f06c2d57
--- /dev/null
+++ b/backend/src/superTabs/osSteps.test.ts
@@ -0,0 +1,190 @@
+import { describe, expect, it } from 'vitest'
+import { applyCommand, type Command, type CommandContext } from './commands.js'
+import { createSuperTab, type Actor, type AgentConfiguration } from './model.js'
+import { SEED_RULES, type ProjectRules } from './policy.js'
+import { stepsOf } from './steps.js'
+import { openWaitingSteps } from './osSteps.js'
+
+// Task #4278: since v3 (#4120) a Tester starts only on its own person's computer, and no own-account Linux machine could take
+// harness's Linux test steps, yet every new head opened one and the PM closed it by hand (#4204, #4215, #4216, #4217, #4252,
+// #4259 on 11-07). Task #4410: the same for Windows, whose steps #3362 makes more common; there no CI run stands in, so the
+// task says a person's Windows check is owed.
+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
+
+/** The seed rules with the CLI's changes tested [where]. */
+const cliTestedOn = (where: string): ProjectRules => {
+ const rules = structuredClone(SEED_RULES) as ProjectRules
+ return { ...rules, reviews: { ...rules.reviews, test: rules.reviews.test.map(row => row.paths.includes('cli/**') ? { ...row, where } : row) } }
+}
+const windowsRules = cliTestedOn('The CLI on a Mac and on a Windows machine')
+const bothRules = cliTestedOn('The CLI on a Mac, on a Linux machine and on a Windows machine')
+
+/** Each OS whose test step waits for its machine: what the machine reports, its step, the task's line, its waiting field. */
+const OSES = {
+ linux: { reports: 'Linux', step: 'Test on a Linux machine', line: 'No Linux machine: CI\'s Linux runs stand in.', field: 'waitingLinuxStep', rules: undefined },
+ windows: { reports: 'Windows', step: 'Test on a Windows machine', line: 'No Windows machine: a person\'s Windows check is owed.', field: 'waitingWindowsStep',
+ rules: windowsRules },
+} as const
+
+/** A machine as its reading lists it: online, signed in, with quota. */
+const machine = (machineId: string, os: string, contributorId = 'owner', extra: Record<string, unknown> = {}) => ({ machineId, name: machineId, contributorId,
+ 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 }] }] }, ...extra })
+
+/** The PM's person is `owner`: its PM, Engineer and Mac Tester run on owner's Mac. [rules]: the project's, or the seed's. */
+function fixture(rules?: ProjectRules) {
+ let state = createSuperTab('tab', 'Pilot', { id: 'owner', email: owner.email }, 'prod')
+ let sequence = 0
+ const rows: Array<{ conversationId: string; text: string; recipients: string[] }> = []
+ 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
+ rows.push(...effects.messages)
+ return effects
+ }
+ const as = (agentId: string): Actor => ({ kind: 'agent', agentId, machineOwnerId: 'host-owner' })
+ const add = (harnessId: string, group: string, machineId: string, roleName?: string, lead = false) => run({ type: 'agent.add', conversationId: group, machineId,
+ harnessId, name: harnessId, configuration: opus, lead, ...roleName ? { roleName } : {} } as Command, owner,
+ { contribution: { machineOwnerId: 'host-owner', contributorId: 'owner' } }).result.agentId as string
+ const lead = add('pm', 'lead', 'mac1', undefined, true)
+ const task = run({ type: 'conversation.create', title: 'Fix the host', brief: 'The host restarts cleanly.', checks: [{ description: 'Restarts', independent: true }],
+ priority: 'P2', requesterId: 'owner' }, as(lead)).result.conversationId as string
+ const dev = add('dev', task, 'mac1', 'Engineer')
+ run({ type: 'work.assign', conversationId: task, agentId: dev }, as(lead))
+ add('rev', task, 'mac1', 'Reviewer')
+ add('mac-tst', task, 'mac1', 'Tester')
+ const group = (id: string) => state.conversations.find(c => c.id === id)!
+ const ready = (head: string) => run({ type: 'work.status', conversationId: task, assignmentId: group(task).assignment!.id, status: 'review',
+ result: `Ready: ${PR}` } as Command, as(dev), { pullRequestFiles: { urls: [PR], head, files: ['cli/src/superTabs/host.ts'] },
+ ...rules ? { projectRules: { revision: 1, rules } } : {} })
+ const steps = () => stepsOf(state, task).filter(step => !step.archived).map(step => step.step)
+ const lines = (line: string) => rows.filter(row => row.conversationId === task && row.text === line)
+ const machines = (...list: unknown[]) => { state.machines = [machine('mac1', 'macOS'), ...list] as never }
+ return { run, as, add, lead, task, dev, group, ready, steps, lines, machines, get state() { return state } }
+}
+
+for (const [os, { reports, step: osStep, line, field, rules }] of Object.entries(OSES)) {
+ describe(`a Ready opens a ${reports} test step only where the project can test on ${reports}`, () => {
+ it('with only a Mac, opens the Mac test and no other, and the task says why once', () => {
+ const f = fixture(rules)
+ f.machines()
+ f.ready('a'.repeat(40))
+ expect(f.steps()).toEqual(['Review', 'Test on a Mac'])
+ expect(f.lines(line)).toHaveLength(1)
+ // A second head opens no such step and says it no second time.
+ f.ready('b'.repeat(40))
+ expect(f.steps()).toEqual(['Review', 'Test on a Mac'])
+ expect(f.lines(line)).toHaveLength(1)
+ })
+
+ it(`counts no ${reports} machine that no Tester of the project can reach`, () => {
+ const cases = {
+ 'another person\'s, with no agent of the project': machine('box1', reports, 'dan'),
+ 'a Team account\'s': machine('box1', reports, 'owner', { hostMachineId: 'mac1' }),
+ 'offline': machine('box1', reports, 'owner', { observation: { ...machine('box1', reports).observation, receivedAt: NOW - 10 * 60_000 } }),
+ 'paused': machine('box1', reports, 'owner', { paused: true }),
+ 'kept for other projects': machine('box1', reports, 'owner', { projects: ['other'] }),
+ }
+ for (const [why, box] of Object.entries(cases)) {
+ const f = fixture(rules)
+ f.machines(box)
+ f.ready('a'.repeat(40))
+ expect(f.steps(), why).toEqual(['Review', 'Test on a Mac'])
+ expect(f.lines(line), why).toHaveLength(1)
+ }
+ })
+
+ it(`opens it on the PM's person's own ${reports} computer, where the PM may start a Tester`, () => {
+ const f = fixture(rules)
+ f.machines(machine('box1', reports))
+ f.ready('a'.repeat(40))
+ expect(f.steps()).toEqual(['Review', 'Test on a Mac', osStep])
+ expect(f.lines(line)).toHaveLength(0)
+ })
+
+ it(`opens it on another person's ${reports} machine where their own agent of this project runs`, () => {
+ const f = fixture(rules)
+ const theirs = f.add('dan-tst', f.task, 'box1', 'Tester')
+ const agent = f.state.agents.find(a => a.id === theirs)!
+ agent.contributorId = 'dan'
+ f.machines(machine('box1', reports, 'dan'))
+ f.ready('a'.repeat(40))
+ expect(f.steps()).toEqual(['Review', 'Test on a Mac', osStep])
+ expect(f.lines(line)).toHaveLength(0)
+ })
+
+ it(`never reopens at a later head a ${reports} step the PM closed while no ${reports} machine was there`, () => {
+ const f = fixture(rules)
+ f.machines(machine('box1', reports))
+ f.ready('a'.repeat(40))
+ const opened = stepsOf(f.state, f.task).find(step => step.step === osStep)!
+ // The machine leaves; nobody can take the step, and the PM closes it.
+ f.machines()
+ f.run({ type: 'conversation.archive', conversationId: opened.id, archived: true } as Command, f.as(f.lead))
+ f.ready('b'.repeat(40))
+ expect(f.steps()).toEqual(['Review', 'Test on a Mac'])
+ expect(f.lines(line)).toHaveLength(1)
+ })
+ })
+
+ describe(`a waiting ${reports} step opens once a ${reports} machine is there`, () => {
+ it('opens nothing while none is, then opens it at the recorded head and tells the PM, once', () => {
+ const f = fixture(rules)
+ f.machines()
+ const head = 'a'.repeat(40)
+ f.ready(head)
+ const state = f.state
+ expect(openWaitingSteps(state, NOW)).toEqual([])
+ expect(f.steps()).toEqual(['Review', 'Test on a Mac'])
+ // The PM's person's computer of that OS reports.
+ state.machines = [machine('mac1', 'macOS'), machine('box1', reports)] as never
+ const rows = openWaitingSteps(state, NOW)
+ const opened = stepsOf(state, f.task).filter(step => step.step === osStep)
+ expect(opened).toHaveLength(1)
+ expect(opened[0]!.brief).toContain(head)
+ expect(rows.find(row => row.conversationId === opened[0]!.id)!.text).toBe(opened[0]!.brief)
+ expect(rows.find(row => row.conversationId === f.task)!.recipients).toEqual([f.lead])
+ expect((state.conversations.find(c => c.id === f.task)! as unknown as Record<string, unknown>)[field], os).toBeUndefined()
+ // A second pass opens nothing more.
+ expect(openWaitingSteps(state, NOW)).toEqual([])
+ expect(stepsOf(state, f.task).filter(step => step.step === osStep)).toHaveLength(1)
+ })
+
+ it('keeps waiting on a task that is no longer open', () => {
+ const f = fixture(rules)
+ f.machines()
+ f.ready('a'.repeat(40))
+ const state = f.state
+ state.conversations.find(c => c.id === f.task)!.assignment!.status = 'done'
+ state.machines = [machine('mac1', 'macOS'), machine('box1', reports)] as never
+ expect(openWaitingSteps(state, NOW)).toEqual([])
+ expect(stepsOf(state, f.task).some(step => step.step === osStep)).toBe(false)
+ })
+ })
+}
+
+describe('a task that needs a Linux and a Windows test, with neither machine there (#4410)', () => {
+ it('waits for each, says each line once, and opens each when its own machine is there', () => {
+ const f = fixture(bothRules)
+ f.machines()
+ f.ready('a'.repeat(40))
+ f.ready('b'.repeat(40))
+ expect(f.steps()).toEqual(['Review', 'Test on a Mac'])
+ expect(f.lines(OSES.linux.line)).toHaveLength(1)
+ expect(f.lines(OSES.windows.line)).toHaveLength(1)
+ const state = f.state
+ state.machines = [machine('mac1', 'macOS'), machine('win1', 'Windows')] as never
+ openWaitingSteps(state, NOW)
+ expect(stepsOf(state, f.task).filter(step => !step.archived).map(step => step.step)).toEqual(['Review', 'Test on a Mac', OSES.windows.step])
+ expect(state.conversations.find(c => c.id === f.task)!.waitingLinuxStep).toBeDefined()
+ state.machines = [machine('mac1', 'macOS'), machine('win1', 'Windows'), machine('linux1', 'Linux')] as never
+ openWaitingSteps(state, NOW)
+ expect(stepsOf(state, f.task).filter(step => !step.archived).map(step => step.step))
+ .toEqual(['Review', 'Test on a Mac', OSES.windows.step, OSES.linux.step])
+ })
+})
diff --git a/backend/src/superTabs/osSteps.ts b/backend/src/superTabs/osSteps.ts
new file mode 100644
index 000000000..d29382089
--- /dev/null
+++ b/backend/src/superTabs/osSteps.ts
@@ -0,0 +1,93 @@
+/**
+ * A Linux or Windows test step waits for a machine of its OS (tasks #4278, #4410). Since v3 (#4120) a Tester starts only on
+ * its own person's computer and a Team account takes no work, so harness's Linux steps had nobody who could take them, yet
+ * every new head opened one and the PM closed it by hand (#4204, #4215, #4216, #4217, #4252, #4259 on 11-07); Windows steps
+ * then did the same, and #3362 makes them more common. A Ready now opens one only where the project can test on that OS.
+ * Otherwise the task says so once: for Linux, CI's Linux unit checks stand in; for Windows nothing does, and a person's check
+ * is owed (docs/windows-rules.md). The time checks open the step once such a machine is there. Mac steps open as before.
+ */
+import { agentDisplayName } from './agentNames.js'
+import { isBuddy } from './buddies.js'
+import { machineOffline, machineProjectRefusal, swarmMachines } from './machines.js'
+import { activeWork, stableId, type Author, type Conversation, type MessageDraft, type SuperTabState } from './model.js'
+import { agentProjectId, groupProject, onTeamAccount, teamAccountPool, type SwarmProject } from './projects.js'
+import { OS_PLACE, reportsOs, type PlannedStep, type StepOs } from './reviewTable.js'
+import { openReviewStep, type StepPull } from './stepOpen.js'
+import { stepName, stepsOf } from './steps.js'
+
+/** The OSes whose test step waits for a machine of its own. */
+export type WaitingOs = 'linux' | 'windows'
+export const waits = (os: StepOs | undefined): os is WaitingOs => os === 'linux' || os === 'windows'
+
+/** What the task says while its step of each OS waits. */
+export const WAIT_LINE: Record<WaitingOs, string> = {
+ linux: 'No Linux machine: CI\'s Linux runs stand in.',
+ windows: 'No Windows machine: a person\'s Windows check is owed.',
+}
+
+/** What a task's merge says while its Windows step waits (taskLine.ts): River's ruling 11-07, an owed Windows check does not
+ * hold the merge and is never silent; the release that ships the task lists it (releases.ts). */
+export const WINDOWS_OWED = 'Windows check owed: no Windows machine took its test step.'
+
+/** A task's test step that waits for a machine of its OS, with the pull requests its brief names (no history: the brief says
+ * it is unknown). One per OS and task, replaced at each Ready, gone once the step opens. */
+export interface WaitingStep { step: PlannedStep; pulls: StepPull[] }
+
+/** Where a task keeps its waiting step of each OS: Linux's as #4278 stored it. */
+const FIELD = { linux: 'waitingLinuxStep', windows: 'waitingWindowsStep' } as const satisfies Record<WaitingOs, keyof Conversation>
+
+const coordinatorOf = (state: SuperTabState, project: SwarmProject) =>
+ state.agents.find(a => a.id === state.conversations.find(c => c.id === project.leadConversationId)?.leadId)
+
+/**
+ * Whether [project] can test on [os] at [now]: an own-account machine reports [os], online, not paused or being removed, open
+ * to the project, and a Tester can get there: it is the PM's own person's computer, where the PM may start one, or an
+ * own-account agent of the project runs there as that machine's person.
+ */
+export function testsOn(state: SuperTabState, project: SwarmProject, now: number, os: WaitingOs): boolean {
+ const pm = coordinatorOf(state, project)
+ return swarmMachines(state).some(pool => reportsOs(pool.observation?.resources?.os, os) && !machineOffline(pool, now) && !pool.paused
+ && !pool.removal && !teamAccountPool(pool) && !machineProjectRefusal(state, pool.machineId, project)
+ && (pool.contributorId === pm?.contributorId || state.agents.some(a => a.machineId === pool.machineId && a.contributorId === pool.contributorId
+ && !isBuddy(a) && a.workDecision !== 'stop' && !onTeamAccount(state, a) && agentProjectId(state, a) === project.id)))
+}
+
+/** Records [step] of [task], of a waiting OS, as waiting for a machine of it, briefed on [pulls]; true when it was not waiting
+ * yet, so the task is told once. */
+export function waitFor(task: Conversation, step: PlannedStep & { os: WaitingOs }, pulls: readonly StepPull[]): boolean {
+ const first = !task[FIELD[step.os]]
+ task[FIELD[step.os]] = { step, pulls: pulls.map(({ url, head, base }) => ({ url, head, ...base ? { base } : {} })) }
+ return first
+}
+
+/** [task]'s step of [os] waits no more: it opens now. */
+export function stopWaiting(task: Conversation, os: WaitingOs): void {
+ delete task[FIELD[os]]
+}
+
+/**
+ * The time checks' pass (store.ts runTimeChecks): each open task's waiting step of each OS opens once its project can test on
+ * that OS, and the PM hears it in the task, to give it a Tester there. Written as the PM; a project with none keeps waiting.
+ */
+export function openWaitingSteps(state: SuperTabState, now: number): MessageDraft[] {
+ const can = new Map<string, boolean>()
+ const able = (project: SwarmProject, os: WaitingOs) => {
+ const key = `${os}:${project.id}`
+ return can.get(key) ?? can.set(key, testsOn(state, project, now, os)).get(key)!
+ }
+ return state.conversations.filter(task => !task.archived && activeWork(task)).flatMap(task => (Object.keys(FIELD) as WaitingOs[]).flatMap(os => {
+ const waiting = task[FIELD[os]]
+ if (!waiting) return []
+ const project = groupProject(state, task), pm = coordinatorOf(state, project)
+ if (!pm || !able(project, os)) return []
+ const { step, pulls } = waiting
+ stopWaiting(task, os)
+ // One its PM opened by hand meanwhile is that step.
+ if (stepsOf(state, task.id).some(s => !s.archived && stepName(s) === step.name)) return []
+ const author: Author = { kind: 'agent', id: pm.id, name: pm.name, displayName: agentDisplayName(state.agents, pm.id), membershipGeneration: pm.membershipGeneration }
+ const id = stableId(task.id, `${os}-step`, ...pulls.map(pull => pull.head ?? ''))
+ const { brief } = openReviewStep(state, task, step, pulls, id, author)
+ return [brief, { id: stableId(id, 'told'), conversationId: task.id, author, replyTo: null, recipients: [pm.id], source: { kind: 'system' as const },
+ text: `${step.name} of #${task.number} is open: ${OS_PLACE[os]} is here now. Give it a Tester there.` }]
+ }))
+}
diff --git a/backend/src/superTabs/parts/light.test.ts b/backend/src/superTabs/parts/light.test.ts
index 9d8884b83..10d00c2ac 100644
--- a/backend/src/superTabs/parts/light.test.ts
+++ b/backend/src/superTabs/parts/light.test.ts
@@ -98,6 +98,7 @@ const conversation: Required<Conversation> = {
title: 't',
unlinkedPullRequests: [],
waitingLinuxStep: { step: { name: 'Test on a Linux machine', kind: 'test', areas: [], where: ['The CLI on a Linux machine'], os: 'linux' }, pulls: [] },
+ waitingWindowsStep: { step: { name: 'Test on a Windows machine', kind: 'test', areas: [], where: ['The CLI on a Windows machine'], os: 'windows' }, pulls: [] },
writers: [],
}
diff --git a/backend/src/superTabs/parts/light.ts b/backend/src/superTabs/parts/light.ts
index a96e0a952..ca2a4d61b 100644
--- a/backend/src/superTabs/parts/light.ts
+++ b/backend/src/superTabs/parts/light.ts
@@ -118,6 +118,7 @@ export const GROUP_FIELDS = {
'teamWrittenBy',
'unlinkedPullRequests',
'waitingLinuxStep',
+ 'waitingWindowsStep',
'writers',
],
} as const
diff --git a/backend/src/superTabs/releases.test.ts b/backend/src/superTabs/releases.test.ts
index e8b4d2c22..2e327c38f 100644
--- a/backend/src/superTabs/releases.test.ts
+++ b/backend/src/superTabs/releases.test.ts
@@ -300,6 +300,20 @@ describe('settleReleases', () => {
expect(state.conversations.find(c => c.id === 'g13')).not.toHaveProperty('releasing')
})
+ // Task #4410, River's ruling 11-07: a task merged while its Windows test step waited for a Windows machine owes a person's
+ // Windows check, which the Windows rules ask for on the signed build: the release that ships it lists every such task.
+ it('lists each task it ships whose Windows check is owed, for whoever checks Windows on the signed build', () => {
+ const waiting = { step: { name: 'Test on a Windows machine', kind: 'test' as const, areas: [], where: ['The CLI on a Windows machine'], os: 'windows' as const }, pulls: [] }
+ const state = swarm([entry({ groupId: 'g12', mergedAt: T - MINUTE, components: ['desktop'] }),
+ entry({ groupId: 'g13', url: 'https://github.com/o/r/pull/13', mergedAt: T - MINUTE, components: ['desktop'] })])
+ state.conversations.find(c => c.id === 'g12')!.waitingWindowsStep = waiting
+ const opened = settleReleases(state, 'p1', noFacts, T).opened
+ const step = state.conversations.find(c => c.id === opened)!
+ expect(step.brief).toContain('#12 Task 12; #13 Task 13')
+ expect(step.brief).toContain('Windows check owed on the signed build: #12 Task 12. No Windows machine took its test step: record it here.')
+ expect(step.brief).not.toContain('owed on the signed build: #12 Task 12; #13')
+ })
+
it('opens one release step for the Integrator inside the window, and no second one while it is open', () => {
const state = swarm([entry({ groupId: 'g12', mergedAt: T - MINUTE, components: ['desktop', 'web'] })])
const outcome = settleReleases(state, 'p1', noFacts, T)
diff --git a/backend/src/superTabs/releases.ts b/backend/src/superTabs/releases.ts
index 11a46deea..701653294 100644
--- a/backend/src/superTabs/releases.ts
+++ b/backend/src/superTabs/releases.ts
@@ -320,9 +320,15 @@ export function settleReleases(state: SuperTabState, projectId: string, facts: R
const id = stableId('release-step', state.id, projectId, due.map(c => c.id).join(','), String(now))
if (state.conversations.some(c => c.id === id)) return outcome
const integrator = integratorOf(state, projectId)
- const waiting = [...new Set(due.flatMap(c => waitingFor(scheduled, c.id).map(e => e.groupId)))].map(groupId => named(state, groupId))
+ const waitingIds = [...new Set(due.flatMap(c => waitingFor(scheduled, c.id).map(e => e.groupId)))]
+ const waiting = waitingIds.map(groupId => named(state, groupId))
+ // Each task merged while its Windows test step waited for a Windows machine owes a person's Windows check, which the Windows
+ // rules ask for on the signed build (osSteps.ts, task #4410, River's ruling 11-07): listed here, for whoever records it.
+ const owed = waitingIds.filter(groupId => state.conversations.find(c => c.id === groupId)?.waitingWindowsStep).map(groupId => named(state, groupId))
const names = joined(due.map(c => c.name)), window = rules.releaseWindow
const brief = [`Release ${names}: ${waiting.length} merged ${waiting.length === 1 ? 'task waits' : 'tasks wait'} for it (${waiting.join('; ')}).`,
+ ...owed.length ? [`Windows check owed on the signed build: ${owed.join('; ')}. No Windows machine took ${owed.length === 1
+ ? 'its test step: record it here.' : 'their test steps: record each here.'}`] : [],
`Release between ${window.start} and ${window.end} (${window.timeZone}), applying the merged pull requests' rollout notes first, and verify each release is live.`,
'The Swarm marks those tasks shipped once each tag\'s release workflow succeeds, and says so here.'].join('\n')
const number = nextConversationNumber(state)
diff --git a/backend/src/superTabs/reviewTable.ts b/backend/src/superTabs/reviewTable.ts
index fea3bbff6..ddab9bfd9 100644
--- a/backend/src/superTabs/reviewTable.ts
+++ b/backend/src/superTabs/reviewTable.ts
@@ -16,7 +16,7 @@ export interface PlannedStep { name: string; kind: StepKind; areas: string[]; wh
/** 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' }
+export 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)))
diff --git a/backend/src/superTabs/stepOpen.ts b/backend/src/superTabs/stepOpen.ts
index a47491639..2197d1fa4 100644
--- a/backend/src/superTabs/stepOpen.ts
+++ b/backend/src/superTabs/stepOpen.ts
@@ -1,6 +1,6 @@
/**
* Opening a planned review step (task #3401), as conversation.create opens one with `reviewOf` and `step`: a Ready opens its
- * steps here, and so do the time checks for a Linux step that waited for a Linux machine (linuxSteps.ts, task #4278).
+ * steps here, and so do the time checks for a Linux or Windows step that waited for a machine of its OS (osSteps.ts, tasks #4278, #4410).
*/
import { bindTaskCard } from './cards.js'
import { nextConversationNumber, stableId, type Author, type Conversation, type MessageDraft, type SuperTabState } from './model.js'
diff --git a/backend/src/superTabs/store.ts b/backend/src/superTabs/store.ts
index d2024510b..a694a1316 100644
--- a/backend/src/superTabs/store.ts
+++ b/backend/src/superTabs/store.ts
@@ -82,7 +82,7 @@ import { RefusalMemory } from './dispatchRefusals.js'
import { tasksHoldingMoves } from './ruleGuard.js'
import { candidatesFor, dispatchRules, DISPATCH_RULES, dispatchPlan, freeCrew, laneCapacity, openTasks, pinBuilder, pullRequestPin, roundOf, type DispatchLookup, type DispatchRules, type Skip } from './dispatch.js'
import { buddySleepCandidates, sleepBuddies } from './buddySleep.js'
-import { openWaitingSteps } from './linuxSteps.js'
+import { openWaitingSteps } from './osSteps.js'
import { failRefusedStarts, judgedMachines, loseTasks, nextLossAt, recordTaskState, sweepForLead, sweepLiveness, SWEEP_EVERY_MS, unpurgedNotice } from './liveness.js'
import { endedReply, taskLineChats } from './taskLine.js'
import { owedAsk } from './timeChecks.js'
@@ -5606,7 +5606,7 @@ export class SuperTabStore {
if (chats.length) loaded = await this.ensure(tx, loaded, { groupIds: [...loaded.state.conversations.map(c => c.id), ...chats] })
const state = cloneData(loaded.state), now = this.now()
const rulesFor = await this.projectDispatch(tx, state)
- // A Linux test step that waited for a Linux machine opens once one is there (linuxSteps.ts, task #4278).
+ // A Linux or Windows test step that waited for a machine of its OS opens once one is there (osSteps.ts, tasks #4278, #4410).
const written = [...sweepForLead(state, now, rulesFor), ...advanceProposalCards(state, now), ...openWaitingSteps(state, now)]
for (const [id, bodies] of migration) written.push(...migrateLegacyProposals(state, projectsOf(state).find(p => p.id === id)!, bodies, now))
// What waits for each agent: an agent with a delivery open is not idle. Only loaded groups' active work keeps an agent
diff --git a/backend/src/superTabs/taskLine.test.ts b/backend/src/superTabs/taskLine.test.ts
index 27f3a5b8d..9a67f4d74 100644
--- a/backend/src/superTabs/taskLine.test.ts
+++ b/backend/src/superTabs/taskLine.test.ts
@@ -91,6 +91,21 @@ describe('ordinary task messages and progress replies', () => {
expect(thread(f.run({ type: 'conversation.merged', conversationId: id, pullRequestUrl: PR }), root)).toEqual([])
})
+ // Task #4410, River's ruling 11-07: an owed Windows check does not hold the merge, and is never silent. The merge reply says
+ // it, and the task keeps it after the merge, for the release that ships it to list (releases.ts).
+ it('says at the merge that a Windows check is owed while its Windows test step waits, and keeps it owed', () => {
+ const f = fixture(), id = f.group(), root = f.task(id).cards!.line!.messageId
+ const builder = f.add('Kai', id)
+ f.run({ type: 'work.assign', conversationId: id, agentId: builder })
+ f.status(id, builder, 'review', `Ready: ${PR}`)
+ f.task(id).waitingWindowsStep = { step: { name: 'Test on a Windows machine', kind: 'test', areas: [], where: ['The CLI on a Windows machine'], os: 'windows' },
+ pulls: [{ url: PR, head: 'a'.repeat(40) }] }
+ f.status(id, builder, 'done', `Checks passed: ${PR}`)
+ const merged = f.run({ type: 'conversation.merged', conversationId: id, pullRequestUrl: PR })
+ expect(thread(merged, root)).toEqual(['Merged: PR #7. Ships in the next release. Windows check owed: no Windows machine took its test step.'])
+ expect(f.task(id).waitingWindowsStep).toBeDefined()
+ })
+
it('keeps agents\' posts in the task\'s own conversation and repeats no unchanged status', () => {
const f = fixture(), id = f.group(), root = f.task(id).cards!.line!.messageId
const builder = f.add('Kai', id)
diff --git a/backend/src/superTabs/taskLine.ts b/backend/src/superTabs/taskLine.ts
index 453b58e25..5484cefb0 100644
--- a/backend/src/superTabs/taskLine.ts
+++ b/backend/src/superTabs/taskLine.ts
@@ -5,6 +5,7 @@ import { activeWork, isLeads, stableId, type Assignment, type Author, type Comma
import { groupProject, projectsOf } from './projects.js'
import type { Reaction } from './reactions.js'
import { isStep } from './steps.js'
+import { WINDOWS_OWED } from './osSteps.js'
import { usernameOf } from './usernames.js'
/** A task's ordinary opening message in the project chat. Its details and progress are replies; the root is never edited. */
@@ -67,9 +68,11 @@ function progress(state: SuperTabState, effects: CommandEffects, group: Conversa
const cards = group.cards?.pullRequests
const merged = cards?.length ? cards.filter(card => card.mergedAt !== undefined
&& previous?.cards?.pullRequests?.find(was => was.url === card.url)?.mergedAt === undefined).map(card => card.url) : []
- if (merged.length) return `Merged: ${pullRequests(merged)}. Ships in the next release.`
+ // A merge while its Windows test step waits for a Windows machine says the check is owed (osSteps.ts, task #4410).
+ const owed = group.waitingWindowsStep ? ` ${WINDOWS_OWED}` : ''
+ if (merged.length) return `Merged: ${pullRequests(merged)}. Ships in the next release.${owed}`
// A merge with no card to mark is still the merge: its row has no other way to say it shipped.
- if (group.ledger?.mergedAt != null && previous?.ledger?.mergedAt == null) return `Merged: ${pullRequests(group.pullRequestUrls ?? [])}. Ships in the next release.`
+ if (group.ledger?.mergedAt != null && previous?.ledger?.mergedAt == null) return `Merged: ${pullRequests(group.pullRequestUrls ?? [])}. Ships in the next release.${owed}`
const assignment = group.assignment
const was = previous?.assignment
// Most tasks did not move in this command: they say nothing, and nothing more is read for them.
diff --git a/docs/plans/2026-11-07-windows-test-steps-plan.md b/docs/plans/2026-11-07-windows-test-steps-plan.md
new file mode 100644
index 000000000..e511fecde
--- /dev/null
+++ b/docs/plans/2026-11-07-windows-test-steps-plan.md
@@ -0,0 +1,70 @@
+# Windows test steps open only where a Windows machine can take them: implementation plan
+
+> This plan is carried out by the project's Engineer way of working (test first, task by task, one pull request), not
+> subagent-driven-development. There is no execution handoff.
+
+**Goal:** A Ready opens a Windows test step only when an own-account Windows machine can take it. Otherwise the task says
+"No Windows machine: a person's Windows check is owed.", and the step opens by itself within 30 seconds of such a machine
+showing up. This is task #4410, which applies #4278's Linux rule to Windows.
+
+**Architecture:** #4278 (PR #3484) made a Linux step wait for a Linux machine: `linuxSteps.ts` (`testsOnLinux`,
+`waitForLinux`, `openWaitingSteps`), the task's `waitingLinuxStep`, a branch in `commands.ts openReviewSteps`, and the time
+checks' pass (`store.ts runTimeChecks`). The same functions now take the OS, `linux` or `windows`, in `osSteps.ts`, which
+replaces `linuxSteps.ts`. A task keeps one waiting step per OS: `waitingLinuxStep`, as already stored, and
+`waitingWindowsStep` beside it, so no stored task needs a migration. Mac steps never wait.
+
+**Tech Stack:** TypeScript backend, vitest.
+
+**Spec:** Task #4410's brief; #4278's plan (`docs/plans/2026-11-07-linux-test-steps-plan.md`).
+
+## Global Constraints
+
+- Backend only.
+- The Windows rules are not weakened: the card says a person's Windows check is owed. No CI run stands in for Windows.
+- Mac and Linux behaviour unchanged: Linux keeps its line, its stored field and its message ids.
+- A step the PM closed stays closed at later heads.
+
+## Review Focus
+
+- A task that needs both a Linux and a Windows step, with neither machine there: both wait, each line is said once, and
+ each step opens when its own OS's machine shows up.
+- A Windows machine that is another person's with no project agent, on a Team account, offline, paused, or kept for other
+ projects does not count, as for Linux.
+- A task stored by the current release with `waitingLinuxStep` still opens its Linux step.
+
+---
+
+### Task 1: The Linux step tests, run for Windows too
+
+**Files:**
+- Modify: `backend/src/superTabs/linuxSteps.test.ts`: each case runs for `linux` and `windows`. Windows uses project rules
+ that test `cli/**` on a Mac and on a Windows machine.
+- Modify: `backend/src/superTabs/parts/light.test.ts`: the light projection keeps `waitingWindowsStep`.
+
+- [ ] **Step 1: Write the failing tests.** For Windows: with only a Mac, the Ready opens `Review` and `Test on a Mac`, and
+ the task says "No Windows machine: a person's Windows check is owed." once. Every unreachable machine counts as none. The
+ PM's own Windows computer, or another person's with their own project agent, opens `Test on a Windows machine`. A closed
+ step stays closed. A waiting step opens at the recorded head, and the PM hears about it once. Plus one case where both
+ OSes wait.
+- [ ] **Step 2: Run** `npx vitest run src/superTabs/linuxSteps.test.ts src/superTabs/parts/light.test.ts`. Expected: the
+ Windows cases fail (the Windows step opens with no Windows machine); Linux passes.
+- [ ] **Step 3: Commit.**
+
+### Task 2: OS test steps wait for their OS's machine
+
+**Files:**
+- Rename: `linuxSteps.ts` → `osSteps.ts`, `linuxSteps.test.ts` → `osSteps.test.ts`
+- Modify: `osSteps.ts`, `commands.ts` (`openReviewSteps`), `store.ts` (import), `model.ts` (`waitingWindowsStep`),
+ `parts/light.ts` (`GROUP_FIELDS`), `stepOpen.ts` (comment), `reviewTable.ts` (export `OS_PLACE`)
+
+**Interfaces:**
+- `type WaitingOs = 'linux' | 'windows'`; `waits(os?: StepOs): os is WaitingOs`
+- `WAIT_LINE: Record<WaitingOs, string>`: the Linux line unchanged.
+- `testsOn(state, project, now, os: WaitingOs): boolean`, which replaces `testsOnLinux`
+- `waitFor(task, step, pulls): boolean`, which replaces `waitForLinux` (the OS is `step.os`); `stopWaiting(task, os)`
+- `openWaitingSteps(state, now): MessageDraft[]`, which opens each OS's waiting step
+
+- [ ] **Step 1: Implement.** The Linux message ids stay `stableId(operationId, 'linux-wait')` and
+ `stableId(task.id, 'linux-step', …)`.
+- [ ] **Step 2: Run** the Task 1 tests and `integration/superTabReviewSteps.test.ts`. Expected: PASS.
+- [ ] **Step 3: Commit.**