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 11 to 12

Compare

+66 −3 in 4 places
Lines 75–82 at 12 (were 75–80 at 11)
7575 staleModText,
7676} from "./status-commands.ts";
7777
78+import { gitMarkerLine } from "./settle.ts";
7880// --- record ---
7981
8082interface Recorded {
Lines 93–102 at 12 (were 91–96 at 11)
9193 readonly news: News;
9294 readonly leftOut: readonly LeftOut[];
9395 readonly turnedBinary: readonly TurnedBinary[];
96+ /** Text files sent that hold what looks like a git conflict (a merge git left unfinished, or markers typed by hand). */
97+ readonly gitMarkers?: readonly { path: string; line: number }[];
98+ /** Sent files whose path is long enough to fail on Windows, here or in another agent's folder. */
99+ readonly longPaths?: readonly { path: string; length: number }[];
94100}
95101
96102/** The warning for text files that turned binary: what, where, and what to do. Empty when there are none. */
Lines 245–307 at 12 (were 239–252 at 11)
239245 ...(answer.spelling ?? []).map(spellingText),
240246 ...(answer.uncomposed ?? []).map(uncomposedText),
241247 ]);
242− return { sent, paths, deleted, added, changed: answer.changed, news: answer.news, leftOut, turnedBinary };
248+ const longPaths = longPathsOf(
249+ root,
250+ [...files].filter(([, text]) => text !== null).map(([path]) => path),
251+ );
252+ const gitMarkers = [...files]
253+ .flatMap(([path, text]) => {
254+ const line = text === null ? undefined : gitMarkerLine(text);
255+ return line === undefined ? [] : [{ path, line }];
256+ })
257+ .sort((a, b) => (a.path < b.path ? -1 : 1));
258+ return {
259+ sent,
260+ paths,
261+ deleted,
262+ added,
263+ changed: answer.changed,
264+ news: answer.news,
265+ leftOut,
266+ turnedBinary,
267+ gitMarkers,
268+ longPaths,
269+ };
243270}
244271
272+/** A note per file that holds what looks like a git conflict: abso records it as it is, as text, and does not call it a collision. */
273+export function gitMarkerText(list: readonly { path: string; line: number }[] | undefined): string[] {
274+ return (list ?? []).map(
275+ (m) =>
276+ `Note: ${m.path} has lines that look like a git conflict (from line ${m.line}). abso records them as ordinary text and will publish them as they are. If a merge was left unfinished, fix the file first.`,
277+ );
278+}
280+/** Windows stops at 260 characters for a whole path, and another agent's folder may sit deeper than this one. */
281+const LONG_FULL_PATH = 240;
282+const LONG_RELATIVE_PATH = 160;
284+/** The sent files whose path will likely fail to write on Windows: the whole path is near its limit here, or the part inside the folder is already long. */
285+export function longPathsOf(root: string, paths: Iterable<string>): { path: string; length: number }[] {
286+ return [...paths]
287+ .map((path) => ({ path, length: absolute(root, path).length }))
288+ .filter((p) => p.length >= LONG_FULL_PATH || p.path.length >= LONG_RELATIVE_PATH)
289+ .sort((a, b) => (a.path < b.path ? -1 : 1));
290+}
292+/** A note per long path: abso keeps it, but a Windows agent may not be able to write the file. */
293+export function longPathText(list: readonly { path: string; length: number }[] | undefined): string[] {
294+ return (list ?? []).map(
295+ (p) =>
296+ `Note: ${p.path} is ${p.path.length} characters inside the folder (${p.length} with this folder's location). Windows stops at 260 for a whole path, so an agent on Windows may be unable to write it. A shorter path avoids that.`,
297+ );
298+}
245300/** "Recorded 3 files first: a, b, c." (names cut short past 8), or a word that the folder is paused. Empty when nothing was sent. */
246301export function recordedFirst(r: Recorded): string[] {
247302 if (r.paused) return ["Recording is paused (abso resume): your folder's changes were not sent first."];
248303 if (r.sent === 0) return [];
249− return [`Recorded first: ${recordedList(r)}.`];
304+ return [`Recorded first: ${recordedList(r)}.`, ...gitMarkerText(r.gitMarkers), ...longPathText(r.longPaths)];
250305}
251306
252307/** "2 changed (a, b), 3 deleted (x, y, z)": deletions said as such (#37, Builder 2 read its rm'd files as edits). */
Lines 362–382 at 12 (were 307–319 at 11)
307362 : `Recorded ${recordedList(r)}${changed === undefined ? "" : `; ${changed} changed on the server`}.`;
308363 return withLeftOut(
309364 {
310− text: [...turnedBinaryText(r.turnedBinary), text, ...leftOutText(r.leftOut)].join("\n"),
365+ text: [
366+ ...turnedBinaryText(r.turnedBinary),
367+ text,
368+ ...gitMarkerText(r.gitMarkers),
369+ ...longPathText(r.longPaths),
370+ ...leftOutText(r.leftOut),
371+ ].join("\n"),
311372 json: {
312373 sent: r.sent,
313374 changed: r.changed ?? null,
314375 news: newsLines(r.news),
315376 leftOut: r.leftOut,
316377 turnedBinary: r.turnedBinary,
378+ gitMarkers: r.gitMarkers ?? [],
379+ longPaths: r.longPaths ?? [],
317380 },
318381 },
319382 r.leftOut,
MCP
compare on this site's /mcp
CLI
abso diff 11 12 client/src/commands.ts --json
JSON
/christopher/abso-core/compare/11..12?file=client%2Fsrc%2Fcommands.ts&format=json