- MCP
- blame on this site's /mcp
- CLI
- abso blame server/test/writer-long-atom.test.ts --json
- JSON
- /christopher/abso-core/blame/server/test/writer-long-atom.test.ts?format=json
50 linescodex-capacity-chair 84% · open 16%Last change open in version 174,
50 lines from 2 changes in 2 versions.
open174Move 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/.Compare1// 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).
3import assert from "node:assert/strict";
4import { test } from "node:test";
5import { Graph } from "../../src/engine/graph.ts";
6import { MemoryStore, Project } from "../../worker/project/project.ts";
7import { SqliteWriterState } from "../src/writer-host.ts";
8import { memoryStorage } from "./helpers.ts";
codex-capacity-chair162Add reviewed disk-first history and indexed graph storage for core issue 16; retain runtime activation gateCompare9
10test("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});