--- a/worker/project/news.ts
+++ b/worker/project/news.ts
@@ -273,15 +273,25 @@
273273 names: ReadonlySet<string>, 275275 ): DefinitionCollision[]; 276+ /** The space's atoms at `version`: setOf as it was then (owed news). */ 277+ setAt(space: Space, version: number): ReadonlySet<AtomId>; 278+ /** collision, with theirs described from the agent's space at `version`, not its newest (owed news). */ 279+ collisionAt(agent: AgentState, pair: Pair, version: number): Collision; 278−/** A publish's definition news for other agents, not yet worked out: the version it made, and the names it changed. */
279−export interface OwedDefinitionNews {
283+ * A publish's news for other agents, not yet worked out: the version it made, and who made it. `all`: everything the 284+ * publish would have told them (same lines, definitions, moves; abso 714). Without it, as owed before 714, only the 285+ * definition news. `names`: the names its definitions changed, once worked out (owedNewsNames). 287+export interface OwedNews { 280288 readonly version: number; 281289 readonly space: string; 282290 readonly publisher: string; 283− readonly names: readonly string[];
291+ readonly names?: readonly string[]; 292+ readonly all?: boolean; 294+export type OwedDefinitionNews = OwedNews; 286296function lineNews(host: NewsHost, agent: AgentState, pairs: readonly Pair[]): NewsItem[] { 287297 return pairs.map((p) => ({ key: pairKey(p), text: linesText(host.collision(agent, p)) })); @@ -302,6 +312,8 @@
302312 just: ReadonlySet<AtomId>, 315+ /** The space's version the moved lines' files are read at: its newest, or an owed publish's own. */ 306318 const g = host.graph; 307319 const movers = [...just].filter((id) => g.atom(id).moves); @@ -314,7 +326,7 @@
316328 const was = host.viewAt(space, version - 1); 317− const now = host.viewAt(space, last(space));
329+ const after = host.viewAt(space, now); 318330 const out: NewsItem[] = []; 319331 for (const id of movers) { @@ -323,7 +335,7 @@
323335 .filter((k) => k.kind === "pos" && claimed.has(k.node)) 324336 .map((k) => k.node); 325337 if (moved.length === 0) continue; 326− out.push(moveItem(id, host.origin(id, space.name), was.fileOf(moved[0]!), now.fileOf(moved[0]!)));
338+ out.push(moveItem(id, host.origin(id, space.name), was.fileOf(moved[0]!), after.fileOf(moved[0]!))); @@ -360,37 +372,30 @@
360372 // For the host's logs (abso 702): a line as the work starts, written before it, and one as it ends, so work that 361373 // outlives its request still shows. No time in them: a Durable Object's clock stands still in synchronous code. 363− let files = 0;
365− const compareDefinitions = (): ReadonlySet<string> => {
366− const touched = touchedFiles(host.graph, just, [host.viewAt(space, version - 1), host.viewAt(space, last(space))]);
367− files = touched.size;
368− const before = definitionsIn(host.viewAt(space, version - 1), touched);
369− const after = definitionsIn(host.viewAt(space, last(space)), touched);
370− return new Set(
371− [...new Set([...before.keys(), ...after.keys()])].filter(
372− (name) => !before.has(name) || signature(before.get(name)!) !== signature(after.get(name) ?? []),
373− ),
374− );
375− };
376− // Owed (abso Capacity, 2026-10-15): the definition rule over every other draft was most of a publish's write on
377− // 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
378− // and moves are told here as before; the definition news is worked out after the write, against this version.
379− // Asked only once some other agent has a draft (news-lazy.test.ts: no news work at all otherwise).
376+ // Owed (abso 714, Christopher's base fix): on stored tables this news for other agents was most of a publish's one 377+ // write transaction (the same-lines pairs, the definitions, the moves, for every draft: about 10 s for a 30-line 378+ // change to abso's 12k-line index.ts), long enough to time storage out and reset the object (prod abso, 23:32Z 379+ // 2026-10-16). Owing, the publish only notes what it owes, here, once some other agent has a draft; it's worked out 380+ // after the commit, one agent at a time, against this version (newsOwed). Asked only then (news-lazy.test.ts: no 381+ // news work at all otherwise). 380382 let owing: boolean | undefined; 381− let owed = false;
382383 for (const agent of [...host.agents.values()].toSorted((a, b) => (a.name < b.name ? -1 : 1))) { 383384 if (agent === publisher || agent.space !== space.name) continue; 384385 const draft = host.draft(agent); 385386 if (draft.length === 0) continue; 387+ owing ??= host.owesDefinitionNews(); 389+ host.owe({ version, space: space.name, publisher: publisher.name, all: true }); 390+ host.logLine?.({ work: "publishNews", step: "owed", space: space.name, version, publisher: publisher.name }); 386393 if (drafts++ === 0) 387394 host.logLine?.({ work: "publishNews", step: "start", space: space.name, version, publisher: publisher.name }); 388395 const lines = pairsIn(host.graph, draft, just, unionOverlay(host.setOf(space), draft)); 389− changedNames ??= compareDefinitions();
390− owing ??= host.owesDefinitionNews();
391− if (owing && changedNames.size > 0) owed = true;
396+ changedNames ??= changedNamesAt(host, space, version); 393− changedNames.size > 0 && !owing
398+ changedNames.size > 0 394399 ? host.definitionCollisions(agent, host.newerFor(agent), changedNames).filter((d) => just.has(d.by)) @@ -409,43 +414,77 @@
410415 publisher: publisher.name, 412− files,
413417 changedNames: changedNames?.size ?? 0, 415− owed: owed ? 1 : 0,
417− if (owed)
418− host.owe({ version, space: space.name, publisher: publisher.name, names: [...(changedNames ?? [])].sort() });
423+ * The names whose definitions the publish at `version` changed, in the files it touched: before it against its own 424+ * version. Most publishes change none; then only the same-lines rule can bring news. A definition collision the publish 425+ * brings is one of these, so a draft that uses none of them has none (abso Capacity, prod abso 2026-10-15). 427+function changedNamesAt(host: NewsHost, space: Space, version: number): ReadonlySet<string> { 428+ const just = new Set(space.versions[version]!.atoms); 429+ const touched = touchedFiles(host.graph, just, [host.viewAt(space, version - 1), host.viewAt(space, version)]); 430+ const before = definitionsIn(host.viewAt(space, version - 1), touched); 431+ const after = definitionsIn(host.viewAt(space, version), touched); 433+ [...new Set([...before.keys(), ...after.keys()])].filter( 434+ (name) => !before.has(name) || signature(before.get(name)!) !== signature(after.get(name) ?? []), 439+/** owedNews's names, worked out once for a publish (the host keeps them on its row): changedNamesAt its version. */ 440+export function owedNewsNames(host: NewsHost, owed: OwedNews): string[] { 441+ const space = host.spaceNamed(owed.space); 442+ if (!space || owed.version > last(space) || !space.versions[owed.version]) return []; 443+ return [...changedNamesAt(host, space, owed.version)].sort(); 422447 * The definition news a publish owes, worked out as newsForOthers would have at that version: the same agents, the 423448 * same rule against the space at `owed.version` and the work published up to it, the same words and keys. Reads only. 424449 * An agent that has synced past the version since is left out (the version is no longer newer for it), and an item 425450 * an agent was already told (from its own edit since, or this run before) is dropped, as queueNews would. 427−export function definitionNewsOwed(
452+export function newsOwed( 429− owed: OwedDefinitionNews,
430− /** Only these agents (owedAgents' names), so a host can work the news out a few agents at a time (abso 714). */
455+ /** Only these agents (owedAgents' names), so a host can work the news out one agent at a time (abso 714). */ 431456 only?: readonly string[], 432457): { agent: string; items: NewsItem[] }[] { 433458 const space = host.spaceNamed(owed.space); 434459 if (!space || owed.version > last(space) || !space.versions[owed.version]) return []; 435460 const just = new Set(space.versions[owed.version]!.atoms); 436− const names = new Set(owed.names);
461+ let names: ReadonlySet<string> | undefined = owed.names ? new Set(owed.names) : undefined; 437462 const out: { agent: string; items: NewsItem[] }[] = []; 438463 for (const agent of [...host.agents.values()].toSorted((a, b) => (a.name < b.name ? -1 : 1))) { 439464 if (only && !only.includes(agent.name)) continue; 440465 if (!owedTo(host, owed, space, agent)) continue; 441− const defs = host
442− .definitionCollisionsAt(agent, host.newerAt(agent, owed.version), names, owed.version)
443− .filter((d) => just.has(d.by));
444− const items = definitionNews(defs).filter((item) => !agent.told.has(item.key));
466+ const draft = host.draft(agent); 467+ names ??= changedNamesAt(host, space, owed.version); 468+ const lines = owed.all 469+ ? pairsIn(host.graph, draft, just, unionOverlay(host.setAt(space, owed.version), draft)).map((p) => ({ 471+ text: linesText(host.collisionAt(agent, p, owed.version)), 477+ .definitionCollisionsAt(agent, host.newerAt(agent, owed.version), names, owed.version) 478+ .filter((d) => just.has(d.by)) 480+ const moves = owed.all ? moveNews(host, draft, just, space, owed.version, owed.version) : []; 481+ const items = [...lines, ...definitionNews(defs), ...moves].filter((item) => !agent.told.has(item.key)); 445482 if (items.length > 0) out.push({ agent: agent.name, items }); 486+/** newsOwed, under the name tonight's owed definition news had (abso 2341e805). */ 487+export const definitionNewsOwed = newsOwed; 451490 * The agents a publish's owed news may be for, in the order definitionNewsOwed takes them: every other agent in the