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

Compare

+34 −0 in 1 place
new file, 34 lines
1+import assert from "node:assert/strict";
2+import { test } from "node:test";
3+import { answer } from "../../worker/project/http.ts";
4+import { EngineProject } from "../src/engine-project.ts";
5+import { pushSnapshot } from "../src/push-snapshot.ts";
6+import { memoryStorage } from "./helpers.ts";
7+
8+test("push batches cap file count and text while preserving exact lazy contents", (t) => {
9+ const storage = memoryStorage();
10+ t.after(() => storage.db.close());
11+ const project = EngineProject.open(storage);
12+ const files = Object.fromEntries(Array.from({ length: 130 }, (_, i) => [`f${i}`, `${i}\n`]));
13+ assert.equal(answer(project, "init", undefined, { files }).status, 200);
14+ let batches = 0;
15+ const snapshot = pushSnapshot(
16+ project.sharedPushMetadata(),
17+ () => {
18+ throw Error("single read forbidden");
19+ },
20+ (version, paths) => {
21+ batches++;
22+ return project.fileTextsAt(version, paths);
23+ },
24+ );
25+ assert.equal(batches, 0);
26+ assert.deepEqual({ ...snapshot.files }, files);
27+ assert.equal(batches, 3);
28+ const large = "x".repeat(70000) + "\n";
29+ assert.equal(answer(project, "record", "writer", { files: { large } }).status, 200);
30+ assert.equal(answer(project, "publish", "writer", { message: "Large file" }).status, 200);
31+ const batch = project.fileTextsAt(1, ["large", "f0"]);
32+ assert.deepEqual(Object.keys(batch), ["large"]);
33+ assert.equal(batch.large, large);
34+});
MCP
compare on this site's /mcp
CLI
abso diff 2 318 server/test/push-snapshot-batch.test.ts --json
JSON
/christopher/abso-core/compare/2..318?file=server%2Ftest%2Fpush-snapshot-batch.test.ts&format=json