Versions 68 to 318
new file, 670 lines
11+
16+ url: `data:text/javascript,${encodeURIComponent("export class DurableObject { constructor(ctx, env) { this.ctx = ctx; this.env = env; } }")}`,
24+
56+ assert.equal((await object(false).call("retry", "init", undefined, { files: { "a.txt": "first\n" } })).status, 200);
75+ assert.ok(alarm !== null && alarm >= before + minutes * 60000 && alarm <= Date.now() + minutes * 60000);
85+
86+test("size refusals survive cold objects, retry changed heads or policy, and prevent outgoing pushes", async (t) => {
124+ (await object(false).call("size-refusal", "init", undefined, { files: { "a.txt": "original\n" } })).status,
165+ values.set("git:size-refusal", { ...(values.get("git:size-refusal") as object), policy: "old-policy" });
178+
189+
192+ const intake = (options.cache as Record<symbol, GitDiskIntake> | undefined)?.[Symbol.for("abso.git.disk-pack")];
201+ const pack = (await git.packObjects({ fs: remote, dir: "/repo", oids, write: false })).packfile!;
212+
213+test("empty disk projects and unloadable legacy projects preserve lookup fallbacks", async (t) => {
216+ const context = { id: { toString: () => "empty" }, storage: { ...storage, get: async () => undefined } };
223+ assert.deepEqual(await disk.news("empty", [{ from: "alice", issue: null, text: "Hello" }]), [{ to: [] }]);
230+ assert.deepEqual(await legacy.news("empty", [{ from: "alice", issue: null, text: "Hello" }]), [{ to: [] }]);
233+
276+ { ABSO_DISK_FIRST: "on", ABSO_ARTIFACTS: "off", KEY_HMAC_SECRET: "invented-test-secret" } as never,
281+ const call = async (op: string, agent: string | undefined, body: unknown, requestId?: string) => {
283+ const result = await object().call("project", op, agent, body, false, undefined, undefined, requestId);
297+ () => object().call("project", "init", undefined, initBody, false, undefined, undefined, initId),
302+ assert.deepEqual(storage.db.prepare("SELECT * FROM log ORDER BY seq,part").all(), initializedLog);
308+ () => object().call("project", "record", "alice", recordBody, false, undefined, undefined, requestId),
313+ (await object().call("project", "record", "alice", recordBody, false, undefined, undefined, requestId)).status,
316+ assert.deepEqual(storage.db.prepare("SELECT * FROM log ORDER BY seq,part").all(), recordedLog);
337+ const keyCall = { presented: issued.key, address: "test-address", write: true, route: "record" };
348+ assert.equal(crossPrincipal.status, 200, "each checked principal owns its own request ID namespace");
350+ .prepare("SELECT DISTINCT key FROM writer_state WHERE collection = 'runtime:receipts' AND key LIKE ?")
355+ assert.deepEqual(storage.db.prepare("SELECT * FROM log ORDER BY seq,part").all(), beforeSharedReplay);
358+ (await object().call("project", "record", "alice", recordBody, false, undefined, keyCall, keyRequestId)).status,
374+ assert.deepEqual(storage.db.prepare("SELECT * FROM log ORDER BY seq,part").all(), beforeRevokedRetry);
378+ () => object().call("project", "reader", "alice", { reader: true }, false, undefined, undefined, readerId),
397+ (await object().call("project", "reader", "alice", { reader: true }, false, undefined, undefined, readerId)).status,
409+ assert.deepEqual(await object().news("project", [{ from: "bob", issue: null, text: "Hello", to: ["alice"] }]), [
413+ for (const agent of ["alice", "bob"]) assert.equal((await call("sync", agent, {})).status, 200);
414+ assert.equal((await call("record", "alice", { files: { "a.txt": "Alice's change\n" } })).status, 200);
415+ assert.equal((await call("record", "bob", { files: { "a.txt": "Bob's change\n" } })).status, 200);
425+ state: storage.db.prepare("SELECT * FROM writer_state ORDER BY namespace,collection,key,part").all(),
429+ const held = await disabled.call("project", "record", "alice", { files: { "a.txt": "legacy write\n" } });
434+ assert.equal((await call("status", undefined, {})).status, 200, "re-enabling disk mode preserves the valid root");
445+ () => object().news("project", [{ from: "bob", issue: null, text: "Must roll back", to: ["alice"] }]),
454+ const revoked = await current.call("project", "record", "alice", { files: { "a.txt": "unauthorized\n" } });
497+ ? { ...entry, data: new Uint8Array((await (options.fs as MemoryFS).readFile(path)) as Uint8Array) }
510+ const bound = () => new ProjectObject(context as never, { ABSO_DISK_FIRST: "on", ARTIFACTS: artifacts } as never);
529+ const blob = await git.writeBlob({ fs: remote, dir: "/repo", blob: new TextEncoder().encode("From Git\n") });
566+ assert.equal((await bound().out()).git.head, parent, "failed intake must not acknowledge the remote head");
576+ assert.deepEqual(rows(), committedIntake, "retry after cursor failure returns the atomic intake receipt");
588+
615+ new ProjectObject(context as never, { ABSO_DISK_FIRST: disk ? "on" : "off", ARTIFACTS: artifacts } as never);
666+ JSON.stringify((await call("file", { path: "a.txt", version: String((await object().out()).version) })).body),
- MCP
- compare on this site's /mcp
- CLI
- abso diff 68 318 server/test/project-object-disk-first.test.ts --json
- JSON
- /christopher/abso-core/compare/68..318?file=server%2Ftest%2Fproject-object-disk-first.test.ts&format=json