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

Compare

+22 −8 in 7 places
Lines 49–59 at 318 (were 49–57 at 86)
4949}
5050
5151/**
52− * What a reader may not do. Edits and records (which old edit mods send on
53− * their own) and publishes answer 200 {ok: false, reason}, so a mod only logs
54− * it; the rest are refused outright.
52+ * What a reader may not do: change code. Edits and records (which old edit
53+ * mods send on their own) and publishes answer 200 {ok: false, reason}, so a
54+ * mod only logs it; the rest are refused outright. Talking stays open (abso
55+ * 682, Christopher: "readers need to be able to do asks and news and stuff"):
56+ * announcements, notes on lines, asks and issues all work for a reader.
5557 */
5658const NOT_FOR_READERS: Record<string, "answer" | "refuse"> = {
5759 edit: "answer",
Lines 100–106 at 318 (were 98–104 at 86)
98100 if (me && (me.draftChanges > 0 || (me.parked?.length ?? 0) > 0)) {
99101 return fail(
100102 409,
101− `${agent} has unpublished changes; publish or restore them (abso restore --all) before it becomes a reader`,
103+ `${agent} has unpushed changes; push or restore them (abso restore --all) before it becomes a reader`,
102104 );
103105 }
104106 }
Lines 318–324 at 318 (were 316–322 at 86)
316318 return { status: 200, body: history.blame(q.file, num(q.from), num(q.to), num(q.version), draft, who) };
317319 const line = num(q.line);
318320 if (!line || !Number.isInteger(line)) return fail(400, "why needs ?line=<number>");
319− return { status: 200, body: history.why(q.file, line, draft, who) };
321+ return { status: 200, body: history.why(q.file, line, draft, who, num(q.version)) };
320322 }
321323 if (op === "announce" && agent === undefined) {
322324 // The sender comes from the route, like every other agent op, not from
Lines 352–368 at 318 (were 350–355 at 86)
350352 const limit = q.limit !== undefined && Number.isInteger(Number(q.limit)) ? Number(q.limit) : undefined;
351353 return { status: 200, body: history.refusals(q.agent || undefined, limit) };
352354 }
355+ if (op === "without") {
356+ // GET ?version=<n>&versions=<n,n>: version n of shared with those versions left out (without.ts).
357+ const q = (body ?? {}) as Record<string, string | undefined>;
358+ const history = project as ProjectCalls & Partial<ProjectHistory>;
359+ if (!history.without) return fail(501, "without needs the engine");
360+ const version = q.version !== undefined && /^\d+$/.test(q.version) ? Number(q.version) : undefined;
361+ const versions = (q.versions ?? "").split(",").filter((s) => s.trim() !== "");
362+ if (version === undefined || versions.length === 0 || versions.some((s) => !/^\s*\d+\s*$/.test(s)))
363+ return fail(400, "without needs ?version=<number>&versions=<number,number>");
364+ return { status: 200, body: history.without(version, versions.map(Number)) };
365+ }
353366 if (op === "log" || op === "show" || op === "file" || op === "compare") {
354367 // GETs: ?draft=<name> (shared when absent); log ?limit, ?path; show ?version; file ?path, ?version; compare ?from, ?to.
355368 const q = (body ?? {}) as Record<string, string | undefined>;
Lines 394–401 at 318 (were 381–387 at 86)
381394 const from = int(q.from);
382395 const to = int(q.to);
383396 if (from === undefined || to === undefined) return fail(400, "compare needs ?from=<number>&to=<number>");
384− return { status: 200, body: history.compare(from, to, draft, who) };
397+ // summary=1: each file's size and SHA-256, not its texts (abso issue 680).
398+ return { status: 200, body: history.compare(from, to, draft, who, q.summary === "1") };
385399 }
386400 const version = Number(q.version);
387401 if (q.version === undefined || !Number.isInteger(version)) return fail(400, "show needs ?version=<number>");
Lines 444–450 at 318 (were 430–436 at 86)
430444 }
431445 case "publish": {
432446 const message = (body as { message?: string })?.message;
433− if (typeof message !== "string" || !message.trim()) return fail(400, "publish needs {message} saying why");
447+ if (typeof message !== "string" || !message.trim()) return fail(400, "push needs {message} saying why");
434448 const unseen = unseenError("the message", message);
435449 if (unseen) return fail(400, unseen);
436450 // asIs (#37): publish even with collided lines untouched since the sync, both sides kept.
Lines 456–462 at 318 (were 442–448 at 86)
442456 if ((body as { full?: unknown } | undefined)?.full === true) {
443457 // {full: true}: every file in the agent's view, as a first sync answers (#37).
444458 const history = project as ProjectCalls & Partial<ProjectHistory>;
445− if (!history.syncFull) return fail(501, "a full sync needs the engine");
459+ if (!history.syncFull) return fail(501, "a full pull needs the engine");
446460 if (label !== undefined && typeof label !== "string") return fail(400, "label must be a label name");
447461 return { status: 200, body: history.syncFull(agent, label as string | undefined) };
448462 }
MCP
compare on this site's /mcp
CLI
abso diff 86 318 worker/project/http.ts --json
JSON
/christopher/abso-core/compare/86..318?file=worker%2Fproject%2Fhttp.ts&format=json