The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
A Buddy's proposal carries the pictures it showed its owner (#4470) (#3538)
0xken1526d72412a3f7
diff --git a/backend/integration/superTabBuddies.test.ts b/backend/integration/superTabBuddies.test.tsindex 5a0d21345..a2bfc9713 100644--- a/backend/integration/superTabBuddies.test.ts+++ b/backend/integration/superTabBuddies.test.ts@@ -483,6 +483,46 @@ describe('a Buddy through the store', () => {await expect(f.execute({ type: 'message.send', conversationId: 'lead', text: '', replyTo: null, recipientIds: [], attachmentIds: [loose] }, peer, agentId)).rejects.toThrow('Attach this file again')})+ it('carries a picture it showed its owner in their chat, for the project to open, and no file it did not show them (#4470)', async () => {+ const f = await swarm()+ const { chat, agentId, swarmChat, main } = await buddy(f)+ const upload = async (name: string, bytes: Buffer, conversationId = chat, as: string | null = agentId, user = peer) =>+ (await f.store.upload(user, f.tab, conversationId, { name, mime: 'image/png', body: Readable.from([bytes]) }, as ?? undefined)).attachment.id+ const show = async (attachmentIds: string[], conversationId = chat, as = agentId) => String((await f.execute({ type: 'message.send', conversationId,+ text: 'Here is the mockup', replyTo: null, recipientIds: [], attachmentIds }, peer, as)).result.messageId)+ const ask = async () => String((await f.execute({ type: 'message.send', conversationId: chat, text: 'Send it to the PM with the mockup', replyTo: null, recipientIds: [] }, peer)).result.messageId)+ const propose = async (attachmentIds: string[]) => f.execute({ type: 'buddy.propose', conversationId: chat, ownerMessageId: await ask(),+ text: 'Send it to the PM with the mockup', goal: 'New board', scope: 'Desktop only', priority: 'normal', attachmentIds }, peer, agentId)++ // The picture it drew and showed its owner, on its own message in their chat.+ const mockup = await upload('mockup.png', png())+ const shownIn = await show([mockup])+ // Not one it showed in another chat, even its owner's other Buddy chat, nor one its owner's other Buddy showed there.+ const elsewhere = await upload('elsewhere.png', png(), swarmChat, main)+ await show([elsewhere], swarmChat, main)+ // Nor one another person posted in the project chat.+ const projects = await upload('project.png', png(), 'lead', null, owner)+ await f.execute({ type: 'message.send', conversationId: 'lead', text: 'Board idea', replyTo: null, recipientIds: [], attachmentIds: [projects] })+ // Nor one over the 10 MB a proposal file may be, which it could have sent by an upload link.+ const large = await upload('large.png', png())+ await db.superTabAttachment.update({ where: { id: large }, data: { size: 10 * 1024 * 1024 + 1 } })+ await show([large])+ for (const id of [elsewhere, projects]) await expect(propose([id])).rejects.toMatchObject({ code: 'ATTACHMENT_UNAVAILABLE' })+ await expect(propose([large])).rejects.toMatchObject({ code: 'ATTACHMENT_TOO_LARGE', status: 413 })+ await expect(propose([mockup, 'a'.repeat(24), 'b'.repeat(24), 'c'.repeat(24), 'd'.repeat(24), 'e'.repeat(24)])).rejects.toThrow('at most 5 files')++ const id = String((await propose([mockup])).result.messageId)+ // The project's members open it on the proposal, its owner's message in the project chat, as the PM does.+ for (const as of [f.lead, undefined]) {+ const read = (await f.store.messages(owner, f.tab, 'lead', {}, as)).messages.find(m => m.id === id)+ expect(read?.attachments?.map(a => [a.name, a.mime])).toEqual([['mockup.png', 'image/png']])+ expect(openPng(f.files.open(read!.attachments![0]!.link!)!)).toEqual({ width: 1, height: 1, pixel: [255, 0, 0, 255] })+ }+ // It stays on the message its owner saw, and goes with one proposal at most.+ expect(await db.superTabAttachment.findUniqueOrThrow({ where: { id: mockup } })).toMatchObject({ usedBy: shownIn, proposedBy: id })+ expect((await f.store.messages(peer, f.tab, chat, { messageId: shownIn }, agentId)).messages[0]?.attachments?.map(a => a.id)).toEqual([mockup])+ await expect(propose([mockup])).rejects.toThrow('already went with a proposal')+ })it('persists approved files on a proposal card for the PM to open after the switch', async () => {const f = await swarm()const { chat, agentId } = await buddy(f)diff --git a/backend/integration/superTabSwarmBuddy.test.ts b/backend/integration/superTabSwarmBuddy.test.tsindex 12c6e4b07..1d4e43f54 100644--- a/backend/integration/superTabSwarmBuddy.test.ts+++ b/backend/integration/superTabSwarmBuddy.test.ts@@ -308,6 +308,24 @@ describe('the one Buddy sends a proposal to a project its person reads (Scholes,const read = (await f.store.messages(owner, f.tab, f.web.conversationId, {})).messages.find(m => m.id === sent)expect(read?.attachments?.map(a => a.name).sort()).toEqual(['main.log', 'plan.md'])})++ it('carries a file it showed its person in its own part of the chat, never one another Buddy there showed (#4470)', async () => {+ const f = await swarm()+ const { chat, main } = await buddy(f)+ const { thread, agentId: session } = await projectSession(f, chat, f.web.projectId, 'Let us plan the web board')+ const mainShot = await upload(f, chat, 'main.png', main)+ await send(f, chat, 'Here is a sketch', { attachmentIds: [mainShot] }, peer, main)+ const sessionShot = await upload(f, chat, 'session.png', session)+ await send(f, chat, 'Here is the mockup', { replyTo: thread, attachmentIds: [sessionShot] }, peer, session)+ const threadAsk = async () => String((await send(f, chat, 'Send it to the PM', { replyTo: thread })).result.messageId)+ // Each Buddy proposes only what it showed: the main Buddy not the session's picture, the session not the main Buddy's.+ await expect(propose(f, chat, await ask(f, chat), f.web.projectId, main, { attachmentIds: [sessionShot] })).rejects.toMatchObject({ code: 'ATTACHMENT_UNAVAILABLE' })+ await expect(propose(f, chat, await threadAsk(), undefined, session, { text: 'Send it to the PM', attachmentIds: [mainShot] })).rejects.toMatchObject({ code: 'ATTACHMENT_UNAVAILABLE' })+ const fromSession = String((await propose(f, chat, await threadAsk(), undefined, session, { text: 'Send it to the PM', attachmentIds: [sessionShot] })).result.messageId)+ const fromMain = String((await propose(f, chat, await ask(f, chat), f.web.projectId, main, { attachmentIds: [mainShot] })).result.messageId)+ const read = (await f.store.messages(owner, f.tab, f.web.conversationId, {}, f.pms.web)).messages+ expect([fromSession, fromMain].map(id => read.find(m => m.id === id)?.attachments?.map(a => a.name))).toEqual([['session.png'], ['main.png']])+ })})describe('the main Buddy', () => {diff --git a/backend/src/superTabs/commands.ts b/backend/src/superTabs/commands.tsindex 42eeacab9..097288c57 100644--- a/backend/src/superTabs/commands.ts+++ b/backend/src/superTabs/commands.ts@@ -358,7 +358,8 @@ export const commandSchema = z.discriminatedUnion('type', [launchRefused: z.object({ model: z.string().regex(LAUNCH_MODEL), effort: z.string().regex(LAUNCH_EFFORT).optional() }).strict().optional() }).strict(),z.object({ type: z.literal('agent.start'), request: startRequestSchema, routeDecisionId: id.optional(), overrideReason: reason.optional() }).strict(),// A Buddy's proposal for its owner, posted in its project's chat: `conversationId` is its own chat, and `ownerMessageId` its- // owner's message there asking for it. Its files are its own uploads in that chat, or files its owner sent there (store.ts proposable).+ // owner's message there asking for it. Its files are its own uploads in that chat, files its owner sent there, or files it showed its+ // owner there on its own messages (store.ts proposable).// `projectId` is the project a person's one Buddy sends to (authorizeCommandAccess reads it as its person would); a project// session or a project chat's Buddy has its own project, and naming another reads as a project that does not exist.// `text` is what the project chat shows, as its owner's own message (anh Dee, task #2926): their words, or the line their Buddy@@ -715,7 +716,7 @@ export interface CommandContext {/** An uncertain receipt and its original message, read transactionally. */delivery?: { id: string; conversationId: string; agentId: string; messageId: string; text: string; attachments?: Attachment[] }/** The files `message.send` or `buddy.propose` names, each checked by the store: uploaded by this actor to this conversation and- * unused, or for a proposal, sent there by its Buddy's owner (store.ts proposable). */+ * unused, or for a proposal, sent there by its Buddy's owner or shown to them by that Buddy (store.ts proposable). */attachments?: Attachment[]/** The words of each voice message's file among [attachments], by its id, read by the store (store.ts readVoice). */voiceWords?: Record<string, string>diff --git a/backend/src/superTabs/store.ts b/backend/src/superTabs/store.tsindex 46d868cf8..bebe5854e 100644--- a/backend/src/superTabs/store.ts+++ b/backend/src/superTabs/store.ts@@ -3214,11 +3214,13 @@ export class SuperTabStore {}/**- * The files a Buddy's proposal names (buddies.ts), and which of them it takes. Only what its owner handed it: its own upload- * to its chat, still unsent, which the proposal then takes like a chat message; or a file its owner sent in that chat,- * which stays with their message too and goes with one proposal at most. Nothing else is found, so the command refuses- * it, its own order of refusals first. The server cannot tell where an upload's bytes came from on the Buddy's machine:- * that is its CLI's folder check and its guard (lib/buddyGuard.ts), and here only what it uploaded to its own chat.+ * The files a Buddy's proposal names (buddies.ts), and which of them it takes. Only what its owner handed it or saw: its own+ * upload to its chat, still unsent, which the proposal then takes like a chat message; a file its owner sent in that chat;+ * or one it showed its owner there on its own plain message, as a picture it drew (#4470). Those two stay with their+ * message and go with one proposal at most. Nothing else is found, so the command refuses it, its own order of refusals+ * first; a file over the 10 MB a proposal carries is refused by name. The server cannot tell where an upload's bytes came+ * from on the Buddy's machine: that is its CLI's folder check and its guard (lib/buddyGuard.ts), and here only what it+ * uploaded to its own chat.*/private async proposable(tx: Transaction, state: SuperTabState, actor: Actor, command: ProposeCommand): Promise<{ attachments: Attachment[]; claimed: string[]; proposed: string[] }> {const attachments = this.attachments ?? fail('ATTACHMENTS_UNAVAILABLE', 'File attachments are not available on this server.', 503)@@ -3227,23 +3229,30 @@ export class SuperTabStore {if (!ownerId) return { attachments: [], claimed: [], proposed: [] }const ids = [...new Set(command.attachmentIds)]const rows = await tx.superTabAttachment.findMany({ where: { tabId: state.id, id: { in: ids }, conversationId: command.conversationId } })- const own = rows.filter(r => !r.purpose && r.actorKey === actorKey(actor) && !r.usedBy)- // A file the expiry sweep took (lib/attachmentSweep.ts) is being removed: it was never sent, so it was never handed.- let handed = rows.filter(r => !r.purpose && r.actorKey === `person:${ownerId}` && !!r.usedBy && r.usedBy !== EXPIRED_UPLOAD)- // A thread session reads its own thread alone, so it proposes only files its person sent there (spec: Guard): a file from- // the main chat or another thread could be another project's.+ const mine = actorKey(actor), owners = `person:${ownerId}`+ const own = rows.filter(r => !r.purpose && r.actorKey === mine && !r.usedBy)+ // A file the expiry sweep took (lib/attachmentSweep.ts), or on a message deleted since, is being removed: never handed.+ const sent = rows.filter(r => !r.purpose && (r.actorKey === owners || r.actorKey === mine) && !!r.usedBy && r.usedBy !== EXPIRED_UPLOAD)+ // The messages they are on, by id through their named index (pageReads.ts messagesById), never an `in` filter on a hot+ // collection: at most 5, and only in this chat.+ const on = new Map((await messagesById(tx, state.id, command.conversationId, sent.map(r => r.usedBy!))).map(m => [m.id, m]))+ // A thread session reads its own thread alone, so it proposes only files from there (spec: Guard): a file from the main+ // chat or another thread could be another project's. The main Buddy never hears a session's thread either.const thread = self.buddySession?.thread- if (thread && handed.length) {- // By the messages' ids through their named index (pageReads.ts messagesById), never an `in` filter on a hot collection.- const inThread = new Set((await messagesById(tx, state.id, command.conversationId, handed.map(r => r.usedBy!)))- .filter(m => m.id === thread || m.thread === thread).map(m => m.id))- handed = handed.filter(r => inThread.has(r.usedBy!))- } else if (handed.length && self.buddyScope === 'swarm') {- // The main Buddy never hears a session's thread, and a file sent there is that session's project's: never another's.- const heard = new Set((await messagesById(tx, state.id, command.conversationId, handed.map(r => r.usedBy!))).filter(m => !m.buddySession).map(m => m.id))- handed = handed.filter(r => heard.has(r.usedBy!))+ const heard = (m: Pick<SuperTabMessage, 'id' | 'thread' | 'buddySession'>) => thread ? m.id === thread || m.thread === thread+ : self.buddyScope !== 'swarm' || !m.buddySession+ // Its own file only on a message it wrote itself, never a row the Swarm wrote (a source): what its owner saw it show.+ const shownBy = (m: Pick<SuperTabMessage, 'author' | 'source'>) => {+ const author = m.author as { kind?: unknown; id?: unknown } | null+ return !m.source && author?.kind === 'agent' && author.id === self.id}- return { attachments: [...own, ...handed].map(row => ({ id: row.id, name: row.name, mime: row.mime, size: row.size, url: publicUrl(attachments.publicBase, row.objectKey),+ const handed = sent.filter(r => {+ const m = on.get(r.usedBy!)+ return !!m && heard(m) && (r.actorKey === owners || shownBy(m))+ })+ const taken = [...own, ...handed]+ if (taken.some(r => r.size > MAX_FORM_ATTACHMENT_BYTES)) fail('ATTACHMENT_TOO_LARGE', 'A proposal carries files of up to 10 MB each. Send a smaller file.', 413)+ return { attachments: taken.map(row => ({ id: row.id, name: row.name, mime: row.mime, size: row.size, url: publicUrl(attachments.publicBase, row.objectKey),...pictureFields(row.image) })),claimed: own.map(r => r.id), proposed: handed.map(r => r.id) }}diff --git a/cli/src/lib/swarmSkills.spec.ts b/cli/src/lib/swarmSkills.spec.tsindex 7e31a910e..a5f3762ee 100644--- a/cli/src/lib/swarmSkills.spec.ts+++ b/cli/src/lib/swarmSkills.spec.ts@@ -899,6 +899,8 @@ describe('the Buddy skill (Ken\'s Buddy spec, 10-28)', () => {expect(text).toContain('Send only after your owner says yes to that proposal')expect(text).toContain('One offer per idea; never repeat an ignored or declined offer')expect(text).toContain('harness super-tab --tab TAB propose OPERATION_ID')+ // Task #4470: a picture it drew and showed its owner goes by id, from a machine without the project's code too.+ expect(text).toContain('"attachmentIds":["ID"] in the JSON for a file your owner sent in your chat, or one you showed them there on your own message')// Scholes (11-02): its one Buddy sends, naming the project, and asks which when it is unclear; never "open a session".expect(text).toContain('"projectId":"PROJECT"')expect(text).toContain('If they read several and it is unclear which one this is for, ask them first.')diff --git a/cli/src/lib/swarmSkills.ts b/cli/src/lib/swarmSkills.tsindex 203598f62..901277a57 100644--- a/cli/src/lib/swarmSkills.ts+++ b/cli/src/lib/swarmSkills.ts@@ -702,7 +702,7 @@ You are one person's Buddy. Your start note says which: their one Buddy for ever- Write the goal, the scope and a priority (low, normal or high) from what you agreed. Put in only what your owner wants sent; anything private stays in your chat.- Before you send, show your owner the exact line you will post as them, in their voice: I'll post this as you: "…", and wait for their ok. It is their message to the team: one plain line, as they would say it. Quotes around that line are required. Only the quoted line immediately after "I'll post this as you:" counts as shown; nothing after its closing quote counts. Put nothing after it but that line in quotes; send the words inside the quotes whole, never a piece of them. If an unquoted line is refused, show it again in quotes and wait for a new ok. When they wrote the words to send themselves, send those. A change they ask for is a new line to show them.- Send it with harness super-tab --tab TAB propose OPERATION_ID '{"conversationId":"CHAT","ownerMessageId":"MESSAGE","projectId":"PROJECT","text":"the line they okayed, or their own words","goal":"...","scope":"...","priority":"normal"}', where MESSAGE is the id of your owner's message saying ok or asking you to send it and PROJECT is the project's id from status (a session in one project leaves projectId out). One message sends one proposal, to one project.-- To hand the PM a plan, spec, log or screenshot, attach it, up to 5 files of 10 MB each: add --attach PATH for a file inside your folder (as your owner's one Buddy, inside that project's folder under projects/), and "attachmentIds":["ID"] in the JSON for a file your owner sent in your chat (its id is on their message). Attach only what your owner wants sent; nothing from anywhere else.+- To hand the PM a plan, spec, log or screenshot, attach it, up to 5 files of 10 MB each: add --attach PATH for a file inside your folder (as your owner's one Buddy, inside that project's folder under projects/), and "attachmentIds":["ID"] in the JSON for a file your owner sent in your chat, or one you showed them there on your own message, such as a picture you drew (its id is on that message; this works when the project's code is not on your machine). Attach only what your owner wants sent; nothing from anywhere else.- The Swarm posts the text in the project chat in full, never cut, as their own message, with no reply from you in the chat. The goal, scope and priority go to the PM with it and become the task's brief. It refuses words your owner did not see and okay. Tell your owner it went; the PM answers in the project chat.## Tell your owner how it goesdiff --git a/cli/src/superTabs/attach.ts b/cli/src/superTabs/attach.tsindex 1a20385b4..3139fa815 100644--- a/cli/src/superTabs/attach.ts+++ b/cli/src/superTabs/attach.ts@@ -150,7 +150,7 @@ export interface CheckedFile { name: string; type: string; bytes: Buffer }export function readInsideFolder(paths: string[], folder: string): CheckedFile[] {const root = realpathSync.native(folder)return paths.map(path => {- const outside = () => new Error(`${path} is outside your folder. Attach only files inside your folder; name a file your owner sent in your chat by its id.`)+ const outside = () => new Error(`${path} is outside your folder. Attach only files inside your folder; name a file your owner sent in your chat, or one you showed them there, by its id.`)let fd: number// Never waiting on the open: a named pipe with no writer held the proposal forever (re-check of #2103). A regular// file reads the same without blocking, and anything else is refused below before a byte is read.diff --git a/cli/src/superTabs/command.ts b/cli/src/superTabs/command.tsindex 3421aa39c..9d27fdb92 100644--- a/cli/src/superTabs/command.ts+++ b/cli/src/superTabs/command.ts@@ -507,7 +507,7 @@ async function proposalFiles(paths: string[], operationId: string, command: Recoif (!wide && command.projectId && command.projectId !== projectId) throw new Error('A session sends only to its own project\'s PM: leave the project out.')if (typeof home !== 'string') throw new Error(wide ? 'Name the project to send this to, from your status.' : 'Name your own chat: a proposal comes from there.')const inside = wide ? buddyProjectFolder(folder, String(projectId)) : folder- if (!inside) throw new Error('That project\'s code is not on this machine: attach only a file your owner sent in your chat.')+ if (!inside) throw new Error('That project\'s code is not on this machine: name by its id a file your owner sent in your chat, or one you showed them there.')const files = readInsideFolder(paths, inside)const uploaded = await uploadAttachments(files, operationId, { ...target, sentIn: home }, scoped, deps.fetch)return [...new Set([...named, ...uploaded])]diff --git a/cli/src/superTabs/service.ts b/cli/src/superTabs/service.tsindex 7d27b2d21..034c859b9 100644--- a/cli/src/superTabs/service.ts+++ b/cli/src/superTabs/service.ts@@ -78,7 +78,7 @@ const HELP = {release: 'agent.release records keep, or requests stop, for an agent whose work ended; assigning it new work reuses it. Wait for the execution host to confirm a stop. A person can withdraw a stuck stop; the session cannot receive new work in that Swarm. Its native capacity stays reserved until its host confirms stopping. Other Swarms wait up to two minutes for an in-flight close, then may reuse it.',resume: 'resume START_ID: finish a pending start without creating another agent.',// Buddies (backend superTabs/buddies.ts): a person adds and removes their own; the Buddy proposes only when they ask.- buddies: 'Buddies, in every Swarm: each person has one Buddy chat for the whole Swarm that only they and their Buddy read (buddy.chat opens it before any Buddy; with projectId, their older chat in that project), may add their one Buddy (buddy.create with machineId of their own machine, engine claude), remove it (buddy.remove), and name it (buddy.rename with conversationId of their Buddy chat and name, or null for the default name). It reads every project they read and brainstorms with them in that chat, and the PM\'s private lines to them land there too, marked with their project. A proposal is the only thing it sends into a project. propose OPERATION_ID JSON [--attach PATH]...: when its owner asks (a New session in one project, in its thread, for that project): {"conversationId":"its chat","ownerMessageId":"their message asking","projectId":"the project they read to send it to; a session of one project leaves it out","text":"the line its owner okayed, or their own words","goal":"...","scope":"...","priority":"low|normal|high","attachmentIds":["a file its owner sent in its chat"]}. --attach adds a file inside its own folder (in that project\'s folder, for their one Buddy); up to 5 files in all, 10 MB each. The Swarm posts the text in full in the project chat as its owner\'s own message, delivered to the PM with the goal, scope and priority, which become the task\'s brief; words its owner did not okay in its chat are refused. A Buddy is never assigned work.',+ buddies: 'Buddies, in every Swarm: each person has one Buddy chat for the whole Swarm that only they and their Buddy read (buddy.chat opens it before any Buddy; with projectId, their older chat in that project), may add their one Buddy (buddy.create with machineId of their own machine, engine claude), remove it (buddy.remove), and name it (buddy.rename with conversationId of their Buddy chat and name, or null for the default name). It reads every project they read and brainstorms with them in that chat, and the PM\'s private lines to them land there too, marked with their project. A proposal is the only thing it sends into a project. propose OPERATION_ID JSON [--attach PATH]...: when its owner asks (a New session in one project, in its thread, for that project): {"conversationId":"its chat","ownerMessageId":"their message asking","projectId":"the project they read to send it to; a session of one project leaves it out","text":"the line its owner okayed, or their own words","goal":"...","scope":"...","priority":"low|normal|high","attachmentIds":["a file its owner sent in its chat, or one it showed them there on its own message"]}. --attach adds a file inside its own folder (in that project\'s folder, for their one Buddy); up to 5 files in all, 10 MB each. The Swarm posts the text in full in the project chat as its owner\'s own message, delivered to the PM with the goal, scope and priority, which become the task\'s brief; words its owner did not okay in its chat are refused. A Buddy is never assigned work.',// A person's own command, for the machines they added; an agent's terminal is refused (command.ts), so no agent raises its// own machine's room (Lead, 2026-10-28).setAgents: 'set-agents MACHINE_ID COUNT: for a machine\'s owner, from their own terminal, not an agent\'s: how many Swarm agents may run on that machine at once. Each agent still needs free memory when it starts. A machine may offer one agent for every 2 GB of its memory, and at least 4; a larger number is refused.',diff --git a/docs/plans/2026-11-07-buddy-proposal-shown-files-plan.md b/docs/plans/2026-11-07-buddy-proposal-shown-files-plan.mdnew file mode 100644index 000000000..12e7c1eae--- /dev/null+++ b/docs/plans/2026-11-07-buddy-proposal-shown-files-plan.md@@ -0,0 +1,61 @@+# Buddy proposal shown files implementation plan++> Implemented by the Engineer in this session, task by task, test first; two independent security reviews of the pull request.++**Goal:** A Buddy's proposal can carry a file it already showed its owner in their private chat, so a picture it drew reaches the PM and the builder even when the project's code is not on the Buddy's machine.++**Architecture:** `SuperTabStore.proposable` (backend/src/superTabs/store.ts) already finds a proposal's files: the Buddy's own unsent uploads to its chat, and files its owner sent there. It gains a third source: files on the Buddy's own plain messages in that same chat. They go with one proposal at most, by the existing `proposedBy` claim, as its owner's files do. The thread-session and Swarm-Buddy read rules that scope the owner's files scope these too. The CLI already passes `attachmentIds` from the JSON; only its help, error lines and the swarm-buddy skill change.++**Tech Stack:** TypeScript, Prisma on MongoDB, Vitest with an in-memory replica set; no new dependencies.++**Spec:** Harness task #4470, "A Buddy's proposal can carry the pictures it showed its owner in their private chat" (anh Dee, project chat, 2026-11-07 15:37: "it should take both instruction in text and pics").++## Global Constraints++- Backend and CLI only. No other source of files; the project-folder rule for `--attach` stays.+- Never a file from another chat, another person's message (other than the owner's, as today), or another Buddy.+- A "plain" message is the Buddy's own `message.send`: authored by that agent, with no system source, not deleted.+- Existing limits hold: 5 files per proposal, 10 MB per file (the upload limit).+- The server enforces who opens the files: the proposal's message in the project chat, read by its members.++## Review Focus++- `proposable` accepts a file only when its row is this Buddy's upload, in this chat, used by a message this Buddy wrote, with no source.+- A thread session takes only files from its own thread; the Swarm Buddy none from a session's thread.+- A deleted message's file (usedBy EXPIRED) and an unsent or swept file are refused as today.+- A file goes with one proposal at most, raced or not.+- Only the project's members open the proposal's files; the Buddy's private chat stays private.++## Design++- growth: no new rows or fields; an attachment row's existing `proposedBy` is set, removed with the row by the existing sweep.+- concurrency: the existing conditional `updateMany` on `proposedBy` claims a file once inside the command's transaction.+- read cost: one extra read of the named messages by id (`messagesById`, the `_id` index), at most 5 ids.+- scale: bounded by the 5-file limit per proposal; nothing grows with the Swarm.+- compatibility: an added accepted case of an existing command field; older CLIs send `attachmentIds` the same way. Backend ships first; a CLI without the new help still works.+- migration and rollback: none; rollback reverts the code, and proposals already sent keep their files.+- audience: server-enforced as today: the file shows on the owner's proposal message in the project chat, read by project members.+- identity: the proposal is posted as its owner, from their consent, as today; the Buddy's own login never posts it.+- failure: a refused file fails the whole proposal with ATTACHMENT_UNAVAILABLE or ATTACHMENT_USED and its reason.+- platforms: backend (Linux), CLI on macOS, Linux and Windows; no platform-specific code.++## Task 1: the backend accepts a file the Buddy showed its owner++**Files:** `backend/integration/superTabBuddies.test.ts`, `backend/src/superTabs/store.ts`, `backend/src/superTabs/commands.ts` (comments).++**Interfaces:** `buddy.propose` `attachmentIds` unchanged in shape.++- [ ] Write a failing integration test: a Buddy posts a picture in its chat; a proposal naming it carries it, its owner's members open it in the project chat; it is refused from another chat, from another person's message, from another Buddy's message, from a deleted message, for a second proposal, and past 5 files.+- [ ] Run it and watch the own-message case fail with "Upload this file again".+- [ ] Add the shown-file source to `proposable`, scoped like the owner's files, claimed through `proposedBy`.+- [ ] Run the test and the existing proposal file tests green.+- [ ] Commit.++## Task 2: the CLI and the swarm-buddy skill say so++**Files:** `cli/src/lib/swarmSkills.ts`, `cli/src/superTabs/service.ts`, `cli/src/superTabs/command.ts`, `cli/src/superTabs/attach.ts` and their specs.++- [ ] Write a failing spec that the built swarm-buddy skill names a file the Buddy showed its owner in their chat as attachable by id.+- [ ] Update the skill line, the help line and the two refusal lines.+- [ ] Run the specs green.+- [ ] Commit.