{"draft":null,"from":116,"to":318,"files":[{"path":"client/test/client.test.ts","added":71,"removed":5,"diff":"--- a/client/test/client.test.ts\n+++ b/client/test/client.test.ts\n@@ -824,6 +824,46 @@\n \t\t);\n \t});\n \n+\tit(\"shows and exports a version without earlier ones, refuses one a kept version builds on, and leaves shared alone\", async () => {\n+\t\tconst { name, folders } = await project({ \"a.txt\": \"a\\n\", \"b.txt\": \"b\\n\" }, \"alice\", \"bob\");\n+\t\tconst [alice, bob] = [folders.alice!, folders.bob!];\n+\t\twrite(alice, { \"a.txt\": \"a, changed\\n\" });\n+\t\tassert.equal((await avcs(alice, \"push\", \"-m\", \"change a\")).exit, 0);\n+\t\twrite(alice, { \"b.txt\": \"b, changed\\n\" });\n+\t\tassert.equal((await avcs(alice, \"push\", \"-m\", \"change b\")).exit, 0);\n+\t\twrite(alice, { \"a.txt\": \"a, changed again\\n\" });\n+\t\tassert.equal((await avcs(alice, \"push\", \"-m\", \"change a again\")).exit, 0);\n+\t\tconst before = shared(name);\n+\n+\t\tconst shown = await text(bob, \"show\", \"2\", \"--without\", \"1\");\n+\t\tassert.equal(shown.exit, 0, shown.stderr);\n+\t\tassert.match(\n+\t\t\tshown.stdout,\n+\t\t\t/^Version 2 of shared without version 1:\\n {2}version 1 by alice: change a\\nCompared with version 2: 1 file, 1 line added, 1 removed\\.\\nThe files hash to [0-9a-f]{64}; the same ask gives the same hash\\. Shared doesn't change\\./,\n+\t\t);\n+\t\tassert.match(shown.stdout, /-a, changed\\n\\+a\\n/);\n+\t\tassert.equal((await text(bob, \"show\", \"2:a.txt\", \"--without\", \"1\")).stdout, \"a\\n\");\n+\t\tassert.equal((await text(bob, \"show\", \"2:b.txt\", \"--without\", \"1\")).stdout, \"b, changed\\n\");\n+\n+\t\tconst refused = await text(bob, \"show\", \"3\", \"--without\", \"1\");\n+\t\tassert.equal(refused.exit, 2);\n+\t\tassert.equal(\n+\t\t\trefused.stdout,\n+\t\t\t\"Version 3 of shared can't leave out version 1: versions it keeps build on it.\\n  version 3 by alice: change a again\\n    builds on version 1 (a.txt)\\nLeaving those out too works: abso show 3 --without 1,3\\n\",\n+\t\t);\n+\t\tconst out = join(temp(), \"without\");\n+\t\tconst blocked = await avcs(bob, \"export\", out, \"--version\", \"3\", \"--without\", \"1\");\n+\t\tassert.equal(blocked.exit, 2);\n+\t\tassert.deepEqual(blocked.json.suggestion, [1, 3]);\n+\t\tconst exported = await avcs(bob, \"export\", out, \"--version\", \"3\", \"--without\", \"1,3\");\n+\t\tassert.equal(exported.exit, 0, exported.out);\n+\t\tassert.deepEqual(exported.json.without, [1, 3]);\n+\t\tassert.equal(readFileSync(join(out, \"a.txt\"), \"utf8\"), \"a\\n\");\n+\t\tassert.equal(readFileSync(join(out, \"b.txt\"), \"utf8\"), \"b, changed\\n\");\n+\t\tassert.deepEqual(shared(name), before, \"shared doesn't change\");\n+\t\tassert.equal((await text(bob, \"show\", \"3\", \"--without\", \"x\")).exit, 1);\n+\t});\n+\n \tit(\"refuses a push that builds on lines a drop took out, plainly, with exit 2\", async () => {\n \t\tconst { folders } = await project({ \"a.txt\": \"one\\ntwo\\n\" }, \"alice\", \"bob\");\n \t\tconst [alice, bob] = [folders.alice!, folders.bob!];\n@@ -1556,7 +1596,7 @@\n \t\tassert.equal(tokenGoesTo(\"https://sneaky.example\", trusted), false);\n \t\tassert.equal(tokenGoesTo(\"https://evil.example\", trusted), false);\n \t\tassert.equal(issuesServerFor(\"https://abso.example\", machine), \"https://issues.abso.example\");\n-\t\tassert.equal(issuesServerFor(\"https://staging.abso.example\", machine), undefined);\n+\t\tassert.equal(issuesServerFor(\"https://staging.abso.example\", machine), \"https://staging.abso.example/issues\");\n \t\tassert.deepEqual(machineServers(\"{not json\"), { trusted: [], issues: {} });\n \t\tassert.deepEqual(machineServers(undefined), { trusted: [], issues: {} });\n \t\tassert.equal(trustedList(\"https://a.example\", machine).split(\",\")[0], \"https://a.example\");\n@@ -2846,9 +2886,12 @@\n \tit(\"abso login, box and logout outside a folder act on https://api.abso.dev\", () => {\n \t\tconst outside = mkdtempSync(join(tmpdir(), \"abso-login-\"));\n \t\ttry {\n-\t\t\tassert.equal(boxServer(parseArgs(\"login\", [], { server: \"string\" }), { cwd: outside }), \"https://api.abso.dev\");\n+\t\t\tassert.equal(\n+\t\t\t\tboxServer(parseArgs(\"login\", [], { server: \"string\" }), { cwd: outside, env: {} }),\n+\t\t\t\t\"https://api.abso.dev\",\n+\t\t\t);\n \t\t\tconst given = parseArgs(\"login\", [\"--server\", \"https://example.test\"], { server: \"string\" });\n-\t\t\tassert.equal(boxServer(given, { cwd: outside }), \"https://example.test\");\n+\t\t\tassert.equal(boxServer(given, { cwd: outside, env: {} }), \"https://example.test\");\n \t\t} finally {\n \t\t\trmSync(outside, { recursive: true, force: true });\n \t\t}\n@@ -3193,7 +3236,7 @@\n \t\t\t\"Not checked yet. Version 4 is being checked (35 s so far).\",\n \t\t]);\n \t\tassert.deepEqual(ciText({ ...base, checked: { version: 2, result: \"none\" }, running: null }, 3, now), [\n-\t\t\t\"CI couldn't check version 2 (the box failed twice, or abso.json has nothing to run). Versions after 2 aren't checked yet.\",\n+\t\t\t\"CI couldn't check version 2 (the box failed twice, or the pipeline file has nothing to run). Versions after 2 aren't checked yet.\",\n \t\t]);\n \t\tassert.deepEqual(\n \t\t\tciText({ ...base, running: null, red: { version: 1, agent: null, message: null, lastGood: null } }, 1, now),\n@@ -3705,6 +3748,29 @@\n \t\tassert.equal((await avcs(dir, \"push\", \"-m\", \"rep writes\")).exit, 0);\n \t});\n \n+\tit(\"a reader talks: it announces, notes lines and closes notes, but still can't start or push (abso 682)\", async () => {\n+\t\tconst { name, folders } = await project({ \"a.txt\": \"a\\n\" }, \"alice\");\n+\t\tconst dir = temp();\n+\t\tconst joined = await main([\"join\", name, \"--agent\", \"rep\", \"--server\", fake.url, \"--reader\"], {\n+\t\t\tcwd: dir,\n+\t\t\tenv: ENV,\n+\t\t\twrite: () => {},\n+\t\t});\n+\t\tassert.equal(joined.exit, 0, joined.stdout + joined.stderr);\n+\t\t// Talking: news to the other agents, and notes on lines, made and closed.\n+\t\tconst said = await avcs(dir, \"announce\", \"reader here\");\n+\t\tassert.equal(said.exit, 0, said.out);\n+\t\tassert.deepEqual(said.json.to, [\"alice\"]);\n+\t\tconst noted = await avcs(dir, \"note\", \"a.txt:1\", \"why this line?\");\n+\t\tassert.equal(noted.exit, 0, noted.out);\n+\t\tassert.equal((await avcs(dir, \"note\", \"--close\", String(noted.json.id), \"--withdrawn\")).exit, 0);\n+\t\t// Code: still refused.\n+\t\tconst started = await main([\"start\", \"reader work\"], { cwd: dir, env: ENV, write: () => {} });\n+\t\tassert.match(started.stdout + started.stderr, /agent rep is a reader: it records nothing/);\n+\t\tassert.equal((await main([\"push\", \"-m\", \"x\"], { cwd: dir, env: ENV, write: () => {} })).exit, 1);\n+\t\tassert.equal((await avcs(folders.alice!, \"news\")).json.news.length > 0, true, \"alice heard the reader\");\n+\t});\n+\n \tit(\"reader on is refused while the agent has unpushed work, and changes nothing here\", async () => {\n \t\tconst { folders } = await project({ \"a.txt\": \"a\\n\" }, \"alice\");\n \t\twrite(folders.alice!, { \"a.txt\": \"a, unpushed\\n\" });\n@@ -4733,7 +4799,7 @@\n \t\t\tcredential: \"abso_bx_secret\",\n \t\t\tid: \"b_1\",\n \t\t\texpiresAt: Date.now() + 1e6,\n-\t\t\tgrant: { projects: [{ project: \"p\", role: \"writer\" }], max_agents: 1 },\n+\t\t\tgrant: { projects: [{ project: \"p\", role: \"writer\" }] },\n \t\t};\n \t\tmkdirSync(join(home, \".avcs\", \"boxes\"), { recursive: true });\n \t\twriteBox(record as never, home);"}],"unmatched":[]}