Implement Studio root and placement capabilities on the replica graph (WI-10)

This commit is contained in:
Timothy J. Aveni
2026-09-21 16:37:00 -07:00
parent 2cf53280e4
commit e1ad15c620
9 changed files with 103 additions and 19 deletions
+7 -6
View File
@@ -23,8 +23,8 @@ const workspace = `workspace Test id "workspace:test" revision "workspace:test@1
bind peek.call to package Runtime.peek with { peers to interface Data from input; };
}
}`;
function compile(packageSource = pkg, workspaceSource = workspace) {
const contract = compileCapabilityResourceSource(iface, { source });
function compile(packageSource = pkg, workspaceSource = workspace, interfaceSource = iface) {
const contract = compileCapabilityResourceSource(interfaceSource, { source });
assert.ok(contract.ok && contract.resource.kind === "interface", JSON.stringify(contract.diagnostics));
const interfaces = new Map([["Data", contract.resource.revision]]);
const runtime = compileCapabilityResourceSource(packageSource, { source, environment: { interfaces } });
@@ -82,8 +82,9 @@ test("closed generic specialization preserves reference-selected interface ports
);
});
test("dynamic reference reads do not promise an unimplemented client input closure", () => {
const result = compile(pkg.replace("targets [server]", "targets [browser, server]"));
assert.equal(result.ok, false);
assert.ok(result.diagnostics.some((diagnostic) => diagnostic.message.includes("local acquisition")));
test("portable input-selected reads require the dependency's declared target support", () => {
const portable = pkg.replaceAll("targets [server]", "targets [browser, server]");
assert.equal(compile(portable).ok, false);
const result = compile(portable, workspace, iface.replaceAll("targets [server]", "targets [browser, server]"));
assert.ok(result.ok, JSON.stringify(result.diagnostics));
});