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

Compare

+44 −1 in 2 places
Lines 3–16 at 318 (were 3–10 at 166)
33import git from "isomorphic-git";
44import { absoVersion } from "../src/ingest.ts";
55import { MemoryFS } from "../src/memory-fs.ts";
6−import { commitShared, projectOfRepo, readTreeFiles, repoName } from "../src/push.ts";
6+import { blobOid, commitShared, projectOfRepo, readTreeFiles, repoName } from "../src/push.ts";
77
8+it("hashes exact Git blob bytes including a nonzero buffer offset", async () => {
9+ assert.equal(await blobOid(new Uint8Array()), "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391");
10+ const bytes = new TextEncoder().encode("prefixhello\nsuffix");
11+ assert.equal(await blobOid(bytes.subarray(6, 12)), "ce013625030ba8dba906f756967f9e9ca394464a");
12+});
814describe("repo names", () => {
915 it("names a project's Artifacts repo abso-<project>, and back", () => {
1016 assert.equal(repoName("game"), "abso-game");
Lines 28–70 at 318 (were 22–27 at 166)
2228});
2329
2430describe("commitShared", () => {
31+ it("batches changed text and preserves pending old files in intermediate commits", async () => {
32+ const fs = new MemoryFS(),
33+ dir = "/repo";
34+ await git.init({ fs, dir, defaultBranch: "main" });
35+ const first = await commitShared(
36+ fs,
37+ dir,
38+ null,
39+ { version: 0, files: { "a.txt": "old a", "b.txt": "old b", "gone.txt": "delete" } },
40+ () => null,
41+ );
42+ const parts: string[] = [];
43+ const body = "x".repeat(9 * 1024 * 1024);
44+ const next = await commitShared(
45+ fs,
46+ dir,
47+ first.commit,
48+ { version: 1, files: { "a.txt": body, "b.txt": body + "b" } },
49+ () => null,
50+ async (commit) => {
51+ parts.push(commit);
52+ assert.equal(
53+ new TextDecoder().decode((await git.readBlob({ fs, dir, oid: commit, filepath: "b.txt" })).blob),
54+ "old b",
55+ );
56+ assert.equal((await git.readBlob({ fs, dir, oid: commit, filepath: "a.txt" })).blob.length, body.length);
57+ await assert.rejects(() => git.readBlob({ fs, dir, oid: commit, filepath: "gone.txt" }));
58+ },
59+ );
60+ assert.equal(parts.length, 1);
61+ assert.deepEqual((await git.readCommit({ fs, dir, oid: next.commit })).commit.parent, parts);
62+ assert.equal(
63+ new TextDecoder().decode((await git.readBlob({ fs, dir, oid: next.commit, filepath: "b.txt" })).blob),
64+ body + "b",
65+ );
66+ assert.equal(absoVersion((await git.readCommit({ fs, dir, oid: parts[0]! })).commit.message), 1);
67+ });
2568 it("reads one lazy file at a time and does not read symlink placeholder text", async (t) => {
2669 const fs = new MemoryFS();
2770 const dir = "/repo";
MCP
compare on this site's /mcp
CLI
abso diff 166 318 server/test/push.test.ts --json
JSON
/christopher/abso-core/compare/166..318?file=server%2Ftest%2Fpush.test.ts&format=json