The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Merge batch 11-03 bs: #2716 (#2729)
0xken15b452710586bf
diff --git a/backend/src/superTabs/checkVerdicts.ts b/backend/src/superTabs/checkVerdicts.tsnew file mode 100644index 000000000..a8037e843--- /dev/null+++ b/backend/src/superTabs/checkVerdicts.ts@@ -0,0 +1,20 @@+/**+ * Each checker's verdict on a task check (Diego, 2026-11-03, #2311): Review and Test record the same checks in parallel, so+ * a later pass by one checker used to erase another's failure and its evidence. A check keeps every checker's latest+ * verdict; `passedBy` and `evidence`, which every older reader reads, are derived from them with a failure winning.+ */+import type { Check, CheckVerdict } from './model.js'++/** Records [verdict] on [check], in place of its checker's earlier one, which it returns (undefined on its first). The+ * verdicts are kept oldest first. A pass kept from before verdicts were is its checker's verdict; a failure from then names+ * no checker, so it is not kept. */+export function recordCheckVerdict(check: Check, verdict: CheckVerdict): CheckVerdict | undefined {+ const kept = check.verdicts ?? (check.passedBy ? [{ by: check.passedBy, passed: true, evidence: check.evidence ?? '', at: 0 }] : [])+ const earlier = kept.find(v => v.by === verdict.by)+ const verdicts = check.verdicts = [...kept.filter(v => v !== earlier), verdict]+ // The check passes only while no checker's latest verdict failed: its latest passer, else the latest failure's evidence.+ const failed = verdicts.findLast(v => !v.passed)+ check.passedBy = failed ? null : verdict.by+ check.evidence = (failed ?? verdict).evidence+ return earlier+}diff --git a/backend/src/superTabs/commands.ts b/backend/src/superTabs/commands.tsindex 5c457673f..55095d852 100644--- a/backend/src/superTabs/commands.ts+++ b/backend/src/superTabs/commands.ts@@ -12,6 +12,7 @@ import {} from './model.js'import { jobKindOf } from './evidence/jobKind.js'import { endSteps, stepEndedRows, holdsStepOf, isStep, ownerOf, taskOwner } from './steps.js'+import { recordCheckVerdict } from './checkVerdicts.js'import { routeRecordSchema, routeTitle, startedAs, type RouteCandidate, type RouteDecision, type RouteFinal, type RouteOverride } from './routeRecord.js'import { routingOverrideSaveSchema } from './routingPolicy.js'import { askedInSchema, RULE_MESSAGE_MS, ruleSchema, ruleTextSchema } from './rules.js'@@ -3028,7 +3029,7 @@ function applyCommandOnce(original: SuperTabState, actor: Actor, input: Command,renewLease(group.assignment, context.now)leadActed(group.id, 'assign')recordRun(state, group, group.assignment, worker, context.now)- group.checks.forEach(c => { c.evidence = null; c.passedBy = null })+ group.checks.forEach(c => { c.evidence = null; c.passedBy = null; delete c.verdicts })result.assignmentId = operationIdlet routeNote: { decisionId: string; text: string } | null = nullif (command.routeDecisionId) {@@ -3217,13 +3218,13 @@ function applyCommandOnce(original: SuperTabState, actor: Actor, input: Command,// Checks are information (project instructions, phase 4): who passes one is the project's workflow, so anyone in the task// records a verdict, its assignee too, and a failed one leaves the work's status as its agent set it. A verdict counts as a// review only from someone other than the assignee (leaderboard/record.ts).- check.evidence = command.evidence- check.passedBy = command.passed ? actorKey(actor) : null+ const by = actorKey(actor)+ const first = !recordCheckVerdict(check, { by, passed: command.passed, evidence: command.evidence, at: context.now })const run = group.ledger?.runs?.find(r => r.assignmentId === group.assignment!.id), reviewed = run?.firstReviewconst byAssignee = actor.kind === 'agent' && actor.agentId === group.assignment.agentId- // Before the review's first verdict is kept: a check's verdict counts once per attempt.- if (actor.kind === 'agent') recordVerdict(state, group, check, agent(state, actor.agentId), context.now)- recordReview(group, check, command.passed, byAssignee)+ // A checker's verdict on a check counts once per attempt.+ if (actor.kind === 'agent') recordVerdict(state, group, check, agent(state, actor.agentId), context.now, first)+ recordReview(group, check, by, command.passed, byAssignee, first)// A grid attempt whose first review just failed is told to the coordinator (decision 8); a subscription attempt's is not.if (reviewed !== false && run?.firstReview === false && run.grid) reviewFailed(group, run.model ?? 'its grid model', command.evidence)// An older skill's working hand-off stops waiting once someone else's verdict finds problems in it: its quiet time countsdiff --git a/backend/src/superTabs/leaderboard/record.test.ts b/backend/src/superTabs/leaderboard/record.test.tsindex 1927863f2..47af61930 100644--- a/backend/src/superTabs/leaderboard/record.test.ts+++ b/backend/src/superTabs/leaderboard/record.test.ts@@ -1065,6 +1065,46 @@ describe('the model behind each assignment, and its first review (roadmap, Dec:})})+// Diego, 2026-11-03 (#2311): a Tester and a Reviewer judge the same checks in parallel. Each one's first verdict is its own+// review, and a checker passing what another failed is no re-review of a failure.+describe('several checkers on one check', () => {+ const checkers = () => {+ const f = fixture()+ const id = f.create(owner, { checks: [{ description: 'Signs in offline', independent: true }] })+ const { assignmentId } = f.assign(id)+ const tester = f.add('tester', id), reviewer = f.add('reviewer', id)+ f.state.agents.find(a => a.id === tester)!.configuration = { ...config, engine: 'codex', model: 'gpt-6.1-sol' }+ const check = (agentId: string, passed: boolean) => f.run({ type: 'work.check', conversationId: id, assignmentId,+ checkId: f.group(id).checks[0]!.id, passed, evidence: 'rev abc' }, f.asAgent(agentId))+ return { f, id, tester, reviewer, check, run: () => f.group(id).ledger!.runs![0]! }+ }++ it('credits a Reviewer\'s verdict after a Tester\'s on the same check as its own review', () => {+ const { f, id, tester, reviewer, check } = checkers()+ check(tester, false)+ check(reviewer, true)+ check(reviewer, true)+ expect(f.group(id).ledger!.reviews!.map(r => [r.model, r.count])).toEqual([['gpt-6.1-sol', 1], ['opus', 1]])+ })++ it('adds no rework round when another checker passes a check one failed', () => {+ const { tester, reviewer, check, run } = checkers()+ check(tester, false)+ check(reviewer, true)+ expect(run().reworkRounds).toBe(0)+ check(tester, true)+ expect(run().reworkRounds).toBe(1)+ })++ it('fails the first review when a second checker\'s first verdict fails', () => {+ const { tester, reviewer, check, run } = checkers()+ check(reviewer, true)+ expect(run().firstReview).toBe(true)+ check(tester, false)+ expect(run().firstReview).toBe(false)+ })+})+describe('a group opened from a Buddy\'s proposal (Lead, 2026-10-29: the Buddy earns when it ships)', () => {/** A Buddy of the owner in the project, and its proposal posted in the project chat. */function proposed(f: ReturnType<typeof fixture>) {diff --git a/backend/src/superTabs/leaderboard/record.ts b/backend/src/superTabs/leaderboard/record.tsindex b0d4e4247..5bcd2d5cf 100644--- a/backend/src/superTabs/leaderboard/record.ts+++ b/backend/src/superTabs/leaderboard/record.ts@@ -15,8 +15,9 @@ import type { UnblockKind } from './contract.js'export interface Unblock { personId: string; at: number; waitedMs: number; kind?: UnblockKind; item?: string }/** One attempt at a group's work: what it ran on and whether its first review passed (roadmap, Dec: about 30% of work on* cheaper models without lower quality). `grid`: a model served on the Swarm's grid, named by its start, since the engine- * reports none of its own. `firstVerdicts`: each check's first verdict during this attempt by anyone but its assignee, by- * check id. `firstReview`: false once any of them failed, true while every one so far passed, absent until the first. */+ * reports none of its own. `firstVerdicts`: each check's first verdicts during this attempt by anyone but its assignee, by+ * check id: false once any checker's first verdict on it failed (#2311). `firstReview`: false once any of them failed, true+ * while every one so far passed, absent until the first. */export interface Run extends RanOn { assignmentId: string; at: number/** The agent and its terminal that ran it, so the model that terminal reports later fills this attempt only (record* ReportedModel). Absent from attempts recorded before them. */@@ -29,7 +30,9 @@ export interface Run extends RanOn { assignmentId: string; at: numberengineDefault?: true/** Re-reviews after a failed review during this attempt (evidence routing, Ken 2026-10-29): the most on any one check, so* a review that judges two checks counts once. Absent until a review fails; 0 while a failure waits for its- * re-review. `reworks`: each check's last verdict and its re-reviews after a failure, by check id. */+ * re-review. `reworks`: each checker's last verdict on a check and its re-reviews after its own failure, by check id and+ * checker's actor key (`${checkId} ${by}`); one checker passing what another failed is no re-review (#2311). Attempts+ * recorded before kept them by check id alone. */reworkRounds?: numberreworks?: Record<string, { last: boolean; rounds: number }> }/** What an agent ran on: its engine, the model (a grid model's own name, `grid` set), and its effort when it names one;@@ -289,15 +292,16 @@ export function firstAssignedAt(ledger: GroupLedger): number | undefined {}/** An agent's verdict on a check of another agent's task is one finished review by the model it runs on; the assignee's own- * verdicts are no review (checks are information, project instructions phase 4: `independent` is read by nothing). */-export function recordVerdict(state: SuperTabState, group: Conversation, check: Check, checker: Agent, now: number): void {+ * verdicts are no review (checks are information, project instructions phase 4: `independent` is read by nothing).+ * [first]: the checker gave no verdict on this check during this attempt before. */+export function recordVerdict(state: SuperTabState, group: Conversation, check: Check, checker: Agent, now: number, first: boolean): void {if (checker.id === group.assignment?.agentId) returnconst ledger = group.ledger ??= {}- // A check given again on the same attempt is the same review (full review of #2097): only its first verdict counts.- // An attempt recorded before attempts were has no run to tell a repeat by, so it earns no model credit (review of- // #2128).+ // A check given again on the same attempt by the same checker is the same review (full review of #2097): only each+ // checker's first verdict counts, so a Reviewer after a Tester earns its own (#2311). An attempt recorded before attempts+ // were has no run to tell a repeat by, so it earns no model credit (review of #2128).const run = ledger.runs?.find(r => r.assignmentId === group.assignment?.id)- if (!run || run.firstVerdicts?.[check.id] !== undefined) return+ if (!run || !first) returnconst on = ranOn(state, checker, checker.configuration), week = weekStart(now)// Only the weeks the board reads: one row per week and model, however many verdicts.const kept = (ledger.reviews ?? []).filter(r => week - r.week < LEDGER_WEEKS * WEEK_MS)@@ -332,23 +336,24 @@ function ranOn(state: SuperTabState, worker: Agent, configuration: AgentConfigurconst namedEffort = (effort: string | null): string | undefined =>effort && effort !== 'auto' && effort !== 'default' ? effort : undefined-/** Each check's first verdict during an attempt, by anyone but its assignee, is its first review; later verdicts are repairs- * and never rewrite it. The attempt's first review fails once any first verdict failed, and passes while every one so far- * passed (review of #1808: one check passing first used to count as a pass while another failed). */-export function recordReview(group: Conversation, check: Check, passed: boolean, byAssignee: boolean): void {+/** Each checker's first verdict on a check during an attempt, by anyone but its assignee, is a first review; its later+ * verdicts are repairs and never rewrite it (#2311: each checker's, not only the check's first). The attempt's first review+ * fails once any first verdict failed, and passes while every one so far passed (review of #1808: one check passing first+ * used to count as a pass while another failed). [by]: the checker's actor key; [first]: as recordVerdict's. */+export function recordReview(group: Conversation, check: Check, by: string, passed: boolean, byAssignee: boolean, first: boolean): void {const run = group.ledger?.runs?.find(r => r.assignmentId === group.assignment?.id)if (byAssignee || !run) returnconst verdicts = run.firstVerdicts ??= {}- verdicts[check.id] ??= passed- recordRework(run, check.id, passed)+ if (first) verdicts[check.id] = (verdicts[check.id] ?? true) && passed+ recordRework(run, `${check.id} ${by}`, passed)run.firstReview = !group.checks.some(c => verdicts[c.id] === false)}-/** A verdict on a check whose last verdict in this attempt failed is a rework round. */-function recordRework(run: Run, checkId: string, passed: boolean): void {- const trail = run.reworks?.[checkId]+/** A checker's verdict on a check whose last verdict from it in this attempt failed is a rework round. */+function recordRework(run: Run, key: string, passed: boolean): void {+ const trail = run.reworks?.[key]if (!trail && passed) returnconst reworks = run.reworks ??= {}- reworks[checkId] = { last: passed, rounds: (trail?.rounds ?? 0) + (trail && !trail.last ? 1 : 0) }+ reworks[key] = { last: passed, rounds: (trail?.rounds ?? 0) + (trail && !trail.last ? 1 : 0) }run.reworkRounds = Math.max(...Object.values(reworks).map(r => r.rounds))}diff --git a/backend/src/superTabs/leaderboard/rolling.test.ts b/backend/src/superTabs/leaderboard/rolling.test.tsindex 3e84b2899..35856677f 100644--- a/backend/src/superTabs/leaderboard/rolling.test.ts+++ b/backend/src/superTabs/leaderboard/rolling.test.ts@@ -240,9 +240,8 @@ describe('what a verdict writes', () => {it('counts it in its week and its hour, one row per hour and model', () => {const g = reviewed()- recordVerdict(swarm(), g, check, reviewer, NOW + 1)- g.ledger!.runs![0]!.firstVerdicts = undefined- recordVerdict(swarm(), g, check, reviewer, NOW + 2)+ recordVerdict(swarm(), g, check, reviewer, NOW + 1, true)+ recordVerdict(swarm(), g, check, reviewer, NOW + 2, true)expect(g.ledger!.reviews).toEqual([{ week: THIS_WEEK, ...opus, count: 2 }])expect(g.ledger!.reviewHours).toEqual([{ hour: NOW, ...opus, count: 2 }])})@@ -250,13 +249,13 @@ describe('what a verdict writes', () => {it('lets go of hours older than the weeks kept', () => {const g = reviewed()g.ledger!.reviewHours = [{ hour: NOW - 36 * DAY, ...opus, count: 7 }, { hour: NOW - 34 * DAY, ...opus, count: 1 }]- recordVerdict(swarm(), g, check, reviewer, NOW)+ recordVerdict(swarm(), g, check, reviewer, NOW, true)expect(g.ledger!.reviewHours.map(r => r.hour)).toEqual([NOW - 34 * DAY, NOW])})it('keeps an assignee\'s own verdict out of both', () => {const g = reviewed()- recordVerdict(swarm(), g, check, { ...reviewer, id: 'worker' }, NOW)+ recordVerdict(swarm(), g, check, { ...reviewer, id: 'worker' }, NOW, true)expect(g.ledger).not.toHaveProperty('reviewHours')})})diff --git a/backend/src/superTabs/model.ts b/backend/src/superTabs/model.tsindex a35c59c29..d2db9ed4d 100644--- a/backend/src/superTabs/model.ts+++ b/backend/src/superTabs/model.ts@@ -208,7 +208,12 @@ export interface Check {independent: booleanevidence: string | nullpassedBy: string | null+ /** Each checker's latest verdict during this attempt (checkVerdicts.ts); `evidence` and `passedBy` are derived from them.+ * Absent until the first verdict recorded since verdicts were kept. */+ verdicts?: CheckVerdict[]}+/** One checker's verdict on a check: its actor key (`agent:ID` or `person:ID`), what it found and when. */+export interface CheckVerdict { by: string; passed: boolean; evidence: string; at: number }export interface Assignment {id: stringagentId: stringdiff --git a/backend/src/superTabs/steps.test.ts b/backend/src/superTabs/steps.test.tsindex fd03cba91..29cb0f66f 100644--- a/backend/src/superTabs/steps.test.ts+++ b/backend/src/superTabs/steps.test.ts@@ -508,3 +508,74 @@ describe("the row a step's ended work leaves", () => {expect(stepEndedRows(state, [step('gone')], 'Fix was archived.', null, s => s.id)).toEqual([])})})++// Diego, 2026-11-03 (#2311): Review and Test record the same checks in parallel, and a Reviewer's pass used to erase the+// Tester's failure and its crash log, so the check read passed on a pull request whose test failed.+describe('checks with several checkers', () => {+ const checkers = () => {+ const f = stepsFixture()+ const tester = f.add('tester', f.task), reviewer = f.add('reviewer', f.task)+ const check = (actor: string, passed: boolean, evidence: string) => f.run({ type: 'work.check', conversationId: f.task,+ assignmentId: f.group(f.task).assignment!.id, checkId: f.group(f.task).checks[0]!.id, passed, evidence } as Command, f.as(actor))+ return { f, tester, reviewer, check, read: () => f.group(f.task).checks[0]! }+ }++ it('Tester fails, Reviewer passes: the check reads failed and keeps the Tester\'s evidence', () => {+ const { f, tester, reviewer, check, read } = checkers()+ check(tester, false, 'Crashes offline\nlog')+ f.tick(1000)+ check(reviewer, true, 'Diff reads right')+ expect(read()).toMatchObject({ passedBy: null, evidence: 'Crashes offline\nlog' })+ expect(read().verdicts).toEqual([+ { by: `agent:${tester}`, passed: false, evidence: 'Crashes offline\nlog', at: f.now - 1000 },+ { by: `agent:${reviewer}`, passed: true, evidence: 'Diff reads right', at: f.now },+ ])+ })++ it('the same Tester passing it then passes the check', () => {+ const { tester, reviewer, check, read } = checkers()+ check(tester, false, 'Crashes offline')+ check(reviewer, true, 'Diff reads right')+ check(tester, true, 'Signs in offline now')+ expect(read()).toMatchObject({ passedBy: `agent:${tester}`, evidence: 'Signs in offline now' })+ expect(read().verdicts!.map(v => [v.by, v.passed])).toEqual([[`agent:${reviewer}`, true], [`agent:${tester}`, true]])+ })++ it('the assignee passing a check the Reviewer failed leaves it failed', () => {+ const { f, reviewer, check, read } = checkers()+ check(reviewer, false, 'Drops the session')+ check(f.dev, true, 'Fixed it')+ expect(read()).toMatchObject({ passedBy: null, evidence: 'Drops the session' })+ })++ it('two failures: failed until both pass, the latest failure\'s evidence shown', () => {+ const { tester, reviewer, check, read } = checkers()+ check(tester, false, 'Crashes offline')+ check(reviewer, false, 'Leaks the token')+ expect(read()).toMatchObject({ passedBy: null, evidence: 'Leaks the token' })+ check(reviewer, true, 'Token kept')+ expect(read()).toMatchObject({ passedBy: null, evidence: 'Crashes offline' })+ check(tester, true, 'Works offline')+ expect(read()).toMatchObject({ passedBy: `agent:${tester}`, evidence: 'Works offline' })+ })++ it('a pass kept from before verdicts counts as its checker\'s verdict', () => {+ const { tester, reviewer, check, read } = checkers()+ // As a check recorded before verdicts were kept: its pass and evidence only.+ Object.assign(read(), { passedBy: `agent:${reviewer}`, evidence: 'Diff reads right' })+ check(tester, false, 'Crashes offline')+ expect(read()).toMatchObject({ passedBy: null, evidence: 'Crashes offline' })+ check(reviewer, true, 'Still right')+ expect(read().verdicts!.map(v => [v.by, v.passed, v.evidence])).toEqual([+ [`agent:${tester}`, false, 'Crashes offline'], [`agent:${reviewer}`, true, 'Still right']])+ })++ it('a new attempt starts with no verdicts', () => {+ const { f, tester, check, read } = checkers()+ check(tester, false, 'Crashes offline')+ f.run({ type: 'work.cancel', conversationId: f.task, assignmentId: f.group(f.task).assignment!.id, reason: 'Again.' } as Command, f.as(f.lead))+ f.run({ type: 'work.assign', conversationId: f.task, agentId: f.dev }, f.as(f.lead))+ expect(read()).toMatchObject({ passedBy: null, evidence: null })+ expect(read()).not.toHaveProperty('verdicts')+ })+})diff --git a/cli/src/superTabs/agentContext.spec.ts b/cli/src/superTabs/agentContext.spec.tsindex 87dbaed54..52af57564 100644--- a/cli/src/superTabs/agentContext.spec.ts+++ b/cli/src/superTabs/agentContext.spec.ts@@ -1,5 +1,5 @@import { describe, expect, it } from 'vitest'-import { isCoordinator, mineText, openWorkOf, taskText } from './agentContext.js'+import { isCoordinator, mineText, openWorkOf, taskText, unknownAgents } from './agentContext.js'const NOW = Date.parse('2026-11-02T10:00:00.000Z')const MIN = 60_000@@ -209,3 +209,29 @@ describe('a linked task with no step name', () => {expect(mineText(state, changed({}), 'rev1', NOW)).toBe('#12 Fix login · Test: PR #7 (conversation g13) — working')})})++// Diego, 2026-11-03 (#2311): a Tester and a Reviewer record the same check; each one's latest verdict is kept, and a failure+// wins until its own checker passes it.+describe('a check with several checkers', () => {+ const verdict = (by: string, passed: boolean, evidence: string, at: number) => ({ by, passed, evidence, at })+ const withCheck = (check: Group) => task('g1', 1, 'Fix login', 'dev1', 'review',+ { checks: [{ id: 'c', description: 'Signs in offline', independent: true, ...check }] })++ it('shows each checker\'s verdict, a failure first', () => {+ const group = withCheck({ evidence: 'Crashes offline\nlog', passedBy: null,+ verdicts: [verdict('agent:rev1', true, 'Diff reads right', 1), verdict('person:owner', false, 'Crashes offline\nlog', 2)] })+ const state = swarm([group], { people: [{ id: 'owner', email: '[email protected]' }] })+ expect(taskText(group, state, [], changed({}), NOW)).toContain('✗ Signs in offline — failed by [email protected]: Crashes offline; passed by Rev1')+ })++ it('names every checker that passed it', () => {+ const group = withCheck({ evidence: 'Works', passedBy: 'agent:dev1',+ verdicts: [verdict('agent:rev1', true, 'Diff reads right', 1), verdict('agent:dev1', true, 'Works', 2)] })+ expect(taskText(group, swarm([group]), [], changed({}), NOW)).toContain('✓ Signs in offline — by Rev1, Dev1')+ })++ it('names a stopped checker', () => {+ const group = withCheck({ evidence: 'Crashes', passedBy: null, verdicts: [verdict('agent:gone', false, 'Crashes', 1)] })+ expect(unknownAgents(group, swarm([group]), [])).toContain('gone')+ })+})diff --git a/cli/src/superTabs/agentContext.ts b/cli/src/superTabs/agentContext.tsindex 0d6334438..be734fe3a 100644--- a/cli/src/superTabs/agentContext.ts+++ b/cli/src/superTabs/agentContext.ts@@ -155,14 +155,26 @@ export function mineText(state: Json, groupChangedAt: ReadonlyMap<string, number...line.step ? [] : [...stepsLine(state, line.id), ...linkedTo(state, groups.get(line.id)!).map(linked => ` linked: ${otherLine(linked)}`)]].join('\n')).join('\n')}+/** Who an actor key (`agent:ID` or `person:ID`) names: an agent by its name, a person by their email. */+function checkerName(state: Json, by: string): string {+ const [kind, id] = by.split(':', 2)+ return (kind === 'agent' ? agentName(state, id) : text(list(state.people).find(p => p.id === id)?.email)) ?? id ?? by+}++/** A check with each checker's latest verdict (backend checkVerdicts.ts, #2311): failed while any of them failed, each+ * failure with its evidence first; a check from an older backend has only its last verdict. */function checkLine(state: Json, check: Json): string {const description = String(check.description ?? '')- const by = text(check.passedBy)- if (by) {- const [kind, id] = by.split(':', 2)- const name = kind === 'agent' ? agentName(state, id) : text(list(state.people).find(p => p.id === id)?.email) ?? id- return `✓ ${description} — by ${name}`+ const verdicts = list(check.verdicts).filter(v => typeof v.by === 'string')+ if (verdicts.length) {+ const failed = verdicts.filter(v => v.passed !== true), passed = verdicts.filter(v => v.passed === true)+ const by = passed.map(v => checkerName(state, String(v.by))).join(', ')+ if (!failed.length) return `✓ ${description} — by ${by}`+ const failures = failed.map(v => `failed by ${checkerName(state, String(v.by))}: ${firstLine(text(v.evidence) ?? '', RESULT_MAX)}`)+ return `✗ ${description} — ${[...failures, ...passed.length ? [`passed by ${by}`] : []].join('; ')}`}+ const by = text(check.passedBy)+ if (by) return `✓ ${description} — by ${checkerName(state, by)}`const evidence = text(check.evidence)return evidence ? `✗ ${description} — ${firstLine(evidence, RESULT_MAX)}` : `· ${description}`}@@ -179,7 +191,8 @@ function attemptLine(state: Json, attempt: Json, current: boolean): string {export function unknownAgents(group: Json, state: Json, attempts: Json[] | null): string[] {const listed = new Set(list(state.agents).map(a => a.id))const ids = [object(group.assignment).agentId, ...(attempts ?? []).map(a => a.agentId),- ...list(group.checks).map(c => typeof c.passedBy === 'string' && c.passedBy.startsWith('agent:') ? c.passedBy.slice(6) : null)]+ ...list(group.checks).flatMap(c => [c.passedBy, ...list(c.verdicts).map(v => v.by)])+ .map(by => typeof by === 'string' && by.startsWith('agent:') ? by.slice(6) : null)]return [...new Set(ids.filter((id): id is string => typeof id === 'string' && !listed.has(id)))]}diff --git a/desktop/test/super_tab_review_test.dart b/desktop/test/super_tab_review_test.dartindex db956c513..a603ef899 100644--- a/desktop/test/super_tab_review_test.dart+++ b/desktop/test/super_tab_review_test.dart@@ -483,4 +483,45 @@ void main() {'Test: PR #2514 (Nova): working',);});++ // Diego, 2026-11-03 (#2311): a check a Tester failed and a Reviewer then+ // passed, as the backend writes it now: each verdict kept, the failure wins.+ test('a check one checker failed reads failed after another passed it', () {+ final server = groupServer(+ linked: [+ {+ ...conversationFixture('t', 'Tested'),+ 'number': 21,+ 'reviewOf': 'offline',+ 'checks': [+ {+ 'id': 'c',+ 'description': 'Signs in offline',+ 'evidence': 'Crashes offline',+ 'passedBy': null,+ 'verdicts': [+ {+ 'by': 'agent:tester',+ 'passed': false,+ 'evidence': 'Crashes offline',+ 'at': 1,+ },+ {+ 'by': 'agent:reviewer',+ 'passed': true,+ 'evidence': 'Diff reads right',+ 'at': 2,+ },+ ],+ },+ ],+ },+ ],+ );+ final snapshot = SuperTabSnapshot.fromJson(server.state);+ expect(+ superTabLinkedLine(snapshot, snapshot.conversation('offline')!),+ 'Tested: 1 check failed',+ );+ });}diff --git a/desktop/test/super_tab_work_details_test.dart b/desktop/test/super_tab_work_details_test.dartindex 462f578b5..f576e27c7 100644--- a/desktop/test/super_tab_work_details_test.dart+++ b/desktop/test/super_tab_work_details_test.dart@@ -175,4 +175,62 @@ void main() {);expect(tester.takeException(), isNull);});++ // Diego, 2026-11-03 (#2311): the Tester's failure and its evidence stay+ // shown after the Reviewer passes the same check.+ testWidgets('work details show a check one checker failed as not verified', (+ tester,+ ) async {+ final server = ConversationServer();+ final row =+ (server.state['conversations'] as List)[1] as Map<String, dynamic>;+ row['checks'] = [+ {+ 'id': 'check',+ 'description': 'Signs in offline',+ 'independent': true,+ 'evidence': 'Crashes offline',+ 'passedBy': null,+ 'verdicts': [+ {+ 'by': 'agent:tester',+ 'passed': false,+ 'evidence': 'Crashes offline',+ 'at': 1,+ },+ {+ 'by': 'agent:reviewer',+ 'passed': true,+ 'evidence': 'Diff reads right',+ 'at': 2,+ },+ ],+ },+ ];+ final controller = server.controller();+ addTearDown(controller.dispose);+ await controller.refresh();+ await tester.pumpWidget(+ MaterialApp(+ home: Builder(+ builder: (context) => Scaffold(+ body: TextButton(+ onPressed: () => showSuperTabWork(context, controller, 'offline'),+ child: const Text('Open'),+ ),+ ),+ ),+ ),+ );+ await tester.tap(find.text('Open'));+ await tester.pumpAndSettle();+ expect(find.text('Not verified'), findsOneWidget);+ expect(find.text('Verified'), findsNothing);+ expect(+ find.byWidgetPredicate(+ (w) => w is SuperTabMessageText && w.text == 'Crashes offline',+ ),+ findsOneWidget,+ );+ });}diff --git a/docs/plans/2026-11-03-check-verdicts-per-checker-plan.md b/docs/plans/2026-11-03-check-verdicts-per-checker-plan.mdnew file mode 100644index 000000000..19f25073e--- /dev/null+++ b/docs/plans/2026-11-03-check-verdicts-per-checker-plan.md@@ -0,0 +1,128 @@+# A Failed Check Stays Failed When Another Checker Passes It Implementation Plan++> **How this is worked:** by the project's instructions, task by task, each failing test committed before its code.++**Goal:** A check failed by one checker stays failed until that same checker passes it, every checker's latest verdict and evidence is kept, and the leaderboard counts each checker's first verdict without inventing rework rounds.++**Architecture:** `work.check` overwrites `check.evidence` and `check.passedBy`, so a Reviewer's pass erases a Tester's failure. Each check gets `verdicts`: one entry per checker (`by`, `passed`, `evidence`, `at`), the latest replacing that checker's earlier one. `passedBy` and `evidence` are derived from it on every verdict, a failing checker winning, so every reader (Desktop, phone, CLI, tidy, links) reads the right state without knowing `verdicts`. The leaderboard keys its "first verdict" and rework trail by check and checker instead of check alone. The CLI's task output lists each checker's verdict; Desktop and the phone need no change.++**Tech Stack:** TypeScript, Vitest (backend, CLI); Dart, Flutter 3.47.2 (Desktop tests).++**Spec:** Task #2311 (Diego), its brief.++## Global Constraints++- The PR body starts with: `Requested by [email protected] through Harness.`+- Before Ready: a test that fails without the fix for every risk the task names, red/green evidence in a PR comment, and the full Super Tab integration suite (backend change).+- Never run a test that signs the Mac out of the real CLI; Desktop tests use a memory store and a fake sign-in.+- Swarm code stays out of `cli/src/core`.+- Temporary files only in `mktemp -d` folders.++## Review Focus++1. The assignee's own verdict is a checker's verdict too: the Engineer passing a check the Reviewer failed leaves it failed (Task 1 test).+2. Two checkers failing: the check stays failed until both pass; the derived evidence is the latest failure's (Task 1 test).+3. A check recorded before this change (no `verdicts`, `passedBy` set) keeps its pass as that checker's verdict, so a later failure by another checker still fails it and a later pass by the same one does not duplicate it (Task 1 test).+4. A new attempt starts from no verdicts (Task 1 test).+5. The same checker failing then passing is still one review and one rework round (Task 2: the existing tests keep passing unchanged).++## Design++- **Growth:** at most one verdict per checker per check, replaced, not appended; `work.assign` clears them with `evidence` and `passedBy` for each new attempt. A group has few checkers (its agents and people).+- **Concurrency:** the Swarm's existing per-tab command lock; nothing new.+- **Read cost:** the verdicts ride on the check already read; readers that only need the state read the derived `passedBy`.+- **Scale:** 10x checkers on a check is still tens of entries; the state part size of a group warns first.+- **Compatibility:** older clients, Desktop and the phone read `passedBy` and `evidence`, now derived so a failure wins; the CLI reads `verdicts` when present and falls back to those fields.+- **Migration + rollback:** no migration. A check from before has no `verdicts`; its first new verdict seeds its kept pass (`passedBy`) as that checker's verdict. A kept failure names no checker and is not seeded (as today, a later verdict replaces it). Rolling back leaves `verdicts` unread and the old overwrite again.+- **Audience:** verdicts are part of the check, read by whoever reads the group, as its evidence already is.+- **Identity:** a verdict is keyed by the actor's key (`agent:ID` or `person:ID`), never a machine owner's login.+- **Failure:** nothing new fails; a refused `work.check` is refused as before.+- **Platforms:** backend and CLI change; Desktop and the phone read the derived fields unchanged.++---++### Task 1: Each checker's verdict kept; a failure wins++**Files:**+- Create: `backend/src/superTabs/checkVerdicts.ts`+- Modify: `backend/src/superTabs/model.ts` (`Check`), `backend/src/superTabs/commands.ts` (`work.check`, `work.assign` reset)+- Test: `backend/src/superTabs/steps.test.ts`++**Interfaces:**+- Produces: `interface CheckVerdict { by: string; passed: boolean; evidence: string; at: number }`; `Check.verdicts?: CheckVerdict[]`;+ `recordCheckVerdict(check: Check, verdict: CheckVerdict): CheckVerdict | undefined` — replaces `verdict.by`'s earlier verdict, returns it (undefined on its first), and derives `check.passedBy` (the latest passer's key while no verdict failed, else null) and `check.evidence` (the latest failure's evidence, else the latest verdict's).++- [ ] **Step 1: Write the failing tests** in `steps.test.ts`, `describe('checks with several checkers')`:+ - `Tester fails, Reviewer passes: the check reads failed and keeps the Tester's evidence` — `passedBy` null, `evidence` 'Crashes offline\nlog', `verdicts` both.+ - `the same Tester passing it then passes the check` — `passedBy` `agent:<tester>`.+ - `the assignee passing a check the Reviewer failed leaves it failed`.+ - `two failures: failed until both pass, the latest failure's evidence shown`.+ - `a pass kept from before verdicts counts as its checker's verdict`.+ - `a new attempt starts with no verdicts`.+- [ ] **Step 2: Run** `npx vitest run src/superTabs/steps.test.ts` in `backend`: the new tests FAIL (the check reads passed).+- [ ] **Step 3: Commit** the failing tests.+- [ ] **Step 4: Implement** `checkVerdicts.ts`, call it from `work.check` with `{ by: actorKey(actor), passed, evidence, at: context.now }`; `work.assign` deletes `verdicts`.+- [ ] **Step 5: Run** the file and `npx tsc --noEmit`: PASS.+- [ ] **Step 6: Commit and push.**++### Task 2: The leaderboard counts per checker++**Files:**+- Modify: `backend/src/superTabs/leaderboard/record.ts` (`recordVerdict`, `recordReview`, `recordRework`, `Run` docs), `backend/src/superTabs/commands.ts`+- Test: `backend/src/superTabs/leaderboard/record.test.ts`++**Interfaces:**+- Consumes: `recordCheckVerdict`'s return (the checker's earlier verdict).+- Produces: `recordVerdict(state, group, check, checker, now, first: boolean)`; `recordReview(group, check, by: string, passed, byAssignee, first: boolean)`. `first`: this checker gave no verdict on this check in this attempt.+ - `recordVerdict` credits each checker's first verdict on a check (no longer only the check's first), still never the assignee's and never on an attempt without a run.+ - `firstVerdicts[check]` is false once any checker's first verdict on it failed.+ - `reworks` is keyed by check and checker (`${checkId} ${by}`): a round is a checker's verdict after its own failure. Keys from before (check id alone) still count in `reworkRounds`.++- [ ] **Step 1: Write the failing tests** in `record.test.ts`:+ - `credits a Reviewer's verdict after a Tester's on the same check as its own review` — two reviewer agents on different models: `reviews` has a row for each.+ - `adds no rework round when another checker passes a check one failed` — Tester fails, Reviewer passes: `reworkRounds` 0; Tester passes: 1.+ - `fails the first review when a second checker's first verdict fails` — Reviewer passes, Tester fails: `firstReview` false.+- [ ] **Step 2: Run** `npx vitest run src/superTabs/leaderboard/record.test.ts`: the new tests FAIL; the existing ones pass.+- [ ] **Step 3: Commit** the failing tests.+- [ ] **Step 4: Implement** in `record.ts`; `work.check` passes `first = previous === undefined`.+- [ ] **Step 5: Run** the file, `steps.test.ts`, `commands.test.ts` and `tsc`: PASS.+- [ ] **Step 6: Commit and push.**++### Task 3: The CLI shows every checker's verdict++**Files:**+- Modify: `cli/src/superTabs/agentContext.ts` (`checkLine`, `unknownAgents`)+- Test: `cli/src/superTabs/agentContext.spec.ts`++**Interfaces:**+- Consumes: `check.verdicts` as the backend writes it (Task 1); a check without it reads as today.+- Output, one line per check: `✗ Signs in offline — failed by Tester: Crashes offline; passed by Rev1` while any verdict failed (each failure with its evidence's first line, failures first); `✓ Signs in offline — by Rev1, Tester` when all passed.++- [ ] **Step 1: Write the failing tests:** `shows each checker's verdict, a failure first` and `names a stopped checker` (`unknownAgents` returns a verdict's agent missing from the read).+- [ ] **Step 2: Run** `npx vitest run src/superTabs/agentContext.spec.ts` in `cli`: FAIL.+- [ ] **Step 3: Commit** the failing tests.+- [ ] **Step 4: Implement.**+- [ ] **Step 5: Run** the file and `npx tsc --noEmit`: PASS.+- [ ] **Step 6: Commit and push.**++### Task 4: Desktop shows the failed check++Desktop reads `passedBy` and `evidence`, which the backend now derives with a failure winning, so it needs no code change.+Reading `verdicts` on Desktop would change `linked_tasks.dart`, which is kept byte-identical with the phone's copy+(`mobile/test/swarm/desktop_parity_test.dart`), for no reader that the derived fields do not already serve. These tests pin+what Desktop shows for a check as the backend writes it now; the red test for the risk is Task 1's.++**Files:**+- Test: `desktop/test/super_tab_review_test.dart`, `desktop/test/super_tab_work_details_test.dart`++**Interfaces:**+- Consumes: a check as Task 1 writes it: `verdicts` [Tester failed 'Crashes offline', Reviewer passed], `passedBy` null, `evidence` 'Crashes offline'.++- [ ] **Step 1: Write the tests:** the linked line reads "1 check failed"; work details show "Not verified" and the Tester's evidence, never "Verified".+- [ ] **Step 2: Run** `flutter test test/super_tab_review_test.dart test/super_tab_work_details_test.dart` in `desktop`: PASS.+- [ ] **Step 3: Commit and push.**++### Task 5: Before Ready++- [ ] Full Super Tab integration suite (`npm run test:super-tabs` in `backend`), `npm test` in `backend`, CLI `npm run test:super-tabs`.+- [ ] Red/green evidence comment on the PR; mark it ready; Review step by Routing.