Versions 32 to 318
new file, 499 lines
15+
26+ const large = memory.entries.findIndex((entry) => Buffer.byteLength(JSON.stringify(entry)) > 1_048_576);
54+
55+test("historical runtime preserves named draft bases and intermediate states after landing", (t) => {
97+
114+ storage.db.prepare("SELECT COUNT(*) AS n FROM sqlite_master WHERE name = 'writer_state'").get()!.n,
119+ runtime().initialize((calls) => answer(calls, "init", undefined, { files: { "a.txt": "one\ntwo\n" } }), validate)
137+ "DELETE FROM writer_state WHERE namespace LIKE 'disk-v1:history%'; DROP TABLE writer_history_keys; DROP TABLE writer_history_heads;",
146+ const req = { id: "record-1", identity: { agent: "alice", operation: "record", files: { "a.txt": "changed\n" } } };
167+ assert.throws(() => runtime().write(operation, validate, { ...req, identity: { agent: "bob" } }), /reused/);
180+ runtime().write((calls) => answer(calls, "publish", "alice", { message: "Publish" }), validate).status,
219+
229+ const tables = storage.db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY name").all();
232+ storage.db.prepare(`SELECT * FROM "${String(row.name).replaceAll('"', '""')}" ORDER BY rowid`).all(),
278+ assert.deepEqual(rows(), adopted, "receipt failure must roll back canonical state, history and its cursor");
281+
306+ const oldWriter = () => new SqliteWriterHost(storage, namespace, projection, { indexProjectionAtoms: true });
326+ for (let page = 0; page < 100 && !ready; page++) ready = runtime().preparePage(() => {}).ready;
350+
361+ const request = { id: "large-response", identity: { agent: "alice", operation: "large-fixture" } };
373+ const header = state.read("runtime:receipts", request.id) as { parts: number; characters: number; digest: string };
393+
405+ state: storage.db.prepare("SELECT * FROM writer_state ORDER BY namespace,collection,key,part").all(),
406+ history: storage.db.prepare("SELECT * FROM writer_history_keys ORDER BY namespace,collection,key,revision").all(),
416+ if (collection === "runtime:receipt:chunk-failure" && key === "1") throw Error("injected receipt chunk failure");
424+ assert.throws(() => runtime().write(operation, () => {}, request), /injected receipt chunk failure/);
468+
481+ const before = storage.db.prepare("SELECT * FROM writer_state ORDER BY namespace,collection,key,part").all();
- MCP
- compare on this site's /mcp
- CLI
- abso diff 32 318 server/test/disk-first-runtime.test.ts --json
- JSON
- /christopher/abso-core/compare/32..318?file=server%2Ftest%2Fdisk-first-runtime.test.ts&format=json