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

Compare

+14 −22 in 3 places
Lines 126–144 at 318 (were 126–136 at 121)
126126/** `a` has the lower seq. */
127127function makeConflict(graph: Graph, set: AtomSet | undefined, a: Atom, b: Atom, keys: ConflictKey[]): Conflict {
128128 const kind = keys.every((k) => k.relation === "hold") ? "semantic" : "edit-edit";
129− let resolvedBy: AtomId[] = [];
129+ const resolvedBy: AtomId[] = [];
130130 if (set) {
131− const fromA = graph.resolversOf(a.id).filter((r) => set.has(r));
132− const fromB = new Set(graph.resolversOf(b.id));
133− resolvedBy = fromA.filter((r) => fromB.has(r)).sort((p, q) => graph.atom(p).seq - graph.atom(q).seq);
131+ // Resolver indexes append in sequence order: intersect without copying either history.
132+ const left = graph.eachResolverOf(a.id);
133+ const right = graph.eachResolverOf(b.id);
134+ let p = left.next();
135+ let q = right.next();
136+ while (!p.done && !q.done) {
137+ const order = graph.atom(p.value).seq - graph.atom(q.value).seq;
138+ if (order === 0 && set.has(p.value)) resolvedBy.push(p.value);
139+ if (order <= 0) p = left.next();
140+ if (order >= 0) q = right.next();
141+ }
134142 }
135143 return { atoms: [a.id, b.id], kind, keys, sides: [side(a), side(b)], resolvedBy };
136144}
Lines 207–213 at 318 (were 199–221 at 121)
199207function visibleNeighbours(view: View, graph: Graph, line: LineId): LineId[] {
200208 const info = graph.line(line);
201209 if (!info) return [];
202− const sequence = view.sequence(info.file);
203− const at = view.sequenceIndex(info.file, line);
204− if (at < 0) return [];
205− const out: LineId[] = [];
206− for (let i = at - 1; i >= 0; i--) {
207− if (sequence[i]!.visible) {
208− out.push(sequence[i]!.id);
209− break;
210− }
211− }
212− for (let i = at + 1; i < sequence.length; i++) {
213− if (sequence[i]!.visible) {
214− out.push(sequence[i]!.id);
215− break;
216− }
217− }
218− return out;
210+ return view.visibleNeighbours(info.file, line);
219211}
220212
221213/**
Lines 245–251 at 318 (were 253–259 at 121)
253245 const seen = new Set<string>();
254246 for (const a of [...changed].sort(bySeq(graph))) {
255247 if (a === atom.id) continue;
256− for (const link of graph.togetherLinks(a)) {
248+ for (const link of graph.eachTogetherLink(a)) {
257249 const b = link.other;
258250 if (b === atom.id || !set.has(b) || acknowledged.has(b)) continue;
259251 const tag = `${a} ${b}`;
MCP
compare on this site's /mcp
CLI
abso diff 121 318 src/engine/conflicts.ts --json
JSON
/christopher/abso-core/compare/121..318?file=src%2Fengine%2Fconflicts.ts&format=json