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 210 to 211

Compare

+43 −0 in 2 places
Lines 3–10 at 211 (were 3–8 at 210)
33// Off unless AUTOSETTLE is "on" (advice) or "act" (the client settles) and the Worker has an AI binding. The model
44// picks one of four words; it never writes code.
55
6+import type { AutoSettled } from "./project-types.ts";
7+
68/** abso's settle choices, plus a hand edit by an agent. */
79export type Pick = "yours" | "theirs" | "both" | "agent";
810export const PICKS: readonly Pick[] = ["yours", "theirs", "both", "agent"];
Lines 42–88 at 211 (were 40–45 at 210)
4042 readonly ms: number;
4143}
4244
45+/**
46+ * The heading a client puts over what it settled by itself, in the message of the push that follows (abso-core 19,
47+ * 23). One line per file under it: `- <file>: kept <side>, confidence 0.81. <reason>` or `…, by a check in code. …`.
48+ */
49+export const AUTO_HEADING = "Settled automatically (abso 19):";
51+/** The lines a client adds to its message for the files it settled by itself. */
52+export function autoTrailer(
53+ plan: Iterable<
54+ readonly [
55+ string,
56+ { readonly pick: string; readonly by: string; readonly confidence: number; readonly reason: string },
57+ ]
58+ >,
59+): string {
60+ const lines = [...plan].map(([file, a]) => {
61+ const how = a.by === "rule" ? "by a check in code" : `confidence ${a.confidence.toFixed(2)}`;
62+ return `- ${file}: kept ${a.pick}, ${how}. ${a.reason.replace(/\s+/g, " ").trim()}`;
63+ });
64+ return [AUTO_HEADING, ...lines].join("\n");
65+}
67+/** What a push's message says its abso settled by itself, by file; empty for a push that settled by hand. */
68+export function autoSettledOf(message: string): Map<string, AutoSettled> {
69+ const found = new Map<string, AutoSettled>();
70+ const lines = message.split(/\r?\n/);
71+ const at = lines.lastIndexOf(AUTO_HEADING);
72+ if (at < 0) return found;
73+ for (const line of lines.slice(at + 1)) {
74+ const m = /^- (.+): kept (yours|theirs|both), (?:by a check in code|confidence ([01]\.\d\d))\. ?(.*)$/.exec(line);
75+ if (!m) break;
76+ found.set(m[1]!, {
77+ pick: m[2] as AutoSettled["pick"],
78+ by: m[3] === undefined ? "rule" : "model",
79+ confidence: m[3] === undefined ? 1 : Number(m[3]),
80+ reason: m[4] ?? "",
81+ });
82+ }
83+ return found;
84+}
4386export interface Ai {
4487 run(model: string, input: unknown): Promise<unknown>;
4588}
MCP
compare on this site's /mcp
CLI
abso diff 210 211 worker/project/autosettle.ts --json
JSON
/christopher/abso-core/compare/210..211?file=worker%2Fproject%2Fautosettle.ts&format=json