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 71 to 318

Compare

+29 −10 in 6 places
Lines 3–9 at 318 (were 3–8 at 71)
33// which space) is applied first, in spaces.ts.
44
55import type { AtomId, Graph } from "../../src/engine/index.ts";
6+import { capNews, outlastsSync } from "./news.ts";
67import { ProjectError } from "./project-error.ts";
78import type {
89 AgentState,
Lines 113–119 at 318 (were 112–117 at 71)
112113 }
113114 host.joinChange(agent, entry, at, space.name === SHARED ? null : space.name);
114115 agent.marked = agent.marked.filter((r) => r.space !== (entry.space ?? SHARED));
116+ delete agent.held;
115117 if (entry.queued !== undefined) host.setQueued(host.queued().filter((q) => q.id !== entry.queued));
116118 break;
117119 }
Lines 143–163 at 318 (were 141–152 at 71)
141143 const { type: _, ...note } = entry;
142144 host.notes.set(entry.id, { ...note, lines: [...entry.lines], at });
143145 host.setLastNote(Math.max(host.lastNote(), entry.id));
144− if (entry.change !== undefined && host.changes.has(entry.change)) host.changes.get(entry.change)!.last = at;
146+ if (entry.change !== undefined) {
147+ const change = host.changes.get(entry.change);
148+ if (change) {
149+ change.last = at;
150+ host.changes.set(entry.change, change);
151+ }
152+ }
145153 break;
146154 }
147155 case "note-closed": {
148156 const note = host.notes.get(entry.id);
149− if (note) note.closed = { agent: entry.agent, how: entry.how, time: entry.time };
157+ if (note) {
158+ note.closed = { agent: entry.agent, how: entry.how, time: entry.time };
159+ host.notes.set(entry.id, note);
160+ }
150161 break;
151162 }
152163 case "pulled":
Lines 201–207 at 318 (were 190–195 at 71)
190201 host.setAnnounced(Math.max(host.announced(), id));
191202 tellSent(host.tells, id, entry.text[i] ?? entry.text[0] ?? "", agent.name, time);
192203 });
204+ capNews(agent);
193205 break;
194206 }
195207 case "discard": {
Lines 213–223 at 318 (were 201–211 at 71)
201213 }
202214 case "heard": {
203215 const agent = host.agentOf(entry.agent);
204− // A sync's stale heard keeps announcements, so it hears no tell.
216+ // A sync's stale heard keeps announcements and settles' news (outlastsSync), so it hears no tell.
205217 if (entry.stale !== true)
206218 for (const tell of host.tells.values())
207219 if (tell.heard.get(agent.name) === null) tell.heard.set(agent.name, { at: time });
208− const keep = agent.news.map((t) => entry.stale === true && t.startsWith("Announcement from "));
220+ const keep = agent.news.map((t) => entry.stale === true && outlastsSync(t));
209221 agent.news = agent.news.filter((_, i) => keep[i]);
210222 agent.newsAt = agent.newsAt.filter((_, i) => keep[i]);
211223 break;
Lines 246–274 at 318 (were 234–255 at 71)
234246 via: entry.via,
235247 time: entry.time,
236248 collisions: entry.collisions.map((c) => ({ ...c })),
249+ ...(entry.message ? { message: entry.message } : {}),
237250 });
238251 {
239252 // On the change the agent was working on, when there is one (#44).
240253 const agent = host.agentOf(entry.agent);
241254 host.active(agent, entry.time);
242255 const id = host.currentChange(agent, entry.time);
256+ const refusal = {
257+ at,
258+ time: entry.time,
259+ kinds: [...new Set(entry.collisions.map((c) => c.kind))].sort(),
260+ files: [...new Set(entry.collisions.map((c) => c.file))].sort(),
261+ ...(entry.message ? { message: entry.message } : {}),
262+ };
243263 if (id !== undefined) {
244264 const rec = host.changeRecord(id, agent, entry.time);
245− rec.refusals.push({
246− at,
247− time: entry.time,
248− kinds: [...new Set(entry.collisions.map((c) => c.kind))].sort(),
249− files: [...new Set(entry.collisions.map((c) => c.file))].sort(),
250− });
265+ rec.refusals.push({ ...refusal, files: [...refusal.files], kinds: [...refusal.kinds] });
251266 rec.last = at;
267+ host.changes.set(id, rec);
252268 }
269+ // Kept until it pushes: the settle tells the held push's reason, and its change lists the refusal.
270+ if (entry.via === "publish")
271+ agent.held = [...(agent.held ?? []), { ...refusal, ...(id !== undefined ? { change: id } : {}) }];
253272 }
254273 break;
255274 case "switch": {
MCP
compare on this site's /mcp
CLI
abso diff 71 318 worker/project/apply-entry.ts --json
JSON
/christopher/abso-core/compare/71..318?file=worker%2Fproject%2Fapply-entry.ts&format=json