{"draft":null,"from":52,"to":53,"files":[{"path":"client/test/issues.test.ts","added":73,"removed":1,"diff":"--- a/client/test/issues.test.ts\n+++ b/client/test/issues.test.ts\n@@ -14,7 +14,8 @@\n import { after, before, describe, it } from \"node:test\";\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 { issuePage, searchLines } from \"../src/issues.ts\";\n+import type { IssuePage } from \"../src/issues-wire.ts\";\n import { main } from \"../src/main.ts\";\n import { argvFor, mcpTools } from \"../src/mcp.ts\";\n import { type Fake, startFake } from \"./fake-server.ts\";\n@@ -64,6 +65,12 @@\n \t\t\t});\n \t\t\treturn;\n \t\t}\n+\t\t// An ack answers with the ask, acknowledged and still open.\n+\t\tconst ack = /\\/a\\/([^/]+)\\/ack\\/(\\d+)$/.exec(req.url ?? \"\");\n+\t\tif (req.method === \"POST\" && ack)\n+\t\t\treturn send(200, {\n+\t\t\t\task: { id: Number(ack[2]), by: \"desk\", of: ack[1], answer: null, ack: { at: Date.now(), note: \"\" } },\n+\t\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@@ -197,6 +204,71 @@\n \t\tassert.equal(posts.length, 1, posts.join(\"\\n\"));\n \t\tassert.match(posts[0]!, /^POST \\/p\\/issues\\d+\\/a\\/erin\\/withdraw\\/3$/);\n \t});\n+\n+\tit(\"ack is one POST to the one asked's ack/<ask> route, and says the ask stays open\", async () => {\n+\t\tconst fay = await folder(\"fay\");\n+\t\tconst before = seen.length;\n+\t\tconst r = await main([\"ack\", \"7\", \"on it after the deploy\"], { cwd: fay, env: ENV(), write: () => {} });\n+\t\tassert.equal(r.exit, 0, r.stdout + r.stderr);\n+\t\tassert.equal(r.stdout, 'Acknowledged ask 7. desk hears it; the ask stays open until abso answer 7 \"...\".\\n');\n+\t\tconst posts = seen.slice(before).filter((s) => s.startsWith(\"POST\"));\n+\t\tassert.deepEqual(posts.length, 1, posts.join(\"\\n\"));\n+\t\tassert.match(posts[0]!, /^POST \\/p\\/issues\\d+\\/a\\/fay\\/ack\\/7$/);\n+\t\tassert.equal((await main([\"ack\"], { cwd: fay, env: ENV(), write: () => {} })).exit, 1);\n+\t});\n+\n+\tit(\"an acknowledged ask reads as acknowledged, not answered, with the note under it\", () => {\n+\t\tconst ask = {\n+\t\t\tid: 7,\n+\t\t\tissue: 3,\n+\t\t\tby: \"desk\",\n+\t\t\tof: \"fay\",\n+\t\t\tkind: \"question\",\n+\t\t\tquestion: \"Which way?\",\n+\t\t\treview: false,\n+\t\t\tdue: null,\n+\t\t\trecommendation: null,\n+\t\t\toptions: [],\n+\t\t\tblocks: [],\n+\t\t\tat: 0,\n+\t\t\tanswer: null,\n+\t\t\tseen: 0,\n+\t\t\tack: { at: 0, note: \"on it after the deploy\" },\n+\t\t};\n+\t\tconst page = {\n+\t\t\tissue: {\n+\t\t\t\tid: 3,\n+\t\t\t\ttitle: \"t\",\n+\t\t\t\tstatus: \"blocked\",\n+\t\t\t\tparent: null,\n+\t\t\t\topened: { by: \"desk\", at: 0 },\n+\t\t\t\tagent: null,\n+\t\t\t\tagents: [],\n+\t\t\t\tblockedBy: [],\n+\t\t\t\tlabels: [],\n+\t\t\t\tversions: [],\n+\t\t\t\twaitingOn: [\"fay\"],\n+\t\t\t\tclosed: null,\n+\t\t\t\tdescription: \"\",\n+\t\t\t\tlines: null,\n+\t\t\t\twatchers: [],\n+\t\t\t},\n+\t\t\tcomments: [],\n+\t\t\tedits: [],\n+\t\t\tasks: [ask],\n+\t\t\tclaims: [],\n+\t\t\tchildren: [],\n+\t\t} as unknown as IssuePage;\n+\t\tconst text = issuePage(page).join(\"\\n\");\n+\t\tassert.match(\n+\t\t\ttext,\n+\t\t\t/\\n {2}ask 7: desk, [^\\n]*asks fay a question on issue 3 \\(acknowledged [^;)]+, not answered yet\\): \"Which way\\?\"\\n {4}fay acknowledged: \"on it after the deploy\"/,\n+\t\t);\n+\t\tassert.doesNotMatch(text, /answer:/);\n+\t\tconst answered = { ...ask, answer: { by: \"fay\", words: \"This way\", at: 0 } };\n+\t\tconst later = issuePage({ ...page, asks: [answered] } as unknown as IssuePage).join(\"\\n\");\n+\t\tassert.doesNotMatch(later, /acknowledged/, \"an answer replaces the ack\");\n+\t});\n });\n \n describe(\"abso issue <N> --copy-to <project>\", () => {"}],"unmatched":[]}