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

Compare

+19 −5 in 4 places
Lines 49–59 at 318 (were 49–57 at 175)
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 318–324 at 318 (were 316–322 at 175)
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 175)
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 175)
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>");
MCP
compare on this site's /mcp
CLI
abso diff 175 318 worker/project/http.ts --json
JSON
/christopher/abso-core/compare/175..318?file=worker%2Fproject%2Fhttp.ts&format=json