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

Compare

+17 −10 in 2 places
Lines 179–194 at 318 (were 179–199 at 180)
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,
Lines 203–226 at 318 (were 208–219 at 180)
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`);
MCP
compare on this site's /mcp
CLI
abso diff 180 318 server/src/push.ts --json
JSON
/christopher/abso-core/compare/180..318?file=server%2Fsrc%2Fpush.ts&format=json