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 217 to 218

Compare

+39 −9 in 3 places
Lines 4–11 at 218 (were 4–10 at 217)
44// shared, with its message. Why adds the change's reasons, what it settled,
55// and the reasons other changes give that point at it, and the line's
66// earlier changes (trail.ts).
7−import { type Atom, type AtomId, type LineId, type ReadView, View } from "../../src/engine/index.ts";
7+import { type Atom, type AtomId, type LineId, type ReadView, seqOf, View } from "../../src/engine/index.ts";
8+import { isClosedSet, markClosed, StableSet } from "../../src/engine/state-source.ts";
89import { blocksIn, isMarkerLine } from "./markers.ts";
910import { pathKey } from "./pathkey.ts";
1011import type { Project } from "./project.ts";
Lines 127–154 at 218 (were 126–146 at 217)
126127function keptThrough(project: Project, view: ReadView, file: string, line: LineId, author: Atom): Atom | undefined {
127128 const graph = project.graph;
128129 const set = view.set;
129− for (const s of graph.atoms()) {
130− if (s.seq <= author.seq || s.resolves.length === 0 || !set.has(s.id)) continue;
130+ // Only atoms that write or take out the file's lines can take out its markers (abso Capacity): every atom in the
131+ // history was read on a stored graph.
132+ for (const id of graph.eachAtomIn(file)) {
133+ if (seqOf(id) <= author.seq) continue;
134+ const s = graph.atom(id);
135+ if (s.resolves.length === 0 || !set.has(s.id)) continue;
131136 const marks = s.deletes.filter((id) => {
132137 const info = graph.line(id);
133138 return info !== undefined && info.file === file && isMarkerLine(info.text);
134139 });
135140 if (marks.length === 0) continue;
136− // The file just before the settle, markers and all.
141+ // The file just before the settle, markers and all: of a closed set, its atoms before the settle, which a
142+ // stored set answers one by one; otherwise listed.
137143 const before = new View(
138144 graph,
139− graph
140− .atoms()
141− .slice(0, s.seq)
142− .filter((a) => set.has(a.id))
143− .map((a) => a.id),
145+ isClosedSet(set)
146+ ? markClosed(new BeforeSet(set, s.seq))
147+ : graph
148+ .atoms()
149+ .slice(0, s.seq)
150+ .filter((a) => set.has(a.id))
151+ .map((a) => a.id),
144152 );
145153 if (!before.hasFile(file)) continue;
146154 const lines = before.lines(file);
Lines 160–187 at 218 (were 152–157 at 217)
152160 return undefined;
153161}
154162
163+/** A set's atoms numbered below a limit. Atoms depend only on earlier ones, so a closed set's prefix is closed. */
164+class BeforeSet extends StableSet<AtomId> {
165+ readonly #set: ReadonlySet<AtomId>;
166+ readonly #limit: number;
167+ readonly retainedBytes = 32;
168+ constructor(set: ReadonlySet<AtomId>, limit: number) {
169+ super();
170+ this.#set = set;
171+ this.#limit = limit;
172+ }
173+ has(id: AtomId): boolean {
174+ const seq = seqOf(id);
175+ return seq >= 0 && seq < this.#limit && this.#set.has(id);
176+ }
177+ *values(): SetIterator<AtomId> {
178+ for (const id of this.#set) {
179+ const seq = seqOf(id);
180+ if (seq >= 0 && seq < this.#limit) yield id;
181+ }
182+ }
183+}
155185/** The settler's push that was held for this collision, newest first: its message is that side's reason. */
156186function heldPush(project: Project, settle: Atom, file: string, after: number) {
157187 const held = project
MCP
compare on this site's /mcp
CLI
abso diff 217 218 worker/project/blame.ts --json
JSON
/christopher/abso-core/compare/217..218?file=worker%2Fproject%2Fblame.ts&format=json