{"draft":null,"from":133,"to":318,"files":[{"path":"src/engine/test/projection-scratch.test.ts","added":4,"removed":1,"diff":"--- a/src/engine/test/projection-scratch.test.ts\n+++ b/src/engine/test/projection-scratch.test.ts\n@@ -32,11 +32,14 @@\n \t\t\t);\n \t\t\tassert.deepEqual(result, { value: 99, data: new Int32Array([1, 2]) });\n \t\t\tassert.throws(() => escaped!.write(\"x\", \"y\", true), /ended/);\n+\t\t\t// A scratch rollback drops only what the scratch wrote (abso Capacity): the canonical value written before it, in\n+\t\t\t// the outer transaction, stays cached and is still right.\n+\t\t\tassert.equal(storage.retainedEntries, 1, \"only the canonical value written before the scratch remains\");\n \t\t\tassert.equal(storage.read(\"canonical\", \"before\"), 1);\n \t\t\tstorage.write(\"canonical\", \"after\", 2);\n \t\t});\n \t\tassert.equal(source.db.prepare(\"SELECT count(*) AS n FROM state\").get()!.n, 2);\n-\t\tassert.equal(storage.retainedEntries, 1);\n+\t\tassert.equal(storage.retainedEntries, 2, \"only the canonical read and successful counter write remain\");\n \t\tassert.equal(storage.read(\"canonical\", \"after\"), 2);\n \t} finally {\n \t\tsource.db.close();"}],"unmatched":[]}