A publish's news for others runs the definition rule only for drafts that use a name the publish changed (abso Capacity; prod abso's publishes ran past the storage limit, 2026-10-15) Version 283 of shared· capacity· Oct 16 (2026-10-16 02:33 UTC) · Not checked
When a publish changes any definition, newsForOthers ran the definition rule for every agent with a draft (about 100 on abso), and the rule compared definitions in every file changed since that agent's own base: worker/src/index.ts was laid out and parsed again for each base. News only reports collisions this publish brings (their by is in just), and each is a name whose definition this publish changed.
So compareDefinitions now returns those names, worked out once, and DefinitionRule.collisions takes them: a draft that uses none of them has none, and the definitions changed since its base aren't worked out. Answers are unchanged.
On a copy of abso's tables, a publish changing about 300 lines of worker/src/index.ts plus 13 other files went from 56 s and 412,000 statements to 22.5 s and 158,000 (the second run on a busier machine; its first step took 18 s instead of 10). tsc and Biome clean; the 70 worker/project tests on news, definitions, publish and collisions: 329 pass.
Version 282 · Files at version 283
3 files, 34 lines added, 12 removed.
--- a/worker/project/definition-rule.ts
+++ b/worker/project/definition-rule.ts
@@ -121,12 +121,16 @@
121 121 newer: ReadonlySet<AtomId>, 122 122 spaceName: string, 123 123 kept?: { parts: KeptParts; uses: string; changed: string }, 124 + names?: ReadonlySet<string>, 124 125 ): DefinitionCollision[] { 125 126 if (draft.size === 0 || newer.size === 0) return []; 127 128 ? kept.parts.get(`uses ${kept.uses}`, () => this.#usesOf(draft, view, baseView), usesBytes) 128 129 : this.#usesFor(draft, view, baseView); 129 130 if (uses.size === 0) return []; 131 + // Only these names can collide (a publish's news, news.ts): a draft that uses none of them has none, and the 132 + // definitions changed since its base needn't be worked out. 133 + if (names && ![...uses.keys()].some((name) => names.has(name))) return []; 130 134 const nowOf = () => (typeof nowView === "function" ? nowView() : nowView); 131 135 const { baseDefs, nowDefs } = kept --- a/worker/project/news.ts
+++ b/worker/project/news.ts
@@ -248,7 +248,12 @@
248 248 viewAt(space: Space, version: number): ReadView; 249 249 origin(atom: AtomId, spaceName: string): Origin; 250 250 collision(agent: AgentState, pair: Pair): Collision; 251 − definitionCollisions(agent: AgentState, newer: ReadonlySet<AtomId>): DefinitionCollision[];
251 + /** `names`: only these can collide; a draft that uses none of them has none (newsForOthers). */ 252 + definitionCollisions( 254 + newer: ReadonlySet<AtomId>, 255 + names?: ReadonlySet<string>, 256 + ): DefinitionCollision[]; 252 257 queueNews(agent: AgentState, items: readonly NewsItem[], entries: Entry[]): void; @@ -320,14 +325,20 @@
322 327 const just = new Set(space.versions[version]!.atoms); 323 − let changedDefinitions: boolean | undefined;
324 − const compareDefinitions = () => {
325 − // Most publishes change no definition; then only the same-lines rule can bring news.
328 + // The names whose definitions this publish changed, worked out once. Most publishes change none; then only the 329 + // same-lines rule can bring news. A definition collision this publish brings (its `by` in `just`) is one of 330 + // these, so a draft that uses none of them has none, and the rule isn't run for it (abso Capacity, prod abso 331 + // 2026-10-15): it compared definitions in every file changed since each agent's base, for every agent with a draft, 332 + // and a publish touching abso's worker/src/index.ts took 48 s of it. 333 + let changedNames: ReadonlySet<string> | undefined; 334 + const compareDefinitions = (): ReadonlySet<string> => { 326 335 const touched = touchedFiles(host.graph, just, [host.viewAt(space, version - 1), host.viewAt(space, last(space))]); 327 336 const before = definitionsIn(host.viewAt(space, version - 1), touched); 328 337 const after = definitionsIn(host.viewAt(space, last(space)), touched); 329 − return [...new Set([...before.keys(), ...after.keys()])].some(
330 − (name) => !before.has(name) || signature(before.get(name)!) !== signature(after.get(name) ?? []),
339 + [...new Set([...before.keys(), ...after.keys()])].filter( 340 + (name) => !before.has(name) || signature(before.get(name)!) !== signature(after.get(name) ?? []), 333 344 for (const agent of [...host.agents.values()].toSorted((a, b) => (a.name < b.name ? -1 : 1))) { @@ -335,10 +346,11 @@
335 346 const draft = host.draft(agent); 336 347 if (draft.length === 0) continue; 337 348 const lines = pairsIn(host.graph, draft, just, unionOverlay(host.setOf(space), draft)); 338 − changedDefinitions ??= compareDefinitions();
339 − const defs = changedDefinitions
340 − ? host.definitionCollisions(agent, host.newerFor(agent)).filter((d) => just.has(d.by))
341 − : [];
349 + changedNames ??= compareDefinitions(); 351 + changedNames.size > 0 352 + ? host.definitionCollisions(agent, host.newerFor(agent), changedNames).filter((d) => just.has(d.by)) 344 356 [...lineNews(host, agent, lines), ...definitionNews(defs), ...moveNews(host, draft, just, space, version)], --- a/worker/project/project.ts
+++ b/worker/project/project.ts
@@ -2105,7 +2105,7 @@
2105 2105 viewAt: (space, version) => this.#viewAt(space, version), 2106 2106 origin: (atom, spaceName) => this.#origin(atom, spaceName), 2107 2107 collision: (agent, pair) => this.#collision(agent, pair), 2108 − definitionCollisions: (agent, newer) => this.#definitionCollisions(agent, newer),
2108 + definitionCollisions: (agent, newer, names) => this.#definitionCollisions(agent, newer, names), 2109 2109 queueNews: (agent, items, entries) => this.#queueNews(agent, items, entries), 2111 2111 return this.#news; @@ -3111,7 +3111,11 @@
3111 3111 // The changed-definition rule (#11) ------------------------------------------- 3113 3113 /** The rule for an agent's draft in its space. */ 3114 − #definitionCollisions(agent: AgentState, newer: ReadonlySet<AtomId>): DefinitionCollision[] {
3114 + #definitionCollisions( 3116 + newer: ReadonlySet<AtomId>, 3117 + names?: ReadonlySet<string>, 3118 + ): DefinitionCollision[] { 3115 3119 const draft = new Set(this.#draft(agent)); 3116 3120 if (draft.size === 0 || newer.size === 0) return []; 3117 3121 const space = this.#spaceOf(agent); @@ -3126,6 +3130,8 @@
3126 3130 this.#viewAt(space, last(space)),