{"version":174,"agent":"open","message":"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/.","time":1791965799931,"timeIso":"2026-10-14T08:16:39.931Z","changes":2,"change":2682,"files":["server/test/writer-long-atom.test.ts","src/engine/test/graph-long-text.test.ts"],"draft":null,"diff":[{"path":"server/test/writer-long-atom.test.ts","added":50,"removed":0,"diff":"--- /dev/null\n+++ b/server/test/writer-long-atom.test.ts\n@@ -0,0 +1,50 @@\n+// A server writer's own storage holds long atom text in chunks (moved here from src/engine/test/graph-long-text.test.ts:\n+// the engine's tests stay free of server/, which the platform's pin on the tool doesn't carry).\n+import assert from \"node:assert/strict\";\n+import { test } from \"node:test\";\n+import { Graph } from \"../../src/engine/graph.ts\";\n+import { MemoryStore, Project } from \"../../worker/project/project.ts\";\n+import { SqliteWriterState } from \"../src/writer-host.ts\";\n+import { memoryStorage } from \"./helpers.ts\";\n+\n+test(\"persistent atom metadata accepts text beyond the generic state limit\", (t) => {\n+\tconst database = memoryStorage();\n+\tt.after(() => database.db.close());\n+\tSqliteWriterState.initialize(database);\n+\tconst storage = new SqliteWriterState(database, \"long-atom\");\n+\tconst memory = new MemoryStore();\n+\tconst value = \"x\".repeat(8100000);\n+\tnew Project(memory).init({ \"large.txt\": value }, 0);\n+\tconst entry = memory.entries[0]!;\n+\tif (entry.type !== \"init\") throw Error(\"expected init\");\n+\tnew Graph({ storage }).add(entry.atom);\n+\tassert.ok(JSON.stringify(storage.read(\"atoms\", \"0\")).length < 4096);\n+\tconst read = storage.read.bind(storage);\n+\tlet textReads = 0;\n+\tt.mock.method(storage, \"read\", (collection: string, key: string) => {\n+\t\tif (collection === \"atom-text:long:chunks\") textReads++;\n+\t\treturn read(collection, key);\n+\t});\n+\tconst graph = new Graph({ storage });\n+\tconst atom = graph.atom(\"a0\");\n+\tassert.equal(textReads, 0, \"reading atom metadata must not load long text\");\n+\tassert.equal(atom.inserts[0]!.lines[0], value);\n+\tassert.ok(textReads > 0);\n+\tassert.equal(graph.lineText(\"a0.0\"), value);\n+\tassert.equal(\n+\t\tdatabase.db\n+\t\t\t.prepare(\n+\t\t\t\t\"SELECT COUNT(*) AS n FROM writer_state WHERE namespace = 'long-atom' AND collection = 'atom-text:long:chunks' AND part = -1\",\n+\t\t\t)\n+\t\t\t.get()!.n,\n+\t\tMath.ceil(value.length / 16384),\n+\t);\n+\tassert.equal(\n+\t\tdatabase.db\n+\t\t\t.prepare(\n+\t\t\t\t\"SELECT COUNT(*) AS n FROM writer_state WHERE namespace = 'long-atom' AND collection = 'line-text:long:chunks'\",\n+\t\t\t)\n+\t\t\t.get()!.n,\n+\t\t0,\n+\t);\n+});"},{"path":"src/engine/test/graph-long-text.test.ts","added":0,"removed":45,"diff":"--- a/src/engine/test/graph-long-text.test.ts\n+++ b/src/engine/test/graph-long-text.test.ts\n@@ -47,51 +47,6 @@\n \t}\n });\n \n-import { SqliteWriterState } from \"../../../server/src/writer-host.ts\";\n-import { memoryStorage } from \"../../../server/test/helpers.ts\";\n-\n-test(\"persistent atom metadata accepts text beyond the generic state limit\", (t) => {\n-\tconst database = memoryStorage();\n-\tt.after(() => database.db.close());\n-\tSqliteWriterState.initialize(database);\n-\tconst storage = new SqliteWriterState(database, \"long-atom\");\n-\tconst memory = new MemoryStore();\n-\tconst value = \"x\".repeat(8100000);\n-\tnew Project(memory).init({ \"large.txt\": value }, 0);\n-\tconst entry = memory.entries[0]!;\n-\tif (entry.type !== \"init\") throw Error(\"expected init\");\n-\tnew Graph({ storage }).add(entry.atom);\n-\tassert.ok(JSON.stringify(storage.read(\"atoms\", \"0\")).length < 4096);\n-\tconst read = storage.read.bind(storage);\n-\tlet textReads = 0;\n-\tt.mock.method(storage, \"read\", (collection: string, key: string) => {\n-\t\tif (collection === \"atom-text:long:chunks\") textReads++;\n-\t\treturn read(collection, key);\n-\t});\n-\tconst graph = new Graph({ storage });\n-\tconst atom = graph.atom(\"a0\");\n-\tassert.equal(textReads, 0, \"reading atom metadata must not load long text\");\n-\tassert.equal(atom.inserts[0]!.lines[0], value);\n-\tassert.ok(textReads > 0);\n-\tassert.equal(graph.lineText(\"a0.0\"), value);\n-\tassert.equal(\n-\t\tdatabase.db\n-\t\t\t.prepare(\n-\t\t\t\t\"SELECT COUNT(*) AS n FROM writer_state WHERE namespace = 'long-atom' AND collection = 'atom-text:long:chunks' AND part = -1\",\n-\t\t\t)\n-\t\t\t.get()!.n,\n-\t\tMath.ceil(value.length / 16384),\n-\t);\n-\tassert.equal(\n-\t\tdatabase.db\n-\t\t\t.prepare(\n-\t\t\t\t\"SELECT COUNT(*) AS n FROM writer_state WHERE namespace = 'long-atom' AND collection = 'line-text:long:chunks'\",\n-\t\t\t)\n-\t\t\t.get()!.n,\n-\t\t0,\n-\t);\n-});\n-\n test(\"long atom acceptance rolls back partial chunks and detects missing text\", (t) => {\n \tconst storage = new SqlState();\n \tt.after(() => storage.db.close());"}],"ci":null}