{"draft":null,"from":127,"to":128,"files":[{"path":"src/engine/test/state-source.test.ts","added":38,"removed":0,"diff":"--- a/src/engine/test/state-source.test.ts\n+++ b/src/engine/test/state-source.test.ts\n@@ -5,6 +5,44 @@\n import { lines, Repo } from \"./helpers.ts\";\n import { SqlState } from \"./storage-helper.ts\";\n \n+test(\"current visibility stops at the first included deletion while history retains every deleter\", () => {\n+\tclass ObservedStorage extends SqlState {\n+\t\tpageReads = 0;\n+\t\toverride read(collection: string, key: string): unknown {\n+\t\t\tif (collection === \"more-deleters:pages\") this.pageReads++;\n+\t\t\treturn super.read(collection, key);\n+\t\t}\n+\t}\n+\tconst storage = new ObservedStorage();\n+\ttry {\n+\t\tconst oracle = Repo.init({ \"a.txt\": \"gone\\nlive\\n\" });\n+\t\tconst deletion = oracle.draft({ edits: [{ file: \"a.txt\", old: \"gone\\n\", new: \"\" }] });\n+\t\tconst graph = new Graph({ storage });\n+\t\tgraph.add(oracle.graph.atom(\"a0\"));\n+\t\tconst ids = [\"a0\"];\n+\t\tfor (let seq = 1; seq <= 514; seq++) {\n+\t\t\tconst atom = { ...deletion, id: `a${seq}`, seq };\n+\t\t\tgraph.add(atom);\n+\t\t\toracle.graph.add(atom);\n+\t\t\tids.push(atom.id);\n+\t\t}\n+\t\tconst reopened = new Graph({ storage });\n+\t\tconst membership = new StableOverlaySet(ids);\n+\t\tconst view = new View(reopened, membership);\n+\t\tstorage.pageReads = 0;\n+\t\tassert.equal(view.text(\"a.txt\"), \"live\\n\");\n+\t\tassert.equal(storage.pageReads, 0, \"current visibility needs no later deleters after the first match\");\n+\t\tassert.deepEqual(view.sequence(\"a.txt\"), new View(oracle.graph, membership).sequence(\"a.txt\"));\n+\t\tassert.equal(view.sequence(\"a.txt\")[0]!.deletedBy.length, 514);\n+\t\tassert.equal(storage.pageReads, 3);\n+\t\tassert.deepEqual(reopened.deletersOf(\"a0.0\"), oracle.graph.deletersOf(\"a0.0\"));\n+\t\tconst lastOnly = new View(reopened, new StableOverlaySet([\"a0\", \"a514\"]));\n+\t\tassert.equal(lastOnly.text(\"a.txt\"), \"live\\n\", \"excluded early deletions must not hide a later included one\");\n+\t} finally {\n+\t\tstorage.db.close();\n+\t}\n+});\n+\n test(\"relocation indexes stream one fixed page before yielding and preserve order\", () => {\n \tclass ObservedStorage extends SqlState {\n \t\tpageReads = 0;"}],"unmatched":[]}