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 174 --json
JSON
/christopher/abso-core/versions/174?format=json

Move the writer-storage long-atom test out of src/engine/test/graph-long-text.test.ts into server/test/writer-long-atom.test.ts. It imported server/src and server/test, which abso's pin on the tool (client, src, worker/project) doesn't carry, so the pin bump to 173 failed its typecheck and test there. Engine tests stay free of server/.

of shared·open··Not checked

Version 173 · Files at version 174

2 files, 50 lines added, 45 removed.

--- /dev/null
+++ b/server/test/writer-long-atom.test.ts
@@ -0,0 +1,50 @@
1+// A server writer's own storage holds long atom text in chunks (moved here from src/engine/test/graph-long-text.test.ts:
2+// the engine's tests stay free of server/, which the platform's pin on the tool doesn't carry).
3+import assert from "node:assert/strict";
4+import { test } from "node:test";
5+import { Graph } from "../../src/engine/graph.ts";
6+import { MemoryStore, Project } from "../../worker/project/project.ts";
7+import { SqliteWriterState } from "../src/writer-host.ts";
8+import { memoryStorage } from "./helpers.ts";
9+
10+test("persistent atom metadata accepts text beyond the generic state limit", (t) => {
11+ const database = memoryStorage();
12+ t.after(() => database.db.close());
13+ SqliteWriterState.initialize(database);
14+ const storage = new SqliteWriterState(database, "long-atom");
15+ const memory = new MemoryStore();
16+ const value = "x".repeat(8100000);
17+ new Project(memory).init({ "large.txt": value }, 0);
18+ const entry = memory.entries[0]!;
19+ if (entry.type !== "init") throw Error("expected init");
20+ new Graph({ storage }).add(entry.atom);
21+ assert.ok(JSON.stringify(storage.read("atoms", "0")).length < 4096);
22+ const read = storage.read.bind(storage);
23+ let textReads = 0;
24+ t.mock.method(storage, "read", (collection: string, key: string) => {
25+ if (collection === "atom-text:long:chunks") textReads++;
26+ return read(collection, key);
27+ });
28+ const graph = new Graph({ storage });
29+ const atom = graph.atom("a0");
30+ assert.equal(textReads, 0, "reading atom metadata must not load long text");
31+ assert.equal(atom.inserts[0]!.lines[0], value);
32+ assert.ok(textReads > 0);
33+ assert.equal(graph.lineText("a0.0"), value);
34+ assert.equal(
35+ database.db
36+ .prepare(
37+ "SELECT COUNT(*) AS n FROM writer_state WHERE namespace = 'long-atom' AND collection = 'atom-text:long:chunks' AND part = -1",
38+ )
39+ .get()!.n,
40+ Math.ceil(value.length / 16384),
41+ );
42+ assert.equal(
43+ database.db
44+ .prepare(
45+ "SELECT COUNT(*) AS n FROM writer_state WHERE namespace = 'long-atom' AND collection = 'line-text:long:chunks'",
46+ )
47+ .get()!.n,
48+ 0,
49+ );
50+});
--- a/src/engine/test/graph-long-text.test.ts
+++ b/src/engine/test/graph-long-text.test.ts
@@ -47,51 +47,6 @@
4747 }
4848});
4949
50−import { SqliteWriterState } from "../../../server/src/writer-host.ts";
51−import { memoryStorage } from "../../../server/test/helpers.ts";
52−
53−test("persistent atom metadata accepts text beyond the generic state limit", (t) => {
54− const database = memoryStorage();
55− t.after(() => database.db.close());
56− SqliteWriterState.initialize(database);
57− const storage = new SqliteWriterState(database, "long-atom");
58− const memory = new MemoryStore();
59− const value = "x".repeat(8100000);
60− new Project(memory).init({ "large.txt": value }, 0);
61− const entry = memory.entries[0]!;
62− if (entry.type !== "init") throw Error("expected init");
63− new Graph({ storage }).add(entry.atom);
64− assert.ok(JSON.stringify(storage.read("atoms", "0")).length < 4096);
65− const read = storage.read.bind(storage);
66− let textReads = 0;
67− t.mock.method(storage, "read", (collection: string, key: string) => {
68− if (collection === "atom-text:long:chunks") textReads++;
69− return read(collection, key);
70− });
71− const graph = new Graph({ storage });
72− const atom = graph.atom("a0");
73− assert.equal(textReads, 0, "reading atom metadata must not load long text");
74− assert.equal(atom.inserts[0]!.lines[0], value);
75− assert.ok(textReads > 0);
76− assert.equal(graph.lineText("a0.0"), value);
77− assert.equal(
78− database.db
79− .prepare(
80− "SELECT COUNT(*) AS n FROM writer_state WHERE namespace = 'long-atom' AND collection = 'atom-text:long:chunks' AND part = -1",
81− )
82− .get()!.n,
83− Math.ceil(value.length / 16384),
84− );
85− assert.equal(
86− database.db
87− .prepare(
88− "SELECT COUNT(*) AS n FROM writer_state WHERE namespace = 'long-atom' AND collection = 'line-text:long:chunks'",
89− )
90− .get()!.n,
91− 0,
92− );
93−});
94−
9550test("long atom acceptance rolls back partial chunks and detects missing text", (t) => {
9651 const storage = new SqlState();
9752 t.after(() => storage.db.close());