{"version":309,"agent":"capacity","message":"A publish owes all its news for other agents after the commit, not only definition news (abso 714, piece 2 of Christopher's base fix)\n\n- With owesDefinitionNews set (abso's disk route), newsForOthers no longer works out other agents' news inside the publish. At the first other agent with a draft, it owes { version, space, publisher, all: true } and returns. Nothing else changes in the publish or its answer.\n- newsOwed(owed, only?) works the news out against the publish's version, for those agents only: same lines (pairsIn at the owed version), definitions (changed names, from owed.names or worked out once), and moves. Items an agent was already told are left out. definitionNewsOwed stays as an alias. A row from before all: true (names only) still tells definition news only.\n- owedNewsNames(owed) works out the changed definitions once, so a host can keep them on its row. New host hooks are setAt and collisionAt (project.ts), and moveNews takes the version to read at.\n- The publishNews end line no longer reports files: changed names are now worked out only when an agent needs them.\n- Tests: owed-definition-news.test.ts adds a test that each of three agents' full news (definition and same-lines), told one agent at a time after the publish, equals the news told at publish time, plus one where nothing is owed. news-lines.test.ts drops the files check.\n\nChecks: tsc and tsc -p server clean. Biome clean on the changed files; the existing errors in server/ are untouched. Core tests: worker/project and src, 762 passed, none failed.\nLab, on abso's Oct 14 tables with abso's disk route on top, in the 1470-shaped publish: publish 24,209 statements (was 36,038). The owed news then goes out in 17 short transactions (longest 3.8 s) for 16 agents.","time":1792198297392,"timeIso":"2026-10-17T00:51:37.392Z","changes":4,"change":5267,"files":["worker/project/news.ts","worker/project/project.ts","worker/project/test/news-lines.test.ts","worker/project/test/owed-definition-news.test.ts"],"draft":null,"diff":[{"path":"worker/project/news.ts","added":77,"removed":38,"diff":"--- a/worker/project/news.ts\n+++ b/worker/project/news.ts\n@@ -273,15 +273,25 @@\n \t\tnames: ReadonlySet<string>,\n \t\tversion: number,\n \t): DefinitionCollision[];\n+\t/** The space's atoms at `version`: setOf as it was then (owed news). */\n+\tsetAt(space: Space, version: number): ReadonlySet<AtomId>;\n+\t/** collision, with theirs described from the agent's space at `version`, not its newest (owed news). */\n+\tcollisionAt(agent: AgentState, pair: Pair, version: number): Collision;\n }\n \n-/** A publish's definition news for other agents, not yet worked out: the version it made, and the names it changed. */\n-export interface OwedDefinitionNews {\n+/**\n+ * A publish's news for other agents, not yet worked out: the version it made, and who made it. `all`: everything the\n+ * publish would have told them (same lines, definitions, moves; abso 714). Without it, as owed before 714, only the\n+ * definition news. `names`: the names its definitions changed, once worked out (owedNewsNames).\n+ */\n+export interface OwedNews {\n \treadonly version: number;\n \treadonly space: string;\n \treadonly publisher: string;\n-\treadonly names: readonly string[];\n+\treadonly names?: readonly string[];\n+\treadonly all?: boolean;\n }\n+export type OwedDefinitionNews = OwedNews;\n \n function lineNews(host: NewsHost, agent: AgentState, pairs: readonly Pair[]): NewsItem[] {\n \treturn pairs.map((p) => ({ key: pairKey(p), text: linesText(host.collision(agent, p)) }));\n@@ -302,6 +312,8 @@\n \tjust: ReadonlySet<AtomId>,\n \tspace: Space,\n \tversion: number,\n+\t/** The space's version the moved lines' files are read at: its newest, or an owed publish's own. */\n+\tnow = last(space),\n ): NewsItem[] {\n \tconst g = host.graph;\n \tconst movers = [...just].filter((id) => g.atom(id).moves);\n@@ -314,7 +326,7 @@\n \t\t}\n \t}\n \tconst was = host.viewAt(space, version - 1);\n-\tconst now = host.viewAt(space, last(space));\n+\tconst after = host.viewAt(space, now);\n \tconst out: NewsItem[] = [];\n \tfor (const id of movers) {\n \t\tconst moved = g\n@@ -323,7 +335,7 @@\n \t\t\t.filter((k) => k.kind === \"pos\" && claimed.has(k.node))\n \t\t\t.map((k) => k.node);\n \t\tif (moved.length === 0) continue;\n-\t\tout.push(moveItem(id, host.origin(id, space.name), was.fileOf(moved[0]!), now.fileOf(moved[0]!)));\n+\t\tout.push(moveItem(id, host.origin(id, space.name), was.fileOf(moved[0]!), after.fileOf(moved[0]!)));\n \t}\n \treturn out;\n }\n@@ -360,37 +372,30 @@\n \t// For the host's logs (abso 702): a line as the work starts, written before it, and one as it ends, so work that\n \t// outlives its request still shows. No time in them: a Durable Object's clock stands still in synchronous code.\n \tlet drafts = 0;\n-\tlet files = 0;\n \tlet news = 0;\n-\tconst compareDefinitions = (): ReadonlySet<string> => {\n-\t\tconst touched = touchedFiles(host.graph, just, [host.viewAt(space, version - 1), host.viewAt(space, last(space))]);\n-\t\tfiles = touched.size;\n-\t\tconst before = definitionsIn(host.viewAt(space, version - 1), touched);\n-\t\tconst after = definitionsIn(host.viewAt(space, last(space)), touched);\n-\t\treturn new Set(\n-\t\t\t[...new Set([...before.keys(), ...after.keys()])].filter(\n-\t\t\t\t(name) => !before.has(name) || signature(before.get(name)!) !== signature(after.get(name) ?? []),\n-\t\t\t),\n-\t\t);\n-\t};\n-\t// Owed (abso Capacity, 2026-10-15): the definition rule over every other draft was most of a publish's write on\n-\t// stored tables (5.5 of 7.3 s on abso in the lab, about 45 s in prod, long enough to reset the object). Same lines\n-\t// and moves are told here as before; the definition news is worked out after the write, against this version.\n-\t// Asked only once some other agent has a draft (news-lazy.test.ts: no news work at all otherwise).\n+\t// Owed (abso 714, Christopher's base fix): on stored tables this news for other agents was most of a publish's one\n+\t// write transaction (the same-lines pairs, the definitions, the moves, for every draft: about 10 s for a 30-line\n+\t// change to abso's 12k-line index.ts), long enough to time storage out and reset the object (prod abso, 23:32Z\n+\t// 2026-10-16). Owing, the publish only notes what it owes, here, once some other agent has a draft; it's worked out\n+\t// after the commit, one agent at a time, against this version (newsOwed). Asked only then (news-lazy.test.ts: no\n+\t// news work at all otherwise).\n \tlet owing: boolean | undefined;\n-\tlet owed = false;\n \tfor (const agent of [...host.agents.values()].toSorted((a, b) => (a.name < b.name ? -1 : 1))) {\n \t\tif (agent === publisher || agent.space !== space.name) continue;\n \t\tconst draft = host.draft(agent);\n \t\tif (draft.length === 0) continue;\n+\t\towing ??= host.owesDefinitionNews();\n+\t\tif (owing) {\n+\t\t\thost.owe({ version, space: space.name, publisher: publisher.name, all: true });\n+\t\t\thost.logLine?.({ work: \"publishNews\", step: \"owed\", space: space.name, version, publisher: publisher.name });\n+\t\t\treturn;\n+\t\t}\n \t\tif (drafts++ === 0)\n \t\t\thost.logLine?.({ work: \"publishNews\", step: \"start\", space: space.name, version, publisher: publisher.name });\n \t\tconst lines = pairsIn(host.graph, draft, just, unionOverlay(host.setOf(space), draft));\n-\t\tchangedNames ??= compareDefinitions();\n-\t\towing ??= host.owesDefinitionNews();\n-\t\tif (owing && changedNames.size > 0) owed = true;\n+\t\tchangedNames ??= changedNamesAt(host, space, version);\n \t\tconst defs =\n-\t\t\tchangedNames.size > 0 && !owing\n+\t\t\tchangedNames.size > 0\n \t\t\t\t? host.definitionCollisions(agent, host.newerFor(agent), changedNames).filter((d) => just.has(d.by))\n \t\t\t\t: [];\n \t\tconst items = [\n@@ -409,43 +414,77 @@\n \t\t\tversion,\n \t\t\tpublisher: publisher.name,\n \t\t\tdrafts,\n-\t\t\tfiles,\n \t\t\tchangedNames: changedNames?.size ?? 0,\n \t\t\tnews,\n-\t\t\towed: owed ? 1 : 0,\n \t\t});\n-\tif (owed)\n-\t\thost.owe({ version, space: space.name, publisher: publisher.name, names: [...(changedNames ?? [])].sort() });\n }\n \n /**\n+ * The names whose definitions the publish at `version` changed, in the files it touched: before it against its own\n+ * version. Most publishes change none; then only the same-lines rule can bring news. A definition collision the publish\n+ * brings is one of these, so a draft that uses none of them has none (abso Capacity, prod abso 2026-10-15).\n+ */\n+function changedNamesAt(host: NewsHost, space: Space, version: number): ReadonlySet<string> {\n+\tconst just = new Set(space.versions[version]!.atoms);\n+\tconst touched = touchedFiles(host.graph, just, [host.viewAt(space, version - 1), host.viewAt(space, version)]);\n+\tconst before = definitionsIn(host.viewAt(space, version - 1), touched);\n+\tconst after = definitionsIn(host.viewAt(space, version), touched);\n+\treturn new Set(\n+\t\t[...new Set([...before.keys(), ...after.keys()])].filter(\n+\t\t\t(name) => !before.has(name) || signature(before.get(name)!) !== signature(after.get(name) ?? []),\n+\t\t),\n+\t);\n+}\n+\n+/** owedNews's names, worked out once for a publish (the host keeps them on its row): changedNamesAt its version. */\n+export function owedNewsNames(host: NewsHost, owed: OwedNews): string[] {\n+\tconst space = host.spaceNamed(owed.space);\n+\tif (!space || owed.version > last(space) || !space.versions[owed.version]) return [];\n+\treturn [...changedNamesAt(host, space, owed.version)].sort();\n+}\n+\n+/**\n  * The definition news a publish owes, worked out as newsForOthers would have at that version: the same agents, the\n  * same rule against the space at `owed.version` and the work published up to it, the same words and keys. Reads only.\n  * An agent that has synced past the version since is left out (the version is no longer newer for it), and an item\n  * an agent was already told (from its own edit since, or this run before) is dropped, as queueNews would.\n  */\n-export function definitionNewsOwed(\n+export function newsOwed(\n \thost: NewsHost,\n-\towed: OwedDefinitionNews,\n-\t/** Only these agents (owedAgents' names), so a host can work the news out a few agents at a time (abso 714). */\n+\towed: OwedNews,\n+\t/** Only these agents (owedAgents' names), so a host can work the news out one agent at a time (abso 714). */\n \tonly?: readonly string[],\n ): { agent: string; items: NewsItem[] }[] {\n \tconst space = host.spaceNamed(owed.space);\n \tif (!space || owed.version > last(space) || !space.versions[owed.version]) return [];\n \tconst just = new Set(space.versions[owed.version]!.atoms);\n-\tconst names = new Set(owed.names);\n+\tlet names: ReadonlySet<string> | undefined = owed.names ? new Set(owed.names) : undefined;\n \tconst out: { agent: string; items: NewsItem[] }[] = [];\n \tfor (const agent of [...host.agents.values()].toSorted((a, b) => (a.name < b.name ? -1 : 1))) {\n \t\tif (only && !only.includes(agent.name)) continue;\n \t\tif (!owedTo(host, owed, space, agent)) continue;\n-\t\tconst defs = host\n-\t\t\t.definitionCollisionsAt(agent, host.newerAt(agent, owed.version), names, owed.version)\n-\t\t\t.filter((d) => just.has(d.by));\n-\t\tconst items = definitionNews(defs).filter((item) => !agent.told.has(item.key));\n+\t\tconst draft = host.draft(agent);\n+\t\tnames ??= changedNamesAt(host, space, owed.version);\n+\t\tconst lines = owed.all\n+\t\t\t? pairsIn(host.graph, draft, just, unionOverlay(host.setAt(space, owed.version), draft)).map((p) => ({\n+\t\t\t\t\tkey: pairKey(p),\n+\t\t\t\t\ttext: linesText(host.collisionAt(agent, p, owed.version)),\n+\t\t\t\t}))\n+\t\t\t: [];\n+\t\tconst defs =\n+\t\t\tnames.size > 0\n+\t\t\t\t? host\n+\t\t\t\t\t\t.definitionCollisionsAt(agent, host.newerAt(agent, owed.version), names, owed.version)\n+\t\t\t\t\t\t.filter((d) => just.has(d.by))\n+\t\t\t\t: [];\n+\t\tconst moves = owed.all ? moveNews(host, draft, just, space, owed.version, owed.version) : [];\n+\t\tconst items = [...lines, ...definitionNews(defs), ...moves].filter((item) => !agent.told.has(item.key));\n \t\tif (items.length > 0) out.push({ agent: agent.name, items });\n \t}\n \treturn out;\n }\n+/** newsOwed, under the name tonight's owed definition news had (abso 2341e805). */\n+export const definitionNewsOwed = newsOwed;\n \n /**\n  * The agents a publish's owed news may be for, in the order definitionNewsOwed takes them: every other agent in the"},{"path":"worker/project/project.ts","added":17,"removed":3,"diff":"--- a/worker/project/project.ts\n+++ b/worker/project/project.ts\n@@ -103,10 +103,11 @@\n import { move as hostedMove, type MoveHost } from \"./move.ts\";\n import {\n \taddressedItem,\n-\tdefinitionNewsOwed as hostedDefinitionNewsOwed,\n \tnewsAboutOwnDraft as hostedNewsAboutOwnDraft,\n \tnewsForOthers as hostedNewsForOthers,\n+\tnewsOwed as hostedNewsOwed,\n \towedAgents as hostedOwedAgents,\n+\towedNewsNames as hostedOwedNewsNames,\n \tmarkedItem,\n \ttype NewsHost,\n \ttype NewsItem,\n@@ -1353,11 +1354,21 @@\n \t\treturn owed;\n \t}\n \n-\t/** What a publish owes, worked out against its version (news.ts definitionNewsOwed), for `only` these agents if given. Reads only. */\n+\t/** What a publish owes, worked out against its version (news.ts newsOwed), for `only` these agents if given. Reads only. */\n+\tnewsOwed(owed: OwedDefinitionNews, only?: readonly string[]): { agent: string; items: NewsItem[] }[] {\n+\t\treturn hostedNewsOwed(this.#newsHost, owed, only);\n+\t}\n+\n+\t/** newsOwed, under the name owed definition news had before abso 714. */\n \tdefinitionNewsOwed(owed: OwedDefinitionNews, only?: readonly string[]): { agent: string; items: NewsItem[] }[] {\n-\t\treturn hostedDefinitionNewsOwed(this.#newsHost, owed, only);\n+\t\treturn this.newsOwed(owed, only);\n \t}\n \n+\t/** The names a publish's definitions changed (news.ts owedNewsNames), worked out once for its owed news. Reads only. */\n+\towedNewsNames(owed: OwedDefinitionNews): string[] {\n+\t\treturn hostedOwedNewsNames(this.#newsHost, owed);\n+\t}\n+\n \t/** The agents a publish's owed news may be for (news.ts owedAgents). Reads only. */\n \towedAgents(owed: OwedDefinitionNews): string[] {\n \t\treturn hostedOwedAgents(this.#newsHost, owed);\n@@ -2176,6 +2187,9 @@\n \t\t\tnewerAt: (agent, version) => this.#newerFor(agent, version),\n \t\t\tdefinitionCollisionsAt: (agent, newer, names, version) =>\n \t\t\t\tthis.#definitionCollisions(agent, newer, names, version),\n+\t\t\tsetAt: (space, version) => this.#at(space, version),\n+\t\t\tcollisionAt: (agent, pair, version) =>\n+\t\t\t\tthis.#describe(pair, this.#agentView(agent), this.#viewAt(this.#spaceOf(agent), version), agent.space),\n \t\t};\n \t\treturn this.#news;\n \t}"},{"path":"worker/project/test/news-lines.test.ts","added":0,"removed":1,"diff":"--- a/worker/project/test/news-lines.test.ts\n+++ b/worker/project/test/news-lines.test.ts\n@@ -37,7 +37,6 @@\n \t);\n \tassert.equal(news[0]!.publisher, \"lib\");\n \tassert.equal(news[1]!.drafts, 1);\n-\tassert.equal(news[1]!.files, 1);\n \tassert.equal(news[1]!.changedNames, 1);\n \tassert.equal(news[1]!.news, 1);\n });"},{"path":"worker/project/test/owed-definition-news.test.ts","added":45,"removed":1,"diff":"--- a/worker/project/test/owed-definition-news.test.ts\n+++ b/worker/project/test/owed-definition-news.test.ts\n@@ -66,7 +66,7 @@\n \tassert.deepEqual(owing.publish(\"ann\", \"parsePattern takes flags\", 4), toldAnswer, \"the publisher's answer\");\n \tconst owed = owing.takeOwedDefinitionNews();\n \tassert.deepEqual(owed, [\n-\t\t{ version: owing.version, space: owed[0]!.space, publisher: \"ann\", names: [\"parsePattern\"] },\n+\t\t{ version: owing.version, space: owed[0]!.space, publisher: \"ann\", all: true },\n \t]);\n \tassert.deepEqual(owing.takeOwedDefinitionNews(), [], \"handed over once\");\n \t// Not told yet: bob's news holds no definition news until it's delivered.\n@@ -145,3 +145,47 @@\n \towing.sync(\"bob\");\n \tassert.deepEqual(owing.owedAgents(owed!), [\"cat\"], \"synced past it\");\n });\n+\n+test(\"everything a publish tells other agents is owed and told after it, the same news (abso 714)\", () => {\n+\t// bob's draft calls parsePattern (definition news), dee's changes the line ann's publish changes (same-lines news),\n+\t// and cat's touches nothing of it (no news).\n+\tconst scenario = (project: Project) => {\n+\t\tdrafts(project);\n+\t\tproject.sync(\"dee\");\n+\t\tproject.edit(\n+\t\t\t\"dee\",\n+\t\t\t{ file: \"src/parse.ts\", old: \"parsePattern(text: string): Node\", new: \"parsePattern(input: string): Node\" },\n+\t\t\t5,\n+\t\t);\n+\t};\n+\tconst told = new Project(new MemoryStore());\n+\tscenario(told);\n+\tconst toldAnswer = told.publish(\"ann\", \"parsePattern takes flags\", 6);\n+\tconst expected = Object.fromEntries([\"bob\", \"cat\", \"dee\"].map((a) => [a, told.news(a).news.toSorted()]));\n+\tassert.ok(expected.bob!.length > 0 && expected.dee!.length > 0, \"the scenario has both kinds of news\");\n+\n+\tconst owing = new Project(new MemoryStore());\n+\towing.owesDefinitionNews = true;\n+\tscenario(owing);\n+\tassert.deepEqual(owing.publish(\"ann\", \"parsePattern takes flags\", 6), toldAnswer, \"the publisher's answer\");\n+\tconst [owed] = owing.takeOwedDefinitionNews();\n+\tassert.equal(owed!.all, true);\n+\tfor (const a of [\"bob\", \"cat\", \"dee\"]) assert.deepEqual(owing.news(a).news, [], `${a} is told nothing in the publish`);\n+\tconst names = owing.owedNewsNames(owed!);\n+\tassert.deepEqual(names, [\"parsePattern\"]);\n+\t// One agent at a time, as the host works it out.\n+\tfor (const agent of owing.owedAgents(owed!)) owing.deliverOwedNews(owing.newsOwed({ ...owed!, names }, [agent]));\n+\tfor (const a of [\"bob\", \"cat\", \"dee\"]) assert.deepEqual(owing.news(a).news.toSorted(), expected[a], a);\n+\t// Twice tells nothing more.\n+\tassert.deepEqual(owing.newsOwed({ ...owed!, names }), []);\n+});\n+\n+test(\"a publish that no other draft can collide with owes nothing\", () => {\n+\tconst owing = new Project(new MemoryStore());\n+\towing.owesDefinitionNews = true;\n+\towing.init({ \"a.txt\": \"one\\n\" }, 0);\n+\towing.sync(\"ann\");\n+\towing.edit(\"ann\", { file: \"a.txt\", old: \"one\", new: \"two\" }, 1);\n+\towing.publish(\"ann\", \"alone\", 2);\n+\tassert.deepEqual(owing.takeOwedDefinitionNews(), []);\n+});"}],"ci":null}