{"version":186,"agent":"candidates","message":"Read a version of shared without some earlier versions: abso show <N> --without A,B shows what differs and abso export <dir> --version N --without A,B writes the files. The server's GET without?version=&versions= checks the set left exactly as asked: when a version it keeps builds on one left out, it refuses with that chain, the files and the wider set that works, and never widens it. Atoms keep their ids and authors; shared and its log don't change; the same ask gives the same tree hash.","time":1792004002371,"timeIso":"2026-10-14T18:53:22.371Z","changes":25,"change":3023,"files":["client/src/api.ts","client/src/at.ts","client/src/changes.ts","client/src/export.ts","client/src/history-answers.ts","client/src/main.ts","client/src/without.ts","client/test/client.test.ts","client/test/fake-server.ts","server/src/engine-project.ts","server/src/project-object.ts","server/src/router.ts","worker/project/http.ts","worker/project/project-api.ts","worker/project/project.ts","worker/project/test/without.test.ts","worker/project/without.ts"],"draft":null,"diff":[{"path":"client/src/api.ts","added":6,"removed":0,"diff":"--- a/client/src/api.ts\n+++ b/client/src/api.ts\n@@ -50,6 +50,7 @@\n \tWhere,\n \tWhereAnswer,\n \tWhyAnswer,\n+\tWithoutAnswer,\n } from \"./history-answers.ts\";\n import type {\n \tAsk,\n@@ -878,6 +879,11 @@\n \t\treturn this.json(\"GET\", `/compare?${query({ from, to, ...where })}`);\n \t}\n \n+\t/** Version `version` of shared with `versions` left out, or the refusal naming what builds on them. */\n+\twithout(version: number, versions: readonly number[]): Promise<WithoutAnswer> {\n+\t\treturn this.json(\"GET\", `/without?${query({ version, versions: versions.join(\",\") })}`);\n+\t}\n+\n \t/** A message to the project's other agents (or those named), delivered once as news. */\n \tstarting(\n \t\ttext: string | null,"},{"path":"client/src/at.ts","added":8,"removed":7,"diff":"--- a/client/src/at.ts\n+++ b/client/src/at.ts\n@@ -25,19 +25,20 @@\n \treadonly modes: Map<string, FullMode>;\n }\n \n-/** Each file as it is on one side of a change (`before`), applied to the snapshot. */\n-function applyBefore(s: Snapshot, changes: readonly FileChange[]): void {\n+/** Each file as it is on one side of a change (`before` unless said), applied to the snapshot. */\n+export function applySide(s: Snapshot, changes: readonly FileChange[], side: \"before\" | \"after\" = \"before\"): void {\n \tfor (const f of changes) {\n \t\tif (isLocalOnly(f.path)) continue;\n-\t\tconst blob = f.blob?.before ?? null;\n+\t\tconst blob = f.blob?.[side] ?? null;\n+\t\tconst text = f[side];\n \t\tif (blob !== null) s.files.set(f.path, { blob });\n-\t\telse if (f.before !== null) s.files.set(f.path, { text: f.before });\n+\t\telse if (text !== null) s.files.set(f.path, { text });\n \t\telse {\n \t\t\ts.files.delete(f.path);\n \t\t\ts.modes.delete(f.path);\n \t\t\tcontinue;\n \t\t}\n-\t\tif (f.mode) s.modes.set(f.path, { exec: f.mode.before.exec === true, link: f.mode.before.link ?? null });\n+\t\tif (f.mode) s.modes.set(f.path, { exec: f.mode[side].exec === true, link: f.mode[side].link ?? null });\n \t}\n }\n \n@@ -56,9 +57,9 @@\n \tfor (const [rel, sha] of readKnownBlobs(root)) s.files.set(rel, { blob: sha });\n \tfor (const [rel, mode] of readKnownModes(root)) if (s.files.has(rel)) s.modes.set(rel, mode);\n \t// Its base: the draft's changes taken back out.\n-\tapplyBefore(s, diff.files);\n+\tapplySide(s, diff.files);\n \t// Version N: what differs from the base, as it was at N.\n-\tif (version !== diff.base) applyBefore(s, (await api.compare(version, diff.base, where)).files);\n+\tif (version !== diff.base) applySide(s, (await api.compare(version, diff.base, where)).files);\n \treturn s;\n }\n "},{"path":"client/src/changes.ts","added":46,"removed":0,"diff":"--- a/client/src/changes.ts\n+++ b/client/src/changes.ts\n@@ -28,6 +28,7 @@\n import { byWhom } from \"./history-answers.ts\";\n import { applyMode, PLAIN, readKnownModes, writeKnownModes } from \"./modes.ts\";\n import { refusedText, screenAnswer } from \"./safety.ts\";\n+import { refusalText, withoutArg, withoutHeading } from \"./without.ts\";\n \n /** The space to read: --draft (where \"shared\" means shared), else the one this agent is in (shared, in a folder with no agent). */\n function space(args: Parsed, agent: string): Where {\n@@ -425,6 +426,49 @@\n \treturn { text: lines.join(\"\\n\"), json: { ...answer } };\n }\n \n+/** abso show <version>[:<file>] --without <versions>: what differs with them left out, or that file then. */\n+async function showWithout(\n+\tapi: Api,\n+\troot: string,\n+\tcwd: string,\n+\tword: string,\n+\twhere: Where,\n+\tleave: readonly number[],\n+): Promise<Output> {\n+\tif (\"draft\" in where && where.draft !== null) throw new UsageError(\"--without reads shared, not a named draft\");\n+\tconst colon = word.indexOf(\":\");\n+\tconst v = version(colon >= 0 ? word.slice(0, colon) : word);\n+\tconst path = colon >= 0 ? fileArg(root, cwd, word.slice(colon + 1)) : undefined;\n+\tconst answer = await api.without(v, leave);\n+\tif (!answer.ok)\n+\t\treturn {\n+\t\t\texit: EXIT.refused,\n+\t\t\ttext: refusalText(answer, (vs) => `abso show ${word} --without ${vs.join(\",\")}`),\n+\t\t\tjson: { ...answer },\n+\t\t};\n+\tif (path !== undefined) {\n+\t\tconst file = answer.files.find((f) => f.path === path);\n+\t\tif (file === undefined) {\n+\t\t\tconst same = await api.fileAt(path, v, { draft: null });\n+\t\t\tif (same.text !== null) return { text: same.text, json: { ...same, without: answer.without } };\n+\t\t} else if (file.after !== null) return { text: file.after, json: { ...file, without: answer.without } };\n+\t\treturn {\n+\t\t\texit: EXIT.error,\n+\t\t\ttext: `${path} isn't in version ${v} of shared without them.`,\n+\t\t\tjson: { path, version: v, without: answer.without },\n+\t\t};\n+\t}\n+\tconst changed = pairRenames(answer.files);\n+\tconst d = diffs(changed);\n+\tconst lines = [\n+\t\t...withoutHeading(answer),\n+\t\tchanged.length === 0 ? `No file differs from version ${v}.` : `Compared with version ${v}: ${totals(changed)}.`,\n+\t\t`The files hash to ${answer.tree}; the same ask gives the same hash. Shared doesn't change.`,\n+\t\t...d.text,\n+\t];\n+\treturn { text: lines.join(\"\\n\"), json: { ...answer, files: d.json } };\n+}\n+\n export async function runShow(args: Parsed, env: Env): Promise<Output> {\n \tif (args.positionals.length !== 1)\n \t\tthrow new UsageError(\"show takes one version: abso show <version> or abso show <version>:<file>\");\n@@ -432,6 +476,8 @@\n \tconst word = args.positionals[0]!;\n \tconst colon = word.indexOf(\":\");\n \tconst where = space(args, config.agent);\n+\tconst leave = withoutArg(args);\n+\tif (leave !== undefined) return showWithout(api, root, env.cwd, word, where, leave);\n \n \tif (colon >= 0) {\n \t\tconst v = version(word.slice(0, colon));"},{"path":"client/src/export.ts","added":20,"removed":3,"diff":"--- a/client/src/export.ts\n+++ b/client/src/export.ts\n@@ -14,11 +14,12 @@\n import { dirname, join, resolve } from \"node:path\";\n import type { Where } from \"./api.ts\";\n import { type Parsed, str, UsageError } from \"./args.ts\";\n-import { globTest, snapshotAt, snapshotEntries } from \"./at.ts\";\n-import { type Env, type Output, open, plural } from \"./commands.ts\";\n+import { applySide, globTest, snapshotAt, snapshotEntries } from \"./at.ts\";\n+import { type Env, EXIT, type Output, open, plural } from \"./commands.ts\";\n import { ignoredHere } from \"./fetch.ts\";\n import { loadIgnore, relativeTo } from \"./folder.ts\";\n import { type Refused, unsafePath } from \"./safety.ts\";\n+import { refusalText, versionsText, withoutArg } from \"./without.ts\";\n \n /** The file an export leaves in its folder: what it holds, and the sign that the folder is one export may replace. */\n export const EXPORT_STAMP = \".abso-export\";\n@@ -81,8 +82,11 @@\n \tconst rawVersion = str(args, \"version\");\n \tif (rawVersion !== undefined && !/^\\d+$/.test(rawVersion))\n \t\tthrow new UsageError(`--version is a version number (got ${JSON.stringify(rawVersion)})`);\n+\tconst leave = withoutArg(args);\n \tconst diff = await api.diff();\n \tconst where: Where = { draft: diff.draft };\n+\tif (leave !== undefined && diff.draft !== null)\n+\t\tthrow new UsageError(`--without reads shared, and this folder is on draft ${diff.draft}`);\n \t// The listing names the version (the newest by default) and every file it holds; a server from before it answers 404.\n \tconst listing = await api\n \t\t.filesAt(diff.draft, rawVersion === undefined ? undefined : Number(rawVersion))\n@@ -106,6 +110,18 @@\n \t\t\t\t});\n \t\t}\n \t}\n+\t// Without some versions: the server says what differs from this version, as it is without them.\n+\tconst without = leave === undefined ? undefined : await api.without(version, leave);\n+\tif (without !== undefined && !without.ok)\n+\t\treturn {\n+\t\t\texit: EXIT.refused,\n+\t\t\ttext: refusalText(\n+\t\t\t\twithout,\n+\t\t\t\t(vs) => `abso export ${args.positionals[0]} --version ${version} --without ${vs.join(\",\")}`,\n+\t\t\t),\n+\t\t\tjson: { ...without },\n+\t\t};\n+\tif (without !== undefined) applySide(snap, without.files, \"after\");\n \tconst entries = await snapshotEntries(api, snap);\n \t// Built before anything is removed, so a failed export leaves an earlier one whole.\n \tconst keepGlob = str(args, \"keep\");\n@@ -135,13 +151,14 @@\n \t\tproject: config.project,\n \t\tspace: diff.draft ?? \"shared\",\n \t\tversion,\n+\t\t...(without !== undefined ? { without: without.without.map((w) => w.version), tree: without.tree } : {}),\n \t\tfiles: written,\n \t\texportedAt: new Date().toISOString(),\n \t};\n \twriteFileSync(join(target, EXPORT_STAMP), `${JSON.stringify(stamp)}\\n`);\n \treturn {\n \t\ttext: [\n-\t\t\t`Exported version ${version} of ${space} to ${target}: ${plural(written, \"file\")}. ${EXPORT_STAMP} there names the version; abso export to the same folder replaces it.`,\n+\t\t\t`Exported version ${version} of ${space}${without !== undefined ? ` without ${versionsText(without.without.map((w) => w.version))}` : \"\"} to ${target}: ${plural(written, \"file\")}. ${EXPORT_STAMP} there names the version; abso export to the same folder replaces it.`,\n \t\t\t...(kept.length > 0 ? [`Kept from the earlier export: ${kept.join(\", \")}.`] : []),\n \t\t\t...(skipped.length > 0\n \t\t\t\t? [`Not exported (${skipped.length}):`, ...skipped.map((s) => `  ${s.path}: ${s.why}`)]"},{"path":"client/src/history-answers.ts","added":22,"removed":0,"diff":"--- a/client/src/history-answers.ts\n+++ b/client/src/history-answers.ts\n@@ -73,6 +73,28 @@\n \t\t\t\treadonly files: readonly string[];\n \t\t\t}[];\n \t  };\n+/** A version of shared without some earlier ones (abso show --without, abso export --without). */\n+export type WithoutAnswer =\n+\t| {\n+\t\t\treadonly ok: true;\n+\t\t\treadonly version: number;\n+\t\t\treadonly without: readonly VersionRef[];\n+\t\t\t/** Every file that differs from the version: before, in it; after, without the others. */\n+\t\t\treadonly files: readonly FileChange[];\n+\t\t\t/** One hash of every file without them: the same ask always gives the same one. */\n+\t\t\treadonly tree: string;\n+\t  }\n+\t| {\n+\t\t\treadonly ok: false;\n+\t\t\treadonly version: number;\n+\t\t\treadonly without: readonly VersionRef[];\n+\t\t\t/** Versions it keeps that build on one it leaves out, each with what it builds on and where. */\n+\t\t\treadonly dependents: readonly (VersionRef & {\n+\t\t\t\treadonly needs: readonly { readonly version: number; readonly files: readonly string[] }[];\n+\t\t\t})[];\n+\t\t\t/** What to leave out for it to work: the versions asked, and every one that builds on them. */\n+\t\t\treadonly suggestion: readonly number[];\n+\t  };\n export type PluckAnswer =\n \t| { readonly ok: true; readonly version: number; readonly changes: number; readonly plucked: readonly unknown[] }\n \t| { readonly ok: false; readonly needs?: readonly VersionRef[]; readonly collisions?: readonly Collision[] };"},{"path":"client/src/main.ts","added":7,"removed":6,"diff":"--- a/client/src/main.ts\n+++ b/client/src/main.ts\n@@ -655,10 +655,10 @@\n \t\trun: runRestore,\n \t},\n \texport: {\n-\t\tflags: { version: \"string\", keep: \"string\" },\n-\t\tusage: \"abso export <dir> [--version <N>] [--keep <glob>]\",\n+\t\tflags: { version: \"string\", keep: \"string\", without: \"string\" },\n+\t\tusage: \"abso export <dir> [--version <N>] [--without <version,...>] [--keep <glob>]\",\n \t\tabout:\n-\t\t\t\"Write one pushed version of this folder's space (the newest unless --version) into a folder of its own, for a build that doesn't move. The folder must be empty, an earlier export (which it replaces, keeping node_modules and what --keep names), or one .absoignore leaves out; .avcs-export.json there names the version.\",\n+\t\t\t\"Write one pushed version of this folder's space (the newest unless --version) into a folder of its own, for a build that doesn't move. The folder must be empty, an earlier export (which it replaces, keeping node_modules and what --keep names), or one .absoignore leaves out; .avcs-export.json there names the version. --without 37,38 writes the version of shared with those earlier versions left out, and names them there too; shared doesn't change, and it is refused, naming the chain, when a version it keeps builds on one left out.\",\n \t\trun: runExport,\n \t},\n \tfiles: {\n@@ -677,9 +677,10 @@\n \t\trun: runLog,\n \t},\n \tshow: {\n-\t\tflags: { draft: \"string\" },\n-\t\tusage: \"abso show <version> | abso show <version>:<file> [--draft <name>]\",\n-\t\tabout: \"One version: who pushed it, why, and its diff. With :<file>, that file's text as it was then.\",\n+\t\tflags: { draft: \"string\", without: \"string\" },\n+\t\tusage: \"abso show <version> | abso show <version>:<file> [--draft <name>] [--without <version,...>]\",\n+\t\tabout:\n+\t\t\t\"One version: who pushed it, why, and its diff. With :<file>, that file's text as it was then. --without 37,38 shows the version of shared with those earlier versions left out: what differs, and with :<file> that file. Shared doesn't change. Refused, naming the chain, when a version it keeps builds on one left out.\",\n \t\trun: runShow,\n \t},\n \tannounce: {"},{"path":"client/src/without.ts","added":53,"removed":0,"diff":"--- /dev/null\n+++ b/client/src/without.ts\n@@ -0,0 +1,53 @@\n+// --without <version,...> on abso show and abso export: a version of shared with some earlier versions left out.\n+// The server reads it; shared doesn't change. When a version kept builds on one left out, it is refused with\n+// that chain and the wider set that works, which is never taken without being asked.\n+\n+import type { VersionRef, WithoutAnswer } from \"./api.ts\";\n+import { type Parsed, str, UsageError } from \"./args.ts\";\n+\n+/** The versions --without names, sorted, or undefined without it. */\n+export function withoutArg(args: Parsed): number[] | undefined {\n+\tconst raw = str(args, \"without\");\n+\tif (raw === undefined) return undefined;\n+\tconst words = raw\n+\t\t.split(\",\")\n+\t\t.map((w) => w.trim())\n+\t\t.filter((w) => w !== \"\");\n+\tif (words.length === 0 || words.some((w) => !/^\\d+$/.test(w)))\n+\t\tthrow new UsageError(`--without takes version numbers, like --without 37,38 (got ${JSON.stringify(raw)})`);\n+\treturn [...new Set(words.map(Number))].toSorted((a, b) => a - b);\n+}\n+\n+/** \"version 37\", \"versions 37 and 38\", \"versions 37, 38 and 40\". */\n+export function versionsText(versions: readonly number[]): string {\n+\tif (versions.length === 1) return `version ${versions[0]}`;\n+\treturn `versions ${versions.slice(0, -1).join(\", \")} and ${versions[versions.length - 1]}`;\n+}\n+\n+function ref(v: VersionRef): string {\n+\treturn `  version ${v.version} by ${v.agent}: ${v.message}`;\n+}\n+\n+/** The heading of an answer: the version and what it leaves out, one line each. */\n+export function withoutHeading(answer: WithoutAnswer): string[] {\n+\treturn [\n+\t\t`Version ${answer.version} of shared without ${versionsText(answer.without.map((w) => w.version))}:`,\n+\t\t...answer.without.map(ref),\n+\t];\n+}\n+\n+/** A refusal: which kept versions build on what is left out, and the ask that would work (`retry` writes it). */\n+export function refusalText(\n+\tanswer: Extract<WithoutAnswer, { ok: false }>,\n+\tretry: (versions: readonly number[]) => string,\n+): string {\n+\tconst asked = answer.without.map((w) => w.version);\n+\treturn [\n+\t\t`Version ${answer.version} of shared can't leave out ${versionsText(asked)}: versions it keeps build on ${asked.length === 1 ? \"it\" : \"them\"}.`,\n+\t\t...answer.dependents.flatMap((d) => [\n+\t\t\tref(d),\n+\t\t\t`    builds on ${d.needs.map((n) => `version ${n.version} (${n.files.join(\", \") || \"no file of its own\"})`).join(\", \")}`,\n+\t\t]),\n+\t\t`Leaving those out too works: ${retry(answer.suggestion)}`,\n+\t].join(\"\\n\");\n+}"},{"path":"client/test/client.test.ts","added":40,"removed":0,"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!];"},{"path":"client/test/fake-server.ts","added":15,"removed":1,"diff":"--- a/client/test/fake-server.ts\n+++ b/client/test/fake-server.ts\n@@ -271,7 +271,7 @@\n \t\t\treturn;\n \t\t}\n \t\tconst m =\n-\t\t\t/^\\/p\\/([^/]+)\\/(init|status|queue|change\\/\\d+|changes|notes|ci\\/revoke|ci|blame|why|where|labels|files|diff|log|show|file|compare|a\\/([^/]+)\\/(edit|record|publish|sync|run|draft|land|draft-sync|diff|restore|announce|news|starting|reader|drop|pluck|amend|label|files|unqueue|note|note-close|move))$/.exec(\n+\t\t\t/^\\/p\\/([^/]+)\\/(init|status|queue|change\\/\\d+|changes|notes|ci\\/revoke|ci|blame|why|where|labels|files|diff|log|show|file|compare|without|a\\/([^/]+)\\/(edit|record|publish|sync|run|draft|land|draft-sync|diff|restore|announce|news|starting|reader|drop|pluck|amend|label|files|unqueue|note|note-close|move))$/.exec(\n \t\t\t\turl.pathname,\n \t\t\t);\n \t\tif (!m) return send(res, 404, { error: \"no such route; see docs/v2-slice1.md\" });\n@@ -440,6 +440,20 @@\n \t\t\t\treturn send(res, code === \"bad-request\" ? 400 : 500, { error: e instanceof Error ? e.message : String(e) });\n \t\t\t}\n \t\t}\n+\t\tif (op === \"without\") {\n+\t\t\t// GET ?version=<n>&versions=<n,n>, as worker/project/http.ts routes it.\n+\t\t\tconst q = Object.fromEntries(url.searchParams) as Record<string, string | undefined>;\n+\t\t\ttry {\n+\t\t\t\treturn send(\n+\t\t\t\t\tres,\n+\t\t\t\t\t200,\n+\t\t\t\t\thosted.project.without(Number(q.version), (q.versions ?? \"\").split(\",\").filter(Boolean).map(Number)),\n+\t\t\t\t);\n+\t\t\t} catch (e) {\n+\t\t\t\tconst code = (e as { code?: string }).code;\n+\t\t\t\treturn send(res, code === \"bad-request\" ? 400 : 500, { error: e instanceof Error ? e.message : String(e) });\n+\t\t\t}\n+\t\t}\n \t\tif (op === \"log\" || op === \"show\" || op === \"file\" || op === \"compare\") {\n \t\t\t// As the Worker routes them: ?draft=<name>, shared when absent.\n \t\t\tconst q = Object.fromEntries(url.searchParams) as Record<string, string | undefined>;"},{"path":"server/src/engine-project.ts","added":3,"removed":0,"diff":"--- a/server/src/engine-project.ts\n+++ b/server/src/engine-project.ts\n@@ -522,6 +522,9 @@\n \tcompare(from: number, to: number, draft: string | null, agent?: string) {\n \t\treturn this.project.compare(from, to, { draft, ...(agent ? { agent } : {}) });\n \t}\n+\twithout(version: number, versions: readonly number[]) {\n+\t\treturn this.project.without(version, versions);\n+\t}\n \tshow(version: number, draft: string | null, agent?: string) {\n \t\treturn this.project.show(version, { draft, ...(agent ? { agent } : {}) });\n \t}"},{"path":"server/src/project-object.ts","added":1,"removed":0,"diff":"--- a/server/src/project-object.ts\n+++ b/server/src/project-object.ts\n@@ -49,6 +49,7 @@\n \t\"file\",\n \t\"files\",\n \t\"compare\",\n+\t\"without\",\n \t\"where\",\n \t\"feed\",\n \t\"drafts\","},{"path":"server/src/router.ts","added":1,"removed":0,"diff":"--- a/server/src/router.ts\n+++ b/server/src/router.ts\n@@ -53,6 +53,7 @@\n \t\"file\",\n \t\"files\",\n \t\"compare\",\n+\t\"without\",\n \t\"where\",\n \t\"feed\",\n \t\"drafts\","},{"path":"worker/project/http.ts","added":11,"removed":0,"diff":"--- a/worker/project/http.ts\n+++ b/worker/project/http.ts\n@@ -350,6 +350,17 @@\n \t\t\tconst limit = q.limit !== undefined && Number.isInteger(Number(q.limit)) ? Number(q.limit) : undefined;\n \t\t\treturn { status: 200, body: history.refusals(q.agent || undefined, limit) };\n \t\t}\n+\t\tif (op === \"without\") {\n+\t\t\t// GET ?version=<n>&versions=<n,n>: version n of shared with those versions left out (without.ts).\n+\t\t\tconst q = (body ?? {}) as Record<string, string | undefined>;\n+\t\t\tconst history = project as ProjectCalls & Partial<ProjectHistory>;\n+\t\t\tif (!history.without) return fail(501, \"without needs the engine\");\n+\t\t\tconst version = q.version !== undefined && /^\\d+$/.test(q.version) ? Number(q.version) : undefined;\n+\t\t\tconst versions = (q.versions ?? \"\").split(\",\").filter((s) => s.trim() !== \"\");\n+\t\t\tif (version === undefined || versions.length === 0 || versions.some((s) => !/^\\s*\\d+\\s*$/.test(s)))\n+\t\t\t\treturn fail(400, \"without needs ?version=<number>&versions=<number,number>\");\n+\t\t\treturn { status: 200, body: history.without(version, versions.map(Number)) };\n+\t\t}\n \t\tif (op === \"log\" || op === \"show\" || op === \"file\" || op === \"compare\") {\n \t\t\t// GETs: ?draft=<name> (shared when absent); log ?limit, ?path; show ?version; file ?path, ?version; compare ?from, ?to.\n \t\t\tconst q = (body ?? {}) as Record<string, string | undefined>;"},{"path":"worker/project/project-api.ts","added":2,"removed":0,"diff":"--- a/worker/project/project-api.ts\n+++ b/worker/project/project-api.ts\n@@ -157,6 +157,8 @@\n \tfileAt(path: string, version: number, draft: string | null, agent?: string): unknown;\n \t/** Every file that differs between two versions (#27). */\n \tcompare(from: number, to: number, draft: string | null, agent?: string): unknown;\n+\t/** Version `version` of shared without the versions in `versions` (without.ts). */\n+\twithout(version: number, versions: readonly number[]): unknown;\n \t/** One version: who, why, and each file before and after (#27). */\n \tshow(version: number, draft: string | null, agent?: string): unknown;\n \t/** What an agent's unpublished changes do, file by file (#27). */"},{"path":"worker/project/project.ts","added":16,"removed":0,"diff":"--- a/worker/project/project.ts\n+++ b/worker/project/project.ts\n@@ -202,6 +202,7 @@\n \twholeRules as hostedWholeRules,\n \ttype WholeHost,\n } from \"./whole-files.ts\";\n+import { without as hostedWithout, type WithoutHost } from \"./without.ts\";\n import { WriterAgents } from \"./writer-agents.ts\";\n \n export { MemoryStore } from \"./memory-store.ts\";\n@@ -1798,6 +1799,21 @@\n \t\treturn versionCompare(this.#logHost, ...args);\n \t}\n \n+\t/** A version of shared without some earlier versions, or the refusal naming what builds on them (without.ts). */\n+\twithout(version: number, versions: readonly number[]): ReturnType<typeof hostedWithout> {\n+\t\tconst host: WithoutHost = {\n+\t\t\tgraph: this.#graph,\n+\t\t\tshared: () => this.#shared,\n+\t\t\tneedInit: () => this.#needInit(),\n+\t\t\tcheckVersion: (space, v) => this.#checkVersion(space, v),\n+\t\t\tviewAt: (space, v) => this.#viewAt(space, v),\n+\t\t\tat: (space, v) => this.#at(space, v),\n+\t\t\tclosed: (set) => this.#closed(set),\n+\t\t\ttouchedFiles: (ids, views) => this.#touchedFiles(ids, views),\n+\t\t};\n+\t\treturn hostedWithout(host, version, versions);\n+\t}\n+\n \t/** A version of shared (or of a named draft) as a ReadView (version-log.ts). */\n \tviewAt(...args: Tail<Parameters<typeof versionViewAt>>): ReturnType<typeof versionViewAt> {\n \t\treturn versionViewAt(this.#logHost, ...args);"},{"path":"worker/project/test/without.test.ts","added":206,"removed":0,"diff":"--- /dev/null\n+++ b/worker/project/test/without.test.ts\n@@ -0,0 +1,206 @@\n+// A version without others: the files of one version of shared with some earlier versions left out. A read:\n+// shared and its log never change. Refused, naming the chain, when a version kept builds on one left out.\n+\n+import assert from \"node:assert/strict\";\n+import { test } from \"node:test\";\n+import { MemoryStore, Project, ProjectError } from \"../project.ts\";\n+import { treeHash } from \"../tree.ts\";\n+\n+const START = { \"a.ts\": \"one\\ntwo\\nthree\\n\", \"b.ts\": \"alpha\\nbeta\\n\" };\n+\n+function setup() {\n+\tconst store = new MemoryStore();\n+\tconst project = new Project(store, { hasBlob: () => true });\n+\tproject.init(START, 0);\n+\tfor (const a of [\"ann\", \"bob\", \"cat\"]) project.sync(a);\n+\treturn { project, store };\n+}\n+\n+/** ann publishes v1 (a.ts), bob v2 (b.ts), cat v3 (a new c.ts): three versions that don't build on each other. */\n+function threeVersions(project: Project): void {\n+\tproject.edit(\"ann\", { file: \"a.ts\", old: \"two\", new: \"TWO\" }, 1);\n+\tproject.publish(\"ann\", \"Shout two\", 2);\n+\tproject.edit(\"bob\", { file: \"b.ts\", old: \"beta\", new: \"BETA\" }, 3);\n+\tproject.publish(\"bob\", \"Shout beta\", 4);\n+\tproject.record(\"cat\", { \"c.ts\": \"gamma\\n\" }, 5);\n+\tproject.publish(\"cat\", \"Add c\", 6);\n+}\n+\n+const badRequest = (f: () => unknown): string => {\n+\ttry {\n+\t\tf();\n+\t} catch (e) {\n+\t\tif (e instanceof ProjectError && e.code === \"bad-request\") return e.message;\n+\t\tthrow e;\n+\t}\n+\treturn \"no error\";\n+};\n+\n+test(\"leaving out an independent version takes only its change out; the others stay as they are\", () => {\n+\tconst { project, store } = setup();\n+\tthreeVersions(project);\n+\tconst entries = store.entries.length;\n+\tconst answer = project.without(3, [1]);\n+\tassert.equal(answer.ok, true);\n+\tassert.ok(answer.ok);\n+\tassert.deepEqual(answer.without, [{ version: 1, agent: \"ann\", message: \"Shout two\" }]);\n+\tassert.deepEqual(answer.files, [{ path: \"a.ts\", before: \"one\\nTWO\\nthree\\n\", after: \"one\\ntwo\\nthree\\n\" }]);\n+\tassert.equal(\n+\t\tanswer.tree,\n+\t\ttreeHash({ files: { \"a.ts\": \"one\\ntwo\\nthree\\n\", \"b.ts\": \"alpha\\nBETA\\n\", \"c.ts\": \"gamma\\n\" } }),\n+\t);\n+\t// Shared is unchanged: same version, same files, nothing written to the log.\n+\tassert.equal(project.version, 3);\n+\tassert.deepEqual(project.files(), { \"a.ts\": \"one\\nTWO\\nthree\\n\", \"b.ts\": \"alpha\\nBETA\\n\", \"c.ts\": \"gamma\\n\" });\n+\tassert.equal(store.entries.length, entries);\n+\t// Two left out at once.\n+\tconst two = project.without(3, [3, 1]);\n+\tassert.ok(two.ok);\n+\tassert.deepEqual(\n+\t\ttwo.without.map((w) => w.version),\n+\t\t[1, 3],\n+\t);\n+\tassert.deepEqual(\n+\t\ttwo.files.map((f) => [f.path, f.after]),\n+\t\t[\n+\t\t\t[\"a.ts\", \"one\\ntwo\\nthree\\n\"],\n+\t\t\t[\"c.ts\", null],\n+\t\t],\n+\t);\n+});\n+\n+test(\"the same ask gives the same answer, and shared moving on doesn't change it\", () => {\n+\tconst { project } = setup();\n+\tthreeVersions(project);\n+\tconst first = project.without(3, [2]);\n+\tassert.deepEqual(project.without(3, [2]), first);\n+\tproject.sync(\"ann\");\n+\tproject.edit(\"ann\", { file: \"c.ts\", old: \"gamma\", new: \"GAMMA\" }, 7);\n+\tproject.publish(\"ann\", \"Shout gamma\", 8);\n+\tassert.deepEqual(project.without(3, [2]), first);\n+\t// Asked of the newer version, the newer change is in it.\n+\tconst later = project.without(4, [2]);\n+\tassert.ok(later.ok && first.ok);\n+\tassert.notEqual(later.tree, first.tree);\n+});\n+\n+test(\"leaving out a version a kept one builds on is refused, with the chain, the files and the wider set\", () => {\n+\tconst { project, store } = setup();\n+\tthreeVersions(project);\n+\tproject.sync(\"cat\");\n+\tproject.edit(\"cat\", { file: \"a.ts\", old: \"TWO\", new: \"TWO!\" }, 7);\n+\tproject.publish(\"cat\", \"Louder\", 8); // v4 builds on v1\n+\tproject.sync(\"bob\");\n+\tproject.edit(\"bob\", { file: \"a.ts\", old: \"TWO!\", new: \"TWO!!\" }, 9);\n+\tproject.publish(\"bob\", \"Louder still\", 10); // v5 builds on v4\n+\tconst entries = store.entries.length;\n+\tconst refused = project.without(5, [1]);\n+\tassert.deepEqual(refused, {\n+\t\tok: false,\n+\t\tversion: 5,\n+\t\twithout: [{ version: 1, agent: \"ann\", message: \"Shout two\" }],\n+\t\tdependents: [\n+\t\t\t{ version: 4, agent: \"cat\", message: \"Louder\", needs: [{ version: 1, files: [\"a.ts\"] }] },\n+\t\t\t{ version: 5, agent: \"bob\", message: \"Louder still\", needs: [{ version: 4, files: [\"a.ts\"] }] },\n+\t\t],\n+\t\tsuggestion: [1, 4, 5],\n+\t});\n+\tassert.equal(store.entries.length, entries);\n+\tassert.equal(project.version, 5);\n+\t// The suggestion, asked for, works; it's never applied without being asked.\n+\tconst wider = project.without(5, refused.ok ? [] : refused.suggestion);\n+\tassert.ok(wider.ok);\n+\tassert.deepEqual(wider.files, [{ path: \"a.ts\", before: \"one\\nTWO!!\\nthree\\n\", after: \"one\\ntwo\\nthree\\n\" }]);\n+\t// Before the dependent version, leaving it out is fine.\n+\tassert.equal(project.without(3, [1]).ok, true);\n+});\n+\n+test(\"a deletion left out brings the lines back; a rename left out keeps the old name; a move left out puts lines back\", () => {\n+\tconst { project } = setup();\n+\tproject.edit(\"ann\", { file: \"a.ts\", old: \"two\\n\", new: \"\" }, 1);\n+\tproject.publish(\"ann\", \"No two\", 2);\n+\tproject.record(\"bob\", { \"b.ts\": null, \"c.ts\": START[\"b.ts\"] }, 3);\n+\tproject.publish(\"bob\", \"Rename b to c\", 4);\n+\tproject.sync(\"cat\");\n+\tproject.move(\"cat\", \"a.ts\", \"src/a.ts\", 5);\n+\tproject.publish(\"cat\", \"Move a into src\", 6);\n+\tassert.deepEqual(project.files(), { \"src/a.ts\": \"one\\nthree\\n\", \"c.ts\": \"alpha\\nbeta\\n\" });\n+\n+\tconst noDelete = project.without(3, [1]);\n+\tassert.ok(noDelete.ok);\n+\tassert.deepEqual(\n+\t\tnoDelete.files.map((f) => [f.path, f.after]),\n+\t\t[[\"src/a.ts\", \"one\\ntwo\\nthree\\n\"]],\n+\t);\n+\tconst noRename = project.without(3, [2]);\n+\tassert.ok(noRename.ok);\n+\tassert.deepEqual(\n+\t\tnoRename.files.map((f) => [f.path, f.before, f.after]),\n+\t\t[\n+\t\t\t[\"b.ts\", null, \"alpha\\nbeta\\n\"],\n+\t\t\t[\"c.ts\", \"alpha\\nbeta\\n\", null],\n+\t\t],\n+\t);\n+\tconst noMove = project.without(3, [3]);\n+\tassert.ok(noMove.ok);\n+\tassert.deepEqual(\n+\t\tnoMove.files.map((f) => [f.path, f.after]),\n+\t\t[\n+\t\t\t[\"a.ts\", \"one\\nthree\\n\"],\n+\t\t\t[\"src/a.ts\", null],\n+\t\t],\n+\t);\n+});\n+\n+test(\"a binary file's change and an executable bit left out go back to what they were\", () => {\n+\tconst A = \"a\".repeat(64);\n+\tconst B = \"b\".repeat(64);\n+\tconst store = new MemoryStore();\n+\tconst project = new Project(store, { hasBlob: () => true });\n+\tproject.init({ \"run.sh\": \"echo hi\\n\" }, 0, {}, { \"logo.png\": A });\n+\tproject.sync(\"ann\");\n+\tproject.record(\"ann\", {}, 1, {}, { \"logo.png\": B });\n+\tproject.publish(\"ann\", \"New logo\", 2);\n+\tproject.record(\"ann\", {}, 3, { \"run.sh\": { exec: true } });\n+\tproject.publish(\"ann\", \"Make run.sh runnable\", 4);\n+\tconst noLogo = project.without(2, [1]);\n+\tassert.ok(noLogo.ok);\n+\tassert.deepEqual(\n+\t\tnoLogo.files.map((f) => [f.path, f.blob]),\n+\t\t[[\"logo.png\", { before: B, after: A }]],\n+\t);\n+\tconst noExec = project.without(2, [2]);\n+\tassert.ok(noExec.ok);\n+\tassert.deepEqual(\n+\t\tnoExec.files.map((f) => [f.path, f.mode?.after.exec ?? false]),\n+\t\t[[\"run.sh\", false]],\n+\t);\n+});\n+\n+test(\"versions it can't leave out are refused plainly\", () => {\n+\tconst { project } = setup();\n+\tthreeVersions(project);\n+\tassert.equal(project.drop(\"cat\", [2], \"Undo beta\", 7).ok, true); // v4 drops v2\n+\tassert.match(\n+\t\tbadRequest(() => project.without(3, [4])),\n+\t\t/comes after version 3/,\n+\t);\n+\tassert.match(\n+\t\tbadRequest(() => project.without(4, [0])),\n+\t\t/version 0 is the start/,\n+\t);\n+\tassert.match(\n+\t\tbadRequest(() => project.without(4, [4])),\n+\t\t/is a drop/,\n+\t);\n+\tassert.match(\n+\t\tbadRequest(() => project.without(4, [2])),\n+\t\t/isn't in version 4: version 4 dropped it/,\n+\t);\n+\tassert.match(\n+\t\tbadRequest(() => project.without(4, [])),\n+\t\t/versions to leave out/,\n+\t);\n+\t// Before the drop, it's there to leave out.\n+\tassert.equal(project.without(3, [2]).ok, true);\n+});"},{"path":"worker/project/without.ts","added":183,"removed":0,"diff":"--- /dev/null\n+++ b/worker/project/without.ts\n@@ -0,0 +1,183 @@\n+// A version of shared without some earlier versions: the files that version's atoms make when the atoms those\n+// versions added are left out. Shared doesn't change, and nothing is written: it is a read. The atoms keep\n+// their ids and authors; nothing is replayed or renumbered.\n+//\n+// The set left is checked exactly as asked. When a kept version builds on a left-out one, the answer is a\n+// refusal naming that chain, the files and the wider set that would work. It is never widened silently, and\n+// never closed again by a helper that would bring a left-out atom back.\n+\n+import { type AtomId, type Graph, type ReadView, View } from \"../../src/engine/index.ts\";\n+import { ProjectError } from \"./project-error.ts\";\n+import type { FileChange } from \"./project-types.ts\";\n+import type { Space } from \"./spaces.ts\";\n+import { treeHash } from \"./tree.ts\";\n+import { changesBetween, modesOf } from \"./view-changes.ts\";\n+\n+/** What a version without others needs from a project. */\n+export interface WithoutHost {\n+\treadonly graph: Graph;\n+\tshared(): Space;\n+\tneedInit(): void;\n+\tcheckVersion(space: Space, version: number): void;\n+\tviewAt(space: Space, version: number): ReadView;\n+\tat(space: Space, version: number): ReadonlySet<AtomId>;\n+\t/** The set as a view of it reads it: with any discarded atom a publish still depends on. */\n+\tclosed(set: ReadonlySet<AtomId>): ReadonlySet<AtomId>;\n+\ttouchedFiles(ids: Iterable<AtomId>, views: readonly ReadView[]): Set<string>;\n+}\n+\n+/** A version, as the answer names it. */\n+export interface VersionNamed {\n+\tversion: number;\n+\tagent: string;\n+\tmessage: string;\n+}\n+\n+/** A kept version that builds on a left-out one: the versions it builds on, and in which files. */\n+export interface BuildsOn extends VersionNamed {\n+\tneeds: { version: number; files: string[] }[];\n+}\n+\n+export type WithoutAnswer =\n+\t| {\n+\t\t\tok: true;\n+\t\t\tversion: number;\n+\t\t\twithout: VersionNamed[];\n+\t\t\t/** Every file that differs from the version as it is: before, in it; after, without the others. */\n+\t\t\tfiles: FileChange[];\n+\t\t\t/** The tree hash (tree.ts) of every file without them: the same ask always gives the same hash. */\n+\t\t\ttree: string;\n+\t  }\n+\t| {\n+\t\t\tok: false;\n+\t\t\tversion: number;\n+\t\t\twithout: VersionNamed[];\n+\t\t\t/** Kept versions that build on left-out ones, oldest first: each with what it builds on. */\n+\t\t\tdependents: BuildsOn[];\n+\t\t\t/** The versions to leave out for it to work: these and every dependent. A suggestion, never applied. */\n+\t\t\tsuggestion: number[];\n+\t  };\n+\n+/**\n+ * Version `version` of shared without the versions in `without`: what its\n+ * files are when those versions' atoms are left out. Refused, with the\n+ * chain, when a version kept builds on one left out.\n+ */\n+export function without(host: WithoutHost, version: number, versions: readonly number[]): WithoutAnswer {\n+\thost.needInit();\n+\tconst shared = host.shared();\n+\tif (!Number.isInteger(version)) throw new ProjectError(\"bad-request\", \"version must be a number\");\n+\thost.checkVersion(shared, version);\n+\tif (!Array.isArray(versions) || versions.length === 0)\n+\t\tthrow new ProjectError(\"bad-request\", \"without needs the versions to leave out\");\n+\tconst g = host.graph;\n+\tconst asked = [...new Set(versions)].toSorted((a, b) => a - b);\n+\tconst base = host.at(shared, version);\n+\tconst out = new Set<AtomId>();\n+\tfor (const v of asked) {\n+\t\tif (!Number.isInteger(v) || v < 1)\n+\t\t\tthrow new ProjectError(\n+\t\t\t\t\"bad-request\",\n+\t\t\t\t`there is no version ${String(v)} to leave out (version 0 is the start, which everything builds on)`,\n+\t\t\t);\n+\t\tif (v > version)\n+\t\t\tthrow new ProjectError(\"bad-request\", `version ${v} comes after version ${version}, so it isn't in it`);\n+\t\tconst p = shared.versions[v]!;\n+\t\tif (p.atoms.length === 0)\n+\t\t\tthrow new ProjectError(\n+\t\t\t\t\"bad-request\",\n+\t\t\t\t`version ${v} added nothing (it is a drop), so there is nothing to leave out`,\n+\t\t\t);\n+\t\tconst left = p.atoms.filter((id) => base.has(id));\n+\t\tif (left.length === 0)\n+\t\t\tthrow new ProjectError(\n+\t\t\t\t\"bad-request\",\n+\t\t\t\t`version ${v} isn't in version ${version}: version ${shared.droppedIn.get(p.atoms[0]!)} dropped it`,\n+\t\t\t);\n+\t\tfor (const id of left) out.add(id);\n+\t}\n+\tconst describe = (v: number): VersionNamed => ({\n+\t\tversion: v,\n+\t\tagent: shared.versions[v]!.agent,\n+\t\tmessage: shared.versions[v]!.message,\n+\t});\n+\tconst kept = new Set<AtomId>();\n+\tfor (const id of host.closed(base)) if (!out.has(id)) kept.add(id);\n+\n+\t// Everything kept that builds on what is left out, and the step that reached it.\n+\tconst gone = new Set(out);\n+\tconst steps: { from: AtomId; to: AtomId }[] = [];\n+\tconst stack = [...out];\n+\twhile (stack.length > 0) {\n+\t\tconst id = stack.pop()!;\n+\t\tfor (const d of g.dependentsOf(id)) {\n+\t\t\tif (!kept.has(d)) continue;\n+\t\t\tsteps.push({ from: d, to: id });\n+\t\t\tif (gone.has(d)) continue;\n+\t\t\tgone.add(d);\n+\t\t\tstack.push(d);\n+\t\t}\n+\t}\n+\tif (gone.size > out.size) {\n+\t\t// A discarded atom a publish still needs has no version of its own: it counts with the version that needs it.\n+\t\tconst versionOf = (id: AtomId): number | undefined => shared.publishedIn.get(id);\n+\t\tconst needs = new Map<number, Map<number, Set<string>>>();\n+\t\tconst resolved = (id: AtomId, seen = new Set<AtomId>()): number[] => {\n+\t\t\tconst v = versionOf(id);\n+\t\t\tif (v !== undefined) return [v];\n+\t\t\tif (seen.has(id)) return [];\n+\t\t\tseen.add(id);\n+\t\t\treturn [...new Set(steps.filter((s) => s.from === id).flatMap((s) => resolved(s.to, seen)))];\n+\t\t};\n+\t\tfor (const { from, to } of steps) {\n+\t\t\tconst dv = versionOf(from);\n+\t\t\tif (dv === undefined) continue;\n+\t\t\tconst files = g.filesOf(from).length > 0 ? g.filesOf(from) : g.filesOf(to);\n+\t\t\tfor (const nv of resolved(to)) {\n+\t\t\t\tif (nv === dv) continue;\n+\t\t\t\tlet of = needs.get(dv);\n+\t\t\t\tif (!of) needs.set(dv, (of = new Map()));\n+\t\t\t\tlet set = of.get(nv);\n+\t\t\t\tif (!set) of.set(nv, (set = new Set()));\n+\t\t\t\tfor (const f of files) set.add(f);\n+\t\t\t}\n+\t\t}\n+\t\tconst dependents = [...needs.keys()]\n+\t\t\t.filter((v) => !asked.includes(v))\n+\t\t\t.toSorted((a, b) => a - b)\n+\t\t\t.map((v) => ({\n+\t\t\t\t...describe(v),\n+\t\t\t\tneeds: [...needs.get(v)!]\n+\t\t\t\t\t.toSorted(([a], [b]) => a - b)\n+\t\t\t\t\t.map(([n, files]) => ({ version: n, files: [...files].toSorted() })),\n+\t\t\t}));\n+\t\treturn {\n+\t\t\tok: false,\n+\t\t\tversion,\n+\t\t\twithout: asked.map(describe),\n+\t\t\tdependents,\n+\t\t\tsuggestion: [...new Set([...asked, ...dependents.map((d) => d.version)])].toSorted((a, b) => a - b),\n+\t\t};\n+\t}\n+\n+\t// The set is checked; the engine's View refuses one that isn't closed, so nothing left out comes back.\n+\tconst before = host.viewAt(shared, version);\n+\tconst after = new View(g, kept);\n+\tconst files = changesBetween(before, after, host.touchedFiles(out, [before, after]));\n+\tconst all = after.paths();\n+\tconst blobs: Record<string, string> = {};\n+\tconst texts: Record<string, string> = {};\n+\tfor (const path of all) {\n+\t\tconst blob = after.attrs(path).blob;\n+\t\tif (blob !== null) blobs[path] = blob;\n+\t\telse texts[path] = after.text(path);\n+\t}\n+\tconst modes = modesOf(after);\n+\treturn {\n+\t\tok: true,\n+\t\tversion,\n+\t\twithout: asked.map(describe),\n+\t\tfiles,\n+\t\ttree: treeHash({ files: texts, blobs, modes }),\n+\t};\n+}"}],"ci":null}