{"version":23,"agent":"pinch","message":"abso issue <N> --copy-to <project>: copy an issue into another project, with its comments, answered asks and labels, each keeping its author and time. The Issues server reads the source issue itself; the client sends only which issue, and any cleaned texts.\n\n- --dry-run shows what the copy would make (title, how many comments and asks, which were edited, labels) and what's left behind. It writes nothing.\n- --clean <file> gives cleaned texts by source id, as JSON: {title, description, comments: [{id, text}], asks: [{id, question, answer}]}. A comment left out of a given list isn't copied.\n- --copy-to goes alone, so a copy is never half an edit. Copying into the project the issue is already in is refused before any call.\n- When a live server refuses the copy (copying out of a project there takes an owner of it), the message says --dry-run still works.\n- The MCP issue tool's clean input is a file too, so it's confined to the server's start folder like attach.\n\nTests: client/test/issues.test.ts, against a stand-in Issues server. The run --parallel test that sometimes times out under a full run passed when rerun.","time":1791530025571,"timeIso":"2026-10-09T07:13:45.571Z","changes":7,"change":255,"files":["client/src/api.ts","client/src/issues.ts","client/src/main.ts","client/src/mcp.ts","client/test/client.test.ts","client/test/issues.test.ts"],"draft":null,"diff":[{"path":"client/src/api.ts","added":37,"removed":0,"diff":"--- a/client/src/api.ts\n+++ b/client/src/api.ts\n@@ -97,6 +97,32 @@\n \treturn (typeof news === \"string\" ? [news] : [...news]).filter((s) => typeof s === \"string\" && s.trim() !== \"\");\n }\n \n+/** An issue copy's request: the source, and any texts given cleaned, by their source ids. */\n+export interface CopyBody {\n+\tfrom: string;\n+\tissue: number;\n+\ttitle?: string;\n+\tdescription?: string;\n+\tcomments?: { id: number; text?: string }[];\n+\tasks?: { id: number; question?: string; answer?: string }[];\n+}\n+\n+/** What a copy writes, as a dry run answers it. */\n+export interface CopyPlan {\n+\tfrom: { project: string; issue: number };\n+\ttitle: string;\n+\tedited: (\"title\" | \"description\")[];\n+\tlabels: string[];\n+\tclosed: { how: \"done\" | \"dropped\" } | null;\n+\tcomments: { edited: boolean }[];\n+\tasks: { edited: boolean }[];\n+\tskipped: { comments: number[]; asks: number[] };\n+}\n+\n+export type CopyAnswer =\n+\t| { dryRun: true; plan: CopyPlan }\n+\t| { ok: true; id: number; from: { project: string; issue: number }; skipped: { comments: number[]; asks: number[] } };\n+\n export class Api {\n \treadonly config: Config;\n \treadonly timeoutMs: number;\n@@ -452,6 +478,17 @@\n \t\treturn JSON.parse(text) as Attachment;\n \t}\n \n+\t/**\n+\t * Copies issue `body.issue` of this project into project `to`, keeping\n+\t * authors and times: the Issues server reads the source itself, and only\n+\t * texts may be given cleaned. A dry run answers the plan and writes nothing.\n+\t */\n+\tissueCopy(to: string, body: CopyBody & { dryRun?: boolean }): Promise<CopyAnswer> {\n+\t\tconst there = new Api({ ...this.config, project: to }, this.timeoutMs);\n+\t\tthere.issuesServer = this.issuesServer;\n+\t\treturn there.#issues(\"POST\", there.agentPath(\"copy\"), body);\n+\t}\n+\n \t/** Where an attachment is served. */\n \tattachmentUrl(id: string): string {\n \t\treturn this.url(`/attachments/${id}`, this.issuesServer);"},{"path":"client/src/issues.ts","added":87,"removed":1,"diff":"--- a/client/src/issues.ts\n+++ b/client/src/issues.ts\n@@ -7,7 +7,19 @@\n \n import { readFileSync, statSync } from \"node:fs\";\n import { basename, resolve } from \"node:path\";\n-import type { Api, Ask, Attachment, Draft, DraftBody, IssuePage, IssueRow, IssueSearchHit } from \"./api.ts\";\n+import {\n+\ttype Api,\n+\tApiError,\n+\ttype Ask,\n+\ttype Attachment,\n+\ttype CopyAnswer,\n+\ttype CopyBody,\n+\ttype Draft,\n+\ttype DraftBody,\n+\ttype IssuePage,\n+\ttype IssueRow,\n+\ttype IssueSearchHit,\n+} from \"./api.ts\";\n import { bool, type Parsed, str, UsageError } from \"./args.ts\";\n import { type Env, type Output, open, plural } from \"./commands.ts\";\n import { type Config, readMachineServers, trustedServers } from \"./config.ts\";\n@@ -325,6 +337,76 @@\n \t};\n }\n \n+/** The flags --copy-to goes with: anything else on the same command is refused, so a copy is never half an edit. */\n+const COPY_FLAGS = new Set([\"copy-to\", \"clean\", \"dry-run\"]);\n+\n+/** abso issue <N> --copy-to <project>: the server reads the issue and writes the copy. */\n+async function runCopy(api: Api, id: number, to: string, args: Parsed, env: Env): Promise<Output> {\n+\tconst other = [...args.flags.keys()].filter((f) => !COPY_FLAGS.has(f) && f !== \"json\");\n+\tif (other.length > 0)\n+\t\tthrow new UsageError(`--copy-to goes alone (with --clean and --dry-run), not with --${other[0]}`);\n+\tif (to === api.config.project)\n+\t\tthrow new UsageError(`issue ${id} is already in ${to}; --copy-to names another project`);\n+\tconst clean = str(args, \"clean\");\n+\tconst texts = clean === undefined ? {} : readClean(resolve(env.cwd, clean), clean);\n+\tconst dryRun = bool(args, \"dry-run\");\n+\tconst from = api.config.project;\n+\tlet answer: CopyAnswer;\n+\ttry {\n+\t\tanswer = await api.issueCopy(to, { ...texts, from, issue: id, ...(dryRun ? { dryRun: true } : {}) });\n+\t} catch (e) {\n+\t\tif (e instanceof ApiError && e.status === 403 && !dryRun)\n+\t\t\tthrow new ApiError(`${e.message}. --dry-run still shows what would go.`, e.status);\n+\t\tthrow e;\n+\t}\n+\tif (\"dryRun\" in answer) {\n+\t\tconst p = answer.plan;\n+\t\tconst edited = (list: { edited: boolean }[]) => list.filter((x) => x.edited).length;\n+\t\tconst lines = [\n+\t\t\t`A dry run: nothing was written. Copying ${from} issue ${id} into ${to} would make:`,\n+\t\t\t`  ${q(p.title)}${p.closed ? `, ${p.closed.how}` : \"\"}${p.edited.length > 0 ? ` (${p.edited.join(\" and \")} edited when copied)` : \"\"}`,\n+\t\t\t`  ${plural(p.comments.length, \"comment\")}${edited(p.comments) > 0 ? ` (${edited(p.comments)} edited)` : \"\"}, ${plural(p.asks.length, \"answered ask\")}${edited(p.asks) > 0 ? ` (${edited(p.asks)} edited)` : \"\"}${p.labels.length > 0 ? `, labelled ${p.labels.join(\", \")}` : \"\"}`,\n+\t\t\t...skippedLines(p.skipped),\n+\t\t\t`Run it again without --dry-run to copy it.`,\n+\t\t];\n+\t\treturn { text: lines.join(\"\\n\"), json: answer };\n+\t}\n+\treturn {\n+\t\ttext: [\n+\t\t\t`Copied ${from} issue ${id} to ${to} issue ${answer.id}. Its comments and asks keep their authors and times, and issue ${id} has a comment saying where it went.`,\n+\t\t\t...skippedLines(answer.skipped),\n+\t\t].join(\"\\n\"),\n+\t\tjson: answer,\n+\t};\n+}\n+\n+function skippedLines(skipped: { comments: number[]; asks: number[] }): string[] {\n+\tconst parts = [\n+\t\t...(skipped.comments.length > 0 ? [`comments ${skipped.comments.join(\", \")}`] : []),\n+\t\t...(skipped.asks.length > 0 ? [`asks ${skipped.asks.join(\", \")}`] : []),\n+\t];\n+\treturn parts.length > 0 ? [`  not copied: ${parts.join(\"; \")} (open asks, and what --clean left out)`] : [];\n+}\n+\n+/** --clean's file: cleaned texts by source id. The server checks each id against the issue it reads. */\n+function readClean(path: string, given: string): Omit<CopyBody, \"from\" | \"issue\"> {\n+\tlet raw: unknown;\n+\ttry {\n+\t\traw = JSON.parse(readFileSync(path, \"utf8\"));\n+\t} catch (e) {\n+\t\tthrow new UsageError(\n+\t\t\t`--clean ${given}: ${(e as NodeJS.ErrnoException).code === \"ENOENT\" ? \"no such file\" : \"not JSON\"}`,\n+\t\t);\n+\t}\n+\tif (typeof raw !== \"object\" || raw === null || Array.isArray(raw))\n+\t\tthrow new UsageError(`--clean ${given}: a JSON object with title, description, comments or asks`);\n+\tconst known = new Set([\"title\", \"description\", \"comments\", \"asks\"]);\n+\tconst unknown = Object.keys(raw).filter((k) => !known.has(k));\n+\tif (unknown.length > 0)\n+\t\tthrow new UsageError(`--clean ${given}: ${unknown[0]} isn't one of title, description, comments, asks`);\n+\treturn raw as Omit<CopyBody, \"from\" | \"issue\">;\n+}\n+\n export async function runIssue(args: Parsed, env: Env): Promise<Output> {\n \tconst [first, ...rest] = args.positionals;\n \tconst { api } = openIssues(env);\n@@ -347,6 +429,10 @@\n \t\t\t'abso issue <N> [--comment \"...\" | --object \"...\" | --drop | --reopen | --done [--done-by <version>] | an edit], or abso issue new \"<title>\"',\n \t\t);\n \tconst id = issueNumber(first);\n+\tconst copyTo = str(args, \"copy-to\");\n+\tif (copyTo !== undefined) return runCopy(api, id, copyTo, args, env);\n+\tif (str(args, \"clean\") !== undefined || bool(args, \"dry-run\"))\n+\t\tthrow new UsageError(\"--clean and --dry-run go with --copy-to <project>\");\n \tconst comment = str(args, \"comment\");\n \tconst object = str(args, \"object\");\n \tconst doneBy = str(args, \"done-by\");"},{"path":"client/src/main.ts","added":5,"removed":2,"diff":"--- a/client/src/main.ts\n+++ b/client/src/main.ts\n@@ -387,11 +387,14 @@\n \t\t\topen: \"boolean\",\n \t\t\tdelete: \"boolean\",\n \t\t\tattach: \"string\",\n+\t\t\t\"copy-to\": \"string\",\n+\t\t\tclean: \"string\",\n+\t\t\t\"dry-run\": \"boolean\",\n \t\t},\n \t\tusage:\n-\t\t\t'abso issue <N> [--comment \"...\" [--attach <file,file>] | --object \"...\" | --drop | --reopen | --done [--done-by <version>]] | abso issue <N> [--title \"...\"] [--description \"...\"] [--parent <N|none>] [--agent <agent|none>] [--blocked-by <N,N|none>] [--label <l,l>] [--unlabel <l,l>] [--notify <who,who> | --quiet] | abso issue new \"<title>\" [--description \"...\"] [--parent <N>] [--lines <file>:<from>-<to>@<version>] [--agent <agent>] [--blocked-by <N,N>] [--notify <who,who>] [--label <l,l>] [--attach <file,file>]',\n+\t\t\t'abso issue <N> --copy-to <project> [--clean <file>] [--dry-run] | abso issue <N> [--comment \"...\" [--attach <file,file>] | --object \"...\" | --drop | --reopen | --done [--done-by <version>]] | abso issue <N> [--title \"...\"] [--description \"...\"] [--parent <N|none>] [--agent <agent|none>] [--blocked-by <N,N|none>] [--label <l,l>] [--unlabel <l,l>] [--notify <who,who> | --quiet] | abso issue new \"<title>\" [--description \"...\"] [--parent <N>] [--lines <file>:<from>-<to>@<version>] [--agent <agent>] [--blocked-by <N,N>] [--notify <who,who>] [--label <l,l>] [--attach <file,file>]',\n \t\tabout:\n-\t\t\t\"One issue: its description, Agent, Blocked by, labels, asks, comments, edits, sub-issues and watchers. --comment comments on it and --object objects; its agents hear either. --drop drops it. --reopen opens a dropped issue again. --done marks it done by hand, and --done-by <version> names the published version that did it. publish --done still marks it done too. --title, --description, --parent, --agent and --blocked-by edit it, and the edit tells its watchers (who opened it, its Agent and agents, its Reviewer, whoever was named in Notify, and whoever commented); --notify tells more people, --quiet tells nobody. --label adds labels and --unlabel takes them off (friction, area:client: lower-case letters, digits and - _ . :); a label-only edit tells nobody unless --notify names people. An issue is Blocked until each issue it's blocked by is Done. abso issue new opens one; --lines ties it to lines at a version of shared, --agent says who it's for, --notify tells people now, and --label labels it. --attach shot.png,after.png puts images on a new issue or a comment (png, jpeg, gif or webp, 10 MB each; the server checks the type by the bytes and takes out metadata such as where a photo was taken), and prints each one's id for the text to point at; the issue's page lists them with a link. abso issue draft \\\"<title>\\\" [the same fields] saves a draft instead: yours alone, with no number and no news; abso issue draft <D> [fields] changes it, --open opens it as an issue, --delete deletes it.\",\n+\t\t\t\"One issue: its description, Agent, Blocked by, labels, asks, comments, edits, sub-issues and watchers. --comment comments on it and --object objects; its agents hear either. --drop drops it. --reopen opens a dropped issue again. --done marks it done by hand, and --done-by <version> names the published version that did it. publish --done still marks it done too. --title, --description, --parent, --agent and --blocked-by edit it, and the edit tells its watchers (who opened it, its Agent and agents, its Reviewer, whoever was named in Notify, and whoever commented); --notify tells more people, --quiet tells nobody. --label adds labels and --unlabel takes them off (friction, area:client: lower-case letters, digits and - _ . :); a label-only edit tells nobody unless --notify names people. An issue is Blocked until each issue it's blocked by is Done. abso issue new opens one; --lines ties it to lines at a version of shared, --agent says who it's for, --notify tells people now, and --label labels it. --attach shot.png,after.png puts images on a new issue or a comment (png, jpeg, gif or webp, 10 MB each; the server checks the type by the bytes and takes out metadata such as where a photo was taken), and prints each one's id for the text to point at; the issue's page lists them with a link. --copy-to <project> copies the issue into another project, with its comments, answered asks and labels, each keeping its author and time; --dry-run shows what would go and writes nothing, and --clean <file> gives cleaned texts by source id as JSON ({title, description, comments: [{id, text}], asks: [{id, question, answer}]}; a comment left out of a given list isn't copied). Copying out of a project on a live server takes an owner of that project. abso issue draft \\\"<title>\\\" [the same fields] saves a draft instead: yours alone, with no number and no news; abso issue draft <D> [fields] changes it, --open opens it as an issue, --delete deletes it.\",\n \t\trun: runIssue,\n \t},\n \task: {"},{"path":"client/src/mcp.ts","added":13,"removed":7,"diff":"--- a/client/src/mcp.ts\n+++ b/client/src/mcp.ts\n@@ -120,12 +120,15 @@\n \treturn rel === \"\" || (rel !== \"..\" && !rel.startsWith(`..${sep}`) && !isAbsolute(rel));\n }\n \n+/** The tool inputs that name files on this machine to read, comma-separated: each is confined like the folder. */\n+export const FILE_INPUTS = [\"attach\", \"clean\"] as const;\n+\n /**\n  * Where a tool call runs, and what it may read: its folder and\n- * every --attach file stay inside the folder the server started in. A relative\n- * path that climbs out (..), an absolute one elsewhere, or a link out is\n- * refused, so no tool reads a file outside the project. Answers the folder, or\n- * why the call is refused.\n+ * every file a FILE_INPUTS input names stay inside the folder the server\n+ * started in. A relative path that climbs out (..), an absolute one elsewhere,\n+ * or a link out is refused, so no tool reads a file outside the project.\n+ * Answers the folder, or why the call is refused.\n  */\n export function confineCall(\n \tstart: string,\n@@ -137,15 +140,18 @@\n \t\treturn {\n \t\t\trefused: `folder ${JSON.stringify(named)} is outside ${start}, the folder this server started in; tools run there or below`,\n \t\t};\n-\tif (typeof input.attach === \"string\")\n-\t\tfor (const p of input.attach\n+\tfor (const flag of FILE_INPUTS) {\n+\t\tconst value = input[flag];\n+\t\tif (typeof value !== \"string\") continue;\n+\t\tfor (const p of value\n \t\t\t.split(\",\")\n \t\t\t.map((x) => x.trim())\n \t\t\t.filter((x) => x !== \"\"))\n \t\t\tif (!inside(start, resolve(folder, p)))\n \t\t\t\treturn {\n-\t\t\t\t\trefused: `--attach ${p} is outside ${start}, the folder this server started in; a tool attaches files from there or below`,\n+\t\t\t\t\trefused: `--${flag} ${p} is outside ${start}, the folder this server started in; a tool reads files from there or below`,\n \t\t\t\t};\n+\t}\n \treturn { folder };\n }\n "},{"path":"client/test/client.test.ts","added":2,"removed":0,"diff":"--- a/client/test/client.test.ts\n+++ b/client/test/client.test.ts\n@@ -2657,6 +2657,8 @@\n \t\tassert.match(refused({ attach: \"a.txt,../x.png\" }), /^--attach \\.\\.\\/x\\.png is outside/);\n \t\tassert.match(refused({ attach: join(tmpdir(), \"x.png\") }), /is outside/);\n \t\tassert.match(refused({ folder: \"sub\", attach: \"../../x.png\" }), /is outside/);\n+\t\tassert.match(refused({ clean: \"../clean.json\" }), /^--clean \\.\\.\\/clean\\.json is outside/);\n+\t\tassert.deepEqual(confineCall(start, { clean: \"clean.json\" }), { folder: start });\n \t\tassert.deepEqual(confineCall(start, { folder: \"sub\", attach: \"../a.txt\" }), { folder: join(start, \"sub\") });\n \t\tconst server = mcp(start);\n \t\ttry {"},{"path":"client/test/issues.test.ts","added":115,"removed":2,"diff":"--- a/client/test/issues.test.ts\n+++ b/client/test/issues.test.ts\n@@ -12,7 +12,7 @@\n import { tmpdir } from \"node:os\";\n import { join } from \"node:path\";\n import { after, before, describe, it } from \"node:test\";\n-import { readMachineServers } from \"../src/config.ts\";\n+import { readConfig, readMachineServers } from \"../src/config.ts\";\n import { issuesServerFor, tokenGoesTo } from \"../src/core.ts\";\n import { searchLines } from \"../src/issues.ts\";\n import { main } from \"../src/main.ts\";\n@@ -26,13 +26,45 @@\n let issuesUrl: string;\n /** Every call the stand-in Issues server took. */\n const seen: string[] = [];\n+/** The bodies of the copy requests it took. */\n+const copies: Record<string, unknown>[] = [];\n const dirs: string[] = [];\n \n before(async () => {\n \tfake = await startFake(0, TOKEN);\n \tissues = createServer((req, res) => {\n \t\tseen.push(`${req.method} ${req.url}`);\n-\t\tres.writeHead(500, { \"content-type\": \"application/json\" }).end(JSON.stringify({ error: \"a stand-in\" }));\n+\t\tconst send = (status: number, body: unknown) =>\n+\t\t\tres.writeHead(status, { \"content-type\": \"application/json\" }).end(JSON.stringify(body));\n+\t\tif (req.method === \"POST\" && /\\/copy$/.test(req.url ?? \"\")) {\n+\t\t\tlet raw = \"\";\n+\t\t\treq.on(\"data\", (c: Buffer) => (raw += c.toString(\"utf8\")));\n+\t\t\treq.on(\"end\", () => {\n+\t\t\t\tconst body = JSON.parse(raw) as Record<string, unknown>;\n+\t\t\t\tcopies.push(body);\n+\t\t\t\t// Issue 403 stands for a live server refusing an agent's copy.\n+\t\t\t\tif (body.issue === 403 && body.dryRun !== true)\n+\t\t\t\t\treturn send(403, { error: \"copying an issue out of its project takes an owner of that project\" });\n+\t\t\t\tconst skipped = { comments: [4], asks: [2] };\n+\t\t\t\tif (body.dryRun === true)\n+\t\t\t\t\treturn send(200, {\n+\t\t\t\t\t\tdryRun: true,\n+\t\t\t\t\t\tplan: {\n+\t\t\t\t\t\t\tfrom: { project: body.from, issue: body.issue },\n+\t\t\t\t\t\t\ttitle: \"Sync is slow\",\n+\t\t\t\t\t\t\tedited: [\"description\"],\n+\t\t\t\t\t\t\tlabels: [\"client\"],\n+\t\t\t\t\t\t\tclosed: { how: \"done\" },\n+\t\t\t\t\t\t\tcomments: [{ edited: false }, { edited: true }],\n+\t\t\t\t\t\t\tasks: [{ edited: false }],\n+\t\t\t\t\t\t\tskipped,\n+\t\t\t\t\t\t},\n+\t\t\t\t\t});\n+\t\t\t\tsend(200, { ok: true, id: 31, from: { project: body.from, issue: body.issue }, skipped });\n+\t\t\t});\n+\t\t\treturn;\n+\t\t}\n+\t\tsend(500, { error: \"a stand-in\" });\n \t});\n \tawait new Promise<void>((ok) => issues.listen(0, \"127.0.0.1\", ok));\n \tissuesUrl = `http://127.0.0.1:${(issues.address() as AddressInfo).port}`;\n@@ -166,3 +198,84 @@\n \t\tassert.match(posts[0]!, /^POST \\/p\\/issues\\d+\\/a\\/erin\\/withdraw\\/3$/);\n \t});\n });\n+\n+describe(\"abso issue <N> --copy-to <project>\", () => {\n+\tconst text = async (cwd: string, argv: string[]) => {\n+\t\tconst r = await main(argv, { cwd, env: ENV(), write: () => {} });\n+\t\treturn { exit: r.exit, out: r.stdout + r.stderr };\n+\t};\n+\n+\tit(\"a dry run asks the other project's copy route for the plan, and says nothing was written\", async () => {\n+\t\tconst gil = await folder(\"gil\");\n+\t\tconst before = seen.length;\n+\t\tconst r = await text(gil, [\"issue\", \"12\", \"--copy-to\", \"core\", \"--dry-run\"]);\n+\t\tassert.equal(r.exit, 0, r.out);\n+\t\tassert.deepEqual(seen.slice(before), [\"POST /p/core/a/gil/copy\"]);\n+\t\tconst from = (copies.at(-1) as { from: string }).from;\n+\t\tassert.match(from, /^issues\\d+$/);\n+\t\tassert.deepEqual(copies.at(-1), { from, issue: 12, dryRun: true });\n+\t\tassert.equal(\n+\t\t\tr.out.trimEnd(),\n+\t\t\t[\n+\t\t\t\t`A dry run: nothing was written. Copying ${from} issue 12 into core would make:`,\n+\t\t\t\t`  \"Sync is slow\", done (description edited when copied)`,\n+\t\t\t\t\"  2 comments (1 edited), 1 answered ask, labelled client\",\n+\t\t\t\t\"  not copied: comments 4; asks 2 (open asks, and what --clean left out)\",\n+\t\t\t\t\"Run it again without --dry-run to copy it.\",\n+\t\t\t].join(\"\\n\"),\n+\t\t);\n+\t});\n+\n+\tit(\"copies with the cleaned texts --clean gives, by source id\", async () => {\n+\t\tconst gil = await folder(\"gil\");\n+\t\twriteFileSync(\n+\t\t\tjoin(gil, \"clean.json\"),\n+\t\t\tJSON.stringify({ description: \"Cleaned.\", comments: [{ id: 1 }, { id: 3, text: \"Cleaned too.\" }] }),\n+\t\t);\n+\t\tconst r = await text(gil, [\"issue\", \"12\", \"--copy-to\", \"core\", \"--clean\", \"clean.json\"]);\n+\t\tassert.equal(r.exit, 0, r.out);\n+\t\tconst from = (copies.at(-1) as { from: string }).from;\n+\t\tassert.deepEqual(copies.at(-1), {\n+\t\t\tdescription: \"Cleaned.\",\n+\t\t\tcomments: [{ id: 1 }, { id: 3, text: \"Cleaned too.\" }],\n+\t\t\tfrom,\n+\t\t\tissue: 12,\n+\t\t});\n+\t\tassert.match(\n+\t\t\tr.out,\n+\t\t\tnew RegExp(`^Copied ${from} issue 12 to core issue 31\\\\. Its comments and asks keep their authors`),\n+\t\t);\n+\t});\n+\n+\tit(\"says a dry run still works when the server refuses the copy\", async () => {\n+\t\tconst gil = await folder(\"gil\");\n+\t\tconst r = await text(gil, [\"issue\", \"403\", \"--copy-to\", \"core\"]);\n+\t\tassert.equal(r.exit, 1, r.out);\n+\t\tassert.match(r.out, /takes an owner of that project\\. --dry-run still shows what would go\\./);\n+\t});\n+\n+\tit(\"refuses mistakes before any call\", async () => {\n+\t\tconst gil = await folder(\"gil\");\n+\t\twriteFileSync(join(gil, \"bad.json\"), JSON.stringify({ from: \"elsewhere\" }));\n+\t\tconst before = seen.length;\n+\t\tfor (const [argv, why] of [\n+\t\t\t[[\"issue\", \"12\", \"--copy-to\", \"core\", \"--comment\", \"x\"], /--copy-to goes alone .* not with --comment/],\n+\t\t\t[[\"issue\", \"12\", \"--dry-run\"], /--clean and --dry-run go with --copy-to <project>/],\n+\t\t\t[[\"issue\", \"12\", \"--copy-to\", \"core\", \"--clean\", \"nope.json\"], /--clean nope\\.json: no such file/],\n+\t\t\t[\n+\t\t\t\t[\"issue\", \"12\", \"--copy-to\", \"core\", \"--clean\", \"bad.json\"],\n+\t\t\t\t/from isn't one of title, description, comments, asks/,\n+\t\t\t],\n+\t\t] as const) {\n+\t\t\tconst r = await text(gil, [...argv]);\n+\t\t\tassert.notEqual(r.exit, 0, argv.join(\" \"));\n+\t\t\tassert.match(r.out, why);\n+\t\t}\n+\t\tconst { project } = readConfig(gil);\n+\t\tassert.match(\n+\t\t\t(await text(gil, [\"issue\", \"12\", \"--copy-to\", project])).out,\n+\t\t\t/issue 12 is already in issues\\d+; --copy-to names another project/,\n+\t\t);\n+\t\tassert.equal(seen.length, before, \"nothing reached the Issues server\");\n+\t});\n+});"}],"ci":null}