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

Compare

+55 −0 in 1 place
new file, 55 lines
1+import assert from "node:assert/strict";
2+import { test } from "node:test";
3+import { answer } from "../../worker/project/http.ts";
4+import { Project } from "../../worker/project/project.ts";
5+import { DiskFirstRuntime } from "../src/disk-first-runtime.ts";
6+import { memoryStorage } from "./helpers.ts";
7+
8+test("scratch-backed definition scanning preserves code-file record and publish", (t) => {
9+ const storage = memoryStorage();
10+ t.after(() => storage.db.close());
11+ const runtime = () => new DiskFirstRuntime(storage, "text-bound", "text-bound");
12+ const unchanged = "stable".repeat(10000);
13+ const old = `${"old".repeat(20000)}\n${unchanged}\n`;
14+ const current = `changed\n${unchanged}\n`;
15+ assert.equal(
16+ runtime().initialize(
17+ (c) => answer(c, "init", undefined, { files: { f: old } }),
18+ () => {},
19+ ).status,
20+ 200,
21+ );
22+ while (!runtime().preparePage(() => {}).ready) {}
23+ t.mock.method(Project, "load", () => {
24+ throw Error("full history replay forbidden");
25+ });
27+ assert.equal(
28+ runtime().write(
29+ (c) => answer(c, "record", "writer", { files: { f: current } }),
30+ () => {},
31+ ).status,
32+ 200,
33+ );
34+ assert.equal(
35+ runtime().write(
36+ (c) => answer(c, "publish", "writer", { message: "replace" }),
37+ () => {},
38+ ).status,
39+ 200,
40+ );
41+ assert.equal(
42+ runtime().read(
43+ (c) => c.filesAt(0)["f"],
44+ () => {},
45+ ),
46+ old,
47+ );
48+ assert.equal(
49+ runtime().read(
50+ (c) => c.shared().files["f"],
51+ () => {},
52+ ),
53+ current,
54+ );
55+});
MCP
compare on this site's /mcp
CLI
abso diff 116 318 server/test/definition-scratch-runtime.test.ts --json
JSON
/christopher/abso-core/compare/116..318?file=server%2Ftest%2Fdefinition-scratch-runtime.test.ts&format=json