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
MCP
show on this site's /mcp
CLI
abso show 181 --json
JSON
/christopher/abso-core/versions/181?format=json

Batch changed text toward the 16 MiB push limit. Preserve pending old text and binary files in intermediate commits, retain intended deletions and parent ancestry, and leave single oversized files unsplit. Review 56 cleared the two-file change; disk-first activation remains off.

of shared·codex-capacity-chair··Not checked

Version 180 · Files at version 181

2 files, 54 lines added, 10 removed.

--- a/server/src/push.ts
+++ b/server/src/push.ts
@@ -179,21 +179,16 @@
179179 // Each file goes into the tree as a blob with its mode (#27): 100755 for exec, 120000 for a link, whose blob is
180180 // its target.
181181 const enc = new TextEncoder();
182− for (const path of Object.keys(shared.files)) {
183− const mode = shared.modes?.[path];
184− const link = typeof mode?.link === "string" ? mode.link : null;
185− const bytes = enc.encode(link ?? shared.files[path]!);
186− await put(path, bytes, link !== null ? "120000" : mode?.exec ? "100755" : "100644", await blobOid(bytes));
187− }
188182 const agent = shared.last?.agent ?? "abso";
189183 const author = { name: agent, email: `${agent}@abso.invalid` };
190184 const committer = { name: "abso", email: "abso@abso.invalid" };
191185 const say = (p: string) => `${shared.last?.message ?? "Start the project"}${p}\n\nabso-version: ${shared.version}\n`;
192186 let parent = head;
193− // A part holds what's written so far, and the last push's entries for the binary files not reached yet.
187+ // A part holds what's written so far and preserves old entries for files not reached yet.
194188 const commitNow = async (message: string) => {
195189 const files = new Map(now);
196− for (const [path, f] of old.files) if (!files.has(path) && path in blobs) files.set(path, f);
190+ for (const [path, f] of old.files)
191+ if (!files.has(path) && (path in blobs || path in shared.files)) files.set(path, f);
197192 const tree = await writeTrees(fs, dir, files, old.trees, changed);
198193 parent = await git.commit({
199194 cache,
@@ -208,12 +203,24 @@
208203 });
209204 return parent;
210205 };
211− // Binary files (#27) aren't in files: their bytes come from the blob store.
212− // Artifacts refuses a push much over 20 MB, so when the new blobs add up
206+ // Artifacts refuses a push much over 20 MB, so when new text or binary blobs add up
213207 // to more than PUSH_BATCH, the earlier ones go in commits of their own
214208 // first. Every part carries abso-version, so intake never takes them in.
215209 let pending = 0;
216210 let parts = 0;
211+ for (const path of Object.keys(shared.files)) {
212+ const mode = shared.modes?.[path];
213+ const link = typeof mode?.link === "string" ? mode.link : null;
214+ const bytes = enc.encode(link ?? shared.files[path]!);
215+ const oid = await blobOid(bytes);
216+ const fresh = old.files.get(path)?.oid !== oid;
217+ if (fresh && pending > 0 && pending + bytes.byteLength > PUSH_BATCH) {
218+ await part(await commitNow(say(` (part ${++parts})`)));
219+ pending = 0;
220+ }
221+ if (fresh) pending += bytes.byteLength;
222+ await put(path, bytes, link !== null ? "120000" : mode?.exec ? "100755" : "100644", oid);
223+ }
217224 for (const [path, sha] of Object.entries(blobs)) {
218225 const bytes = readBlob(sha);
219226 if (!bytes) throw new Error(`${path}: blob ${sha} is missing from the project's store`);
--- a/server/test/push.test.ts
+++ b/server/test/push.test.ts
@@ -28,6 +28,43 @@
2828});
2929
3030describe("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+ });
3168 it("reads one lazy file at a time and does not read symlink placeholder text", async (t) => {
3269 const fs = new MemoryFS();
3370 const dir = "/repo";