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 41 to 42

Compare

+39 −2 in 2 places
Lines 3–33 at 42 (were 3–18 at 41)
33
44import assert from "node:assert/strict";
55import { execFileSync, spawnSync } from "node:child_process";
6−import { copyFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, writeFileSync } from "node:fs";
6+import {
7+ copyFileSync,
8+ existsSync,
9+ mkdirSync,
10+ mkdtempSync,
11+ readdirSync,
12+ readFileSync,
13+ rmSync,
14+ utimesSync,
15+ writeFileSync,
16+} from "node:fs";
717import { tmpdir } from "node:os";
818import { join } from "node:path";
9−import { describe, it } from "node:test";
19+import { after, describe, it } from "node:test";
1020
1121const LAUNCH = new URL("../launch.mjs", import.meta.url);
22+const roots: string[] = [];
23+after(() => {
24+ for (const root of roots) rmSync(root, { recursive: true, force: true });
25+});
1226
1327/** A checkout on main with one commit, launch.mjs and a stand-in client/abso.ts that names itself. */
1428function checkout(): { repo: string; home: string; head: string } {
1529 const root = mkdtempSync(join(tmpdir(), "abso-launch-"));
30+ roots.push(root);
1631 const repo = join(root, "repo");
1732 const home = join(root, "home");
1833 mkdirSync(join(repo, "client"), { recursive: true });
Lines 142–169 at 42 (were 127–132 at 41)
127142 assert.equal(existsSync(lock), true);
128143 });
129144
145+ it("takes over a lock a dead run left behind, and removes it after", () => {
146+ const c = checkout();
147+ const lock = join(c.home, ".abso", "client-update.lock");
148+ mkdirSync(lock);
149+ const old = new Date(Date.now() - 11 * 60 * 1000);
150+ utimesSync(lock, old, old);
151+ assert.equal(launch(c, [], { ABSO_LAUNCH_UPDATE: "1" }).status, 0);
152+ assert.deepEqual(
153+ readdirSync(join(c.home, ".abso")).filter((f) => f.includes("lock")),
154+ [],
155+ );
156+ });
158+ it("reads the commit in a git worktree, where .git is a file", () => {
159+ const c = checkout();
160+ const wt = join(c.repo, "..", "wt");
161+ execFileSync("git", ["-C", c.repo, "worktree", "add", "-q", "--detach", wt, "HEAD"]);
162+ bundle(wt, NAMES_ITSELF, c.head);
163+ const r = launch({ repo: wt, home: c.home }, ["status"]);
164+ assert.match(r.stdout, /^bundle /);
165+ });
130167 it("keeps the background step quiet when it can't fetch or build", () => {
131168 const c = checkout();
132169 const r = launch(c, [], { ABSO_LAUNCH_UPDATE: "1" });
MCP
compare on this site's /mcp
CLI
abso diff 41 42 client/test/launch.test.ts --json
JSON
/christopher/abso-core/compare/41..42?file=client%2Ftest%2Flaunch.test.ts&format=json