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

Versions 294 to 318

Compare

+77 −4 in 10 places
Lines 105–117 at 318 (were 105–113 at 294)
105105 addressedItem,
106106 newsAboutOwnDraft as hostedNewsAboutOwnDraft,
107107 newsForOthers as hostedNewsForOthers,
108+ newsOwed as hostedNewsOwed,
109+ owedAgents as hostedOwedAgents,
110+ owedNewsNames as hostedOwedNewsNames,
108111 markedItem,
109112 type NewsHost,
110113 type NewsItem,
114+ type OwedDefinitionNews,
111115 reviewItem,
112116 settledItem,
113117} from "./news.ts";
Lines 222–228 at 318 (were 218–223 at 294)
218222 compare as versionCompare,
219223 compareSummary as versionCompareSummary,
220224 fileAt as versionFileAt,
225+ fileExactAt as versionFileExactAt,
221226 log as versionLog,
222227 ribbon as versionRibbon,
223228 show as versionShow,
Lines 335–346 at 318 (were 330–335 at 294)
330335 * doesn't depend on it.
331336 */
332337 checkerReady = false;
338+ /**
339+ * Owed news (abso Capacity, 2026-10-15): a publish's definition news for other agents is left for after its write
340+ * (takeOwedDefinitionNews, definitionNewsOwed, deliverOwedNews). The disk route sets it; the replay engine doesn't.
341+ */
342+ owesDefinitionNews = false;
343+ #owed: OwedDefinitionNews[] = [];
333344 readonly #now: (() => number) | undefined;
334345 readonly #newsWritten: ((items: readonly NewsWritten[]) => void) | undefined;
335346 readonly #whole: ProjectOptions["whole"];
Lines 1348–1391 at 318 (were 1337–1342 at 294)
13371348 return hostedAnnouncePerson(this.#announceHost, ...args);
13381349 }
13391350
1351+ /** The definition news the writes since the last call owe other agents, handed over once (news.ts). */
1352+ takeOwedDefinitionNews(): OwedDefinitionNews[] {
1353+ const owed = this.#owed;
1354+ this.#owed = [];
1355+ return owed;
1356+ }
1358+ /** What a publish owes, worked out against its version (news.ts newsOwed), for `only` these agents if given. Reads only. */
1359+ newsOwed(owed: OwedDefinitionNews, only?: readonly string[]): { agent: string; items: NewsItem[] }[] {
1360+ return hostedNewsOwed(this.#newsHost, owed, only);
1361+ }
1363+ /** newsOwed, under the name owed definition news had before abso 714. */
1364+ definitionNewsOwed(owed: OwedDefinitionNews, only?: readonly string[]): { agent: string; items: NewsItem[] }[] {
1365+ return this.newsOwed(owed, only);
1366+ }
1368+ /** The names a publish's definitions changed (news.ts owedNewsNames), worked out once for its owed news. Reads only. */
1369+ owedNewsNames(owed: OwedDefinitionNews): string[] {
1370+ return hostedOwedNewsNames(this.#newsHost, owed);
1371+ }
1373+ /** The agents a publish's owed news may be for (news.ts owedAgents). Reads only. */
1374+ owedAgents(owed: OwedDefinitionNews): string[] {
1375+ return hostedOwedAgents(this.#newsHost, owed);
1376+ }
1378+ /** Tells each agent its owed items, as queueNews does: what an agent was already told adds nothing. */
1379+ deliverOwedNews(found: readonly { agent: string; items: readonly NewsItem[] }[]): number {
1380+ const entries: Entry[] = [];
1381+ for (const { agent: name, items } of found) {
1382+ const agent = this.#agents.get(name);
1383+ if (agent) this.#queueNews(agent, items, entries);
1384+ }
1385+ this.#flush(entries);
1386+ return entries.length;
1387+ }
13401389 /** A seat's earlier chat hears that another chat just used the seat (announce.ts seatNotice). */
13411390 seatNotice(...args: Tail<Parameters<typeof hostedSeatNotice>>): ReturnType<typeof hostedSeatNotice> {
13421391 return hostedSeatNotice(this.#announceHost, ...args);
Lines 2009–2019 at 318 (were 1960–1965 at 294)
19602009 return versionFileAt(this.#logHost, ...args);
19612010 }
19622011
2012+ /** fileAt for exactly this spelling, from the file's own lines: no list of the version's files (version-log.ts). */
2013+ fileExactAt(...args: Tail<Parameters<typeof versionFileExactAt>>): ReturnType<typeof versionFileExactAt> {
2014+ return versionFileExactAt(this.#logHost, ...args);
2015+ }
19632017 /** Every file that differs between two versions of shared (or a named draft) (version-log.ts). */
19642018 compare(...args: Tail<Parameters<typeof versionCompare>>): ReturnType<typeof versionCompare> {
19652019 return versionCompare(this.#logHost, ...args);
Lines 2187–2201 at 318 (were 2133–2138 at 294)
21332187 definitionCollisions: (agent, newer, names) => this.#definitionCollisions(agent, newer, names),
21342188 queueNews: (agent, items, entries) => this.#queueNews(agent, items, entries),
21352189 logLine: (line) => this.#logLine?.(line),
2190+ owesDefinitionNews: () => this.owesDefinitionNews,
2191+ owe: (owed) => void this.#owed.push(owed),
2192+ spaceNamed: (name) => (name === SHARED ? this.#shared : this.#spaces.get(name)),
2193+ newerAt: (agent, version) => this.#newerFor(agent, version),
2194+ definitionCollisionsAt: (agent, newer, names, version) =>
2195+ this.#definitionCollisions(agent, newer, names, version),
2196+ setAt: (space, version) => this.#at(space, version),
2197+ collisionAt: (agent, pair, version) =>
2198+ this.#describe(pair, this.#agentView(agent), this.#viewAt(this.#spaceOf(agent), version), agent.space),
21362199 };
21372200 return this.#news;
21382201 }
Lines 2499–2507 at 318 (were 2436–2441 at 294)
24362499 pairs: (draft, against, settled) => this.#pairs(draft, against, settled),
24372500 describe: (pair, yoursView, theirsView, spaceName) => this.#describe(pair, yoursView, theirsView, spaceName),
24382501 definitionRule: () => this.#definitionRule,
2502+ // Only from a stored writer's kept rows, as keptPaths: a project in memory keeps none, and works them out.
2503+ changedSince: (space, from, to) =>
2504+ this.#writerStorage ? this.#paths.keptChangesSince(space, from, to) : undefined,
24392505 refuse: (agent, space, via, time, collisions, entries) =>
24402506 this.#refuse(agent, space, via, time, collisions, entries),
24412507 requireClosed: (tie, union) => this.#requireClosed(tie, union),
Lines 3061–3074 at 318 (were 2995–3007 at 294)
29953061 }
29963062
29973063 /** The space's atoms published after the agent's base, by others. */
2998− #newerFor(agent: AgentState): ReadonlySet<AtomId> {
3064+ /** `upTo`: the work published after the agent's base up to that version only (owed news, news.ts). */
3065+ #newerFor(agent: AgentState, upTo?: number): ReadonlySet<AtomId> {
29993066 const space = this.#spaceOf(agent);
30003067 const base = this.#at(space, agent.base);
3001− const current = this.#setOf(space);
3068+ const current = upTo === undefined ? this.#setOf(space) : this.#at(space, upTo);
30023069 const newer =
30033070 space.name === SHARED && space.membershipVersion
3004− ? new SharedAdditions(space, agent.base, base, current)
3071+ ? new SharedAdditions(space, agent.base, base, current, upTo ?? last(space))
30053072 : differenceSet(current, base);
30063073 return differenceSet(newer, new StableOverlaySet(agent.mine));
30073074 }
Lines 3208–3215 at 318 (were 3141–3146 at 294)
31413208 agent: AgentState,
31423209 newer: ReadonlySet<AtomId>,
31433210 names?: ReadonlySet<string>,
3211+ /** The space's version to compare against: its newest, or an owed publish's (news.ts). */
3212+ version?: number,
31443213 ): DefinitionCollision[] {
31453214 const draft = new Set(this.#draft(agent));
31463215 if (draft.size === 0 || newer.size === 0) return [];
Lines 3218–3236 at 318 (were 3149–3163 at 294)
31493218 const base = agent.mine.some((id) => at.has(id))
31503219 ? this.#view(differenceSet(at, new StableOverlaySet(agent.mine)))
31513220 : this.#viewAt(space, agent.base);
3221+ const to = version ?? last(space);
31523222 return this.#definitionRule.collisions(
31533223 draft,
31543224 this.#agentView(agent),
31553225 base,
3156− this.#viewAt(space, last(space)),
3226+ this.#viewAt(space, to),
31573227 newer,
31583228 space.name,
31593229 undefined,
31603230 names,
3231+ // Where the space changed since the agent's base, from each version's kept files on a stored writer, as land's
3232+ // (abso 714): walking every newer atom for them was 6.5 s of a publish 770 versions behind on abso.
3233+ () => (this.#writerStorage ? this.#paths.keptChangesSince(space, agent.base, to) : undefined),
31613234 );
31623235 }
31633236}
MCP
compare on this site's /mcp
CLI
abso diff 294 318 worker/project/project.ts --json
JSON
/christopher/abso-core/compare/294..318?file=worker%2Fproject%2Fproject.ts&format=json