Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed
MCP
show on this site's /mcp
CLI
abso show 283 --json
JSON
/christopher/abso-core/versions/283?format=json

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)

of shared·capacity··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 @@
121121 newer: ReadonlySet<AtomId>,
122122 spaceName: string,
123123 kept?: { parts: KeptParts; uses: string; changed: string },
124+ names?: ReadonlySet<string>,
124125 ): DefinitionCollision[] {
125126 if (draft.size === 0 || newer.size === 0) return [];
126127 const uses = kept
127128 ? kept.parts.get(`uses ${kept.uses}`, () => this.#usesOf(draft, view, baseView), usesBytes)
128129 : this.#usesFor(draft, view, baseView);
129130 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 [];
130134 const nowOf = () => (typeof nowView === "function" ? nowView() : nowView);
131135 const { baseDefs, nowDefs } = kept
132136 ? kept.parts.get(
--- a/worker/project/news.ts
+++ b/worker/project/news.ts
@@ -248,7 +248,12 @@
248248 viewAt(space: Space, version: number): ReadView;
249249 origin(atom: AtomId, spaceName: string): Origin;
250250 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(
253+ agent: AgentState,
254+ newer: ReadonlySet<AtomId>,
255+ names?: ReadonlySet<string>,
256+ ): DefinitionCollision[];
252257 queueNews(agent: AgentState, items: readonly NewsItem[], entries: Entry[]): void;
253258}
254259
@@ -320,14 +325,20 @@
320325 entries: Entry[],
321326): void {
322327 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> => {
326335 const touched = touchedFiles(host.graph, just, [host.viewAt(space, version - 1), host.viewAt(space, last(space))]);
327336 const before = definitionsIn(host.viewAt(space, version - 1), touched);
328337 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) ?? []),
338+ return new Set(
339+ [...new Set([...before.keys(), ...after.keys()])].filter(
340+ (name) => !before.has(name) || signature(before.get(name)!) !== signature(after.get(name) ?? []),
341+ ),
331342 );
332343 };
333344 for (const agent of [...host.agents.values()].toSorted((a, b) => (a.name < b.name ? -1 : 1))) {
@@ -335,10 +346,11 @@
335346 const draft = host.draft(agent);
336347 if (draft.length === 0) continue;
337348 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();
350+ const defs =
351+ changedNames.size > 0
352+ ? host.definitionCollisions(agent, host.newerFor(agent), changedNames).filter((d) => just.has(d.by))
353+ : [];
342354 host.queueNews(
343355 agent,
344356 [...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 @@
21052105 viewAt: (space, version) => this.#viewAt(space, version),
21062106 origin: (atom, spaceName) => this.#origin(atom, spaceName),
21072107 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),
21092109 queueNews: (agent, items, entries) => this.#queueNews(agent, items, entries),
21102110 };
21112111 return this.#news;
@@ -3111,7 +3111,11 @@
31113111 // The changed-definition rule (#11) -------------------------------------------
31123112
31133113 /** The rule for an agent's draft in its space. */
3114− #definitionCollisions(agent: AgentState, newer: ReadonlySet<AtomId>): DefinitionCollision[] {
3114+ #definitionCollisions(
3115+ agent: AgentState,
3116+ newer: ReadonlySet<AtomId>,
3117+ names?: ReadonlySet<string>,
3118+ ): DefinitionCollision[] {
31153119 const draft = new Set(this.#draft(agent));
31163120 if (draft.size === 0 || newer.size === 0) return [];
31173121 const space = this.#spaceOf(agent);
@@ -3126,6 +3130,8 @@
31263130 this.#viewAt(space, last(space)),
31273131 newer,
31283132 space.name,
3133+ undefined,
3134+ names,
31293135 );
31303136 }
31313137}