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.
Project instructions Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: One instruction document per project defines its roles, workflow and routing; agents talk to each other directly; the server enforces only facts and access.
Architecture: Six phases, each shippable on its own, in the spec's Order of work. Phase 1 (agents message each other directly, no copies to the PM) is planned task by task below. Phases 2-6 are outlined with their scope, files and done criteria; each gets its own task-level plan, written against main as it is when the phase starts, since every phase reshapes the code the next one touches.
Tech Stack: backend Node/TypeScript (Fastify, Prisma on MongoDB, zod, vitest); CLI Node/TypeScript (vitest); Desktop and phone Flutter/Dart.
Spec: docs/plans/2026-10-30-project-instructions-design.md
Global Constraints
- The server and the CLI validate nothing about workflow, roles or routing; they refuse only facts (machine offline, removed or paused; engine signed out or suspended; model not served there) and access (project readability, Swarm settings, Team accounts, Buddy guards, the starts-pending cap).
- Every project always has a PM (the coordinator): created with the project, never removable by the document.
- A message that names agents reaches exactly those agents. A message that names no one goes to its default addressee (an agent's to the coordinator, the coordinator's to the assigned agent, a person's as today); nothing is dropped.
- Server notices to the coordinator are delivered at once; there is no notice period.
- Recipients and posts stay inside the sender's project; Buddy chats, private chats and the Leads conversation keep their current membership rules.
- Repo docs and code comments in English; copy follows
docs/naming-system.md. - Backend tests run with
NODE_ENV=test HARNESS_CREDENTIAL_ENCRYPTION_KEY=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=; runnpx prisma generatebeforetscafter schema changes. - Format only changed Dart files (
dart format <file>), neverdart format lib. - Known baseline failure, not caused here: integration
superTabHotReads"two polls within 15 s read the team machines once".
Review Focus
- An agent names an agent of another project of the same Swarm: refused with
INVALID_RECIPIENT, nothing joins. (Task 1 test.) - An agent posts into a Buddy chat or the Leads conversation it is not in: refused as today (
FORBIDDEN). (Task 1 test.) - An agent names itself among recipients with other agents: it is dropped from the list, not delivered to itself;
an
agentOnlynote to itself keeps its rule. (Task 1 test.) - Two agents answer each other forever: the 20th message in a row between them sends one notice to the coordinator, not one per message after that. (Task 3 test.)
- An old CLI posts with no recipients from a worker: it still reaches the coordinator exactly as today. (Task 2 test.)
Phase 1: agents message each other directly
Shippable alone; relieves the PM under today's roles. Backend, CLI and skill texts ship together (backend first: an old
CLI keeps working, a new CLI on an old backend gets INVALID_RECIPIENT only when naming an agent outside the
conversation, which today's agents never do).
Task 1: Recipients and posts across the project's conversations
Files:
- Modify:
backend/src/superTabs/commands.ts(postable~514,message.send~1995-2050) - Test:
backend/src/superTabs/commands.test.ts(next to "delivers an assigned worker's own post to its Lead")
Interfaces:
Produces:
joinsProject(state: SuperTabState, group: Conversation, agentId: string): booleanincommands.ts: true when the agent exists, is not a Buddy,agentProjectId(state, agent) === groupProject(state, group).id, and the group is neither a Buddy chat (isBuddyChat), the Leads conversation (isLeads) nor private to the coordinator.postable(state, actor, conversationId)keeps its signature; an agent actor not in the group butjoinsProjectis added togroup.agentIdsinstead of refused.Step 1: Write the failing tests
it('lets an agent post in another task of its project and name agents outside it, who join', () => {
const f = fixture()
const lead = f.add('lead', 'owner', 'lead', true)
const build = f.group(), review = f.group()
const engineer = f.add('engineer', 'owner', build), reviewer = f.add('reviewer', 'owner', review)
const as = (agentId: string): Actor => ({ kind: 'agent', agentId, machineOwnerId: 'host-owner' })
const sent = f.run({ type: 'message.send', conversationId: build, text: 'PR #12 is ready.', replyTo: null, recipientIds: [reviewer] }, as(engineer)).messages[0]!
expect(sent.recipients).toEqual([reviewer])
expect(f.state.conversations.find(c => c.id === build)!.agentIds).toContain(reviewer)
// The reviewer answers in its own review task, naming the engineer, who joins it.
const answer = f.run({ type: 'message.send', conversationId: review, text: 'Two findings.', replyTo: null, recipientIds: [engineer] }, as(reviewer)).messages[0]!
expect(answer.recipients).toEqual([engineer])
expect(f.state.conversations.find(c => c.id === review)!.agentIds).toContain(engineer)
expect([sent, answer].some(m => m.recipients.includes(lead))).toBe(false)
})
it('keeps recipients and posts inside the project and out of Buddy chats and the Leads conversation', () => {
// Two projects in one fixture: an agent of project B named from project A is INVALID_RECIPIENT and does not join;
// posting into the Leads conversation or a Buddy chat the agent is not in stays FORBIDDEN.
})
it('never delivers an agent its own message', () => {
// recipientIds: [self, other] delivers to [other]; agentOnly: true with [self] still delivers to [self].
})
The second and third tests follow the first's shape. A second project comes from
f.run({ type: 'project.create', name: 'Other', visibility: 'public', brief: '' }) (as at commands.test.ts ~1270), its
agent from f.add(..., result.conversationId); a Buddy is an agent given buddyOf (as at ~1253-1254); the Leads
conversation is the fixture's 'Leads' group.
- Step 2: Run them to see them fail
Run: cd backend && NODE_ENV=test HARNESS_CREDENTIAL_ENCRYPTION_KEY=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= npx vitest run src/superTabs/commands.test.ts -t "outside it|inside the project|its own message"
Expected: FAIL with FORBIDDEN (posting into the review task) and INVALID_RECIPIENT.
- Step 3: Implement
joinsProjectand use it inpostableand in themessage.sendrecipient loop
In the recipient loop, replace the INVALID_RECIPIENT refusal for non-members with: joinsProject → push the id onto
group.agentIds (once); otherwise refuse as today. Drop the actor's own id from recipients unless agentOnly. Keep
readConversation access as the first check for the actor.
- Step 4: Run the tests to see them pass, then the file
Run: same command without -t. Expected: PASS, including the existing message tests.
- Step 5: Commit
git add backend/src/superTabs/commands.ts backend/src/superTabs/commands.test.ts
git commit -m "Swarm: an agent may post in any task of its project and name any agent of it, who joins"
Task 2: No copies to the coordinator for named messages and terminal turns
Files:
- Modify:
backend/src/superTabs/commands.ts(memberToLeadinmessage.send) - Modify:
backend/src/superTabs/native.ts(append, therecipientsline ~226) - Test:
backend/src/superTabs/commands.test.ts;backend/integration/superTabLiveness.test.ts(the test near line 1456, "A turn typed into a terminal reaches the Lead…") - Modify:
docs/swarms.md(a short "Messages between agents" section: who a message reaches)
Interfaces:
Consumes: Task 1's recipient rules.
Produces:
memberToLeadis non-empty only whencommand.recipientIdsis empty; a native turn's message hasrecipients: []unless it is a gap whose recovery is required (recovery?.source.required).Step 1: Write the failing tests
it('copies nothing to the Lead when an agent names its recipients, and still delivers an unnamed post to it', () => {
const f = fixture()
const lead = f.add('lead', 'owner', 'lead', true)
const group = f.group(), worker = f.add('worker', 'owner', group), other = f.add('other', 'owner', group)
const post = (agentId: string, recipientIds: string[] = []) => f.run({ type: 'message.send', conversationId: group,
text: 'Note.', replyTo: null, recipientIds }, { kind: 'agent', agentId, machineOwnerId: 'host-owner' }).messages[0]!.recipients
expect(post(other, [worker])).toEqual([worker]) // was [worker, lead]
expect(post(other)).toEqual([lead]) // unnamed: the coordinator, as today
})
In superTabLiveness.test.ts, change the native-turn expectation: a recorded prompt or answer has recipientIds: [];
a gap that needs recovery still reaches the Lead.
- Step 2: Run to see them fail
Run: cd backend && NODE_ENV=test HARNESS_CREDENTIAL_ENCRYPTION_KEY=… npx vitest run src/superTabs/commands.test.ts -t "copies nothing"
Expected: FAIL, recipients [worker, lead].
- Step 3: Implement
memberToLead: add && !command.recipientIds.length to its condition. native.ts: recipients = recovery?.source.required && group.leadId && group.leadId !== target.id ? [group.leadId] : []. Update the comments above both to say why (spec: Agents message each other).
- Step 4: Run the unit file and the liveness and superTabs integration files
Run: cd backend && NODE_ENV=test HARNESS_CREDENTIAL_ENCRYPTION_KEY=… npx vitest run src/superTabs/commands.test.ts && npx vitest run --config vitest.super-tabs.config.ts integration/superTabLiveness.test.ts integration/superTabs.test.ts
Expected: PASS.
- Step 5: Commit
git add backend/src/superTabs/commands.ts backend/src/superTabs/native.ts backend/src/superTabs/commands.test.ts backend/integration/superTabLiveness.test.ts docs/swarms.md
git commit -m "Swarm: a message that names its agents is not copied to the PM, nor is every terminal turn"
Task 3: Loop notice between two agents
Files:
- Modify:
backend/src/superTabs/commands.ts(newLOOP_NOTICE_AT,pairLoop, use inmessage.send) - Modify:
backend/src/superTabs/store.ts(~1224: therecentread takesLOOP_NOTICE_ATrows andcreatedAt) - Test:
backend/src/superTabs/commands.test.ts
Interfaces:
Consumes:
CommandContext['recent'], which gainscreatedAt?: number;toLead(state, target, row)fromterminal.ts.Produces:
export const LOOP_NOTICE_AT = 20;pairLoop(recent, a, b, now): number: how many messages in a row, newest first, were between agentsaandb(each authored by one and naming the other), all within the last 30 minutes, stopping at a person's message or any other message.Step 1: Write the failing test
it('tells the coordinator once when two agents have exchanged 20 messages in a row', () => {
// Build recent = 19 alternating messages between engineer and reviewer within 30 minutes; the 20th send returns one
// extra message: author the Swarm, recipients [lead], text containing both agents' names and "20 messages".
// Sending a 21st (recent now 20) returns no extra notice. A person's message in between resets the count.
})
- Step 2: Run to see it fail
Run: … npx vitest run src/superTabs/commands.test.ts -t "20 messages in a row"
Expected: FAIL, no notice.
- Step 3: Implement
After recipients are settled, for an agent sender naming exactly one other agent, when pairLoop(...) + 1 === LOOP_NOTICE_AT
push the notice rows from toLead(state, senderAgent, { id: stableId(operationId, 'loop'), conversationId: group.id, author: sender, text, replyTo: null, recipients: [], source: SYSTEM_ROW }). Text, facts only: " and have
exchanged 20 messages in a row in the last 30 minutes." Delivery is never held. store.ts reads
take: Math.max(PAIR_CHAIN_LIMIT, LOOP_NOTICE_AT) and selects createdAt.
- Step 4: Run the file
Expected: PASS, including the existing PAIR_CHAIN_LIMIT tests (they read only the first PAIR_CHAIN_LIMIT rows).
- Step 5: Commit
git add backend/src/superTabs/commands.ts backend/src/superTabs/store.ts backend/src/superTabs/commands.test.ts
git commit -m "Swarm: the PM hears once when two agents keep answering each other"
Task 4: harness super-tab post --to AGENT
Files:
- Modify:
cli/src/superTabs/command.ts(USAGE, thepostbranch ~105-117) - Modify:
cli/src/superTabs/service.ts(HELPline forpost) - Test:
cli/src/superTabs/command.spec.ts(beside "passes each --mention as written")
Interfaces:
Produces:
post GROUP TEXT OPERATION_ID [--to AGENT]... [--reply-to …] [--attach …]... [--mention …]...; each--tovalue is an agent id, at most 16, mapped torecipientIdsin order without duplicates.Step 1: Write the failing test
it('passes each --to as a recipient, at most 16, and keeps a post without one unnamed', () => {
expect(parseSuperTabArgs([...prefix, 'post', 'g1', 'Ready', 'op-1', '--to', 'a1', '--to', 'a2', '--to', 'a1'], where).payload.command)
.toMatchObject({ type: 'message.send', conversationId: 'g1', recipientIds: ['a1', 'a2'] })
expect(parseSuperTabArgs([...prefix, 'post', 'g1', 'Ready', 'op-1'], where).payload.command).toMatchObject({ recipientIds: [] })
expect(() => parseSuperTabArgs([...prefix, 'post', 'g1', 'Ready', 'op-1', '--to'], where)).toThrow('harness super-tab')
const many = Array.from({ length: 17 }, (_, i) => ['--to', `a${i}`]).flat()
expect(() => parseSuperTabArgs([...prefix, 'post', 'g1', 'Ready', 'op-1', ...many], where)).toThrow('harness super-tab')
})
- Step 2: Run to see it fail
Run: cd cli && npx vitest run src/superTabs/command.spec.ts -t "each --to"
Expected: FAIL (usage error on --to).
Step 3: Implement the flag in the
postloop with the existingidentifier()check; updateUSAGEand theposthelp line: "--to names the agents it reaches (any agent of this project); with none, it reaches the PM."Step 4: Run the CLI super-tab specs
Run: cd cli && npx vitest run src/superTabs/command.spec.ts src/superTabs/service.spec.ts
Expected: PASS.
- Step 5: Commit
git add cli/src/superTabs/command.ts cli/src/superTabs/service.ts cli/src/superTabs/command.spec.ts
git commit -m "CLI: harness super-tab post --to names the agents a message reaches"
Task 5: Today's skills name their recipients
Files:
- Modify:
cli/src/lib/swarmSkills.ts(orchestration and Default texts of dev, review and lead) - Modify:
desktop/lib/super_tabs/roles_editor.dart(its byte-for-byte copies of the Default texts) - Test:
cli/src/lib/swarmSkills.spec.ts;desktop/test/super_tab_project_skills_test.dart(the copy test)
Interfaces:
Consumes: Task 4's
--to.Step 1: Write the failing test in
swarmSkills.spec.ts: for both modes, the dev text containspost <group> … --to <Reviewer>guidance for answering review findings, the review text says to send findings to the Builder with--to, and every role text contains "A post that names no one reaches the PM".Step 2: Run to see it fail
Run: cd cli && npx vitest run src/lib/swarmSkills.spec.ts
Step 3: Edit the texts. Only messaging lines change in this phase:
- dev: answer a Reviewer's findings and tell it a fix is pushed with
--to <its agent id>; tell the PM by name only for blocked, needs a person, or done. - review: post findings in the Builder's group with
--to <Builder's agent id>; the verdict stays a check. - lead: name the agent you speak to with
--to; your unnamed post in a task still reaches its assigned agent. - all roles: "A post that names no one reaches the PM."
Copy the Default texts' changes into
roles_editor.dartbyte for byte.
- dev: answer a Reviewer's findings and tell it a fix is pushed with
Step 4: Run both tests
Run: cd cli && npx vitest run src/lib/swarmSkills.spec.ts and
cd desktop && flutter test test/super_tab_project_skills_test.dart
Expected: PASS. Then dart format desktop/lib/super_tabs/roles_editor.dart only if it changed shape.
- Step 5: Commit
git add cli/src/lib/swarmSkills.ts cli/src/lib/swarmSkills.spec.ts desktop/lib/super_tabs/roles_editor.dart desktop/test/super_tab_project_skills_test.dart
git commit -m "Swarm skills: Builders and Reviewers talk to each other by name; unnamed posts reach the PM"
Phase 1 validation and release
- Backend: unit
src/superTabs, integrationvitest.super-tabs.config.ts(baseline failure above),tsc. - CLI:
npx vitest run src/superTabs src/lib/swarmSkills.spec.tsandnpm run test:core. - Desktop:
super_tab_project_skills_test.dart. - Measure after release with the same 24-hour count used in the spec (messages delivered to the PM, by kind); expect the 198 agent copies a day to fall as skills name recipients.
- Release order: backend, then CLI, then Desktop (only the copied texts changed).
Phase 2: the document, PM notes and role names (backend)
Backend only, additive: nothing here changes enforcement, skills or clients, so it ships alone and old clients ignore the
new fields. Spec sections: The instruction document (Shape and storage, Who changes it, The built-in template), PM notes,
Roles (role names, coordinator, coordinatorName), Migration, Design.
Shared names (phases 3 and 5 build on them):
- Project fields in the state (head part):
instructionsRevision?: number(absent = 0, no document yet),instructionsHash?: string(16 hex of sha256),notesRevision?: number,coordinatorName?: string. Reads givecoordinatorNameits default, "Product Manager". - Agent field:
roleName?: string(1-40). Reads give every agent an effectiveroleNameinderived.agents[id]and in host rows: stored, else "Buddy", "PM" (the coordinator), its custom role's name, "Reviewer" or "Engineer". - Commands:
instructions.save,note.add,note.remove,project.coordinatorName; optionalroleNameonagent.addand onagent.start's request. - Reads:
GET /api/super-tabs/:tabId/projects/:projectId/instructions,…/instructions/revisions,…/instructions/revisions/:revision(all takeasAgentId). - Template:
backend/src/superTabs/instructionsTemplate.tsINSTRUCTIONS_TEMPLATE(and itsTEMPLATE_ROLES,TEMPLATE_WORKFLOW,TEMPLATE_ROUTINGsections, which the migration reuses).
Task 1: The built-in template and the instruction helpers
Files:
- Create:
backend/src/superTabs/instructionsTemplate.ts(the template text, sections as constants) - Create:
backend/src/superTabs/instructions.ts(MAX_INSTRUCTIONS_BYTES = 65_536,instructionsHash(text),DEFAULT_COORDINATOR_NAME,coordinatorNameOf(project),roleNameOf(state, agent),MAX_NOTES = 100,MAX_REVISIONS = 50, zod pieces for the commands) - Test:
backend/src/superTabs/instructions.test.ts
Tests: describes the spec's template (contains the headings Roles, Workflow, Routing and PM, Engineer, Reviewer, Tester;
says review and test run in parallel, the Tester does not read the code, no Sonnet or Haiku Engineers, grid first for
low-risk docs/tests/fixtures; under 16 KB); names roles by default (coordinator → PM, reviewer → Reviewer, builder →
Engineer, Buddy → Buddy, custom role → its name, stored name wins).
Task 2: Storage and instructions.save
Files:
- Modify:
backend/prisma/schema.prisma(SuperTabInstructions{id = stableId(tabId, projectId), tabId, projectId, revision, hash, text, updatedAt};SuperTabInstructionsRevision{id, tabId, projectId, revision, hash, text, writtenByKind, writtenBy, askedBy?, summary, at; @@index([tabId, projectId, revision])}) - Modify:
backend/src/superTabs/model.ts(SuperTabError.details,fail(…, details),CommandEffects.instructions) - Modify:
backend/src/middlewares/errorHandler.ts(sendsdetailswith the code) - Modify:
backend/src/superTabs/commands.ts(schema, WORDS,instructions.save,project.createseeds revision 1) - Modify:
backend/src/superTabs/store.ts(context.instructions read; writes the document, the revision, trims to 50;createseeds the first project; project.delete removes the rows) - Modify:
backend/src/superTabs/projects.ts(project fields),model.tsNOTICE_READERS (instructions: 'people') - Test:
backend/src/superTabs/instructions.test.ts,backend/integration/superTabInstructions.test.ts(new, added tovitest.super-tabs.config.ts)
instructions.save { projectId, baseRevision, text (1 B-64 KB), summary (1-200, one line), askedBy? }: a person who may
write and read the project, or the project's coordinator (askedBy required: a member who reads the project). Stale base →
INSTRUCTIONS_STALE 409 with details: { revision, text }. One chat line in the project chat, source
{ kind: 'instructions', projectId, revision }: "dee changed the instructions: Reviews run on Opus." / "Product Manager
changed the instructions for dee: …". Result { projectId, revision, hash }.
Unit tests: saves and announces; refuses a stale base with the current text; the coordinator needs askedBy, other agents and Buddies are refused, a viewer is READ_ONLY; text over 64 KB is refused; a new project starts at revision 1 with the template's hash. Integration: two members save on the same base, the second gets INSTRUCTIONS_STALE with the first's text; 51 saves keep revisions 2-51; a new Swarm's and a new project's revision 1 text equals the template; project.delete removes its rows.
Task 3: PM notes
Files: schema.prisma (SuperTabPmNote {id, tabId, projectId, text, askedBy, at, expiresAt?; @@index([tabId,
projectId])}), commands.ts, store.ts (context.notes; writes; lazy delete of expired ones), model.ts
(NOTICE_READERS note-removed: 'recipients'), tests as Task 2.
note.add { projectId, text (1-300), askedBy, expiresAt? }: the coordinator only, no chat line, at most 100 live notes,
expired ones deleted on the write. note.remove { projectId, noteId }: a person who may write and read the project, or the
coordinator; a person's removal tells the coordinator (recipients [coordinator], note-removed). Both bump
notesRevision. Unit: coordinator only; 101st refused; an expired note is not counted and is deleted; a person's removal
tells the coordinator, the coordinator's does not; unknown note NOT_FOUND. Integration: expired note not read and gone after
the next write.
Task 4: Role names and coordinatorName
Files: commands.ts (roleName on agent.add and startRequestSchema, copied at agent.started;
project.coordinatorName { projectId, name 1-40 }: the coordinator or the project owner), model.ts (Agent.roleName,
AgentStartRequest.roleName), read/views.ts (derived roleName, head project coordinatorName default), read/contract.ts,
read/hostRows.ts (roleName, instructions: { projectId, revision, hash, coordinatorName }). Unit and integration
tests.
Task 5: Reads
store.ts instructions(user, tabId, projectId, asAgentId) → { projectId, revision, hash, text, template, coordinatorName, notes } (revision 0: the template's text, template: true; a Buddy of the project gets no notes), instructionRevisions
(newest first, no text), instructionRevision (one with text); a Buddy gets NOT_FOUND for both. Routes in
routes/superTabs.ts. Integration: who reads (member, project agent, Buddy text only, outsider and private project 404).
Task 6: Migration job
Files: backend/src/superTabs/migration/instructions.ts (migrateInstructions(db, { apply }), documentFor(…)),
backend/scripts/swarm-instructions/migrate.ts (DATABASE_URL, dry run by default, --apply), tests: unit
migration/instructions.test.ts (documentFor: template copy plus routing lines; custom roles one section each plus the
template's Workflow and Routing; rules in the owner's words; policy notes, floors, reserve, rows, localModels and
priorOverrides as sentences; nothing cut over 64 KB), integration superTabInstructions.test.ts (dry run writes nothing
and lists the documents; apply twice gives the same rows and the second reports nothing to do; a project saved since is
skipped). Open tasks' machine and device requirements are not written.
Task 7: docs/swarms.md "Instructions" section with the Design checklist
Phase 2 validation
npx vitest run src/superTabs src/middlewares src/routes, npx prisma generate && npx tsc --noEmit -p ., integration
vitest.super-tabs.config.ts compared with the baseline list (no new failures).
Done when: two members save on the same base, the second is refused with the current text; a note expires; the job run
twice yields the same documents.
Phase 3: two skills per agent (CLI)
Spec sections: How agents read it, The built-in template, Compatibility, the CLI inventory items for swarmSkills.ts,
host.ts prompt() and start.ts prompts. The template text itself lives in the backend (phase 2,
instructionsTemplate.ts) and reaches the CLI through the instructions read, so the CLI keeps no copy of it.
Decisions this phase makes (ledger them):
- The saved and wire role values stay
lead | dev | review | buddyand the modesdefault | orchestration. A start'sagent_creategoes to another machine's CLI, whoselaunches.tsrefuses an unknown value (INVALID_SWARM_ROLE), and saved registry rows relaunch. The kind now only picks the fallback text for an old backend; phase 4 drops kinds. - Today's role texts (
swarmSkills.ts, and Desktop's byte-for-byte copies) do not change: they are what a new CLI runs on an old backend, and what an agent started before this release holds until the host moves it. - The launch writes the Harness tools skill (built in, no backend read) beside today's role file; the host writes
swarm-instructionsfrom the backend, since the core reads nothing from the backend at launch. The launch line sends the agent to theinstructionscommand, which prints the same text. - An old backend is a host row without an
instructionskey: everything runs as today. A row withinstructions: null(an agent in no project) keeps its role file too.
Shared names:
cli/src/lib/swarmTools.ts:SWARM_TOOLS_SKILL(front mattername: swarm-tools).cli/src/lib/swarmInstructionsSkill.ts:instructionsSkillText(doc: ProjectDoc): string,refreshProjectSkills(workspace: string, saved: SwarmSkill, doc: ProjectDoc): ProjectSkillsRefresh | null,recordProjectSkillsNotice(workspace, saved, sent: Pick<ProjectSkillsRefresh, 'version' | 'change'>): void, whereProjectDoc = { revision: number; text: string; summary: string | null; roleName: string; coordinatorName: string; coordinator: boolean }(saved.roletells a Buddy apart) andProjectSkillsRefresh = { tools: string; instructions: string; version: string; owed: boolean; change: number; notice: string }(tools/instructions: the two files' paths).swarmSkills.tsexportsskillFile(workspace, saved, name: 'swarm-tools' | 'swarm-instructions', create: boolean): string | null(today'sskillDirectorywith the skill's name in place ofswarm-${role}) andreplaceSkillFile.- Service action
instructions{ tabId, agentId, projectId? }→{ ok: true, value: { projectId, revision, text, template, coordinatorName, notes } }; CLIharness super-tab --tab TAB instructions [PROJECT]prints it as text.
Review focus (phase 3):
- An old backend (rows without
instructions, no instructions route): skills, refresh and notices exactly as today;instructionsanswersINSTRUCTIONS_UNAVAILABLE. (Tasks 4 and 5 tests.) - A start from this CLI to a machine on an older CLI: the
agent_createpayload carries no new key or value. (Task 6: assert the payload's keys are unchanged.) - A Buddy: no new command in its guard (
lib/buddyGuard.tsSUPER_TABunchanged); it reads its instructions file inside its folder's.harness, which its folder lock leaves alone. (Task 3/4 tests.) - Several saves between two roster passes: one notice per pass for the newest revision, never one per revision. (Task 4: revisions 2 and 3 seen in one pass → one notice.)
- A 64 KB document: written whole to the skill file and printed whole by
instructionsandroute. (Task 3 test with a 64 KB text.)
Task 1: The Harness tools skill
Files: Create cli/src/lib/swarmTools.ts, test cli/src/lib/swarmTools.spec.ts.
The mechanics from today's role texts, with no workflow: the harness super-tab commands (status, messages, message,
post with --to/--reply-to/--attach/--mention, react, command with the JSON of conversation.create, work.define,
work.assign, work.status, work.check, agent.start via start/resume, route, instructions, decisions, costs,
screen, type, help; and the JSON of instructions.save (base revision, summary, askedBy for the member who asked; a
stale base hands back the current text to merge), note.add, note.remove), what --to reaches (named agents only; no --to reaches the project's coordinator), reactions
mechanics, requests and Done mechanics, cards, threads, shared machines and secrets. Copy wording from today's texts where
it is mechanics; leave out every "only the Lead", "never start a reviewer for your own work", "never merge", automatic
review and fixed role names.
- Step 1: Failing test
describes the commands and no workflow:SWARM_TOOLS_SKILLstarts with---\nname: swarm-tools\n; containspost GROUP,--to AGENT,instructions,work.status,route GROUP,## Reactions;not.toMatch(/\b(Product Manager|Builder|Reviewer|Engineer|Tester|Lead)\b/);not.toMatch(/never merge|your own work|only you/i); byte length under 24 KB. - Step 2: Run
cd cli && npx vitest run src/lib/swarmTools.spec.ts→ FAIL (module missing). - Step 3: Write the text.
- Step 4: Run again → PASS.
- Step 5: Commit
cli/src/lib/swarmTools.ts cli/src/lib/swarmTools.spec.ts— "Swarm: the Harness tools skill, the commands every agent uses, with no workflow (project instructions, phase 3, task 1)".
Task 2: The launch writes the tools skill and points to the instructions
Files: Modify cli/src/lib/swarmSkills.ts (prepareSwarmSkill, skillDirectory → skillFile), test
cli/src/lib/swarmSkills.spec.ts.
Interfaces: Consumes SWARM_TOOLS_SKILL. Produces skillFile, replaceSkillFile, and the tools file's
version.json record (today's SkillRecord shape, told at launch) that Task 3 reads to tell a new session from an older
one.
- Step 1: Failing test
writes the tools skill beside the role's and sends the agent to its instructions: for lead, dev and review in both modes,prepareSwarmSkillwritesswarm-tools/SKILL.mdequal toSWARM_TOOLS_SKILLand still writes the role file; itsinstructionscontain the tools file's path,instructions(the command), and the role file's path as what to use "if this Swarm has no project instructions". A Buddy gets no tools file and its line is unchanged. A relaunch keeps both files' bytes. - Step 2: Run
cd cli && npx vitest run src/lib/swarmSkills.spec.ts→ FAIL. - Step 3: Implement. Line for lead/dev/review:
Use the built-in swarm-tools skill for Harness's Swarm commands: read ${tools} before working. Your role and how this project works are in its instructions: read them with the instructions command (harness super-tab --tab TAB instructions), and work by them. If that command says this Swarm has no project instructions, use the swarm-${role} skill instead: read ${file}. - Step 4: Run
cd cli && npx vitest run src/lib/swarmSkills.spec.ts src/superTabs src/core/agents→ PASS (update launch-line assertions that quote the old line; ledger each). - Step 5: Commit.
Task 3: The instructions skill and its refresh
Files: Create cli/src/lib/swarmInstructionsSkill.ts, test cli/src/lib/swarmInstructionsSkill.spec.ts.
instructionsSkillText(doc): front matter name: swarm-instructions, description "This project's instructions: its
roles, workflow and routing, and your role in them. Read before any project work."; then You are this project's ${roleName}${coordinator ? ', its coordinator' : ''}. ${coordinatorName} is the project's coordinator. (the coordinator
reads You are this project's ${roleName}, its coordinator: people talk to you when they address no one, and you receive the server's notices.), Instructions revision ${revision}:, then the text verbatim.
refreshProjectSkills: writes swarm-instructions/SKILL.md (creating it) and puts swarm-tools/SKILL.md on the current
SWARM_TOOLS_SKILL, both with replaceSkillFile; one record in swarm-instructions/version.json
{ tools, doc, revision, roleName, change, told } (tools/doc: sha256 of each file's text; told: the same fields as
last confirmed, or null). A rewrite bumps change; owed is told?.change !== change. Null when the workspace is gone.
Notices (one per refresh, naming only what changed since told):
no tools record from the launch (a session started before this release):
Harness now gives you two skills in place of your swarm-${role} skill: ${tools}, Harness's Swarm commands, and ${instructions}, this project's instructions and your role in them. Before your next step, read both and work by them.otherwise the parts, in order:
The project's instructions changed: ${summary}.(no summary:The project's instructions changed.),You are now this project's ${roleName}.,Harness updated your swarm-tools skill., thenBefore your next step, read ${files that changed} again and work by them.the first install for a session whose launch wrote the tools record is recorded as told (it read the instructions through the command at launch): no notice.
a Buddy (
saved.role === 'buddy') gets the instructions file only: no tools file, no switch line; its first install tells itYour project's instructions are at ${instructions}: read them as your member's helper; they do not change your limits.once.Step 1: Failing tests:
gives a Buddy the instructions file only;writes the instructions with the role line(roleName "Tester", coordinator false → file containsYou are this project's Tester.and the text);tells nothing on the first install after a new launch;tells once when the instructions change(revision 2, summary "Reviews run on Opus" → owed, notice startsThe project's instructions changed: Reviews run on Opus.; afterrecordProjectSkillsNotice, the same doc → not owed);moves a session started before this release(no tools record → both files written, the switch notice namingswarm-dev);tells a role change and a tools update in one notice;refuses a symlinked skill folder(asskillDirectorydoes today).Step 2: Run
cd cli && npx vitest run src/lib/swarmInstructionsSkill.spec.ts→ FAIL.Step 3: Implement.
Step 4: Run → PASS.
Step 5: Commit.
Task 4: The host installs and refreshes them from the roster
Files: Modify cli/src/superTabs/host.ts (HostAgent, skillSetOf, refreshSkill, tellSkill, the pruning at
~833), test cli/src/superTabs/host.spec.ts (beside the existing skill refresh tests).
Interfaces: Consumes the host row's instructions { projectId, revision, hash, coordinatorName } and roleName
(phase 2, read/hostRows.ts), Task 3's functions, and the reads GET /api/super-tabs/:tabId/projects/:projectId/instructions?asAgentId=
and …/instructions/revisions?asAgentId= (newest first; a Buddy gets NOT_FOUND).
When the row has instructions (an object): every session, a Buddy too, gets refreshProjectSkills with the text read
for that revision (cached per tab and project, dropped when no roster row names it; a read whose revision differs from
the row's is retried later, as role texts are today) and the newest revision's summary when it is that revision (null
for a Buddy or on any failure). A Buddy keeps its swarm-buddy file and gets no tools file (Task 3 takes buddy and
skips the tools part and the switch line). The notice goes through tellSkill unchanged; its operation id is
skill-${agentId}-${version.slice(0, 32)}-${change}. skillSetOf for such a row is
JSON.stringify(['instructions', projectId, revision, hash, roleName, coordinatorName, lead]), so a save is acted on at
the next roster, not the next CLI release. Without the key: today's code path, untouched.
- Step 1: Failing tests:
installs a Tester's instructions from the roster and tells it nothing at first(row roleName "Tester", revision 1 → the file holds the read text andYou are this project's Tester., nomessage.send);tells it once when a save moves the revision(revision 2 → one agent-onlymessage.sendwhose text startsThe project's instructions changed: <summary>; a third poll sends nothing);keeps an old backend's rows on the built-in skills(row withoutinstructions→ today'srefreshSwarmSkillpath, no instructions read);retries a read that answers another revision;gives a Buddy the text without notes or summary. - Step 2: Run
cd cli && npx vitest run src/superTabs/host.spec.ts -t "instructions"→ FAIL. - Step 3: Implement.
- Step 4: Run
cd cli && npx vitest run src/superTabs/host.spec.ts→ PASS. - Step 5: Commit.
Task 5: harness super-tab instructions, and route shows them
Files: Modify cli/src/superTabs/command.ts (parse, USAGE, print as text like screen), service.ts (action,
HELP.instructions), routeCommand.ts (routeTask answer); tests command.spec.ts, serviceReads.spec.ts (or
service.spec.ts, wherever decisions is tested), routeCommand.spec.ts.
The service resolves the project when none is given: the project the agent leads, else the project of its open groups
(projectId ?? 'lead'), else NOT_FOUND. It reads GET …/projects/:projectId/instructions?asAgentId= and returns it. A
404 from a backend without the route answers { error: 'INSTRUCTIONS_UNAVAILABLE', detail: 'This Swarm has no project instructions yet: work by the swarm skill Harness gave you at start.' }. The command prints Instructions of project ${projectId}, revision ${revision}${template ? ' (the built-in template)' : ''}, a blank line, the text, then, when there
are notes, PM's notes: and one line per note - ${text} (asked by ${askedBy}, ${at}${expiresAt ? , until ${expiresAt} : ''});
a failure prints JSON as other commands do. routeTask adds instructions: { revision, text, notes } to its answer, read
for the group's project; a failed read gives instructionsUnreadable: true and the route still answers.
- Step 1: Failing tests: parse
instructionsandinstructions p1(anything else → usage); the service reads the agent's own project and maps a 404 toINSTRUCTIONS_UNAVAILABLE; the command prints the header, text and notes; the route answer carriesinstructionsand survives a failed read. - Step 2: Run
cd cli && npx vitest run src/superTabs/command.spec.ts src/superTabs/serviceReads.spec.ts src/superTabs/routeCommand.spec.ts→ FAIL. - Step 3: Implement; the help line:
instructions [PROJECT]: print your project's instructions (its roles, workflow and routing) and the PM's notes. Work by them; ask the coordinator, or a person, to change them. - Step 4: Run → PASS.
- Step 5: Commit.
Task 6: Neutral prompts
Files: Modify cli/src/superTabs/start.ts (leadPrompt, the worker and reviewer prompt ~387), host.ts
(prompt(), SUPER_TAB_REPLY_STYLE), desktop/lib/super_tabs/launch_prompt.dart; tests start.spec.ts,
host.spec.ts, desktop/test/super_tab_startup_recovery_test.dart and super_tab_work_details_test.dart.
What goes: "Discuss first; build when authorized", "Coordinate: assign multi-part or 15+ minute work…", "Route only to
start an agent or assign work…", "Do not review yet…", "Your lead will assign work…", "Each task needs goal, changes,
constraints…", skill names by role, "Leads: route only when…", "Lead: when a Builder finishes, decide reuse, keep or
stop…", and Desktop's equivalents. What stays: run status until the harness is in the roster, read the conversation,
how to reply, the reply style (minus its Lead line), the GitHub line, the sandbox line. Each start prompt names the
agent's role when the start request has roleName (You are joining this project's Swarm as its ${roleName}.), and
says Read your role in the project's instructions: harness super-tab --tab ${tabId} instructions. The Buddy prompt is
unchanged. Desktop's prompt stays under 2,000 UTF-16 code units.
- Step 1: Failing tests: the lead and worker prompts contain
instructionsand none ofswarm-lead,Coordinate:,Route only,Do not review yet,assign work; a start withroleName: 'Tester'names it;prompt()no longer containsLeads:ordecide reuse, keep or stop; Desktop's prompt for lead and worker containsinstructionsand notswarm-lead/swarm-dev. - Step 2: Run
cd cli && npx vitest run src/superTabs/start.spec.ts src/superTabs/host.spec.ts;cd desktop && flutter test test/super_tab_startup_recovery_test.dart test/super_tab_work_details_test.dart→ FAIL. - Step 3: Rewrite the prompts.
- Step 4: Run the same → PASS;
dart format desktop/lib/super_tabs/launch_prompt.dartand the two test files only;flutter analyzeon them. - Step 5: Commit.
Phase 3 validation
cd cli && npx vitest run src/superTabs src/lib src/core/agents and npx tsc --noEmit -p .; npm run test:core only if
a file under src/core or src/services changed. Desktop: the two launch prompt tests and
super_tab_project_skills_test.dart (unchanged texts, still green).
Done when: Task 4's tests show a session in role "Tester" holding both skills and its role line, a save refreshing its
instructions file and sending exactly one notice, and an old backend's rows running as today.
Release prerequisite (phase 2 review): run the migration in production, with the owner's go, after the backend deploy and before the release of phases 3-5. A project still at revision 0 reads the template; a first save there (the coordinator through the tools skill, or Desktop's panel) would build on the template, drop the project's custom roles and rules, and the migration would then skip it.
Phase 4: role kinds and routing enforcement removed (backend and CLI)
Spec sections: What the server still enforces; Roles ("Any agent of the project may do…", "What the server did by role kind becomes generic"); Agents message each other (phase 1's deferred minors); Server notices to the coordinator; Routing; The nightly routing reflection; Server changes, in brief; the inventory's Backend and CLI lists (every item marked "goes", "any agent of the project may now do", "Automatic workflow the server stops doing", "Role-shaped bookkeeping that becomes generic"); Design (Compatibility, Failure). The Desktop, web and phone items are phase 5; docs are phase 6.
Ships in one release with phases 3 and 5, backend first. It relies on phase 3's CLI (the swarm-tools skill, the host's
swarm-instructions refresh, instructions, neutral start prompts) and changes none of it except where named. Tasks 1-10
are backend and run in order (most edit commands.ts); 11-13 are CLI (11 reads task 7's read); 14 is the done check.
Superseded 2026-11-06 (Dee, task #3591): checkable rules belong in code. The blanket prohibition on the
inventory's refusal codes below no longer applies; removedRefusals.test.ts guards only retired role-registry
codes, each with a stated reason. Plain rule refusal codes are allowed. See the updated design's
"Phase-4 enforcement policy" note. The tasks below are the historical phase-4 implementation.
Original phase-4 completion criterion: removedRefusals.test.ts and integration/superTabWorkflow.test.ts (task 14) pass: no refusal code
in the inventory's list is reachable, and a Tester, an Engineer and a Reviewer run the template's workflow with no
coordinator action between "ready" and "passed".
Decisions this phase makes (ledger them):
- Role kinds on the wire. Inside the CLI the role becomes
coordinator | agent | buddy(SwarmSkill.role, the saved registry row,CreateInput.swarmRole), withfallback?: 'review'kept only so a session started as a Reviewer keeps itsswarm-reviewfile and text.agent_createkeeps sending the old values for this release:lead,dev,buddy, andreviewonly for a start request that still carries an older client'srole: 'reviewer'; no new key. A new receiver accepts both value sets, so the next release can send the new ones. The role name never rides on the wire: the host row (phase 2) is its one source. Cost: an older CLI on the receiving machine installs the built-in dev text for every non-coordinator agent a new CLI starts, until it updates; a machine whose CLI is downgraded after this release relaunches its newly saved Swarm sessions without their Swarm skill (the old parser refusescoordinator). - Old clients' kinds become role names. The backend still stores the
role/roleIdan older client sends, for older readers, and no command reads them.agent.addandagent.startstoreroleName ?? legacyRoleName(...)("Reviewer" forrole: 'reviewer', a custom role's name for itsroleId);work.assign'sroleIdsets the worker's role name when it has none. Cost: none for new clients. - Old clients' saves.
rule.setappends the rule's words to the document's Routing section as a new revision, like a save, withaskedBythe person whose messageaskedInnames (a person actor: themselves); an agent'srule.setwith no person behind it isASKED_BY_REQUIRED.rule.remove,tab.routingPolicy,POST /api/super-tabs/routing-policy,project.skillsandproject.roles.*are accepted, store nothing and answerignored: truewith a note. The old rules, policy rows and role texts stay in place, unread (spec Migration). Cost: an old Desktop's role, skill-set or policy edit is lost; its person edits the document instead. - Settings stay the coordinator's under another code.
controls()goes;tab.rename,tab.pause,tab.project,project.reportandlead: true(onagent.addandconversation.agent: who coordinates is the project's setting, not workflow) are coordinator-or-person and refuse other agents withCOORDINATOR_REQUIRED(phase 2's code), soLEAD_REQUIREDis reachable nowhere. Persons keep their current checks. Cost: none. - Links stay inside the project.
REVIEW_TARGETgoes, but areviewOfnaming a conversation outside the actor's project, the project chat, a Buddy chat, the Leads conversation or a private chat answersNOT_FOUND(never telling whether another project's task exists). A link to a linked task is allowed. Cost: none. - Who resumes a start: the agent that made it, its project's coordinator, or a person (the machine grant still binds a
dispatch to the machine's owner) —
mayResumeStart. Cost: a coordinator can finish another agent's stuck start. - Idle agents. Every agent but the coordinator and Buddies that belongs to no task with active work for 15 minutes is
reported once per idle spell (
Agent.idleNoticedAt), whether tidying is on or off;tab.tidynow governs only auto-archive. The coordinator's poll no longer reads asleep groups. Cost: agents a person added by hand are reported too. - Failed first review: a notice to the coordinator only for an attempt on a model of the Swarm's grid, the attempts the step-up covered. Cost: the coordinator is not woken for subscription attempts' failed first reviews; their findings still reach the Engineer directly.
- Checks. A verdict is a check recorded by anyone but the task's assignee;
independentis still accepted and stored for older readers and read by nothing;work.definetakes zero checks. Review credit and "reviewed by" come from thepassedByof the task's checks and of its linked tasks' checks, minus the assignee. Cost: a Reviewer that records its verdict only on its own review task (as its assignee) earns no credit; the template has it pass the reviewed task's check. - Review capacity notice kept, generic. On a
reviewstatus it says when no machine the project may use can start either engine, without the policy, quality or rules. Cost: one notice the spec's "engine logic removed" might have dropped entirely. - Role defaults.
agent.startfills none;lead.startkeeps the built-in coordinator default (BUILT_IN_ROLE_DEFAULTS.lead, Claude Opus xhigh). Cost: a hand start without a model runs the engine's own model. - Route records carry
instructionsRevision, stamped by the server at record time (project.instructionsRevision ?? 0), not sent by the CLI. Cost: a save between the route's read and its record names the newer revision. - Following another candidate needs no reason; the override is recorded with
reason: 'No reason given.'(the type stays a string). Cost: readers of route decisions see that text. - The catalog is served in the existing tab routing-policy read (a
catalogkey beside the built-in default policy, which is now derived from the catalog), so one read serves catalog, priors and prices and old CLIs read the same rows as a policy. No new route. Cost: none. - A named model the catalog does not list is offered unrated, on Claude Code for names with claude, opus, sonnet, haiku or fable, else on Codex. Cost: a third-party model behind Claude Code gets Codex; the agent can still start it by hand.
lostTaskstays as information (a note in the route); any assignment, an agent's or a person's, clears it.WORK_REQUIRED(keep needs a finished task) goes with the kinds;finishWorkermarks every finished workerawaiting, shown and read by no command.- A failed start is not restarted elsewhere by the CLI; the backend's failure notice reaches the coordinator and the agent that made the start (when it is in the task) and names the model it asked for.
- Grid models too small or slow are offered by the route with a note, from the machines' existing
refusedModelsreports: no report or backend schema change. - Scheduler: from a Swarm snapshot every task has floor 1, no
independent_of, reserve 0 and no machines rule; the solver keeps those fields for bench instances. - Reflection. Each proposal carries one fixed Routing line; the template's PM section says to write it when the owner says Yes; the reflection reads the project's document and reports a proposal whose line is already there with how the last 7 days actually ran, never asking it again. Cost: a reworded line in the document is proposed again.
- Phase 1 minors: the Lead skill line about unnamed posts stays in the built-in fallback text (phase 3's ruling) and the template has none: no work. The loop notice already uses coordinator-only rows (90a13c380).
leadWorkerBouncedstays. The spec says both "the coordinator's to the task's assigned agent (leadToWorker, with its bounce limit)" and, under Loop notice, "leadWorkerBouncedgoes". Ruled for the first: it limits only the coordinator's unnamed posts to its worker, while the loop notice covers named exchanges, and phase 1 kept it. Cost: the coordinator's seventh unnamed post in a row to its worker still reaches nobody until it names the worker.
Shared names:
- Backend:
coordinatorOrPerson(state, actor, conversationId?)andmayResumeStart(state, actor, start)incommands.ts;legacyRoleName(project, given)andappendRouting(text, line)ininstructions.ts;Agent.idleNoticedAt?: number,IDLE_NOTICE_MS = 15 * 60_000,idleNotices(...)intidy.ts;linkPending(state, linked)intidy.ts; notice kindsidleandreview-failed(NOTICE_READERS:'recipients');RouteRecord.instructionsRevision?: number;catalog.tsMODEL_CATALOG,CatalogModel,CatalogRead,catalogRead();routingLine(p)incosts/reflection.ts. - CLI:
lib/savedSkill.tsSwarmRole = 'coordinator' | 'agent' | 'buddy',WireRole = 'lead' | 'dev' | 'review' | 'buddy',roleFromWire(value),wireRole(skill),fallbackSkillName(skill),SwarmSkill.fallback?: 'review';superTabs/route.tsCatalog,catalogFrom(value),strengthOf(...),gridStrength(...),Probe.notes: string[],Probe.unrated?: true.
Review focus (phase 4):
- An agent of another project, or a Buddy, uses a newly opened action (assign, start, check, tell, type in a terminal): refused, nothing written. (Task 1 tests.)
- A non-coordinator agent tries to change who coordinates or a Swarm setting (
lead: true,tab.rename, releasing the coordinator):COORDINATOR_REQUIRED/LEAD_PROTECTED. (Task 1 tests.) - A start from this CLI reaches a machine on an older CLI:
agent_createcarries onlylead|dev|review|buddyand today's keys. (Task 13 test.) - An old Desktop or CLI saves a rule, a policy or a role set: the rule lands in Routing (on a project at revision 0, on the template's text), the rest is accepted and stores nothing. (Task 6 tests.)
- An idle agent is reported once per idle spell, not on every coordinator poll; one with a delivery waiting or in a task with active work is not reported. (Task 8 test.)
Tests of removed behavior. A test that asserted a refusal this phase removes becomes an assertion that the command is
accepted, or is deleted when the behavior is gone. Each task names the blocks it rewrites; ledger every deleted file or
describe block, and every integration test changed (some are in the baseline failure list).
Task 1: Any agent of the project does what only the coordinator did
Files:
- Modify:
backend/src/superTabs/commands.ts:controls(477) →1293, 1425, 1429) andcoordinatorOrPerson, kept only fortab.rename,tab.pause,tab.project(lead: true; removed fromconversation.create(1467),1523),conversation.rename(requester(1528),1536,merged(MERGE_RECORDER1541-1543),1570),archive(agent.add(1586),1662), the start commands (agent.start(1830-1832, plus the2060),actorKeycheck →mayResumeStart),conversation.agent(route.record(2252),2296),route.modelResult(route.override(2307),2327),work.define(work.assign(2351);1050) →project.report(COORDINATOR_REQUIRED;work.status(2410),2484-2488, linework.cancel(2499 names1972-1976:who),agent.release(LEAD_REQUIREDline deleted,LEAD_PROTECTEDstays),person.tell(1764-1765);705-712) records any agent of the projectleadActed( - Modify:
decisions.ts(checkAsker~66-73),mentions.ts(mayTag~116-121,checkMentions~129-134: the Leads conversation refusal becomesINVALID_MENTION),profile.ts(setAgentAvatar~66-70),terminal.ts(mayDrive~64-67;TERMINAL_PRIVATEstays),store.ts(start~1030-1035,githubStart~1603-1606) - Test:
commands.test.ts(newdescribe('any agent of the project')before 'cancelling work' ~1406; rewrite 'Lead mentions' ~3372 and "the Lead's last action on a task" ~845),decisions.test.ts,mentions.test.ts,terminal.test.ts,profile.test.ts,integration/superTabs.test.ts(start resume)
Interfaces:
Produces:
coordinatorOrPerson(state: SuperTabState, actor: Actor, conversationId = 'lead'): void(reads the conversation; an agent that is not its project's coordinator failsCOORDINATOR_REQUIRED403);export function mayResumeStart(state: SuperTabState, actor: Actor, start: AgentStart): boolean.Access for every opened action stays
authorizeCommandAccess/readConversation(an agent reads only its own project) plus the Buddy guard; persons keep their current checks (work.cancel: tab owner;merged: an owner, nowFORBIDDEN).Step 1: Failing tests
lets any agent of the project run the task commands: coordinator, Engineer E and agent A in one project; E runsconversation.create(brief and one check),work.define,route.recordthenwork.assignof A with that decision (decisionIn, as at ~690),conversation.rename,conversation.requester,work.statuson A's task,conversation.merged(→ledger.shippedAtset),work.cancel(→ statuscancelled, the line starts${E} cancelled this task),agent.releaseof A withstop(→workDecision: 'stop'),conversation.archive. None throws;group.leadActionis{ kind: 'route' | 'assign', at: 1000 }after E's route and assignment.keeps settings and who coordinates to the coordinator and people: E'stab.rename,tab.pause,project.report,agent.add … lead: trueandconversation.agent … lead: true→COORDINATOR_REQUIRED; E'sagent.releaseof the coordinator →LEAD_PROTECTED; the coordinator'stab.renamepasses.refuses agents of another project and Buddies: an agent of project B (project.createas at ~1270) assigning in A's task →NOT_FOUND; a Buddy'sconversation.createthrows; neither changesstate.conversations.lets any agent tell a person of its project: E'sperson.tell→ one message in that person's Buddy chat; a person's →FORBIDDEN.decisions.testlets any agent of the project ask a person:checkAskerfor E in its project's task → E's id; in the Leads conversation or another project's task →FORBIDDEN.mentions.testlets any agent of the project tag people:checkMentionsas E in its task → the ids; in the Leads conversation →INVALID_MENTION.terminal.testlets any agent of the project read or type in another agent's terminal:mayDriveE on A passes; on an agent of project B → refused; on the coordinator's terminal →TERMINAL_PRIVATE(as today).profile.testlets any agent of the project set an agent's avatar; an agent of project B →FORBIDDEN.- integration
resumes a start for the agent that made it and its coordinator, never another agent: E'sagent.start;store.start(host, tab, startId, E)and(…, coordinator)answer the start;(…, A)→FORBIDDEN.
Step 2: Run
cd backend && NODE_ENV=test HARNESS_CREDENTIAL_ENCRYPTION_KEY=… npx vitest run src/superTabs/commands.test.ts src/superTabs/decisions.test.ts src/superTabs/mentions.test.ts src/superTabs/terminal.test.ts src/superTabs/profile.test.ts -t "any agent|settings and who coordinates|another project and Buddies|tell a person|ask a person|tag people|terminal|avatar"→ FAIL withLEAD_REQUIRED,MERGE_RECORDER,TELL_FORBIDDEN,DECISION_FORBIDDEN,MENTION_FORBIDDEN.Step 3: Implement. Delete the role checks named under Files; nothing else changes about who may read what.
Step 4: Run the five unit files whole, then
npx vitest run --config vitest.super-tabs.config.ts integration/superTabs.test.ts→ PASS except baseline failures.Step 5: Commit — "Swarm: any agent of the project creates, assigns, starts, routes and closes tasks; the Swarm's settings stay the coordinator's (project instructions, phase 4, task 1)".
Task 2: Role kinds decide nothing
Files:
- Modify:
commands.ts:assignable(430-435) keeps only437-475) and their callers (BUDDY_NOT_ASSIGNABLE; deleteroleSetOf,chosenRole,keepUsedRoles,requireCustomRole(agent.add1601-1606,1608,agent.start~1670-1671,work.assign~2361-2362,conversation.create~1481);REVIEWER_NOT_LEAD(2068);1615) keys onTEAM_ACCOUNT_BUSY(command.lead;conversation.agent(2067-2087):2372-2374) deleted,requireTeamWorkfor every agent added,STOP_REQUESTEDfor any stopping agent added,workDecisioncleared for any agent added;work.assignreviewer loop (lostTaskcleared on any assignment (2371);2449-2451) deleted;work.statusReady-for-review recipients by kind (agent.releaseWORK_REQUIRED(1981-1987) deleted;563);joinsProjectreviewer clause (requireWorkerDecisionscallers (~1664, ~1841, ~2271, ~2365) - Modify:
model.ts: deleterequireWorkerDecisions(524-530);531-540) andfinishWorker(awaitingWorkers(511-523) without541-545) once unusedagentRole; deletereviewing( - Modify:
instructions.ts(legacyRoleName) - Test:
commands.test.ts(rewrite 'Reviewer role' ~1478: itsREVIEWER_NOT_ASSIGNABLE,REVIEW_GROUP,REVIEWER_NOT_LEAD,ROLE_*,WORKER_DECISION_REQUIREDcases),instructions.test.ts
Interfaces:
Produces:
legacyRoleName(project: SwarmProject, given: { role?: 'builder' | 'reviewer'; roleId?: string }): string | undefined.The stored
role/roleIdstay on agents and start requests for older readers; onlyroleNameOfreadsrole.Step 1: Failing tests
assigns any agent any task: an agent started withrole: 'reviewer'assigned a plain task, and a builder assigned a task withreviewOf→ both accepted; a Buddy →BUDDY_NOT_ASSIGNABLE.lets an agent of any kind lead or be named into a linked task: the coordinator'sconversation.agent lead: trueof a reviewer-kind agent →leadIdset; a post naming it in a task withreviewOf→ it joins.names an older client's start by its kind:agent.startwithrole: 'reviewer'and noroleName→ the started agent'sroleNameis'Reviewer'; with a customroleId→ that role's name; withroleName: 'Tester'→'Tester'.holds nothing for an undecided worker: with a finished workerawaiting, the coordinator'sagent.start,work.assignandroute.recordpass.keeps or stops any agent on request:agent.release keepof an agent with no assignment →workDecision: 'keep'.wakes nobody by kind on Ready for review: a reviewer-kind agent in the group; the status row's recipients are[coordinator]only.adds any agent with its team access checked:conversation.agentof a teammate's builder on a personal machine into another person's project → the team-work refusal (asrequireTeamWorkgives today for Reviewers); a stopping agent →STOP_REQUESTED.instructions.testnames an older client's role:legacyRoleNamecases above, and undefined with neither.
Step 2: Run
… npx vitest run src/superTabs/commands.test.ts src/superTabs/instructions.test.ts -t "any agent any task|any kind lead|older client|undecided|keeps or stops|by kind|team access"→ FAIL.Step 3: Implement.
Step 4: Run
… npx vitest run src/superTabs→ PASS.Step 5: Commit — "Swarm: an agent's role kind decides nothing; older clients' kinds become role names (project instructions, phase 4, task 2)".
Task 3: Checks are information; review credit goes to whoever passed
Files:
- Modify:
commands.ts:checkschema (97,223);independentoptional);work.definechecks.min(0)(BRIEF_REQUIRED(1471-1473, ~2356);2413-2415);CHECKS_PENDING(work.check(2536-2559): the three2557-2559) deleted; the assignment row lists acceptance checks only when there are some (~2397)INDEPENDENT_REVIEWrefusals and the hand-back to Working ( - Modify:
liveness.ts:waitingForReview(74-78) is88-94),status === 'review'; deletereviewFoundProblems(READY_FOR_REVIEW,REVISION - Modify:
leaderboard/record.ts(recordVerdict271,20-23)recordReview~310),ship.ts( - Test:
commands.test.ts(rewrite 'the checks of a review' ~3852),liveness.test.ts,leaderboard/record.test.ts,ship.test.ts
Interfaces:
recordVerdict(state, group, check, checker: Agent, now): counts only whenchecker.id !== group.assignment?.agentId.recordReview(group, check, passed, byAssignee: boolean): void: ignores the assignee's verdicts;firstReviewis false once any recorded first verdict failed, true while every recorded first verdict passed.shipNoticereviewerIds: agents inpassedBy(agent:<id>) of the group's and its linked tasks' checks, minus the assignee.Step 1: Failing tests
lets anyone in the task pass its checks, its assignee too: the assignee passes anindependent: truecheck →passedBy === 'agent:<assignee>'; another agent in the task passes the other.marks done without passed checks:work.status donewith a result, checks unpassed → statusdone.creates, defines and assigns a task with no checks: an agent'sconversation.createwithchecks: [],work.definewithchecks: [], thenwork.assign→ accepted; the assignment row's text is the brief alone.keeps a failed check as a finding: a failed check while the assignment isreview→ status staysreview, noWorkingrow.liveness.testwaits for review only in the review status:workingwith "Ready for review @abc1234" → false;review→ true.record.testcredits a check passed by anyone but the assignee: the assignee's → noledger.reviews; another agent's on anindependent: falsecheck → one review counted.ship.testnames who passed its checks as reviewers, whatever their role: a builder-kind agent that passed a check on the task and a linked task's passer are listed; the assignee that passed its own is not.
Step 2: Run
… npx vitest run src/superTabs/commands.test.ts src/superTabs/liveness.test.ts src/superTabs/leaderboard/record.test.ts src/superTabs/ship.test.ts→ FAIL withINDEPENDENT_REVIEW,CHECKS_PENDING,BRIEF_REQUIRED.Step 3: Implement.
Step 4: Run
… npx vitest run src/superTabs→ PASS.Step 5: Commit — "Swarm: checks are information, Done is the agent's word, and review credit goes to whoever passed a check on another agent's task (project instructions, phase 4, task 3)".
Task 4: Linked tasks run in parallel; agents open their own reviews
Files:
- Modify:
commands.ts:conversation.create(1475-1485:1574-1576);REVIEW_TARGET→NOT_FOUNDper decision 5,REVIEW_OPENdeleted; ~1490: the creating agent joinsagentIds);conversation.archiveREVIEW_PENDING(work.statusautomatic review (2454-2462) deleted; review capacity call (2464) without policy and rules - Delete:
backend/src/superTabs/autoReview.ts(verdictPendingmoves totidy.tsaslinkPending) - Modify:
reviewCapacity.ts(seats~25-40 andreviewCapacityNotice~49: no policy rows, quality or rules; textNo new agent can start: no machine this project may use can run Claude Code or Codex now (${list}).; the "would unblock them" sentence goes),tidy.ts(archivable~145 useslinkPending) - Test:
commands.test.ts,reviewCapacity.test.ts,tidy.test.ts; integrationsuperTabTidy.test.ts('a review the Swarm opens by itself' is deleted: ledger, it leaves the baseline list)
Interfaces:
linkPending(state: SuperTabState, linked: Conversation): boolean(today'sverdictPending).reviewCapacityNotice(state, group, now, teamOk: (machineId: string, contributorId: string) => boolean).Step 1: Failing tests
opens several linked tasks at once, each with its creator in it: E creates R and S withreviewOf: T→ both exist;R.agentIdsholds the coordinator and E; a task linked to R is accepted.keeps a link inside the project:reviewOfanother project's task, the project chat or a Buddy chat →NOT_FOUND.archives a linked task without a verdict: archive R with no evidence while T is active → archived.opens no review by itself: E'swork.status reviewwith a project pull request URL and a free reviewer-kind agent → no new conversation and no row with source kindauto-review.reviewCapacity.testsays when no machine the project may use can start either engine: every machine's engines out of quota → the notice above; one usable → none; a machine the project may not use is not counted.
Step 2: Run
… npx vitest run src/superTabs/commands.test.ts src/superTabs/reviewCapacity.test.ts src/superTabs/tidy.test.ts→ FAIL.Step 3: Implement.
Step 4: Run
… npx vitest run src/superTabsandnpx vitest run --config vitest.super-tabs.config.ts integration/superTabTidy.test.ts→ PASS.Step 5: Commit — "Swarm: a task's linked tasks run side by side, opened by agents, and the server opens no review (project instructions, phase 4, task 4)".
Task 5: No routing refusals on the server
Files:
Modify:
commands.ts: deleterefusal,ruled(790-810),718-720),routed(mayRun(782-784),786-787),routedWork(defaulted(751-769),779),policy(groupRules/machineName/macOfonce unused;lead.start(1104) fills only1663,BUILT_IN_ROLE_DEFAULTS.lead;agent.start(1686-1688, ~1713); start dispatch (1838-1840);route.record(2268-2281: no2317, textruled, nostepUpfield, stampsinstructionsRevision);route.override(2321 drops "Hand this task over to it.");2352,work.assign(2396);2084);conversation.agent(linkDecision(~866-881): noOVERRIDE_REASON_REQUIRED, override reason'No reason given.', chat lines${who} started|assigned X instead of Y.plusReason: …when given;CommandContext.routingPolicydeletedModify:
rules.ts: deletebroken,unmet,reviewRefusal,buildRefusal,GRID_BUILDS,gridBuilds,cheapKind,liftEffort,MayRun,policyQuality,targetQuality,agentQuality,agentTarget,startTargetas they lose callers; keep the rule schemas,MAX_RULES,RULE_MESSAGE_MS,SwarmRuleModify:
stepUp.ts(stepUpRefusaldeleted;cheapAttempt(group)isrun.grid, no policy),engineHealth.ts(engineUnusable~93: the quota line goes),routeRecord.ts(instructionsRevision?: numberon the stored record),store.ts(context.routingPolicy~1277 goes)Test:
commands.test.ts(rewrite 'agents route before they start or assign' ~1165, "the owner's rules" ~2148, 'a task that requires a machine or a device' ~2259, "the owner's rules in a Swarm of projects" ~2353, "the owner's rules, after review" ~2568, 'a build at the top tier' ~3802; droproutingPolicy: FIXTURE_POLICYfrom the fixture ~24),engineHealth.test.ts; deletebuildRules.test.ts,reviewRules.test.tsand the rule cases ofteamRouting.test.ts(its team-access cases stay)Step 1: Failing tests
starts, assigns and routes whatever the old rules said:state.rulesholdsforbidModel haikuandmachines [other]; an agent'sagent.startof Haiku onhostwith norouteDecisionId, itswork.assignof a Haiku agent with none, and aroute.recordpicking it → accepted, no row with source kindrule.takes any model for a build or a review: a Sonnet build, a grid-model build of a high-risk task, a grid-model start into a task withreviewOf→ accepted.ignores a task's machine and device requirement: a task requiring[m2]assigned to an agent onhost→ accepted.follows another candidate with no reason:work.assignwith a decision whose pick is another agent and nooverrideReason→ accepted;effects.routeDecisionsholdsoverride.reason === 'No reason given.'; the row readsE assigned A instead of <pick>.records the instructions revision a route relied on: project at revision 3 → the created record'sinstructionsRevision === 3; a project without a document →0.starts with no role default: a person'sagent.startwith no model → the start request has nomodel;lead.startwith engineclaude→model: 'opus', effort: 'xhigh'.engineHealth.teststarts on an engine whose quota is used up: a window at 100% →engineUnusablenull; signed out and suspended → their reasons, as today.
Step 2: Run
… npx vitest run src/superTabs/commands.test.ts src/superTabs/engineHealth.test.ts -t "old rules|any model|requirement|no reason|instructions revision|role default|used up"→ FAIL withROUTE_REQUIRED,RULE_BROKEN,BUILD_REFUSED,REVIEW_REFUSED,REQUIREMENT_UNMET,OVERRIDE_REASON_REQUIRED,ENGINE_UNAVAILABLE.Step 3: Implement.
Step 4: Run
… npx vitest run src/superTabs src/routesandnpx tsc --noEmit -p .→ PASS.Step 5: Commit — "Swarm: the server refuses no start, assignment or route for its model, machine, rules or quota (project instructions, phase 4, task 5)".
Task 6: Old clients' routing and role saves
Files:
- Modify:
commands.ts:rule.set(1443-1453) appends to the document;1454-1462) accepted, no write;rule.remove(ruleChange(829-845) → exported1438-1442),ruleProject(noOWNER_REQUIRED/OWNER_MESSAGE_REQUIRED);tab.routingPolicy(project.skills(1109-1141),1142-1176): accepted, no write;project.roles.create|role.set|role.remove|roles.reset(removeMachine's rules loop (~959-970) deleted - Modify:
instructions.ts(appendRouting,INSTRUCTIONS_FULL),store.ts(context.instructionsalso forrule.set~1214, forruleProject's project;writeRoleTextsonly forproject.delete~1462;saveAccountPolicy~604-617 stores nothing and answers the default) - Test:
commands.test.ts(rewrite 'tab.routingPolicy' ~760, the rule-change cases of the rules blocks, the rules lines of 'machine.remove' ~2634),instructions.test.ts,routingPolicy.test.ts,integration/superTabInstructions.test.ts
Interfaces:
Produces:
appendRouting(text: string, line: string): string:- ${line}at the end of the first## Routingsection (before the next##heading), else\n\n## Routing\n\n- ${line}\nat the end; a result overMAX_INSTRUCTIONS_BYTESfailsINSTRUCTIONS_FULL409.ruleProject(state, actor, command): SwarmProject(the project named, else theaskedInchat's, else the actor's, asruleChangefinds it today).ignoredanswers:result.ignored = true,result.note = 'Routing and roles live in each project's instructions now. Update Harness to edit them there.'Step 1: Failing tests
writes an old CLI's rule into the instructions' Routing: the coordinator'srule.set(forbidModel haiku, textNo Haiku.,askedInthe owner's message) →effects.instructions.text === appendRouting(stored, 'No Haiku.'), revision +1,askedBythe owner, summaryRouting: No Haiku., one chat line as a save;state.rulesunchanged. On a project at revision 0 the text it appends to isINSTRUCTIONS_TEMPLATE.needs a person behind an agent's rule: the coordinator'srule.setwith noaskedIn→ASKED_BY_REQUIRED.accepts a rule removal and changes nothing:rule.remove→ignored: true, no message,state.rulesunchanged.ignores old policy, skill-set and role saves with a note:tab.routingPolicy,project.skills,project.role.set→ignored: trueand the note;state.routingPolicy, the project'sskillSetandrolesunchanged; noSkills:row.leaves the old rules alone when a machine leaves:machine.remove→state.rulesunchanged, noRule changedrow.instructions.testappends a routing line: a section followed by another, a section at the end, no section, a 65,536-byte text →INSTRUCTIONS_FULL.- integration
takes an old Desktop's saves:POST /api/super-tabs/routing-policy→ 200{ isDefault: true }, noRoutingPolicyrow;project.role.setwrites noSuperTabRoleText; an oldrule.setmakes a new revision whose textGET …/instructionsreturns.
Step 2: Run
… npx vitest run src/superTabs/commands.test.ts src/superTabs/instructions.test.ts -t "old CLI|person behind|rule removal|old policy|machine leaves|routing line"→ FAIL.Step 3: Implement.
Step 4: Run
… npx vitest run src/superTabs src/routesandnpx vitest run --config vitest.super-tabs.config.ts integration/superTabInstructions.test.ts→ PASS.Step 5: Commit — "Swarm: an older client's routing rule lands in the project's instructions; its policy, skill set and role saves are accepted and kept nowhere (project instructions, phase 4, task 6)".
Task 7: The model catalog, served in one read
Files:
- Create:
backend/src/superTabs/catalog.ts; testcatalog.test.ts - Modify:
routingPolicy.ts:DEFAULT_ROUTING_POLICY.modelsandlocalModelsderived from the catalog (floor{ low: 1, medium: 2, high: 3 },quotaReserve: 10,notes: ''as today); deleteeffectivePolicy, the override and save schemas once unused;priorForstays - Modify:
store.ts(accountPolicy~596,tabPolicy~619,policyOf~630) - Test:
routingPolicy.test.ts,integration/superTabs.test.ts
Interfaces:
export interface CatalogModel { engine: 'claude' | 'codex'; model: string; effort: string; strength: 1 | 2 | 3; cost: number; offered: boolean; note?: string }
export interface CatalogGrid { strength: number; models: ReadonlyArray<{ model: string; strength: number }> }
export const MODEL_CATALOG: { models: readonly CatalogModel[]; grid: CatalogGrid }
export interface CatalogRead { models: readonly CatalogModel[]; grid: CatalogGrid; priors: PriorsTable; prices: readonly ModelPrice[] }
export function catalogRead(): CatalogRead
Rows, in order: claude opus high 3 cost 3; claude opus xhigh 3 cost 4; codex default default 3 cost 2; codex gpt-6.1-sol
high 3 cost 2; codex gpt-6-astra xhigh 3 cost 5 (all offered); claude sonnet medium 2 cost 2 and claude haiku auto 1 cost 1,
offered: false, note Not offered by default: no Engineer runs on Claude Sonnet or Claude Haiku (Ken and Dee, 2026-10-30).
Grid: strength 1; kimi k3 2, deepseek v4.1 2. GET /api/super-tabs/:tabId/routing-policy answers { policy: DEFAULT_ROUTING_POLICY, warnings: [], overridden: [], override: null, account: DEFAULT_ROUTING_POLICY, catalog: catalogRead() } (a Buddy still refused); GET /api/super-tabs/routing-policy answers { policy: DEFAULT_ROUTING_POLICY, revision: 0, isDefault: true }.
- Step 1: Failing tests
catalog.testlists today's models with their strength: the rows above exactly; every offered row is strength 3.catalog.testgives older CLIs the same rows as a policy:DEFAULT_ROUTING_POLICY.modelsequals the catalog rows as{ engine, model, effort, quality: strength, cost, enabled: offered };localModels.modelsthe grid rows.- integration
serves the catalog, priors and prices with the default policy, whatever the owner saved: an account policy row and a tab override in place → the read'spolicyis the default andoverridenull;catalog.modelshas 7 rows;catalog.pricesholdsclaude-opus-5-5; a Buddy's read is refused.
- Step 2: Run
… npx vitest run src/superTabs/catalog.test.ts src/superTabs/routingPolicy.test.ts→ FAIL (module missing). - Step 3: Implement.
- Step 4: Run
… npx vitest run src/superTabs src/routesand the integration file → PASS. - Step 5: Commit — "Swarm: a reviewed model catalog, served to the route with priors and prices (project instructions, phase 4, task 7)".
Task 8: Server notices replace server actions and say only what happened
Files:
- Modify:
tidy.ts:stopIdleWorkers(~97-127) →idleNotices; deleteasleepMatch,ASLEEP_FIELDS,GroupActivity,stoppedMachines,recheckPending,reportedClean;IDLE_STOP_MS→IDLE_NOTICE_MS - Modify:
store.ts(the coordinator's poll ~2635-2647, ~2682: no asleep read, nostoppedMachines; the stop notice text ~2990) - Delete:
stepUp.ts; incommands.tssteppedUp(811-823) and its callers (1884,2553-2554) become notices,2397) goes;carryOver(agent.startFailed(~1877-1883) recipients and model - Modify:
native.ts(recovery~190-196: noblocked, facts-only text;appendrecipients ~222: only a required recovery reaches the coordinator — phase 1's deferred change) - Modify:
model.ts(Agent.idleNoticedAt,NOTICE_READERSidleandreview-failed→'recipients'),startFailure.ts(failureNotice(name, error, model?);LEAD_PICKUP_SUFFIX→leadPickupSuffix(name)) - Facts-only texts:
liveness.ts(179-183, ~377-379:136),A task is stalled:/N tasks are stalled:and no "Act on…"),terminal.ts(commands.ts(975, ~1004 overlaps: no "Agree an order…", ~1340, ~2050, ~2499); the coordinator's name from495) andcoordinatorNameOf(project):leadStart.ts(LEAD_NAMEuses ~48, 51, 68, 169, 178; the constant stays only forstore.ts~427's old rows),commands.tsprotectLead(lead.start(~1093-1102),decisions.ts(DELEGATED_NOTICE→delegatedNotice(name)) - Test:
tidy.test.ts,commands.test.ts(delete 'stepping up from a cheap model' ~3878),native.test.ts,liveness.test.ts,leadStart.test.ts; integrationsuperTabTidy.test.ts(idle stops),superTabTeam.test.ts~235,superTabLiveness.test.ts~1456,superTabs.test.ts~1137 (per-turn copies, phase 1's ruling)
Interfaces:
idleNotices(state: SuperTabState, projectId: string, now: number, busy: ReadonlySet<string>): MessageDraft[]: for each agent of the project, not a Buddy, not its coordinator, not stopping, not inbusy, not waiting to resume, in no loaded group with active work and assignee of none, idle sinceidleSince(its start, keep, own progress or its groups' activity; no Reviewer case) forIDLE_NOTICE_MSand withidleNoticedAt !== since: onetoLeadrow,${name} has had no open task for 15 minutes., source{ kind: 'idle', agentId }; setsidleNoticedAt = since.The failed first review (
work.check:run.firstReviewturns false on arun.gridattempt): onetoLeadrow,#${n} ${title}: its first review failed. It ran on ${model} on the Swarm's grid. Findings: ${evidence ≤ 500}, source{ kind: 'review-failed', conversationId }; nothing is cancelled.Step 1: Failing tests
tidy.testtells the coordinator once about an agent with no open task for 15 minutes: started 16 minutes ago → one row to the coordinator with the text above,workDecisionunchanged; a second call → none; idle again after new work (a newsince) → one more. A Buddy, the coordinator, an agent inbusy, an agent in a task with active work → none.tells the coordinator of a grid attempt's failed first review and steps nothing up: one notice naming the model and the evidence; the assignment stays active,group.stepUpundefined; a second failed verdict → none; a subscription attempt → none.tells a failed start to the coordinator and the agent that made it: E's grid start fails → the row's recipients are[coordinator, E]and its text names the grid model; nothing cancelled.native.testrecords a recording gap without blocking its task: a required recovery → status staysworking, recipients[coordinator]; a prompt or answer turn → recipients[].states what happened, never the next step: a lost task, a stalled task, a model alert, a person's route override, a removed agent, a removed machine, an abandoned start, a host-confirmed stop and an overlap → no text contains any ofAssign it to another agent now,assign it there now,Act on,Stop it, or give the work,Hand this task over,needs to be assigned again,Start it again,If this work should continue,Agree an order.leadStart.testnames the coordinator as its project calls it:coordinatorName: 'Coordinator'→lead.start'sLEAD_EXISTStext, the joined line and the started agent's name useCoordinator;protectLead's text too.
Step 2: Run
… npx vitest run src/superTabs/tidy.test.ts src/superTabs/commands.test.ts src/superTabs/native.test.ts src/superTabs/liveness.test.ts src/superTabs/leadStart.test.ts→ FAIL.Step 3: Implement.
Step 4: Run
… npx vitest run src/superTabsandnpx vitest run --config vitest.super-tabs.config.ts integration/superTabTidy.test.ts integration/superTabTeam.test.ts integration/superTabLiveness.test.ts integration/superTabs.test.ts→ PASS except baseline failures; ledger each expectation changed.Step 5: Commit — "Swarm: idle agents, failed grid attempts and recording gaps are notices to the coordinator, and notices say only what happened (project instructions, phase 4, task 8)".
Task 9: The nightly reflection writes approved changes into the instructions
Files:
- Modify:
costs/reflection.ts: deleteApproved,APPROVED_DAYS,LAPSED_DAYS,approvedReminder,ReflectionInput.approved | lapsed | rulesand the rule filter; addroutingLine,ReflectionInput.document;proposalQuestion(~270-276) says what Yes does now - Modify:
store.tspostReflection(~2832-2905): reads the project's document (superTabInstructions, orINSTRUCTIONS_TEMPLATEat revision 0); no approved or lapsed maps, no reminder row to the coordinator - Modify:
instructionsTemplate.ts(one PM bullet:When the project owner answers Yes to a nightly routing proposal, writes its line into Routing, naming the owner as who asked.) - Test:
costs/reflection.test.ts,instructions.test.ts,integration/superTabReflection.test.ts
Interfaces:
routingLine(p: Proposal): string:cheaper→${Kind} work runs on ${to} instead of ${from}.;stop→${Kind} work no longer runs on ${from}.(Kindis the task kind, capitalized; models as the report names them).A proposal whose
routingLineis indocumentis not proposed; the report saysIn the instructions: ${line} The last 7 days ran ${n} ${kind} tasks on ${from}.Step 1: Failing tests
reflection.testreads the instructions instead of an approved list: a document with the line → not proposed, the report's line as above; without it → proposed.reflection.testasks Yes as a change to the instructions:options[0]startsYes: the coordinator writes this into the Routing section of the instructions;unblockscontainsroutingLine(p).instructions.testdescribes the spec's templatealso findsnightly routing proposalin the PM section.- integration
posts no reminder of approved changes: an owner's Yes within 30 days → no row to the coordinator and noApproved changestext; a saved revision holding the line → the report saysIn the instructions.
Step 2: Run
… npx vitest run src/superTabs/costs/reflection.test.ts src/superTabs/instructions.test.ts→ FAIL.Step 3: Implement.
Step 4: Run the unit files and
npx vitest run --config vitest.super-tabs.config.ts integration/superTabReflection.test.ts→ PASS.Step 5: Commit — "Swarm: a Yes to a routing proposal is a line in the instructions, and the reflection reads them (project instructions, phase 4, task 9)".
Task 10: Phase 1's deferred minors
Files: commands.ts: message.react (2114-2116) uses a membership check that never joins (2199-2206) lets only an agent sender's recipients join; FORBIDDEN for an agent
not in the group); the message.send recipient loop (joinsProject
(558-564) refuses an agent marked stop; the "Who may post…" comment (552) moves back above postable. Test
commands.test.ts (beside phase 1's recipient tests).
- Step 1: Failing tests:
reacts only where the agent already is(→FORBIDDEN,agentIdsunchanged);keeps a person's message from adding agents(a person naming a project agent outside the group →INVALID_RECIPIENT, nothing joins);never adds a stopping agent(named →INVALID_RECIPIENT; posting into another task →FORBIDDEN);keeps private and Buddy chats closed to posts(an agent posting into a private chat or a Buddy chat it is not in →FORBIDDEN). - Step 2: Run
… npx vitest run src/superTabs/commands.test.ts -t "already is|person's message|stopping agent|closed to posts"→ FAIL (the first three). - Step 3: Implement.
- Step 4: Run
… npx vitest run src/superTabs/commands.test.ts src/superTabs/parts/touches.test.ts→ PASS. - Step 5: Commit — "Swarm: reacting and a person's message add nobody to a task, nor does naming a stopping agent (project instructions, phase 4, task 10)".
Task 11: The route and the plan rank by facts (CLI)
Files:
- Modify:
cli/src/superTabs/route.ts:choose(437-484) without469) and the first-fit-group cut (rules,avoid,reviewFloor, floors, the strongest-only cut (475-476); delete414-418);breaks,lifted,liftEffort,softOf,buildRefusals,gridBuilds,GRID_BUILDS,reviewRefusals,stepUpRefusals,floorFor,NAMED_OFF, theremoteterm ofcompare(rateFor→strengthOf,gridQuality→gridStrength;recordOfsendsfloor: 1,belowFloor: false,notes: false - Modify:
routeCommand.ts:routeTask(195-374): no214), no coordinator exclusion (LEAD_REQUIRED(220-221), every member whatever its kind (233), no forcedreviewkind (223-224), no rules (228-231),ELSEWHERE,UNCHECKED_DEVICE, lost task (303-307), stall (266-268) and avoided account (336-339) as notes;115-121) andmemberRefusals(probeMachine(560) quota as information;75-99) push readiness as a note;unreadyPool(localProbes(471-487) also offers366-372) neutral; phase 3'srefusedModelswith their why as a note; thenexthint (instructionsanswer kept - Modify:
capacity.ts(~163: an exhausted window goes tounknown, notreasons),lib/codingModel.ts(texts say "a coding agent", not "Builders"),service.ts(routeHistory~546-552: noLEAD_REQUIRED) - Modify:
planInput.ts(~80, ~102-107, ~147-182, ~198: no rules, floor 1, linked tasks may take grid models, reserve 0, exhausted engines kept),tools/scheduler/scheduler/swarm.py(_allowed~111-120 unused, floor ~186 → 1,independent_of~192 →[], reserve ~199 → 0) - Test:
route.spec.ts,routeCommand.spec.ts,capacity.spec.ts,planInput.spec.ts,lib/codingModel.spec.ts,serviceReads.spec.ts(or whereverrouteHistoryis tested),tools/scheduler/tests/test_swarm.py
Interfaces:
Consumes: task 7's read (
catalogbesidepolicy); phase 3'srouteTaskinstructionsfield.Produces:
Catalog { models: CatalogModel[]; grid: { strength: number; models: Array<{ model: string; strength: number }> } };catalogFrom(effective: Json): Catalog(itscatalog, else rows derived from itspolicy: an older backend);strengthOf(c, engine, model, effort, engineDefault = false): number | null(exact row, the model's other effort, the engine's default row when launched on it, else null);gridStrength(c, model, label): number;Probe.notes: string[],Probe.unrated?: true,quality = strength ?? 1;choose(probes, catalog, a, now?, open?, held?).Ranking (
compare): strength, then effective cost (price, cheaper with an expiring 5-hour window), then fit (fits,unknown,short), then an idle member before a new agent, then title.Step 1: Failing tests
route.specleaves out only what cannot run: a probe refused as offline is excluded; a Sonnet row is not offered unless named, and named it is offered with its catalog note; a grid model for a high-risk build and a strength-1 model for a high-difficulty task are offered.route.specranks by strength, then price and quota fit, then idle members: Codex default (3, cost 2), Opus high (3, cost 3), Kimi K3 on the grid (2) → that order; a strong candidate short of quota is shown with fitshort.route.specoffers a named model the catalog does not list, unrated:model: 'gpt-6.2'→ Codex candidates whose label saysunrated;model: 'claude-opus-6'→ Claude ones.routeCommand.speclets any agent of the group's project route:value.agentId !== group.leadId→ answerok: true.routeCommand.specshows lost, stalled and avoided accounts as notes: each such candidate is shown and itsnotessay why; an idle coordinator and a reviewer-kind member are candidates for a build.routeCommand.specreads the catalog, or an older backend's policy;offers a small or slow grid model with a note; thenexthint holds"roleName":"ROLE"and none ofBuilder,Reviewer,"role":"reviewer".capacity.specstarts on a used-up account and says so: a 100% window →allowed: true,unknownnames it.planInput.specplans every open group with no floor, rule or reserve.test_swarm.pytest_tasks_have_no_floor_or_independence,test_owner_rules_leave_no_machine_out,test_the_budget_is_the_weekly_quota_left(replacing the reserve, machines-rule and review-family cases).
Step 2: Run
cd cli && npx vitest run src/superTabs/route.spec.ts src/superTabs/routeCommand.spec.ts src/superTabs/capacity.spec.ts src/superTabs/planInput.spec.ts src/lib/codingModel.spec.tsandcd tools/scheduler && python3 -m unittest tests.test_swarm -v→ FAIL.Step 3: Implement.
Step 4: Run
cd cli && npx vitest run src/superTabs src/lib && npx tsc --noEmit -p .; the scheduler suite with the README's venv (.venv/bin/python -m unittest discover -s tests -t .), ortests.test_swarm tests.test_instancewithpython3when OR-Tools is missing (ledger which) → PASS.Step 5: Commit — "CLI: the route and the plan rank every candidate that can run; rules, floors, kinds and quota are notes, not filters (project instructions, phase 4, task 11)".
Task 12: CLI commands, help and the tools skill follow the backend
Files:
Modify:
cli/src/superTabs/service.ts:taskCommand(162-180) refuses nothing (a complete task as today; an incomplete one is sent as its rendered118-128) merged intobriefwithouttask);LEAD_HELP(HELP, so every agent's help has--mention,plan,decision.ask,person.tell;HELPtexts (~52-115) loseleads"agree an order",react's rules,release's "prefer stop",start's Reviewer/role lines,route's rules,screen/type"Only its project's Lead",command's rules, floors and step-ups, therule.set/project.skills/tab.tidyexamples' owner wording,startRequest.name: 'Builder'Modify:
cli/src/lib/swarmTools.ts(lines ~10, 21-22, 28, 56, 63, 68-69, 84-87, 94-95): no "Refused to some agents", no "route first", no hard rules, no "rated 3 by the policy";rule.set/rule.remove/project.skillsleave the list (agents save the document)Modify:
cli/src/superTabs/start.ts: deletestartElsewhere(152-260) and its helpers (110-122) returns the failed startKNOWN_RULES,RETRY,derived,blocked);startAgent(Test:
service.spec.ts,lib/swarmTools.spec.ts,start.spec.tsStep 1: Failing tests
service.spectakes a task as written:conversation.createwithtask: { goal: 'Save edits' }→ the command sent hasbrief: 'Goal:\nSave edits'and notask; a complete task → as today.service.specgives every agent the same help, with no rule the server dropped: a non-coordinator's help holds--mention,decision.ask,person.tell;JSON.stringify(HELP)matches none of/prefer stop|agree an order|Only its project's Lead|without a routeDecisionId is refused|hard rule|top tier|steps the task up|"name":"Builder"|role "reviewer"/i.service.specsends no refusal the server dropped: no non-spec.tsundercli/src/superTabscontains'LEAD_REQUIRED'or'TASK_REQUIRED'.swarmTools.specdescribes the commands the server accepts now:SWARM_TOOLS_SKILLmatches none of/Refused to some agents|route first|hard rules|rated 3|rule\.set|project\.skills/; still containspost GROUP,--to AGENT,instructions.start.specreports a failed start and moves it nowhere: a routed start that fails →{ error: 'START_FAILED' }; noroute.record, no secondagent_create, nomessage.send.
Step 2: Run
cd cli && npx vitest run src/superTabs/service.spec.ts src/lib/swarmTools.spec.ts src/superTabs/start.spec.ts→ FAIL.Step 3: Implement.
Step 4: Run
cd cli && npx vitest run src/superTabs src/lib && npx tsc --noEmit -p .→ PASS.Step 5: Commit — "CLI: help, the tools skill and starts follow the server: any agent tags, asks and tells, tasks are taken as written, and a failed start is reported, not moved (project instructions, phase 4, task 12)".
Task 13: Role kinds in the CLI: coordinator, agent, buddy
Files:
- Modify:
cli/src/lib/savedSkill.ts(SwarmRole,isSwarmRole,parseSwarmSkill; addWireRole,roleFromWire,wireRole,fallbackSkillName); createcli/src/lib/savedSkill.spec.ts - Modify:
cli/src/lib/swarmSkills.ts(skillDirectory,prepareSwarmSkill,refreshSwarmSkill,swarmSkillUse: the role folder and text byfallbackSkillName),cli/src/lib/swarmInstructionsSkill.ts(phase 3's switch notice namesfallbackSkillName(saved)),superTabs/inCore/launch.ts(role: isSwarmRole),superTabs/inCore/role.ts(reads the answer withroleFromWire),superTabs/host.ts(swarmRoleFor52-85),363-385:superTabs/start.ts(wireRole) - Modify:
cli/src/core/agents/launches.ts(~415-433, ~506:roleFromWirebefore the check; detailA Swarm role is coordinator, agent or buddy (or lead, dev or review from an older Harness), for Claude Code or Codex.) - Test:
savedSkill.spec.ts,swarmSkills.spec.ts,core/agents/launches.spec.ts,start.spec.ts,host.spec.ts,superTabs/inCore/role.spec.ts
Interfaces:
type SwarmRole = 'coordinator' | 'agent' | 'buddy';interface SwarmSkill { role: SwarmRole; key: string; mode?; github?; fallback?: 'review' }.roleFromWire(value: unknown): { role: SwarmRole; fallback?: 'review' } | null(new values;lead→ coordinator,dev→ agent,review→ agent + fallback,buddy).wireRole(skill: Pick<SwarmSkill, 'role' | 'fallback'>): WireRole;fallbackSkillName(skill): 'swarm-lead' | 'swarm-dev' | 'swarm-review' | 'swarm-buddy'.parseSwarmSkillreads both shapes; rows are written in the new one.Step 1: Failing tests
savedSkill.specreads saved rows of both shapes:{ role: 'lead' }→ coordinator,dev→ agent,review→ agent withfallback: 'review',{ role: 'agent' }kept,{ role: 'pm' }→ undefined;wireRoleandroleFromWireround trip;fallbackSkillNameper case.launches.spectakes older and newer Swarm roles from agent_create:swarmRole: 'review'→ the registeredswarmSkillis{ role: 'agent', fallback: 'review', … };'coordinator'→ coordinator;'pm'→INVALID_SWARM_ROLE.start.specsends an older machine only the role values it knows: a start withroleName: 'Tester'→ payloadswarmRole: 'dev'; a coordinator's start →'lead'; an older client'srole: 'reviewer'→'review'; the payload's keys equal today's list (written out in the test).swarmSkills.speckeeps each session's role file:{ role: 'agent', fallback: 'review' }writesswarm-review/SKILL.mdbyte-equal to today's review text; coordinator →swarm-lead; a row saved as{ role: 'dev' }relaunches onto its existingswarm-devfile.host.specreads a session's role without its kind: the coordinator → coordinator; an agent with legacyrole: 'reviewer'→ agent withfallback: 'review'; any other → agent; a Buddy → buddy.
Step 2: Run
cd cli && npx vitest run src/lib/savedSkill.spec.ts src/lib/swarmSkills.spec.ts src/core/agents/launches.spec.ts src/superTabs/start.spec.ts src/superTabs/host.spec.ts→ FAIL.Step 3: Implement.
Step 4: Run
cd cli && npx vitest run src/superTabs src/lib src/core/agents && npx tsc --noEmit -p .andnpm run test:core(100% per file forsrc/core) → PASS; ledger any baseline failure seen in phase 3 task 2's report.Step 5: Commit — "CLI: a Swarm session is a coordinator, an agent or a Buddy; older machines still get the role values they know (project instructions, phase 4, task 13)".
Task 14: The template's workflow end to end, and no dropped refusal left
Files:
Create:
backend/src/superTabs/removedRefusals.test.tsCreate:
backend/integration/superTabWorkflow.test.ts; add it tovitest.super-tabs.config.ts'sincludeStep 1: Write the tests
removedRefusals.testreaches none of the refusals the instructions replaced: no.tsfile underbackend/srcbut*.test.tscontains a quoted'CODE'for:WORKER_DECISION_REQUIRED,LEAD_REQUIRED,REVIEW_OPEN,REVIEW_PENDING,REVIEW_TARGET,CHECKS_PENDING,BRIEF_REQUIRED,INDEPENDENT_REVIEW,REVIEWER_NOT_ASSIGNABLE,REVIEW_GROUP,REVIEWER_NOT_LEAD,ROLE_LEAD,ROLE_NAME,ROLE_UNAVAILABLE,ROLE_KIND,ROLE_IN_USE,ROLE_GONE,OVERRIDE_REASON_REQUIRED,ROUTE_REQUIRED,RULE_BROKEN,REQUIREMENT_UNMET,REVIEW_REFUSED,STEPPED_UP,BUILD_REFUSED,MERGE_RECORDER,TELL_FORBIDDEN,DECISION_FORBIDDEN,MENTION_FORBIDDEN,OWNER_MESSAGE_REQUIRED,WORK_REQUIRED. (ENGINE_UNAVAILABLEstays for signed-out and suspended engines; task 5 pins quota.)superTabWorkflowruns review and test in parallel with no coordinator action between ready and passed, on the pattern ofsuperTabInstructions.test.ts(agents added ontest-host, commandsrun(tab, cmd, host, agentId)): coordinator P, Engineer E (roleName: 'Engineer'), Reviewer V, Tester X. P creates T with checksReview passesandTest passesand assigns E. Then only E, V and X act: E setsreviewwith a result; E creates R and S (reviewOf: T) and assigns V and X (norouteDecisionId); E posts in T naming V and X; V failsReview passeswith a finding and posts it to E; E posts the fix to V; V passes it; X passesTest passes; V and X set their own tasksdone; E posts to PReview and test passed.Assert: every one of those commands succeeded; R and S were both open when the last check passed; T's checks havepassedByagent:Vandagent:X; every delivery P received in the window is a status row (Ready for review,Done) or E's message naming P, never a message between E, V and X; V and X each got E's message and E got V's finding; T'sledger.reviewscounts two verdicts.
Step 2: Run
cd backend && NODE_ENV=test HARNESS_CREDENTIAL_ENCRYPTION_KEY=… npx vitest run src/superTabs/removedRefusals.test.tsandnpx vitest run --config vitest.super-tabs.config.ts integration/superTabWorkflow.test.ts→ PASS (red before tasks 1-6; if either fails now, the task that owns the code fixes it — ledger which).Step 3: Commit — "Swarm: the template's workflow runs end to end by agents alone, and no dropped refusal remains (project instructions, phase 4, task 14)".
Phase 4 validation
Prefix every command with export PATH=~/.harness/runtime/node-v22.23.2-darwin-arm64/bin:$PATH.
- Backend unit:
cd backend && NODE_ENV=test HARNESS_CREDENTIAL_ENCRYPTION_KEY=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= npx vitest run src/superTabs src/middlewares src/routes→ all pass (1907 passed, 5 skipped at 17ee31c30; ledger the new count and the deleted test files and blocks);npx tsc --noEmit -p .clean (npx prisma generatefirst; no schema change is planned). - Integration:
npx vitest run --config vitest.super-tabs.config.ts > integration-phase4.log 2>&1(about 10 minutes); compare the failing set with the 25 baseline failures in the progress file usingcomm: no new failures. Baseline tests this phase deletes or rewrites leave the list (for example superTabTidy's "a review the Swarm opens by itself", superTabLiveness's "a Ready for review while no Reviewer of another engine can start"); ledger each. - CLI:
cd cli && npx vitest run src/superTabs src/lib src/core/agents,npx tsc --noEmit -p ., andnpm run test:core(task 13 changessrc/core/agents/launches.ts). - Scheduler: as task 11, step 4.
- Done when: task 14's two tests pass, task 12's CLI scan passes, and the ledger holds every ruling above with its cost.
- Release: one release with phases 3 and 5, backend first (an old CLI then reads the default policy and its rules commands are folded or ignored; nothing it sends is refused for a rule). Phase 3's prerequisite stands: run the migration in production, with the owner's go, before this release.
Phase 5: Desktop, web and phone
Spec sections: The instruction document (Who changes it, How agents read it), PM notes, Roles, What this replaces in main
("Desktop, web and phone"; the liveness.ts "Waiting on others" line under Role-shaped bookkeeping), Desktop and phone,
Design (Compatibility, Failure, Platforms), Order of work step 5.
Ships in one release with phases 3 and 4: backend first, then the CLI, then Desktop (and the web build, which is Desktop's), then the phone. It builds on phase 2's reads and commands and on phase 4's catalog and route records; it changes no backend or CLI file.
Phase 5 is done when a member who is not the project's owner saves the document from Desktop and the phone shows the
saved revision: task 2's a member who is not the owner saves a change with its summary and task 10's shows the revision a member saved from Desktop pass, and the throwaway-Swarm check under "Phase 5 validation" passes after
release.
Global constraints (phase 5):
<flutter>is/private/tmp/claude-501/-Users-mac-harnesses-openharness/81ec7b2c-c155-4a17-9a7e-2fdf05160aef/scratchpad/flutter/bin/flutter(Flutter 3.47.2). Desktop:cd desktop && <flutter> test <files>; phone:cd mobile && <flutter> test <files>;<flutter> analyze <changed files>in each package.- Format only the Dart files you changed (
dart format <file>…), never a folder. - Desktop tests use the fixtures' memory stores (
ConversationServer,SuperTabLaunchFixture), never real~/.harnessstate, and never call a real CLI logout. NeverpkillFlutter by pattern. - Pick each task's tests by grepping its changed symbols and copy across
desktop/testandmobile/test(grep -rln '<symbol or string>' desktop/test mobile/test), not by file-name prefix; run every hit. python3 scripts/check-ui-style.pypasses after every task that touchesdesktop/lib/super_tabsormobile/lib/swarm. New code uses the roles (DesktopChrome,grid.AppDesktop,AppSpace,AppType): no numericEdgeInsets,fontSizeorBorderRadius.circular, noColor(0x…)orColors.*. When a count falls (a deleted file, a removed padding), runpython3 scripts/check-ui-style.py --updateand commit the smallerscripts/ui-style-allowlist/desktop.jsonormobile.jsonwith the task.- The phone's model reads every field Desktop's model reads (
mobile/test/swarm/desktop_parity_test.dart): a field added todesktop/lib/super_tabs/model.dartis added tomobile/lib/swarm/model.dartin the same task, and a file listed there as a copy pair stays byte-identical on both sides. - Copy follows
docs/naming-system.md: the panel is Instructions; a project's coordinator is called by itscoordinatorName; copy states facts, never a fixed workflow. Frames are the existing ones: Desktop'sSuperTabDetailDialog(title, quiet close, scrolling body, actions),AppMenuItemrows,DesktopChrometext roles; the phone'sSwarmTopBar,SwarmCaption,SwarmGroup,SwarmRow. Screens that work keep their layout; new behavior fills the existing menu, form row, dialog frame and Team list. The mockups below are drawn from the real widgets named in each task and go to the requester with this plan. - Compatibility: an old Desktop on the new backend is phase 4's (its saves are accepted and ignored with a note). A new
Desktop or phone on an older backend (no
coordinatorNameon the project) shows no Instructions, no role field, and sends noroleName; everything else works as today.
Decisions this phase makes (ledger them):
- The web client is Desktop.
website/is the Next.js host; the browser runs Desktop's Flutter app (desktop/lib/web/, samesuper_tabsscreens). The one web-only change is the browser transport's allow-list (desktop/lib/super_tabs/backend_transport.dart_swarmRoute): it gains the three instructions reads and loses the routes nothing calls any more (projects/:id/roles/:id, the account/routing-policy). The tab'srouting-policyread stays: New Project reads the catalog there (phase 4 decision 14). Cost: none. - How a client knows the backend has instructions: the project row carries
coordinatorName(phase 2's head read sets it on every project). Absent → no Instructions item, no Team-tab row, no role field. Inside the panel, a 404 whose code is notNOT_FOUNDis a backend without the route (phase 3 ruling 1) and reads "This Swarm has no project instructions yet." The removed forms are not kept for an older backend. Cost: until the backend is released, a new Desktop on an old backend has no routing form or roles editor; the backend ships first. - A stale save re-reads. On
INSTRUCTIONS_STALEthe panel reads the document again rather than the refusal'sdetails: the native transport goes through the CLI's backend proxy (cli/src/superTabs/wire.tsbackend), which hands back code and message only, and the web transport readserror.code/error.messageonly. The draft stays in the editor, the newer text shows beside it, and the next Save goes on the newer revision. Cost: one extra read. - Restore loads, Save writes. Restore puts the old text in the editor with the summary
Restored revision N.; nothing is written until Save, which goes through the same compare-and-set. Cost: one more click. - Notes heading:
${coordinatorName}'s notes("Product Manager's notes" by default). The spec's Names rule (every PM in copy readscoordinatorName) wins over its literal "PM's notes". Cost: a longer heading. - Roles at start. A free-text field (1-40 characters) with suggestions from the document's role headings: the
###headings inside the first## Rolessection, less the coordinator's own role name. Empty sends nothing and the server names the agent ("Engineer").agent.addcarriesroleName. The daemon payload keeps its keys:swarmRoleisleadfor the coordinator anddevfor every other agent (reviewis no longer sent), andswarmSkillModestays, because phase 4 decision 1 keeps role names off the wire and an older CLI refuses other values; the spec's "sends the role name instead ofswarmRole/swarmSkillMode" is ruled out by it. A journal from an older Desktop still sends itsroleId(phase 4 decision 2 names it). Cost: none for new machines. - Adding a running agent from the picker (
actions.dartaddSuperTabAgent) has no form and sends no role: the server names it. The spec listsactions.dart; nothing there changes. Cost: such an agent is an Engineer by name until a role rename command exists. - Role labels. An agent's label is its
roleName(phase 2's derived value); its badge is the role name, cut to 12 characters with "…" (superTabRoleBadge), and the row's own ellipsis still applies. WithoutroleName(an older backend) the labels and badges are today's (Product Manager/PM, Reviewer/Rev, Engineer/Dev), so old-backend screens and their tests stay as they are. Custom role names from an older backend's role set are no longer shown. Cost: that one case. - Coordinator name in copy. Copy about an existing project reads
project.coordinatorName("Product Manager" when the backend sends none). Copy written before a project exists (New Project on both platforms,lead_placement.dart,new_harness.dart's lead lines,launch.dart's machine checks) keeps "Product Manager", the name every new project starts with. Cost: none. - The roles editor's copies of the CLI skill texts go with it, and with them the byte-for-byte test in
super_tab_project_skills_test.dart. The CLI's texts incli/src/lib/swarmSkills.tsstay (phase 3: what a new CLI runs on an old backend) with no Desktop copy left to keep in step; the team's "syncroles_editor.dart" rule stops applying (tell the controller so the memory note is updated). Cost: none. launch_prompt.dartwas rewritten by phase 3 task 6; nothing here.- Reviews are linked tasks. A task's line lists its linked tasks (
reviewOfit, same project) with their checks' results, from one file kept as a copy pair on both platforms (linked_tasks.dart); no agent kind and no parsedReady:line.review_verdict.dartis deleted on both and leaves the parity list. Thereviewstatus reads "Waiting on others" (spec, Role-shaped bookkeeping).work_details.dartshows the brief as written. Cost: a verdict an agent only posted in chat, without a check, shows nowhere but the chat. - Route rows drop floors and policy order and show the instructions revision from the decision's record
(
record.instructionsRevision, phase 4 decision 12); a record without it shows nothing. Cost: none. - Routing gates in the client. With the catalog in the tab's routing-policy read, New Project's model list rules
nothing out; an older backend's answer (no
catalog) keeps today's refusals, since that server still enforces them. Quota never makes a machine unusable on either platform; an older server's own refusal shows as the start's error. A small or slow local model gets a note instead of losing Get and Run for Swarm. Cost: on an older backend a machine out of quota is refused at Start, not before. - The phone shows the document from its Team tab: an Instructions caption and row after Agents, opening a read-only page. Swarm Home C keeps its two tabs (Tony's design). Cost: one tap further than a tab.
- Panel reads. The document is read when the panel opens and again when the project's
instructionsRevisionornotesRevisionmoves in the Swarm read; history when History opens; one revision's text when it is picked. Nothing is read on a poll. A move while the draft is unchanged replaces the text silently; with unsaved changes it is treated as a stale save (decision 3). Cost: none. - The panel is a dialog in the Swarm's details frame (
SuperTabDetailDialog, 720 wide), opened from the project ⋮ menu's existing Instructions item as today's Instructions dialog is. The frame clamps to the window, so the web's phone-width layout gets the same panel. Cost: the chat is covered while it is open.
Phase 4 assumptions (the draft at .superpowers/sdd/…/phase-4-plan-draft.md; confirm when phase 4 lands): decision 1
(agent_create keeps lead|dev|review|buddy); 2 (roleId names an older client's agent); 3 (old saves accepted,
ignored: true with a note); 9 (checks recorded by anyone, independent stored and unread); 12 (route records carry
instructionsRevision, and GET …/route-decisions/:id returns it in record); 14 (GET /api/super-tabs/:tabId/ routing-policy answers { policy, …, catalog: { models: [{ engine, model, effort, strength, cost, offered, note? }], grid, priors, prices } }); task 1 (leadAction records any agent's { kind, at }, with no actor).
Shared names:
- Copy pair
desktop/lib/super_tabs/instructions_model.dart⇄mobile/lib/swarm/instructions_model.dart(no imports butdart:convert):kInstructionsMaxBytes = 65536,kInstructionsSummaryMax = 200;class SuperTabNote { id, text, askedBy; DateTime at; DateTime? expiresAt };class SuperTabInstructions { projectId; int revision; String? hash; text; bool template; coordinatorName; int notesRevision; List<SuperTabNote> notes };class SuperTabRevision { int revision; String? hash; String summary; ({String kind, String id}) writtenBy; String? askedBy; DateTime at; String? text }(each withfromJson(Map<String, dynamic>));String superTabInstructionsPath(String tabId, String projectId, {bool revisions = false, int? revision});List<String> superTabInstructionRoleNames(String text);bool superTabMissingRoute(String code, int statusCode). - Both models:
SuperTabProject.coordinatorName(String?),.instructionsRevision(int, 0),.notesRevision(int, 0),bool get hasInstructions;SuperTabAgent.roleName(String?). Desktop gainsprojectById(the phone has it). - Both models (tasks 6 and 7):
const kDefaultCoordinatorName = 'Product Manager';String superTabRoleBadge(String roleName);SuperTabSnapshot.roleOf(String agentId) → ({String name, String badge})?;SuperTabSnapshot.coordinatorNameOf(String projectId) → String. desktop/lib/super_tabs/instructions_panel.dart:Future<void> showSuperTabInstructions(BuildContext context, SuperTabController c, String projectId).- Copy pair
desktop/lib/super_tabs/linked_tasks.dart⇄mobile/lib/swarm/linked_tasks.dart(importsmodel.dart):String? superTabLinkedLine(SuperTabSnapshot snapshot, SuperTabConversation group). HarnessLaunchIntegration.roleSuggestions(List<String>?, null hides the field) and.roleName(String?).mobile/lib/swarm/swarm_instructions_page.dart:SwarmInstructionsPage({required SwarmReader reader, required String projectId}).
Review focus (phase 5):
- A viewer opens Instructions: reads the document and the notes, has no Save, no Restore and no Delete. (Tasks 2 and 3.)
- Two members save on the same revision: the second keeps their draft, sees the first one's text, and saves on the new revision; nothing is lost silently. (Task 2.)
- An older backend: no Instructions item, no role field, and no
roleNamekey inagent.add(its strict schema would refuse the join). (Tasks 2 and 5.) - A document of exactly 65,536 bytes saves; one byte more disables Save with a line saying why. (Task 2.)
- The web build: the three instructions reads pass the transport's allow-list; the routes dropped from it are refused before anything is sent. (Task 1.)
Task 1: The instructions model, both platforms, and the web's routes
Files:
- Create:
desktop/lib/super_tabs/instructions_model.dart,mobile/lib/swarm/instructions_model.dart(byte-identical) - Modify:
desktop/lib/super_tabs/model.dart(SuperTabAgent~114-170:roleName;SuperTabProject~321-353: the three fields andhasInstructions;SuperTabSnapshot:projectById) - Modify:
mobile/lib/swarm/model.dart(SuperTabAgent~114,SuperTabProject~357: the same fields) - Modify:
desktop/lib/super_tabs/backend_transport.dart(_swarmRoute~13-25) - Modify:
mobile/test/swarm/desktop_parity_test.dart(_copies: the new pair) - Test: create
desktop/test/super_tab_instructions_model_test.dart;desktop/test/super_tab_backend_transport_test.dart
Interfaces: Produces everything under Shared names' first two bullets. fromJson reads phase 2's answers
(store.ts instructions, instructionRevisions, instructionRevision): at/expiresAt are ISO strings,
writtenBy is { kind: 'person' | 'agent' | 'system', id }, notes is absent for a Buddy (read as empty).
superTabInstructionsPath encodes both ids (/api/super-tabs/<tab>/projects/<project>/instructions, /revisions,
/revisions/<n>). superTabMissingRoute(code, status) is status == 404 && code != 'NOT_FOUND'.
- Step 1: Failing tests
super_tab_instructions_model_testreads the document, its notes and its revisions: a phase 2 answer with revision 3,template: false, two notes (one withexpiresAt) → the fields; one withoutnotes→notesempty; a revisions answer → threeSuperTabRevisions newest first withwrittenBy.kindperson,agent,system.finds the role headings of the Roles section:INSTRUCTIONS_TEMPLATE's shape (## Roleswith### PM,### Engineer,### Reviewer,### Tester, then## Workflowwith a### Step) →['PM', 'Engineer', 'Reviewer', 'Tester']; a heading repeated in another case is listed once; a heading over 40 characters is left out; no## Rolessection →[];## rolesmatches.names the reads:superTabInstructionsPath('t 1', 'p1', revision: 4)→/api/super-tabs/t%201/projects/p1/instructions/revisions/4;superTabMissingRoute('BACKEND_UNAVAILABLE', 404)true,('NOT_FOUND', 404)false,('INSTRUCTIONS_UNAVAILABLE', 503)false.reads the project's instructions fields and the agent's role name: aSuperTabSnapshotfrom a parts read whose project hascoordinatorName: 'Coordinator',instructionsRevision: 7,notesRevision: 2and whose derived agent hasroleName: 'Tester'→ those values,hasInstructionstrue; a project without them → null, 0, 0, false.super_tab_backend_transport_testevery Swarm route the web uses goes to the backend: addGET …/projects/p1/instructions,…/instructions/revisions,…/instructions/revisions/4; remove/api/super-tabs/routing-policy(both methods) and…/projects/p1/roles/r1from it and add them to the refused list.
- Step 2: Run
cd desktop && <flutter> test test/super_tab_instructions_model_test.dart test/super_tab_backend_transport_test.dart→ FAIL (missing library; routes refused);cd mobile && <flutter> test test/swarm/desktop_parity_test.dart→ FAIL once the pair is listed (phone copy missing). - Step 3: Implement the model file, copy it byte for byte to the phone, add the fields to both models and the
routes to
_swarmRoute(projects/$_id/(?:github|github/approve|instructions(?:/revisions(?:/[0-9]+)?)?); the account/routing-policyalternative goes). - Step 4: Run the same → PASS; also
cd mobile && <flutter> test test/swarm/swarm_model_lookups_test.dart. - Step 5: Commit — "Desktop and phone: read a project's instructions, notes and history, and the web may ask for them (project instructions, phase 5, task 1)".
Task 2: The Instructions panel: the document, for every member
Replaces the "Instructions for this project" dialog (skill set picker, Create custom set, Edit custom roles) and the custom roles editor.
Files:
- Create:
desktop/lib/super_tabs/instructions_panel.dart - Modify:
desktop/lib/super_tabs/view.dart(_groupAction~1192:'instructions'opens the panel before the project-lead branch;_options~2187-2193:Instructionsfor every member whenproject.hasInstructions, not only an editable owner) - Modify:
desktop/lib/super_tabs/project_options.dart(delete the'skills'action:mode~104, title ~119, body ~205-290, Save's guard ~312-314 and type ~325-335, theroles_editor.dartimport) - Delete:
desktop/lib/super_tabs/roles_editor.dart,desktop/test/super_tab_project_skills_test.dart - Modify:
desktop/test/support/super_tab_fixture.dart(ConversationServer: instructions reads and commands) - Modify:
scripts/ui-style-allowlist/desktop.json(--update:roles_editor.dartandproject_options.dartfall) - Test: create
desktop/test/super_tab_instructions_test.dart
Interfaces:
- Consumes: task 1's model, paths and
superTabMissingRoute;SuperTabController.request,command,operationErrorCode,canWrite,saving,hasPendingAction;SuperTabDetailDialog,SuperTabDialogScope(requireWrite: false). - Produces:
showSuperTabInstructions; keyssuper-instructions-editor,super-instructions-summary,super-instructions-save,super-instructions-theirs; the fixture'sConversationServer.instructions(Map<String, Map<String, dynamic>>by project id, the GET answer),.instructionRevisions(by project id, newest first, each withtext),.instructionsRoute(bool, default true; false answers GETs withSuperTabFailure('BACKEND_UNAVAILABLE', 'Not Found', statusCode: 404)). Itsinstructions.savebumps the project'sinstructionsRevisioninstate, stores the text and a revision, and refuses a stale base withSuperTabFailure('INSTRUCTIONS_STALE', …, statusCode: 409);note.removedrops the note and bumpsnotesRevision.
Mockups (frame: SuperTabDetailDialog, 720 wide, clamped by the window; real menu: view.dart _options):
Project ⋮ menu, a collaborator Today After
Project details Project details
Update cadence Instructions
Swarm routing Update cadence
Archived conversations Archived conversations
(The owner's menu keeps Rename project, Sharing and Delete Project; Instructions stays where it is.)
┌ Instructions ─────────────────────────────────────────────────────────── ✕ ┐
│ Revision 7 │
│ ┌─────────────────────────────────────────────────────────────────────────┐ │
│ │ ## Roles (mono, │ │
│ │ scrolls │ │
│ │ ### PM inside) │ │
│ │ - Talks with people in the project chat and finds out what they want. │ │
│ │ … │ │
│ └─────────────────────────────────────────────────────────────────────────┘ │
│ ┌ What changed ───────────────────────────────────────────────────────────┐ │
│ │ Reviews run on Opus │ │
│ └─────────────────────────────────────────────────────────────────────────┘ │
│ (task 3: notes here) │
│ [History] [Cancel] [Save] │
└─────────────────────────────────────────────────────────────────────────────┘
After a stale save, the same frame:
│ Revision 8 was saved while you edited. Merge what it says into your text, │
│ then save again. │
│ ┌ your draft (editor) ───────────────────────────────────────────────────┐ │
│ Revision 8, as saved │
│ ┌ their text, read only, selectable ─────────────────────────────────────┐ │
Copy: title Instructions; detail Revision N, or Built-in template at revision 0; summary field What changed
(one line, at most 200 characters); a viewer gets a read-only editor and Close; over the limit
Instructions are limited to 64 KB.; a missing route This Swarm has no project instructions yet.; a failed read its
message and Try again; closing with unsaved changes asks Discard your changes to the instructions?
(Keep editing / Discard).
- Step 1: Failing tests (
super_tab_instructions_test.dart; the project fixture gainscoordinatorName: 'Product Manager',instructionsRevision: 3; accountsowner,peer(collaborator),viewer)shows Instructions to every member and opens the document: aspeerand asviewer, the project ⋮ menu hasInstructions; opening it reads…/projects/lead/instructionsonce and shows the text in the editor andRevision 3.a member who is not the owner saves a change with its summary: aspeer, edit the text, typeReviews run on Opus, tap Save → the last posted command is exactly{type: instructions.save, projectId: lead, baseRevision: 3, text: <edited>, summary: 'Reviews run on Opus'}(noaskedBy); the panel then showsRevision 4and an empty summary; the Swarm read's project hasinstructionsRevision4.Save waits for a change, a summary and the 64 KB limit: unchanged text → Save disabled; changed with an empty summary → disabled; a 65,536-byte text → enabled; 65,537 bytes → disabled and the 64 KB line shows.a stale save keeps the draft and shows the newer text to merge: the server moves to revision 4 (Their line) before Save → after Save, the merge line andsuper-instructions-theirsholdingTheir line, the editor still holding the draft; the next Save sendsbaseRevision: 4.a revision saved elsewhere replaces an unchanged draft: with the panel open and nothing edited, the server saves revision 4 and the controller refreshes → the editor shows revision 4's text, no merge line.a viewer reads and cannot save: asviewerthe editor is read-only, there is no Save and no summary field.an older Swarm shows no Instructions: a project withoutcoordinatorName→ noInstructionsitem;showSuperTabInstructionswithinstructionsRoute = false→This Swarm has no project instructions yet.closing with unsaved changes asks first: edit, tap ✕ → the question;Keep editingkeeps the panel and the draft;Discardcloses it.the skill set picker and the roles editor are gone: asowner, the panel shows none ofDefault — the team process,Create custom set,Edit custom roles.
- Step 2: Run
cd desktop && <flutter> test test/super_tab_instructions_test.dart→ FAIL (no panel; collaborator sees no Instructions). - Step 3: Implement the panel (decisions 2, 3 and 16), the menu, the fixture; delete the old dialog branch, the
roles editor and its test file;
python3 scripts/check-ui-style.py --update. - Step 4: Run
cd desktop && <flutter> test test/super_tab_instructions_test.dart test/super_tab_view_test.dartplus every filegrep -rln "Instructions\|roles_editor\|project.skills\|showProjectAction" desktop/testfinds → PASS;python3 scripts/check-ui-style.py→ PASS. - Step 5: Commit — "Desktop: every member reads and edits the project's instructions in one panel; the skill set picker and the roles editor go (project instructions, phase 5, task 2)".
Task 3: The panel's history and the coordinator's notes
Files:
- Modify:
desktop/lib/super_tabs/instructions_panel.dart - Test:
desktop/test/super_tab_instructions_test.dart
Interfaces: Consumes task 2's panel and fixture (instructionRevisions, notes in instructions[...]['notes']),
relativeAgo (core/relative_time.dart), SuperTabSnapshot.agentName, the people's username. Produces keys
super-revision-<n>, super-revision-text, super-restore, super-note-<id>, super-note-delete-<id>.
Mockups:
┌ Instructions › History ───────────────────────────────────────────────── ✕ ┐
│ Revision 8 dee · 2 h ago · Reviews run on Opus. (lit) │
│ Revision 7 Product Manager for ken · yesterday · Tester runs on the Mac. │
│ Revision 1 Harness · Oct 30 · From the project's roles and rules. │
│ ─────────────────────────────────────────────────────────────────────────── │
│ Revision 7 │
│ ┌ its text, read only, selectable ───────────────────────────────────────┐ │
│ [Back to the instructions] [Restore revision 7] │
└─────────────────────────────────────────────────────────────────────────────┘
Under the summary field, in the document view:
│ Product Manager's notes │
│ Don't use Codex on machine A [Delete] │
│ asked by ken · 3 h ago · until 18:00 │
│ Prefer Kimi K3 for docs [Delete] │
│ asked by dee · yesterday │
Who wrote a revision: a person by username (for <asker> when askedBy is someone else); an agent by its name, or
the coordinator's name when it is gone, then for <asker>; system as Harness. Notes newest first;
asked by <username> · <ago> and · until <local time> when it ends; No notes. when there are none.
- Step 1: Failing tests
History lists revisions newest first with who, when and what changed: revisions 8 (persondee), 7 (agent the coordinator,askedByken), 1 (system) → three rows in that order reading as in the mockup; one read of…/instructions/revisions.a past revision opens read only, and Restore puts it in the editor: tap revision 7 → one read of…/revisions/7, its text insuper-revision-text; tap Restore → the document view with the editor holding revision 7's text and the summaryRestored revision 7.; nothing posted until Save, which sends the current base.a viewer has no Restore.a failed history read says so and reads again: the first read throws →Could not read the history.andTry again, which reads once more.notes show under the document with who asked and when: two notes → the rows above, newest first; none →No notes.; withcoordinatorName: 'Coordinator'the heading isCoordinator's notes.a member deletes a note: aspeer, tap Delete on one → the posted command is{type: note.remove, projectId: lead, noteId: n1}; after the read the row is gone; a viewer has no Delete.
- Step 2: Run
cd desktop && <flutter> test test/super_tab_instructions_test.dart→ FAIL. - Step 3: Implement (decision 4; the notes re-read on a
notesRevisionmove never touches the draft). - Step 4: Run the file → PASS;
python3 scripts/check-ui-style.py→ PASS. - Step 5: Commit — "Desktop: the instructions' history, any revision to read and restore, and the coordinator's notes to read and delete (project instructions, phase 5, task 3)".
Task 4: Routing settings removed
Files:
- Delete:
desktop/lib/super_tabs/routing_policy_form.dart,desktop/lib/super_tabs/routing_policy.dart,desktop/lib/settings/sections/routing_section.dart,desktop/test/routing_policy_test.dart - Modify:
desktop/lib/super_tabs/route_row.dart(deleteshowSuperTabRoutingand_RoutingDialog~198-end and their imports),desktop/lib/super_tabs/view.dart(_groupAction~1194-1197'routing';_options~2196Swarm routing) - Modify:
desktop/lib/settings/settings_section.dart(routing41-45, the Agents group entry ~147-148),13, ~51)desktop/lib/settings/settings_body.dart( - Modify:
scripts/ui-style-allowlist/desktop.json(--update) - Test:
desktop/test/settings_section_test.dart(~41, ~68),desktop/test/super_tab_instructions_test.dart
Mockup (Settings rail, settings_section.dart groups): Agents lists Connectors, Usage; Routing is gone. The
project ⋮ menu has no Swarm routing for anyone (task 2's mockup).
- Step 1: Failing tests:
settings_section_testboth lists dropSettingsSection.routing(the Agents group is[connectors (not web), usage]);super_tab_instructions_testthe project menu has no Swarm routing(owner and collaborator). - Step 2: Run
cd desktop && <flutter> test test/settings_section_test.dart test/super_tab_instructions_test.dart→ FAIL. - Step 3: Delete the files and entries;
python3 scripts/check-ui-style.py --update. - Step 4: Run those files and every hit of
grep -rln "routing\|Routing" desktop/test→ PASS;<flutter> analyze lib/settings lib/super_tabs/route_row.dart lib/super_tabs/view.dartclean. - Step 5: Commit — "Desktop: routing lives in the project's instructions; the routing form, Settings ▸ Routing and Swarm routing go (project instructions, phase 5, task 4)".
Task 5: A free-text role when an agent starts
Files:
- Modify:
desktop/lib/state/harness_launch_integration.dart(deleteHarnessLaunchRole~20-28,roles,roleId,chooseRole~49-66; addroleSuggestions,roleName) - Modify:
desktop/lib/super_tabs/launch.dart(open~68-79 and ~93-96: read the document instead of the custom role set;swarmRole~141-144 and ~191-195:leadordev;prepare~173-182: savesroleName;_prepare~832-848: the role check goes; the join command ~929-936:roleName) - Modify:
desktop/lib/widgets/new_harness_form.dart(_desktopStartEnabled~96-99: no role gate; the Role dropdown ~2575-2614 → the field) - Test:
desktop/test/super_tab_launch_test.dart(replace the custom-role tests ~2355-2616)
Interfaces: Consumes task 1's superTabInstructionRoleNames, superTabInstructionsPath,
SuperTabProject.hasInstructions, SuperTabAgent.roleName, task 2's fixture. Produces roleSuggestions (null for
the coordinator's own start, a new project, or an older backend; [] when the read fails) and roleName (trimmed;
empty is null), saved in the journal as saved['roleName'] and sent as agent.add roleName only when set. The field
is a RawAutocomplete<String> with key new-harness-role, label Role, hint Engineer, at most 40 characters; its
options are AppMenuItem rows, filtered by what is typed (case-insensitive), all of them on focus.
Mockup (the launch actions row, _desktopLaunchActions):
Today (custom role sets only) After (every agent joining a project that has instructions)
┌ Role ─────────┐ ┌ Role ─────────┐
│ Engineer ▾ │ [ Start ] │ Tes| │ [ Start ]
└───────────────┘ ├───────────────┤
│ Tester │ ← the document's role headings
└───────────────┘ (Engineer, Reviewer, Tester), filtered
- Step 1: Failing tests
an agent joining a project takes the role typed: project withcoordinatorName, instructions text the template's shape →roleSuggestions['Engineer', 'Reviewer', 'Tester'](the coordinator'sPMleft out);roleName = 'Tester'→ the join'scommand['roleName'] == 'Tester';agent_create'sswarmRoleisdevand its keys equal today's list (written out in the test).an empty role sends none: noroleNamekey in the join.an older Swarm gets no role field and no roleName: project withoutcoordinatorName→roleSuggestionsnull, no instructions read, noroleNamekey; the form shows nonew-harness-role.a failed instructions read leaves the field free: the read throws →roleSuggestions[], the field shows and takesDesigner.the role field offers the document's roles and takes any text(widget): focusing it lists the three; typingTeleavesTester; choosing it setsroleName; Start is enabled with the field empty.a recovered launch keeps its role: a journal withphase: 'joining'androleName: 'Tester'→ the field showsTesterand the join sends it; a journal with an olderroleIdstill sendsroleId.the coordinator's start is lead: New Project's start →swarmRole: 'lead', no field.
- Step 2: Run
cd desktop && <flutter> test test/super_tab_launch_test.dart→ FAIL. - Step 3: Implement (decisions 6 and 7).
- Step 4: Run the file and every hit of
grep -rln "HarnessLaunchRole\|chooseRole\|roleKind\|new-harness-role\|swarmRole" desktop/test→ PASS. - Step 5: Commit — "Desktop: an agent starts in any role typed, with the project's roles offered (project instructions, phase 5, task 5)".
Task 6: Desktop names agents by role and the coordinator by its project's name for it
Files:
- Modify:
desktop/lib/super_tabs/model.dart: addkDefaultCoordinatorName,superTabRoleBadge,roleOf,coordinatorNameOf;leadProtectionReason~517-521 usescoordinatorNameOf; deleteactiveRoleForAgent~499-515,SuperTabRole~303-320,SuperTabProject.rolesand.skillSet(keepskillMode: decision 6) - Modify (labels and badges →
roleOf):roster.dart~338-352,machines.dart~2012-2026,agent_details.dart~296-302 - Modify (copy →
coordinatorNameOf):view.dart~234 ((<coordinator's badge>) → you), ~2983 (Discuss the plan with <name>.), ~2985 (say 'send to the <name>' when it's ready);agent_group_picker.dart~126;decisions_view.dart~190 (<name> decided), ~241 (Let <name> decide);project_options.dart~62 (the row's label), ~180 (<name> gathers new task reports while work is active.), ~400 (Its <name>'s session…);machines.dart~1485, ~1537 (The open task “X” loses its agent.), ~2169 (Add a machine for this Swarm's agents to use.);workspace.dart~491;buddies.dart~205 - Modify:
task_status.dart~82-84:assign→Reassigned,route→Routed again,start→Starting another agent,post→Answered(facts: any agent may act now) - Test: create
desktop/test/super_tab_role_names_test.dart;super_tab_roster_test.dart,super_tab_decisions_test.dart,super_tab_task_status_test.dart,super_tab_buddies_test.dart,super_tab_sidebar_test.dart,support/super_tab_fixture.dart(its copy line)
Interfaces: Consumes task 1's fields. superTabRoleBadge(name): the name when 12 characters or fewer, else its
first 11 characters and …. roleOf(id): null for an unknown agent or a Buddy; with roleName →
(name: roleName, badge: superTabRoleBadge(roleName)); without (older backend) today's pairs
(Product Manager/PM for a coordinator, Reviewer/Rev for role: 'reviewer', Engineer/Dev).
coordinatorNameOf(projectId): the project's coordinatorName, else kDefaultCoordinatorName.
Mockup (members pane row, roster.dart _agentIdentity): Ivy [Rev] lamp-os → Ivy [Tester] lamp-os;
Atlas [PM] stays [PM] (the coordinator's role name in the template); hovering says Ivy · Tester · lamp-os · ….
- Step 1: Failing tests
super_tab_role_names_testnames an agent by its role and the coordinator by its project:roleName: 'Tester'→(Tester, Tester);'Quality assurance lead'→ badgeQuality ass…; noroleName→ today's three pairs; a Buddy → null;coordinatorName: 'Coordinator'→coordinatorNameOfCoordinator, none →Product Manager.super_tab_roster_testshows the role an agent goes by: a fixture agent withroleName: 'Tester'→ its chipTesterand its tooltip… · Tester · …; agents without one keepDev/Rev/PM.super_tab_decisions_test: withcoordinatorName: 'Coordinator', a delegated decision readsCoordinator decided:and the buttonLet Coordinator decide(existingPM decidedassertions becomeProduct Manager decided).super_tab_task_status_test: the four facts above replacePM reassigned it,PM retrying,PM posted.- The Buddy and sidebar copy tests take the new lines.
- Step 2: Run
cd desktop && <flutter> test test/super_tab_role_names_test.dart test/super_tab_roster_test.dart test/super_tab_decisions_test.dart test/super_tab_task_status_test.dart test/super_tab_buddies_test.dart test/super_tab_sidebar_test.dart→ FAIL. - Step 3: Implement (decisions 8 and 9).
- Step 4: Run those and every hit of
grep -rln "activeRoleForAgent\|SuperTabRole\b\|skillSet\|Product Manager\|PM decided\|Let PM\|PM reassigned\|(PM) → you" desktop/test→ PASS;python3 scripts/check-ui-style.py→ PASS. - Step 5: Commit — "Desktop: agents show the role they go by, and copy calls the coordinator what its project calls it (project instructions, phase 5, task 6)".
Task 7: The phone names agents by role and the coordinator by its project's name for it
Files:
- Modify:
mobile/lib/swarm/model.dart: the same four names as task 6;leadProtectionReason~573-577; deleteactiveRoleForAgent~557-571,SuperTabRole~339-356,roles,skillSet - Modify:
swarm_conversation_page.dart~1163-1166 ((<badge>) → you),swarmAgentRole~2176-2182 (roleOf(id)?.badge), ~2481 (pm:);swarm_message_row.dart~389 andswarm_thread_line.dart~56:pm:issnapshot.isLead(authorId), never the label;swarm_project_page.dart~1002-1008;swarm_machines.dart~300-306;swarm_task_status.dart~129-131 (task 6's four facts, word for word) - Test: create
mobile/test/swarm/swarm_role_names_test.dart;swarm_chat_test.dart,swarm_thread_line_faces_test.dart,swarm_task_status_test.dart,swarm_task_rows_test.dart,swarm_buddy_chat_test.dart,swarm_machines_test.dart,desktop_parity_test.dart
Interfaces: Consumes task 1's fields; must run after task 6 (the parity test compares the models' reads).
- Step 1: Failing tests
swarm_role_names_test: the same cases as task 6's model test, on the phone's model.swarm_thread_line_faces_testkeeps the coordinator's face whatever its role is called: a coordinator withroleName: 'Coordinator'→SwarmChatAvatar.pmtrue and the badgeCoordinator; a non-coordinator withroleName: 'PM'→pmfalse.swarm_chat_test: a Tester's message header showsTester.swarm_task_status_test/swarm_task_rows_test: the four facts.
- Step 2: Run
cd mobile && <flutter> test test/swarm/swarm_role_names_test.dart test/swarm/swarm_thread_line_faces_test.dart test/swarm/swarm_chat_test.dart test/swarm/swarm_task_status_test.dart test/swarm/swarm_task_rows_test.dart→ FAIL. - Step 3: Implement.
- Step 4: Run those,
test/swarm/desktop_parity_test.dart, and every hit ofgrep -rln "'PM'\|'Rev'\|'Dev'\|activeRoleForAgent\|PM reassigned" mobile/test→ PASS. - Step 5: Commit — "Phone: agents show the role they go by, and the coordinator keeps its face whatever it is called (project instructions, phase 5, task 7)".
Task 8: Reviews are a task's linked tasks, on both platforms
Files:
- Create:
desktop/lib/super_tabs/linked_tasks.dart,mobile/lib/swarm/linked_tasks.dart(byte-identical) - Delete:
desktop/lib/super_tabs/review_verdict.dart,mobile/lib/swarm/review_verdict.dart - Modify:
desktop/lib/super_tabs/controller.dart(reviewLine~1383-1420 →linkedLine(group), delegating);live_card.dart~92,work_details.dart~63,view.dart~1983 (keysuper-linked-line) - Modify: both
model.dart: deletereviewers()andisReviewer - Modify:
mobile/lib/swarm/swarm_live_card_facts.dart(swarmReviewLine~22-66 goes;SwarmCardFacts.reviewfromsuperTabLinkedLine; parameters left unused go) - Modify ("Waiting on others" for the
reviewstatus, with the agent's note where the row shows one): desktoplive_card.dart~18,task_status.dart~96,agent_details.dart~152-155; phoneswarm_live_card_facts.dart~14,swarm_task_status.dart~146,swarm_project_team.dart~120,team_glance.dart~173 - Modify:
desktop/lib/super_tabs/work_details.dart(~41-61: the brief as written, never the five sections; empty:This task has no description yet.; ~82-83:Requires an independent check.goes) - Modify:
mobile/test/swarm/desktop_parity_test.dart(_copies: thereview_verdict.dartpair out,linked_tasks.dartin) - Test: rewrite
desktop/test/super_tab_review_test.dart;super_tab_live_card_test.dart,super_tab_work_details_test.dart,super_tab_task_status_test.dart;mobile/test/swarm/swarm_live_card_test.dart,swarm_task_status_test.dart,swarm_project_team_test.dart,team_glance_test.dart
Interfaces: superTabLinkedLine(snapshot, group): the conversations with reviewOf == group.id, of
group.projectId, kind == null, lowest number first, each ${linked.label}: ${state}, joined by ·; null when
there are none. state: no checks → superTabWorkStatusLabel(assignment status) or not started; any failed (evidence
set, passedBy null) → 1 check failed / N checks failed; all passed → passed; else P of N checks passed.
Mockup (chat header subtitle, view.dart _subtitle, and the live card's last line):
Reviewer: Ivy · Ready: yes on 1a2b3c4d5 → #14 Review PR 12: passed · #15 Test PR 12: 1 check failed.
- Step 1: Failing tests
super_tab_review_testlists a task's linked tasks with their checks' results: task 12 with linked 14 (one check passed) and 15 (two checks, one failed) → the mockup's line insuper-linked-line; a linked task of another project or a Buddy chat naming it → left out; no linked task → no line; an agent'sReady: yesmessage in the chat changes nothing.work details repeat the linked line and show the brief as written: a five-part brief reads as its text;Requires an independent check.is nowhere.super_tab_live_card_test/swarm_live_card_test: the card's last line is the linked line (theReviewer: Ivy · Ready: …expectations go).- The status tests on both:
reviewreadsWaiting on others.
- Step 2: Run
cd desktop && <flutter> test test/super_tab_review_test.dart test/super_tab_live_card_test.dart test/super_tab_work_details_test.dart test/super_tab_task_status_test.dartandcd mobile && <flutter> test test/swarm/swarm_live_card_test.dart test/swarm/swarm_task_status_test.dart test/swarm/swarm_project_team_test.dart test/swarm/team_glance_test.dart test/swarm/desktop_parity_test.dart→ FAIL. - Step 3: Implement (decision 12).
- Step 4: Run those and every hit of
grep -rln "reviewLine\|swarmReviewLine\|parseSuperTabVerdict\|isReviewer\|reviewers(\|In review\|Waiting for review\|independent check" desktop/test mobile/test→ PASS;python3 scripts/check-ui-style.py→ PASS. - Step 5: Commit — "Desktop and phone: a task shows its linked tasks and their checks, not reviewers by kind (project instructions, phase 5, task 8)".
Task 9: Routing in the clients is information
Files:
- Modify:
desktop/lib/super_tabs/route_row.dart(_how~49-57:jev→Jev N%,only→Only available candidate, otherwiseRanked by strength, price and quota; the floor chip ~129-137 and ~177-178 go; details addRelied on instructions revision N, orRelied on the built-in instructionsfor 0) - Modify:
desktop/lib/super_tabs/model.dart(SuperTabRoute~737-785:belowFloorandfallbackgo) - Modify:
desktop/lib/state/lead_placement.dart(_engineRefusal~136-138: the quota line goes;LeadModelList.of~275 takes the read's whole answer: withcatalog, an empty list) - Modify:
desktop/lib/super_tabs/launch.dart(readRoutingPolicy~570-582 returns the answer; ~91) - Modify:
desktop/lib/super_tabs/machines.dart(~1094 and_noQuotaLeft~2423-2425:No quota left until it resets.as information, never struck through) - Modify:
desktop/lib/models/coding_model.dart(codingRefusal29 →539-556: thecodingNote, same rule; text… usually needs 7B or more, no "Builders"),desktop/lib/state/swarm_search.dart(capablegate goes),desktop/lib/widgets/swarm_resource_preview.dart(1881-1887, ~2029, ~2033-2037, ~2082: facts about "agents in this Swarm", the note without "Not offered to Builders"),204-205:desktop/lib/super_tabs/local_models.dart(Agents in this Swarm can then run on them, at no subscription cost.) - Modify:
mobile/lib/swarm/swarm_new_project_sheet.dart(swarmLeadEngineRefusals~185-187: the quota line goes;swarmLeadModelListRefusals~197 takes the answer: withcatalog, none; the read ~1148-1155 passes the answer) - Test:
desktop/test/super_tab_route_test.dart,super_tab_launch_test.dart(1294),2979),swarm_creation_form_test.dart,super_tab_machines_test.dart(coding_model_test.dart,swarm_search_test.dart,swarm_search_preview_test.dart;mobile/test/swarm/swarm_new_project_test.dart
Interfaces: Consumes phase 4's catalog read and route record (Phase 4 assumptions). codingNote(LocalModel) → String?.
Mockup (a route row's details, route_row.dart):
Today After
Routed to Ivy Below quality floor Details Routed to Ivy Details
Ivy · Claude opus high · Mac Studio Ivy · Claude opus high · Mac Studio
Selection: Policy order (Jev unsure) Selection: Ranked by strength, price and quota
Quality floor 3 Relied on instructions revision 7
Policy notes applied Considered …
Considered …
- Step 1: Failing tests
super_tab_route_testshows what a route relied on, never floors: a route withbelowFloor: true,fallback: 'unsure'and a record withfloor: 3,notes: true,instructionsRevision: 7→ none ofBelow quality floor,Policy order,Quality floor,Policy notes applied;Relied on instructions revision 7; 0 →Relied on the built-in instructions; no field → no such line.swarm_creation_form_testNew Project rules out no model when the Swarm sends its catalog: an answer withcatalogand a policy turning Codex off → Codex enabled, no refusal line; withoutcatalog→ today's refusal.super_tab_launch_test~1294 /swarm_new_project_test: a machine whose engine is at 100% stays startable on both platforms.super_tab_machines_test~2979: the engine row readsNo quota left until it resets., not struck.coding_model_test:codingNotekeeps the rule and its text has noBuilders;swarm_search_test: a 3B local model offersGetandRun for Swarm, and its preview carries the note.
- Step 2: Run
cd desktop && <flutter> test test/super_tab_route_test.dart test/swarm_creation_form_test.dart test/super_tab_launch_test.dart test/super_tab_machines_test.dart test/coding_model_test.dart test/swarm_search_test.dart test/swarm_search_preview_test.dartandcd mobile && <flutter> test test/swarm/swarm_new_project_test.dart→ FAIL. - Step 3: Implement (decisions 13 and 14).
- Step 4: Run those and every hit of
grep -rln "belowFloor\|codingRefusal\|no quota left\|LeadModelList\|swarmLeadModelListRefusals\|Policy order\|Builders" desktop/test mobile/test→ PASS;python3 scripts/check-ui-style.py→ PASS (route_row's count falls:--update). - Step 5: Commit — "Desktop and phone: routes, models and quota are information; nothing is refused for a floor, a model list or quota (project instructions, phase 5, task 9)".
Task 10: The phone shows the instructions, read only
Files:
- Create:
mobile/lib/swarm/swarm_instructions_page.dart - Modify:
mobile/lib/swarm/swarm_project_team.dart(after the Agents group ~460: anInstructionscaption and oneSwarmRow, only whenproject.hasInstructions) - Test: create
mobile/test/swarm/swarm_instructions_page_test.dart;mobile/test/swarm/swarm_project_c_test.dart
Interfaces: Consumes task 1's copy pair and fields, SwarmReader.request/tabId, phoneRoute, swarmTextParts
and SwarmCodeBlock (the chat's text and code), core/relative_time.dart. The page reads the document on open and
again when the project's instructionsRevision or notesRevision moves in the reader; pull to refresh reads again.
Keys swarm-team-instructions (the row), swarm-instructions-text, swarm-instructions-note-<id>.
Mockups (Team tab, Swarm Home C, swarm_project_team.dart; the page in SwarmTopBar with a back button):
Team tab Instructions page
TASKS · 2 working ‹ Instructions
… #lamp-os · revision 7
HUMANS ─────────────────────────────────
… ## Roles
AGENTS · 2 working ### PM
… - Talks with people in the project
INSTRUCTIONS ← new chat and finds out what they want.
┌───────────────────────────────┐ … (selectable)
│ Instructions › │
│ Revision 7 │ PRODUCT MANAGER'S NOTES
└───────────────────────────────┘ Don't use Codex on machine A
asked by ken · 3 h ago · until 18:00
Change them in Harness on a computer,
or ask Product Manager in the project
chat.
Copy: the row's detail Revision N, or Built-in template at 0; notes heading ${coordinatorName}'s notes, No notes. when none; a missing route This Swarm has no project instructions yet.; a failed read its message and Try again.
- Step 1: Failing tests
swarm_project_c_testTeam lists the instructions after the agents: a project withcoordinatorNameandinstructionsRevision: 7→swarm-team-instructionsreadingRevision 7, below the Agents caption; tapping it opens the page; a project withoutcoordinatorName→ no row.swarm_instructions_page_testshows the document and the notes, read only: one read of…/projects/p1/instructions; the text inswarm-instructions-text, a fenced block as a code block; two notes newest first with who and when; no field, no button that writes;No notes.with none.shows the revision a member saved from Desktop(the done check's phone half): open at revision 3; the next Swarm read moves the project to 4 and the route answers revision 4's text → the page shows it without reopening, after exactly one more read.a backend without instructions says so: the route throwsSuperTabFailure('BACKEND_UNAVAILABLE', …, statusCode: 404)→ the missing-route line; a 503 → its message andTry again.
- Step 2: Run
cd mobile && <flutter> test test/swarm/swarm_instructions_page_test.dart test/swarm/swarm_project_c_test.dart→ FAIL. - Step 3: Implement (decision 15).
- Step 4: Run those,
test/swarm/swarm_project_team_test.dartandtest/swarm/swarm_project_c_shots_test.dart→ PASS;python3 scripts/check-ui-style.py→ PASS. - Step 5: Commit — "Phone: a project's Team opens its instructions and the coordinator's notes, read only (project instructions, phase 5, task 10)".
Phase 5 validation
Run once the ten tasks are in, from the worktree:
- Desktop:
cd desktop && <flutter> analyze(whole package: files were deleted) andmake -C .. desktop-test(the bounded VM suite; a broad change tosuper_tabs); compare any failure with a run of the same suite on the phase's base commit before calling it new. - Phone:
cd mobile && <flutter> analyzeand<flutter> test test/swarm test/phone/phone_shell_swarm_link_test.dart. python3 scripts/check-ui-style.py→ PASS, and its allowlists only shrank (--againstthe base branch).grep -rn "Swarm routing\|routing_policy\|roles_editor\|activeRoleForAgent\|parseSuperTabVerdict\|belowFloor\|codingRefusal" desktop/lib mobile/lib→ nothing.- Screenshots for the PR (design system UI checklist): the panel's document, merge and history views, the role field
with its suggestions, a roster row with a role badge, the phone's Team row and page; light and dark, 200% text, an
empty and a failed state each; through the existing capture helpers (
desktop/test/support/capture.dart, the phone's*_shots_test.dart). Paste the UI checklist into the PR with what each item covered. - Done when: task 2's
a member who is not the owner saves a change with its summaryand task 10'sshows the revision a member saved from Desktoppass; then, after the release, an agent runs the check on a throwaway Swarm (the team's rule for checks needing the new backend), removed afterwards: a collaborator who is not the owner saves a change from Desktop; the phone, signed in as a member, shows the new revision's text and the project chat shows the save's line. - Release: with phases 3 and 4, in that order: backend, CLI, then Desktop (
make release-desktop ARGS="--prepare"from the final branch while checks run; merge and release only after they pass), then the phone permobile/RELEASE.md. Phase 3's prerequisite stands: the migration runs in production, with the owner's go, before these clients ship.
Phase 6: docs
Spec sections: the inventory's Docs list; Agents message each other; Server notices to the coordinator; The instruction
document; PM notes; Roles; Routing; The nightly routing reflection; Design; Order of work step 6. Docs only: no code, test or
script changes, and no change to a file outside docs/.
Phase 6 follows the release of phases 3-5 (or is written against their merged code), since it states what shipped. Each task reads the merged code or the phase's Decisions ledger for facts and never invents a name; where a doc and the code differ, the code wins and the task says so in its report.
Phase 6 is done when docs/swarms.md describes the instruction document, messaging and notices, and no section of it
still says the server enforces a role, a routing rule or a review rule; and every replaced plan carries a "Replaced by
2026-10-30-project-instructions-design.md" line (Task 3's greps).
Decisions this phase makes (ledger them):
- Extend, do not duplicate.
docs/swarms.mdalready has "Messages between agents" (phase 1) and "Instructions" (phase 2, with its Design checklist). Each is rewritten in place to state the shipped behavior and its "phase N" / "nothing reads them yet" wording removed. The new section is "Notices to the coordinator" only. Cost: none. - The Routing section is rewritten to the new shape, not appended to. The sections that describe enforcement (grid
models, builds at the top tier, no Haiku/Sonnet by default, stepping up, reviews and their floors) are removed as rules;
what survives is stated as advice and catalog data (Task 1 lists each). Cost: the 2026-10-30 owner rulings (Ken and Dee)
are no longer in
swarms.md; they live on in the template text and the catalog, and in the replaced plans. - Plans are marked, not edited. A replaced plan or spec gets one blockquote line under its title and nothing else changes, so history stays readable. Cost: none.
- Role words. On screen the coordinator is the project's
coordinatorName(default Product Manager); prose inswarms.mdsays "product manager" for the default and "coordinator" for the server concept, never "Lead" for the agent. "Lead" stays only in the Leads conversation and in quoted system names (lead.start,leadChoices,leadin the wire role). Cost: none. - The
docs/naming-system.mdrole table keeps its three rows (Product Manager, Engineer, Reviewer) as the template's default roles, marked as defaults a project's document may rename or replace; the system names becomecoordinator,agent,buddywith the wire values noted. Cost: none. - No link checker exists in the repo (no
scripts/or Makefile target; CI has no markdown link job). Each task checks the relative links it touches with thelsscript in its verification step instead. Cost: none.
Review focus (phase 6):
- A doc still says the server refuses a start, assignment or pick on a quality floor, a grid-model rule, an owner rule or a
role (
REVIEWER_NOT_LEAD,LEAD_REQUIRED,RULE_BROKEN,REVIEW_REFUSED,STEPPED_UP,BUILD_REFUSED,INDEPENDENT_REVIEW,REVIEWER_NOT_ASSIGNABLE,REVIEW_GROUP). (Task 1 grep.) - A doc names a command, field, code or file that does not exist in merged code (
rule.setdescribed as a feature, theharness super-tab instructionscommand misnamed,COORDINATOR_REQUIRED). (Each task's "names exist" step.) - Old-client behavior is described as new-client behavior (an old Desktop's role-set or policy save is accepted and ignored, not applied). (Task 1.)
- The sentence "a notice period" or "delayed delivery of notices" survives: notices are delivered at once. (Task 1 grep.)
- A plan marked replaced is one the design says nothing about, or a replaced plan is missed (the spec's list is nine files plus two edits). (Task 3 greps.)
Task 1: docs/swarms.md describes the instruction document, messaging, notices and routing as advice
Files: Modify docs/swarms.md only.
What each section must say (state facts in the present tense; keep each section's existing Design checklist, updated; sections not listed are only swept for the words in Step 3):
- Starting work (lines ~11-36): the project's first agent is its coordinator; people usually work through it; the
project menu has Instructions where it had "Swarm routing" (Desktop and web; the phone shows the document read-only).
The lead's name is the project's
coordinatorName. - People, agents and machines (~38-170): an agent carries a role name chosen when it is started (free text, 40
characters; empty is named by the server "Engineer"); the roster shows the role name; any agent of the project may create,
assign and start tasks and agents (access and facts bind them: project membership, machine slots, the starts-pending cap);
the settings of the Swarm (
tab.rename,tab.pause,project.report, who coordinates) stay the coordinator's or a person's (COORDINATOR_REQUIRED). Remove "The lead's routing policy still determines eligible engines". - Buddies (~190-340): a Buddy reads the document as its member's helper, never the history or the notes, and changes it only by asking the coordinator; its Swarm read shows no machines, starts or routing rows (as today, reword "routing rules").
- Leaderboard (
342-408) and Cost records (500-575): review credit goes to whoever passes a check on another agent's task, whatever its role name; "the kind of job the Lead gave" reads "the coordinator gave". - Avatars, status and celebrations (~575-628): role names and the coordinator's name as shown; the phone's coordinator avatar does not depend on the label.
- Routing (~410-498), rewritten whole, in this order:
- Advice, not rules.
harness super-tab routeranks candidates for the coordinator, or whichever role the document gives routing to. It leaves out only facts (machine offline, removed or paused; engine signed out or suspended; a model the machine does not serve) and ranks the rest by strength, price, quota fit and idle agents. The document says what the project prefers; where it says nothing the route's order stands. A route decision records the document revision it relied on (server-stamped). A person or the coordinator may follow any candidate; overriding needs no reason. - The model catalog: a reviewed, read-only list in the backend (
catalog.tsMODEL_CATALOG) of each engine's models and offered efforts with a strength rating, served to the CLI in the tab's routing-policy read beside priors and prices. Name the default offered rows as the code has them (Opus high and xhigh, Codex default, GPT-6.1 Sol, Astra xhigh; Sonnet and Haiku listed, not offered). A model a member names that is not listed may still be started and is shown unrated. Grid models keep their built-in ratings as catalog data (Kimi K3 and DeepSeek v4.1 2; others 1). Adding a model is a data change. Point todocs/benchmark-priors.md. - What the server no longer does: no floors for builds, reviews or grid models, no step-up and no cancelling of a
Builder, no owner rules, no task requirements (
TaskRequirementis stored, not enforced), no automatic review step. A failed first review on a grid model, a failed grid start and a failed start are notices to the coordinator with the failure, the model and the findings; the document's workflow says what happens next. - Old clients: an old Desktop's or CLI's
rule.setappends its words to the document's Routing section as a new revision (an agent's with no person behind it is refusedASKED_BY_REQUIRED);rule.remove,tab.routingPolicy,project.skillsandproject.roles.*are accepted, store nothing and answerignored: true(phase 4 decision 3). - The nightly routing reflection: proposals up to three; a Yes means the coordinator writes the approved change as one
fixed Routing line in the document (announced like any save,
askedBythe owner); the reflection reads the document and reports a proposal whose line is already there with how the last 7 days ran. The approved list, its nightly reminder and the lapsed-approval recall are gone (phase 4 decision 21). - Design block: rewrite each line (Growth: catalog is code, route records one revision number; Concurrency: none new; Compatibility: old clients above; Migration and rollback: additive, old policy rows stay unread; Failure: a route that lists nothing says which fact removed each candidate; Platforms: CLI reads, server-side the same everywhere).
- Advice, not rules.
- Messages between agents (~643-682): keep the existing bullets and Design, and add: a post that names no one is never
lost, it is posted and reaches the coordinator as a notice (the 10-29 alarm that reached no one for 4 h 50 min); a person's
message is unchanged; the loop notice names the pair and holds nothing; the coordinator's unnamed posts to its assigned
agent keep their bounce limit (
leadWorkerBouncedstays, phase 4 decision 23); the command isharness super-tab post GROUP TEXT OPERATION_ID --to AGENT, with the exact usage copied fromharness super-tab help. - New section "Notices to the coordinator", placed right after "Messages between agents": what is a notice (a task's
status change, a task lost or stalled, a failed start with the model asked for, a failed first review on a grid model, a
terminal alert, a recording gap, an idle agent, a possible loop, an agent's post that named no one, a review-capacity
note) and what is not (a person's message, a Buddy proposal, an agent's message that names the coordinator); delivered at
once, there is no notice period; idle means in no task with active work for 15 minutes, reported once per idle spell,
and the server stops no agent (the document says whether the coordinator stops or keeps it;
tab.tidygoverns only auto-archive); the update cadence and daily digest are unchanged; the 24-hour measurement (486 messages to the PM, 198 copies, 63 notices) as the reason. Include a Design block. - Instructions (~684-766), rewritten from "phase 2 adds the data" to the feature as shipped:
- The document: Markdown, 64 KB, one per project, free text; the template suggests Roles, Workflow and Routing with
one heading per role (nothing parses them); it is what agents read, in two skills (Harness tools and Project
instructions), which refresh within a roster pass of a save, with one notice per pass for the newest revision;
harness super-tab instructions [PROJECT]androuteprint it with the PM's notes. An agent in no project and a backend without the route keep today's role file (INSTRUCTIONS_UNAVAILABLE). - Who changes it: any member who can read the project edits it in the Instructions panel on Desktop and web, or asks
the coordinator in the project chat or through their Buddy; the phone shows it read-only. A stale save is refused
(
INSTRUCTIONS_STALE) and the panel reads again and keeps the draft; Restore loads an old revision into the editor and Save writes it. Each save posts one line in the project chat. When a request contradicts the document the coordinator changes it, says so and tells the author of the replaced line. - Every project has a coordinator, created with the project, never removable by the document; the document may rename
it (
coordinatorName, default "Product Manager") and say what it does. A document with no coordinator section leaves it running on the template's part. - Roles are names. The server stores a role name, parses nothing and refuses nothing against the document; an agent whose role is not in the document says so to the coordinator. Its first start from New Project keeps the machine choice and the built-in model default.
- PM's notes (heading
${coordinatorName}'s notesin the panel): the coordinator writes them freely, without chat line; every member sees them and can delete one; 1-300 characters, at most 100, expiring; the coordinator follows the newer of note and document; they are not in the instructions skill file. - The template in one paragraph: what its Workflow does with no coordinator action between "ready" and "passed" (the agent whose work is ready opens its own linked review; a reviewer, not the agent that did the work, passes the verdict; test and review in parallel; idle Engineers stopped, Reviewers and Testers kept while the checked work is open).
- Older projects: keep the migration paragraph; add the release prerequisite (migration run before clients ship).
- Design block: keep and update (Compatibility now includes the old-client behaviors in Routing; Failure adds the panel's no-route message "This Swarm has no project instructions yet.").
- The document: Markdown, 64 KB, one per project, free text; the template suggests Roles, Workflow and Routing with
one heading per role (nothing parses them); it is what agents read, in two skills (Harness tools and Project
instructions), which refresh within a roster pass of a save, with one notice per pass for the newest revision;
- Compatibility and rollout (~820 on): add one entry per release note the phases left (the order backend, CLI, Desktop,
phone; a new client on an older backend shows no Instructions and sends no
roleName; an older CLI on a newer backend).
Interfaces: Consumes the merged names in phases 2-5 (copy them from the code, not from this plan): routes under
/api/super-tabs/:tabId/projects/:projectId/instructions, commands instructions.save, note.add, note.remove,
project.coordinatorName, codes INSTRUCTIONS_STALE, INSTRUCTIONS_UNAVAILABLE, COORDINATOR_REQUIRED,
ASKED_BY_REQUIRED, INVALID_RECIPIENT. Produces: the anchors #instructions, #notices-to-the-coordinator,
#messages-between-agents, #routing, which Task 2 links to.
- Step 1: Names exist. For every command, code, route, field and file named in the bullets above, grep it in
backend/src,cli/srcanddesktop/lib; list any that is missing and use the merged name (or drop the sentence). Checkharness super-tab helpfor thepost --to,instructionsandrouteusage. - Step 2: Write the sections above. Keep the file's style (80-column wrap,
Design:lists with the ten rule-1 lines fromdocs/feature-design-rules.md, each answered or "N/A because"). - Step 3: Sweep greps (each must print nothing, or only the lines this task keeps on purpose and lists in its report):
grep -n -E "quality floor|Below quality|step(s|ping)? up|forbidModel|noGridFirst|hard rule|soft rule|owner's rules|REVIEWER_NOT_LEAD|LEAD_REQUIRED|RULE_BROKEN|REVIEW_REFUSED|STEPPED_UP|BUILD_REFUSED|INDEPENDENT_REVIEW|REVIEWER_NOT_ASSIGNABLE|REVIEW_GROUP|never reviews it|rates? Sonnet|No Sonnet|No Haiku|Builds at the top tier" docs/swarms.md;grep -n -i -E "notice period|until phase|nothing reads them yet|work as before until" docs/swarms.md;grep -n -E "\bthe Lead\b|\blead's\b|project lead" docs/swarms.md(remaining hits are only the Leads conversation,lead.start,leadChoicesand wire names). - Step 4: Copy check against
docs/naming-system.md:grep -n -E "\bBuilder\b|\bLead\b" docs/swarms.mdleaves only system names in code spans and the Leads conversation; user-visible names are Product Manager (or the project's name for it), Engineer, Reviewer, Instructions, workgroup. - Step 5: Links.
grep -o -E "\]\([^)#]+\.(md|png)" docs/swarms.md | sed 's/](//' | sort -uthenlseach path relative todocs/; every one exists. - Step 6: Commit
Docs: swarms.md describes the instruction document, messaging, notices and routing as advice (project instructions, phase 6, task 1)
Task 2: The other docs the inventory names
Files: Modify docs/naming-system.md, docs/feature-design-rules.md, docs/benchmark-priors.md,
docs/pr-triage/roles.md, docs/specs/2026-10-30-buddy-read-access.md.
docs/naming-system.md: (a) the table row Instructions (line ~59): the visible name for a project's instruction document (and, on an older backend, its skill set); system name: instructions (skill: the two agent skillsswarm-toolsandswarm-instructions); example "Open Instructions; edit the Reviewer section." (b) the Product Manager row: the agent coordinating a Swarm project; a project may name it otherwise, and then that name replaces Product Manager and PM everywhere on screen; system name: coordinator (the saved/wire value stayslead). (c) the three-role table (line ~78): relabel it "The template's roles"; columns On screen / Short label / System name / Skill become Product Manager / PM / coordinator (wirelead) /swarm-instructions; Engineer / Dev / agent (wiredev); Reviewer / Rev / agent (wirereview, sent only for an older client's start); add one sentence: roles are names in the project's document; the server checks none of them; badges show the role name cut to 12 characters. (d) line ~87 and ~152: the sentence "The Lead does only answers, lookups and work under 15 minutes" and "The storedleadandbuilderrouting roles" are replaced by the compatibility fact (wire valueslead | dev | review | buddystay for older CLIs). (e) Add a Notice row: a message the server posts to the coordinator about what happened; example "Atlas's task is Ready for review."docs/feature-design-rules.mdline 164:Reviewer (another engine)becomesReviewer; the guide says nothing else about the other-engine rule (grep -n "another engine"shows no other hit after the edit). Do not touch the rest.docs/benchmark-priors.md"Owner override" (lines ~40-44): the override now lives in the model catalog (catalog.ts) and the Routing section of a project's document: a project that wants a model rated differently says so in words there;priorOverridesrows in a saved policy are read by nothing (phase 4 decision 3). Say which of the two the code does by readingbackend/src/superTabs/catalog.tsandcosts/first; ifpriorOverridesis still read by the catalog, keep the section and change only its "routing policy" wording.docs/pr-triage/roles.md: the file says "choose Custom and copy the Default texts" and addresses Lead / Reviewer / Builder sections. Rewrite its Setup step 3 to "paste each section below under its role in the project's Instructions (Roles section), or ask the product manager to"; rename the headings' role words to the project's role names (Product Manager, Reviewer, Engineer) in prose, keeping the section bodies' behavior text. Keepghmachine setup as is.docs/specs/2026-10-30-buddy-read-access.md: line ~227 ("it copies only the Lead, Engineer and Reviewer texts") and the "PM assigns work" lines: add under the Status line a one-line note "Under the project instructions design a Buddy reads the project's document instead of copying role texts: seedocs/swarms.md#instructions", and change line ~227's statement to match whatcli/src/lib/swarmInstructionsSkill.tsdoes for a Buddy (read it first). Do not rewrite its threat table.
Interfaces: Consumes Task 1's anchors (#instructions). Produces nothing a later task reads.
- Step 1: Read
catalog.ts,swarmInstructionsSkill.tsand the five files' lines named above. - Step 2: Edit the five files as listed.
- Step 3: Greps.
grep -n "another engine" docs/feature-design-rules.mdprints nothing;grep -n -E "Lead, Reviewer, Builder|choose Custom|Default texts" docs/pr-triage/roles.mdprints nothing;grep -n -E "swarm-lead|swarm-dev|swarm-review" docs/naming-system.mdprints nothing unless a line says they are the fallback skills for older backends;grep -n "Instructions" docs/naming-system.mdshows the new row. - Step 4: Links. Every relative link and anchor added resolves (
lsfor files;grep -n "^## Instructions" docs/swarms.mdfor the anchor). - Step 5: Commit
Docs: naming system, design rules, priors, PR triage roles and Buddy spec follow the project instructions (project instructions, phase 6, task 2)
Task 3: Mark the replaced plans and specs
Files: Modify, one added line each under the title:
docs/plans/2026-10-22-swarm-rules-routing.md, docs/plans/2026-10-22-swarm-lead-dev-skills.md,
docs/plans/2026-10-19-super-tab-routing-v1.md, docs/superpowers/specs/2026-10-19-super-tab-routing-v1-design.md,
docs/plans/2026-10-21-swarm-routing-phase1.md, docs/plans/2026-10-22-swarm-legacy-role-skills.md,
docs/plans/2026-10-22-worker-release.md, docs/plans/2026-10-22-five-part-tasks.md,
docs/plans/2026-10-23-swarm-local-models.md.
The line, placed directly below the first # heading (and below any existing blockquote header block, so a plan's agent
note stays first), with a blank line either side:
> Replaced by [2026-10-30-project-instructions-design.md](PATH): the instruction document and agents' direct messages
> replace what this describes. Kept as history; do not build from it.
PATH is 2026-10-30-project-instructions-design.md in the docs/plans/ files and
../../plans/2026-10-30-project-instructions-design.md in the one docs/superpowers/specs/ file. Where the plan is only
partly replaced (2026-10-23-swarm-local-models.md: the grid models, their hosting and the add-on stay;
2026-10-22-worker-release.md: say which finished-worker decisions the design removes by reading both), the second
sentence reads "Replaced in part: stays." instead of "Kept as history; do not build from it." The first
words are always exactly Replaced by [2026-10-30-project-instructions-design.md](. Read each file's body first and state
the part truthfully; do not mark a plan whose subject the design leaves entirely in place, and report it instead.
Interfaces: none.
- Step 1: Read each of the nine files' first 40 lines and the design's inventory entry for it
(
grep -n "<file name>" docs/plans/2026-10-30-project-instructions-design.md). - Step 2: Insert the line in each file (Edit, no rewrite of other lines).
- Step 3: Greps.
grep -L "Replaced by \[2026-10-30-project-instructions-design.md\](" docs/plans/2026-10-22-swarm-rules-routing.md docs/plans/2026-10-22-swarm-lead-dev-skills.md docs/plans/2026-10-19-super-tab-routing-v1.md docs/superpowers/specs/2026-10-19-super-tab-routing-v1-design.md docs/plans/2026-10-21-swarm-routing-phase1.md docs/plans/2026-10-22-swarm-legacy-role-skills.md docs/plans/2026-10-22-worker-release.md docs/plans/2026-10-22-five-part-tasks.md docs/plans/2026-10-23-swarm-local-models.mdprints nothing (every file has the line), andgrep -c "Replaced by \[2026-10-30-project-instructions-design.md\](" <each file>prints 1 for each.git diff --statshows nine files, one or two added lines each, no deletions. - Step 4: Links. From each file's directory,
lsthe path written in its line; it resolves. - Step 5: Whole-phase greps (Phase 6 validation below), then commit
Docs: earlier routing and role-skill plans marked replaced by the project instructions design (project instructions, phase 6, task 3)
Phase 6 validation
No test suite applies (docs only; confirm git diff --stat main... lists only files under docs/, and that
python3 scripts/check-ui-style.py is not needed). Run once at the end, from the worktree root:
- Task 3's
grep -Lover the nine files prints nothing;grep -rn "Replaced by" docs/plans/2026-10-30-project-instructions-plan.mdshows only the done criterion. - Task 1's sweep greps over
docs/swarms.mdprint nothing unexpected; the same codes (REVIEWER_NOT_LEAD|LEAD_REQUIRED|RULE_BROKEN|STEPPED_UP|BUILD_REFUSED|INDEPENDENT_REVIEW) appear nowhere indocs/*.mdordocs/pr-triageexcept as "removed" in the Routing section's list of what the server no longer does:grep -rn -E "REVIEWER_NOT_LEAD|LEAD_REQUIRED|RULE_BROKEN|STEPPED_UP|BUILD_REFUSED|INDEPENDENT_REVIEW" docs --include=*.mdthen read each hit outsidedocs/plans/anddocs/superpowers/. - Names exist: for each code and command in
docs/swarms.md's new text, a grep inbackend/src,cli/srcordesktop/libfinds it. - Done when
docs/swarms.mdhas the sections Instructions, Messages between agents, Notices to the coordinator and Routing (advice), the nine files carry the line, and the report lists any sentence kept on purpose by a sweep grep. - PR: docs-only, so PR CI runs process checks only; open it ready, record the greps above in the PR description. Docs ship with the phases 3-5 release train and need no release of their own.