- 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:
9+
37+ "SELECT COUNT(*) AS n FROM writer_state WHERE namespace = 'long-atom' AND collection = 'atom-text:long:chunks' AND part = -1",
45+ "SELECT COUNT(*) AS n FROM writer_state WHERE namespace = 'long-atom' AND collection = 'line-text:long:chunks'",
--- a/src/engine/test/graph-long-text.test.ts
+++ b/src/engine/test/graph-long-text.test.ts
@@ -47,51 +47,6 @@
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−