{"draft":null,"from":3,"to":318,"files":[{"path":"src/engine/test/projection-reader-integrity.test.ts","added":29,"removed":0,"diff":"--- /dev/null\n+++ b/src/engine/test/projection-reader-integrity.test.ts\n@@ -0,0 +1,29 @@\n+import assert from \"node:assert/strict\";\n+import { test } from \"node:test\";\n+import { ExperimentalMarkerProjection } from \"../experimental/projection-marker.ts\";\n+import { ProjectionReader } from \"../experimental/projection-reader.ts\";\n+import { Graph } from \"../graph.ts\";\n+import { Repo } from \"./helpers.ts\";\n+import { SqlState } from \"./storage-helper.ts\";\n+\n+test(\"file lookup rejects a missing marker for an included writer instead of following ancestry\", (t) => {\n+\tconst storage = new SqlState();\n+\tt.after(() => storage.db.close());\n+\tconst repo = Repo.init({ \"f.txt\": \"one\\ntwo\\n\" });\n+\tconst graph = new Graph({ storage });\n+\tgraph.add(repo.graph.atom(\"a0\"));\n+\tconst adapter = new ExperimentalMarkerProjection(storage, graph, \"f.txt\", \"included-marker\");\n+\tconst state = adapter.apply(adapter.empty(), graph.atom(\"a0\"));\n+\tconst reader = new ProjectionReader(adapter, state, () => {});\n+\tconst line = [...adapter.lineIds(state, \"f.txt\")][0]!;\n+\tassert.equal(reader.fileOf(line), \"f.txt\");\n+\tconst markerKey = graph.lineN(line) + 1;\n+\tconst get = adapter.markers.get.bind(adapter.markers);\n+\tt.mock.method(adapter.markers, \"get\", (root: Parameters<typeof get>[0], key: number) =>\n+\t\tkey === markerKey ? undefined : get(root, key),\n+\t);\n+\tt.mock.method(graph, \"lineParent\", () => {\n+\t\tthrow Error(\"included writer must not use ancestry fallback\");\n+\t});\n+\tassert.throws(() => reader.fileOf(line), /missing projected line/);\n+});"}],"unmatched":[]}