{"draft":null,"from":7,"to":318,"files":[{"path":"client/src/review.ts","added":19,"removed":11,"diff":"--- a/client/src/review.ts\n+++ b/client/src/review.ts\n@@ -1,23 +1,24 @@\n // Review (#44): review is reading what\n // landed. abso review lists the changes since you last looked, or shows one;\n // abso note leaves a note on lines, which follows them as the file changes;\n-// abso notes lists them. The server holds changes and notes (Engine, 15a3035).\n+// abso notes lists them. The server holds changes and notes.\n \n import { readFileSync } from \"node:fs\";\n import { join } from \"node:path\";\n import type { ChangeAnswer, NoteAnswer } from \"./api.ts\";\n import { bool, type Parsed, str, UsageError } from \"./args.ts\";\n import { type Env, type Output, open, plural, recordFolder } from \"./commands.ts\";\n-import { AVCS_DIR } from \"./config.ts\";\n+import { fromEnv } from \"./env-names.ts\";\n import { writeFileAtomic } from \"./folder.ts\";\n import { fileArg, when } from \"./history.ts\";\n+import { stateDir } from \"./state-dir.ts\";\n \n /** Where this folder last looked: a log position, kept in .avcs/review.json. */\n const MARK = \"review.json\";\n \n function readMark(root: string): number | undefined {\n \ttry {\n-\t\tconst n = (JSON.parse(readFileSync(join(root, AVCS_DIR, MARK), \"utf8\")) as { since?: unknown }).since;\n+\t\tconst n = (JSON.parse(readFileSync(join(stateDir(root), MARK), \"utf8\")) as { since?: unknown }).since;\n \t\treturn typeof n === \"number\" && Number.isInteger(n) && n >= 0 ? n : undefined;\n \t} catch {\n \t\treturn undefined;\n@@ -25,7 +26,7 @@\n }\n \n function writeMark(root: string, since: number): void {\n-\twriteFileAtomic(join(root, AVCS_DIR, MARK), `${JSON.stringify({ since })}\\n`);\n+\twriteFileAtomic(join(stateDir(root), MARK), `${JSON.stringify({ since })}\\n`);\n }\n \n const SAID = { comment: \"says\", objection: \"objects\", read: \"read it\" } as const;\n@@ -61,7 +62,7 @@\n \n /** One change in a list. */\n /**\n- * A change's title as a list shows it (#43, Git Lessons): the first line, cut\n+ * A change's title as a list shows it (#43): the first line, cut\n  * to 100 characters, as git log --oneline does, with an imported commit's\n  * trailer (`git <sha12>, <author>, <time>`) as a short hash beside it. The\n  * change page keeps the whole message.\n@@ -82,6 +83,13 @@\n \treturn `  ${c.id}  ${c.agent}, ${titleLine(c.title)}${c.open ? \" (still going)\" : \"\"}: ${versionsText(c)}${files}${open > 0 ? `; ${plural(open, \"open objection\")}` : \"\"}`;\n }\n \n+/** What a settle kept, read from outside: whose lines, not \"yours\" or \"theirs\". */\n+function keptText(s: ChangeAnswer[\"settled\"][number], settler: string): string {\n+\tif (s.kept === \"yours\") return `kept ${settler}'s`;\n+\tif (s.kept === \"theirs\") return `kept ${s.theirs.agent}'s`;\n+\treturn s.kept === \"both\" ? \"kept both\" : \"rewrote both sides\";\n+}\n+\n /** The change page, as text. */\n export function changePage(c: ChangeAnswer): string[] {\n \tconst out = [\n@@ -98,12 +106,12 @@\n \t\t),\n \t\t...(c.settled.length > 0\n \t\t\t? [\n-\t\t\t\t\t`Settled: ${c.settled.map((s) => `${s.file} (kept ${s.kept}, against ${s.theirs.agent}'s version ${s.theirs.version})`).join(\"; \")}.`,\n+\t\t\t\t\t`Settled: ${c.settled.map((s) => `${s.file} (${keptText(s, c.agent)}, against ${s.theirs.agent}'s version ${s.theirs.version})`).join(\"; \")}.`,\n \t\t\t\t]\n \t\t\t: []),\n \t\t...(c.refusals.length > 0\n \t\t\t? [\n-\t\t\t\t\t`Refused ${plural(c.refusals.length, \"time\")} on the way: ${c.refusals.map((r) => `${r.kinds.join(\", \")} (${r.files.join(\", \")})`).join(\"; \")}.`,\n+\t\t\t\t\t`Refused ${plural(c.refusals.length, \"time\")} on the way: ${c.refusals.map((r) => `${r.kinds.join(\", \")} (${r.files.join(\", \")})${r.message ? `: ${JSON.stringify(r.message)}` : \"\"}`).join(\"; \")}.`,\n \t\t\t\t]\n \t\t\t: []),\n \t\t...((c.reviewers ?? []).length > 0\n@@ -121,7 +129,7 @@\n async function findChange(api: ReturnType<typeof open>[\"api\"], word: string): Promise<ChangeAnswer> {\n \tif (/^\\d+$/.test(word)) return api.change(Number(word));\n \tconst v = /^v(\\d+)$/i.exec(word);\n-\t// show names a version's change (Engine, 6a2911b); older servers don't, and the recent changes are searched.\n+\t// show names a version's change; older servers don't, and the recent changes are searched.\n \tif (v) {\n \t\tconst shown = await api.show(Number(v[1]), { draft: null }).catch(() => undefined);\n \t\tif (shown?.change !== undefined) return api.change(shown.change);\n@@ -168,10 +176,10 @@\n \tconst cutoff = back === undefined ? 0 : Date.now() - back;\n \tconst lastActive = (c: ChangeAnswer): number => Math.max(c.time, ...c.versions.map((v) => v.time));\n \t// A first look shows the newest 20. Otherwise every change since the mark (or the span) is listed, page by\n-\t// page, before the mark moves past them (AVCS - Git Lessons' review): one page would drop the older ones.\n+\t// page, before the mark moves past them: one page would drop the older ones.\n \tconst firstLook = mark === undefined && raw === undefined;\n-\t// AVCS_REVIEW_PAGE shortens the page in tests.\n-\tconst pageSize = Number(process.env.AVCS_REVIEW_PAGE) || 200;\n+\t// ABSO_REVIEW_PAGE shortens the page in tests.\n+\tconst pageSize = Number(fromEnv(process.env, \"REVIEW_PAGE\")) || 200;\n \tconst answer = await api.changes(since, firstLook ? 20 : pageSize);\n \tconst all = [...answer.changes];\n \tfor ("}],"unmatched":[]}