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

Compare

+15 −6 in 6 places
Lines 14–20 at 318 (were 14–20 at 116)
1414// Settled means the block is gone. These helpers also say what an agent kept
1515// once it settled one.
1616
17−import { type Atom, type AtomId, diffLines, type Graph, type Hunk, type View } from "../../src/engine/index.ts";
17+import { type Atom, type AtomId, diffLines, type Graph, type Hunk, type ReadView } from "../../src/engine/index.ts";
1818import type { AgentState, AgentStatus, Collision } from "./project-types.ts";
1919
2020export const YOURS = "<<<<<<< yours (unpublished)";
Lines 181–191 at 318 (were 181–187 at 116)
181181 );
182182}
183183
184−/** Whether `b` reads as `a` reworded: at least half their words in common. */
184+/**
185+ * Whether `b` reads as `a` reworded: at least half of `a`'s words are still
186+ * in it. Counted against `a` alone, so a rewording that keeps the line and
187+ * adds to it (a reason, the other side's number) still reads as the line.
188+ */
185189function alike(a: string, b: string): boolean {
186190 if (a === b) return true;
187191 const x = words(a);
Lines 193–199 at 318 (were 189–195 at 116)
189193 if (x.size === 0 || y.size === 0) return false;
190194 let both = 0;
191195 for (const w of x) if (y.has(w)) both++;
192− return both / (x.size + y.size - both) >= 0.5;
196+ return both / x.size >= 0.5;
193197}
194198
195199/**
Lines 264–278 at 318 (were 260–269 at 116)
260264 return y === "nothing" && t === "nothing" ? "both" : "rewrote";
261265}
262266
267+/** The message of the agent's newest held push that named `file`: its side's reason, for the settle to tell. */
268+export function heldMessage(agent: AgentState, file: string): string | undefined {
269+ return agent.held?.findLast((h) => h.message && h.files.includes(file))?.message;
270+}
263272/** What the marker reads need from a project. */
264273export interface MarkerHost {
265274 readonly graph: Graph;
266− agentView(agent: AgentState): View;
275+ agentView(agent: AgentState): ReadView;
267276 draft(agent: AgentState): AtomId[];
268277 draftFiles(agent: AgentState): Set<string>;
269278}
Lines 318–324 at 318 (were 309–315 at 116)
309318}
310319
311320/** The collided changes behind each block whose marker lines `atom` deletes (#11). */
312−export function markersSettled(host: MarkerHost, agent: AgentState, view: View, atom: Atom): AtomId[] {
321+export function markersSettled(host: MarkerHost, agent: AgentState, view: ReadView, atom: Atom): AtomId[] {
313322 if (agent.marked.length === 0) return [];
314323 const out = new Set<AtomId>();
315324 const blocksBy = new Map<string, Block[]>();
Lines 352–358 at 318 (were 343–349 at 116)
343352 const out: Collision[] = [];
344353 for (const file of [...host.draftFiles(agent)].toSorted()) {
345354 if (!view.hasFile(file)) continue;
346− const lines = view.lines(file);
355+ const lines = view.buildLines(file);
347356 const added = lines.map((l, i) => (mine.has(l.atom) && isMarkerLine(l.text) ? i : -1)).filter((i) => i >= 0);
348357 if (added.length === 0) continue;
349358 const blocks = blocksIn(lines.map((l) => l.text));
MCP
compare on this site's /mcp
CLI
abso diff 116 318 worker/project/markers.ts --json
JSON
/christopher/abso-core/compare/116..318?file=worker%2Fproject%2Fmarkers.ts&format=json