Evaluate coherent local queries over explicit replica scopes

This commit is contained in:
Timothy J. Aveni
2026-09-20 04:04:35 -07:00
parent 3f1976815f
commit c75888833b
5 changed files with 39 additions and 8 deletions
+3 -3
View File
@@ -3,13 +3,13 @@ import { test } from "node:test";
import { compileQuery } from "../src/query/compile.js";
import { linkQueries } from "../src/query/link.js";
import { loadReaderWorkspace as load, readReaderFixture as read } from "./reader-fixture.js";
test("complete reader contracts compose factories, portable selectors, CRDT edits, and six query scopes", async () => {
test("complete reader contracts compose factories, portable selectors, CRDT edits, and bounded query scopes", async () => {
const workspace = await load();
assert.equal(workspace.constructors.length, 0);
assert.equal(workspace.atoms.length, 3);
const linked = linkQueries(workspace);
assert.equal(linked.length, 7);
assert.equal(linked.filter((q) => q.checked.declaration.placement?.kind === "local").length, 3);
assert.equal(linked.length, 8);
assert.equal(linked.filter((q) => q.checked.declaration.placement?.kind === "local").length, 4);
const screen = linked.find((q) => q.checked.declaration.displayName === "ReaderScreen")!;
assert.ok(screen.fields.some((f) => f.memberId === "highlight:excerpt" && f.binding.kind === "package"));
assert.ok(screen.fields.some((f) => f.memberId === "comment:content" && f.binding.kind === "state"));